Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Modernize simcall process_cleanup.
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Wed, 2 May 2018 20:50:35 +0000 (22:50 +0200)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Thu, 3 May 2018 12:44:15 +0000 (14:44 +0200)
include/simgrid/simix.h
src/kernel/context/Context.cpp
src/simix/libsmx.cpp
src/simix/popping_accessors.hpp
src/simix/popping_bodies.cpp
src/simix/popping_enum.h
src/simix/popping_generated.cpp
src/simix/simcalls.in
src/simix/simcalls.py

index 9d1ce9e..3b75af8 100644 (file)
@@ -193,7 +193,6 @@ XBT_PUBLIC void simcall_process_killall();
 XBT_PUBLIC void SIMIX_process_throw(smx_actor_t process, xbt_errcat_t cat, int value, const char* mesg);
 
 /* Process handling */
-XBT_PUBLIC void simcall_process_cleanup(smx_actor_t process);
 XBT_PUBLIC void simcall_process_suspend(smx_actor_t process);
 
 /* Getters and Setters */
index 79024d9..73dccc4 100644 (file)
@@ -80,7 +80,7 @@ void Context::stop()
   this->process_->suspended = 0;
 
   this->iwannadie = false;
-  simcall_process_cleanup(this->process_);
+  simgrid::simix::kernelImmediate([this] { SIMIX_process_cleanup(this->process_); });
   this->iwannadie = true;
 }
 
index 976492f..254652c 100644 (file)
@@ -186,16 +186,6 @@ void simcall_process_killall()
   simcall_BODY_process_killall();
 }
 
-/**
- * \ingroup simix_process_management
- * \brief Cleans up a SIMIX process.
- * \param process poor victim (must have already been killed)
- */
-void simcall_process_cleanup(smx_actor_t process)
-{
-  simcall_BODY_process_cleanup(process);
-}
-
 void simcall_process_join(smx_actor_t process, double timeout)
 {
   simcall_BODY_process_join(process, timeout);
index cdb11ef..698a84a 100644 (file)
  */
 
 #include "src/simix/popping_private.hpp"
-static inline smx_actor_t simcall_process_cleanup__get__process(smx_simcall_t simcall)
-{
-  return simgrid::simix::unmarshal<smx_actor_t>(simcall->args[0]);
-}
-static inline smx_actor_t simcall_process_cleanup__getraw__process(smx_simcall_t simcall)
-{
-  return simgrid::simix::unmarshal_raw<smx_actor_t>(simcall->args[0]);
-}
-static inline void simcall_process_cleanup__set__process(smx_simcall_t simcall, smx_actor_t arg)
-{
-  simgrid::simix::marshal<smx_actor_t>(simcall->args[0], arg);
-}
-
 static inline smx_actor_t simcall_process_suspend__get__process(smx_simcall_t simcall)
 {
   return simgrid::simix::unmarshal<smx_actor_t>(simcall->args[0]);
index 7753890..458aa72 100644 (file)
@@ -44,13 +44,6 @@ inline static void simcall_BODY_process_killall()
   return simcall<void>(SIMCALL_PROCESS_KILLALL);
 }
 
-inline static void simcall_BODY_process_cleanup(smx_actor_t process)
-{
-  if (0) /* Go to that function to follow the code flow through the simcall barrier */
-    SIMIX_process_cleanup(process);
-  return simcall<void, smx_actor_t>(SIMCALL_PROCESS_CLEANUP, process);
-}
-
 inline static void simcall_BODY_process_suspend(smx_actor_t process)
 {
   if (0) /* Go to that function to follow the code flow through the simcall barrier */
index 624fcc1..6cfa5c1 100644 (file)
@@ -20,7 +20,6 @@
 typedef enum {
   SIMCALL_NONE,
   SIMCALL_PROCESS_KILLALL,
-  SIMCALL_PROCESS_CLEANUP,
   SIMCALL_PROCESS_SUSPEND,
   SIMCALL_PROCESS_JOIN,
   SIMCALL_PROCESS_SLEEP,
index f70946c..dcf2093 100644 (file)
@@ -29,7 +29,6 @@ XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(simix_popping);
 const char* simcall_names[] = {
     "SIMCALL_NONE",
     "SIMCALL_PROCESS_KILLALL",
-    "SIMCALL_PROCESS_CLEANUP",
     "SIMCALL_PROCESS_SUSPEND",
     "SIMCALL_PROCESS_JOIN",
     "SIMCALL_PROCESS_SLEEP",
@@ -71,7 +70,7 @@ const char* simcall_names[] = {
 void SIMIX_simcall_handle(smx_simcall_t simcall, int value) {
   XBT_DEBUG("Handling simcall %p: %s", simcall, SIMIX_simcall_name(simcall->call));
   SIMCALL_SET_MC_VALUE(simcall, value);
-  if (simcall->issuer->context->iwannadie && simcall->call != SIMCALL_PROCESS_CLEANUP)
+  if (simcall->issuer->context->iwannadie)
     return;
   switch (simcall->call) {
 case SIMCALL_PROCESS_KILLALL:
@@ -79,11 +78,6 @@ case SIMCALL_PROCESS_KILLALL:
   SIMIX_simcall_answer(simcall);
   break;
 
-case SIMCALL_PROCESS_CLEANUP:
-  SIMIX_process_cleanup(simgrid::simix::unmarshal<smx_actor_t>(simcall->args[0]));
-  SIMIX_simcall_answer(simcall);
-  break;
-
 case SIMCALL_PROCESS_SUSPEND:
   simcall_HANDLER_process_suspend(simcall, simgrid::simix::unmarshal<smx_actor_t>(simcall->args[0]));
   break;
index 49f36d7..aeda3cd 100644 (file)
@@ -36,7 +36,6 @@
 # ./include/simgrid/simix.h (otherwise you will get a warning at compile time)
 
 void process_killall();
-void process_cleanup(smx_actor_t process) [[nohandler]];
 void process_suspend(smx_actor_t process) [[block]];
 int  process_join(smx_actor_t process, double timeout) [[block]];
 int  process_sleep(double duration) [[block]];
index d9a3ae1..500b75e 100755 (executable)
@@ -340,7 +340,7 @@ if __name__ == '__main__':
         '  XBT_DEBUG("Handling simcall %p: %s", simcall, SIMIX_simcall_name(simcall->call));\n')
     fd.write('  SIMCALL_SET_MC_VALUE(simcall, value);\n')
     fd.write(
-        '  if (simcall->issuer->context->iwannadie && simcall->call != SIMCALL_PROCESS_CLEANUP)\n')
+        '  if (simcall->issuer->context->iwannadie)\n')
     fd.write('    return;\n')
     fd.write('  switch (simcall->call) {\n')