Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branches 'auto_restart' and 'auto_restart' of framagit.org:simgrid/simgrid
authorMartin Quinson <martin.quinson@loria.fr>
Sat, 11 Aug 2018 20:49:38 +0000 (22:49 +0200)
committerMartin Quinson <martin.quinson@loria.fr>
Sat, 11 Aug 2018 20:49:38 +0000 (22:49 +0200)
Also, don't run doxygen manually on framagit/gitlab-ci

1  2 
.gitlab-ci.yml
examples/s4u/CMakeLists.txt
src/s4u/s4u_Actor.cpp

diff --combined .gitlab-ci.yml
@@@ -3,12 -3,13 +3,8 @@@ image: debian:testing-sli
  .build: &build
    script:
    - apt-get update
-   - apt-get install -y python3-pip cmake doxygen libboost-all-dev libboost-dev fig2dev
 -  - apt-get install -y python3-sphinx doxygen python3-breathe python3-sphinx-rtd-theme pip3
 -  - apt-get install -y cmake doxygen libboost-all-dev libboost-dev
 -  - pip3 install --no-deps exhale
 -  - cmake -Denable_documentation=ON .
 -  - make documentation
 -  - mkdir docs/doxyoutput
 -  - mv doc/xml docs/doxyoutput
++  - apt-get install -y python3-pip doxygen libboost-all-dev libboost-dev fig2dev
 +  - pip3 install --requirement docs/requirements.txt 
-   - cmake -Denable_documentation=ON .
-   - make documentation
-   - mkdir docs/doxyoutput
-   - cp -r doc/xml docs/doxyoutput
    - cd docs
    - sphinx-build -M html source/ build/
    - mv build/html ../public
@@@ -8,7 -8,7 +8,7 @@@ foreach (example actor-create actor-dae
                   energy-exec energy-boot energy-link energy-vm
                   engine-filtering
                   exec-async exec-basic exec-dvfs exec-monitor exec-ptask exec-remote
 -                 io-file-system io-file-remote io-storage-raw
 +                 io-async io-file-system io-file-remote io-storage-raw
                   mutex
                   platform-failures platform-properties plugin-hostload 
                   replay-comm replay-storage
@@@ -28,11 -28,11 +28,10 @@@ foreach(variant fun class
    target_link_libraries(s4u-app-masterworkers-${variant}  simgrid)
    set_target_properties(s4u-app-masterworkers-${variant}  PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/app-masterworkers)
  
 -  set(examples_src  ${examples_src}  ${CMAKE_CURRENT_SOURCE_DIR}/masterworkers-fun/s4u-masterworkers-${variant}.cpp)
 +  set(examples_src  ${examples_src}  ${CMAKE_CURRENT_SOURCE_DIR}/app-masterworkers/s4u-app-masterworkers-${variant}.cpp)
  endforeach()
 -set(tesh_files    ${tesh_files}    ${CMAKE_CURRENT_SOURCE_DIR}/masterworkers-fun/s4u-masterworkers.tesh)
 -
 +set(tesh_files    ${tesh_files}    ${CMAKE_CURRENT_SOURCE_DIR}/app-masterworkers/s4u-app-masterworkers.tesh)
  
  # CHORD EXAMPLE
  add_executable       (s4u-dht-chord dht-chord/s4u-dht-chord.cpp dht-chord/s4u-dht-chord-node.cpp)
  target_link_libraries(s4u-dht-chord simgrid)
@@@ -102,8 -102,8 +101,13 @@@ foreach(example actor-create actor-daem
                  energy-exec energy-boot energy-link energy-vm
                  engine-filtering
                  exec-async exec-basic exec-dvfs exec-monitor exec-ptask exec-remote
++<<<<<<< HEAD
 +                platform-properties plugin-hostload mutex
 +                io-async io-file-system io-file-remote io-storage-raw
++=======
+                 platform-failures platform-properties plugin-hostload mutex
+                 io-file-system io-file-remote io-storage-raw
++>>>>>>> 4ccbacb51eb49323847a906c3e79ea838d76e2a7
                  replay-comm replay-storage
                  routing-get-clusters
                  )
diff --combined src/s4u/s4u_Actor.cpp
@@@ -8,7 -8,9 +8,9 @@@
  #include "simgrid/s4u/Exec.hpp"
  #include "simgrid/s4u/Host.hpp"
  #include "src/kernel/activity/ExecImpl.hpp"
+ #include "src/simix/smx_host_private.hpp"
  #include "src/simix/smx_private.hpp"
+ #include "src/surf/HostImpl.hpp"
  
  #include <sstream>
  
@@@ -73,7 -75,16 +75,16 @@@ void Actor::join(double timeout
  
  void Actor::set_auto_restart(bool autorestart)
  {
-   simgrid::simix::simcall([this, autorestart]() { pimpl_->set_auto_restart(autorestart); });
+   simgrid::simix::simcall([this, autorestart]() {
+     pimpl_->set_auto_restart(autorestart);
+     std::map<std::string, kernel::actor::ProcessArg*> actors_map = pimpl_->host_->pimpl_->actors_at_boot_;
+     if (actors_map.find(pimpl_->name_) == actors_map.end()) {
+       simgrid::kernel::actor::ProcessArg* arg = new simgrid::kernel::actor::ProcessArg(pimpl_->host_, pimpl_);
+       XBT_DEBUG("Adding Process %s to the actors_at_boot_ list of Host %s", arg->name.c_str(), arg->host->get_cname());
+       actors_map.insert({arg->name, arg});
+     }
+   });
  }
  
  void Actor::on_exit(int_f_pvoid_pvoid_t fun, void* data) /* deprecated */
@@@ -86,6 -97,15 +97,6 @@@ void Actor::on_exit(std::function<void(
    simgrid::simix::simcall([this, fun, data] { SIMIX_process_on_exit(pimpl_, fun, data); });
  }
  
 -/** @brief Moves the actor to another host
 - *
 - * If the actor is currently blocked on an execution activity, the activity is also
 - * migrated to the new host. If it's blocked on another kind of activity, an error is
 - * raised as the mandated code is not written yet. Please report that bug if you need it.
 - *
 - * Asynchronous activities started by the actor are not migrated automatically, so you have
 - * to take care of this yourself (only you knows which ones should be migrated).
 - */
  void Actor::migrate(Host* new_host)
  {
    s4u::Actor::on_migration_start(this);