Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
kill another old-fashioned simcall
authorFrederic Suter <frederic.suter@cc.in2p3.fr>
Wed, 19 Jul 2017 11:59:57 +0000 (13:59 +0200)
committerFrederic Suter <frederic.suter@cc.in2p3.fr>
Wed, 19 Jul 2017 11:59:57 +0000 (13:59 +0200)
include/simgrid/simix.h
src/msg/msg_process.cpp
src/s4u/s4u_actor.cpp
src/simix/ActorImpl.cpp
src/simix/libsmx.cpp
src/simix/popping_accessors.h
src/simix/popping_bodies.cpp
src/simix/popping_enum.h
src/simix/popping_generated.cpp
src/simix/simcalls.in
src/simix/smx_host.cpp

index 6921451..81cf238 100644 (file)
@@ -219,7 +219,6 @@ XBT_PUBLIC(void) simcall_process_set_data(smx_actor_t process, void *data);
 XBT_PUBLIC(xbt_dict_t) simcall_process_get_properties(smx_actor_t host);
 XBT_PUBLIC(void) simcall_process_set_kill_time(smx_actor_t process, double kill_time);
 XBT_PUBLIC(void) simcall_process_on_exit(smx_actor_t process, int_f_pvoid_pvoid_t fun, void *data);
-XBT_PUBLIC(void) simcall_process_auto_restart_set(smx_actor_t process, int auto_restart);
 XBT_PUBLIC(smx_actor_t) simcall_process_restart(smx_actor_t process);
 XBT_PUBLIC(void) simcall_process_join(smx_actor_t process, double timeout);
 /* Sleep control */
index 2cabc47..cb1dd50 100644 (file)
@@ -464,7 +464,7 @@ void MSG_process_on_exit(int_f_pvoid_pvoid_t fun, void *data) {
  * If the flag is set to 1, the process will be automatically restarted when its host comes back up.
  */
 XBT_PUBLIC(void) MSG_process_auto_restart_set(msg_process_t process, int auto_restart) {
-  simcall_process_auto_restart_set(process->getImpl(), auto_restart);
+  simgrid::simix::kernelImmediate([process, auto_restart]() { process->getImpl()->auto_restart = auto_restart; });
 }
 /**
  * \ingroup m_process_management
index 3d8a38e..859dfe7 100644 (file)
@@ -62,7 +62,7 @@ void Actor::join() {
 }
 
 void Actor::setAutoRestart(bool autorestart) {
-  simcall_process_auto_restart_set(pimpl_,autorestart);
+  simgrid::simix::kernelImmediate([this, autorestart]() { pimpl_->auto_restart = autorestart; });
 }
 
 void Actor::onExit(int_f_pvoid_pvoid_t fun, void* data)
index f9b0f73..afdedc1 100644 (file)
@@ -191,7 +191,7 @@ ActorImpl* ActorImpl::restart(ActorImpl* issuer)
   if (arg.kill_time >= 0)
     simcall_process_set_kill_time(actor, arg.kill_time);
   if (arg.auto_restart)
-    simcall_process_auto_restart_set(actor, arg.auto_restart);
+    actor->auto_restart = arg.auto_restart;
 
   return actor;
 }
index f05e1f1..1d1b2a6 100644 (file)
@@ -267,16 +267,6 @@ XBT_PUBLIC(void) simcall_process_on_exit(smx_actor_t process, int_f_pvoid_pvoid_
 {
   simcall_BODY_process_on_exit(process, fun, data);
 }
-/**
- * \ingroup simix_process_management
- * \brief Sets the process to be auto-restarted or not by SIMIX when its host comes back up.
- * Will restart the process when the host comes back up if auto_restart is set to 1.
- */
-
-XBT_PUBLIC(void) simcall_process_auto_restart_set(smx_actor_t process, int auto_restart)
-{
-  simcall_BODY_process_auto_restart_set(process, auto_restart);
-}
 
 /**
  * \ingroup simix_process_management
index 1966f28..2cf9ba5 100644 (file)
@@ -443,31 +443,6 @@ static inline void simcall_process_on_exit__set__data(smx_simcall_t simcall, voi
   simgrid::simix::marshal<void*>(simcall->args[2], arg);
 }
 
-static inline smx_actor_t simcall_process_auto_restart_set__get__process(smx_simcall_t simcall)
-{
-  return simgrid::simix::unmarshal<smx_actor_t>(simcall->args[0]);
-}
-static inline smx_actor_t simcall_process_auto_restart_set__getraw__process(smx_simcall_t simcall)
-{
-  return simgrid::simix::unmarshal_raw<smx_actor_t>(simcall->args[0]);
-}
-static inline void simcall_process_auto_restart_set__set__process(smx_simcall_t simcall, smx_actor_t arg)
-{
-  simgrid::simix::marshal<smx_actor_t>(simcall->args[0], arg);
-}
-static inline int simcall_process_auto_restart_set__get__auto_restart(smx_simcall_t simcall)
-{
-  return simgrid::simix::unmarshal<int>(simcall->args[1]);
-}
-static inline int simcall_process_auto_restart_set__getraw__auto_restart(smx_simcall_t simcall)
-{
-  return simgrid::simix::unmarshal_raw<int>(simcall->args[1]);
-}
-static inline void simcall_process_auto_restart_set__set__auto_restart(smx_simcall_t simcall, int arg)
-{
-  simgrid::simix::marshal<int>(simcall->args[1], arg);
-}
-
 static inline smx_actor_t simcall_process_restart__get__process(smx_simcall_t simcall)
 {
   return simgrid::simix::unmarshal<smx_actor_t>(simcall->args[0]);
index 486da23..8d687e5 100644 (file)
@@ -135,12 +135,6 @@ inline static void simcall_BODY_process_on_exit(smx_actor_t process, int_f_pvoid
     return simcall<void, smx_actor_t, int_f_pvoid_pvoid_t, void*>(SIMCALL_PROCESS_ON_EXIT, process, fun, data);
   }
 
-inline static void simcall_BODY_process_auto_restart_set(smx_actor_t process, int auto_restart) {
-    /* Go to that function to follow the code flow through the simcall barrier */
-    if (0) SIMIX_process_auto_restart_set(process, auto_restart);
-    return simcall<void, smx_actor_t, int>(SIMCALL_PROCESS_AUTO_RESTART_SET, process, auto_restart);
-  }
-
 inline static smx_actor_t simcall_BODY_process_restart(smx_actor_t process) {
     /* Go to that function to follow the code flow through the simcall barrier */
     if (0) simcall_HANDLER_process_restart(&SIMIX_process_self()->simcall, process);
index eede34f..9b88602 100644 (file)
@@ -32,7 +32,6 @@ typedef enum {
   SIMCALL_EXECUTION_SET_BOUND,
   SIMCALL_EXECUTION_WAIT,
   SIMCALL_PROCESS_ON_EXIT,
-  SIMCALL_PROCESS_AUTO_RESTART_SET,
   SIMCALL_PROCESS_RESTART,
   SIMCALL_COMM_IPROBE,
   SIMCALL_COMM_SEND,
index 0de896d..d5e4940 100644 (file)
@@ -38,7 +38,6 @@ const char* simcall_names[] = {
     "SIMCALL_EXECUTION_SET_BOUND",
     "SIMCALL_EXECUTION_WAIT",
     "SIMCALL_PROCESS_ON_EXIT",
-    "SIMCALL_PROCESS_AUTO_RESTART_SET",
     "SIMCALL_PROCESS_RESTART",
     "SIMCALL_COMM_IPROBE",
     "SIMCALL_COMM_SEND",
@@ -162,11 +161,6 @@ case SIMCALL_PROCESS_ON_EXIT:
       SIMIX_simcall_answer(simcall);
       break;
 
-case SIMCALL_PROCESS_AUTO_RESTART_SET:
-      SIMIX_process_auto_restart_set(simgrid::simix::unmarshal<smx_actor_t>(simcall->args[0]), simgrid::simix::unmarshal<int>(simcall->args[1]));
-      SIMIX_simcall_answer(simcall);
-      break;
-
 case SIMCALL_PROCESS_RESTART:
       simgrid::simix::marshal<smx_actor_t>(simcall->result, simcall_HANDLER_process_restart(simcall, simgrid::simix::unmarshal<smx_actor_t>(simcall->args[0])));
       SIMIX_simcall_answer(simcall);
index 69734e4..25fc2e3 100644 (file)
@@ -50,7 +50,6 @@ void          execution_set_bound(boost::intrusive_ptr<simgrid::kernel::activity
 int           execution_wait(boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> execution) [[block]];
 
 void          process_on_exit(smx_actor_t process, int_f_pvoid_pvoid_t fun, void* data) [[nohandler]];
-void          process_auto_restart_set(smx_actor_t process, int auto_restart) [[nohandler]];
 smx_actor_t   process_restart(smx_actor_t process);
 
 boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> comm_iprobe(smx_mailbox_t mbox, int type, simix_match_func_t match_fun, void* data);
index 18e9829..bc6c5a7 100644 (file)
@@ -63,7 +63,7 @@ namespace simgrid {
         if (arg->kill_time >= 0)
           simcall_process_set_kill_time(actor, arg->kill_time);
         if (arg->auto_restart)
-          simcall_process_auto_restart_set(actor, arg->auto_restart);
+          actor->auto_restart = arg->auto_restart;
       }
     }
 
@@ -147,7 +147,7 @@ void SIMIX_host_autorestart(sg_host_t host)
     if (arg->kill_time >= 0)
       simcall_process_set_kill_time(actor, arg->kill_time);
     if (arg->auto_restart)
-      simcall_process_auto_restart_set(actor, arg->auto_restart);
+      actor->auto_restart = arg->auto_restart;
   }
   process_list.clear();
 }