Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Modernize simcall process_killall.
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Thu, 3 May 2018 09:02:49 +0000 (11:02 +0200)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Thu, 3 May 2018 12:44:15 +0000 (14:44 +0200)
include/simgrid/simix.h
src/msg/msg_global.cpp
src/s4u/s4u_Actor.cpp
src/simix/ActorImpl.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

index 3b75af8..7c50946 100644 (file)
@@ -189,7 +189,6 @@ XBT_PUBLIC smx_actor_t simcall_process_create(const char* name, xbt_main_func_t
                                               int argc, char** argv, std::map<std::string, std::string>* properties);
 #endif
 
-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 */
index 70480e1..cf4cda0 100644 (file)
@@ -3,6 +3,7 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
+#include "simgrid/s4u/Actor.hpp"
 #include "simgrid/s4u/Engine.hpp"
 #include "simgrid/s4u/Host.hpp"
 
@@ -91,8 +92,7 @@ void MSG_config(const char *key, const char *value){
  */
 int MSG_process_killall()
 {
-  simcall_process_killall();
-
+  simgrid::s4u::Actor::kill_all();
   return 0;
 }
 
index c4ac691..2228a91 100644 (file)
@@ -225,7 +225,8 @@ ActorPtr Actor::by_pid(aid_t pid)
 
 void Actor::kill_all()
 {
-  simcall_process_killall();
+  smx_actor_t self = SIMIX_process_self();
+  simgrid::simix::kernelImmediate([&self] { SIMIX_process_killall(self); });
 }
 
 std::map<std::string, std::string>* Actor::get_properties()
index 26ad38b..cbf5b96 100644 (file)
@@ -565,10 +565,6 @@ void SIMIX_process_throw(smx_actor_t process, xbt_errcat_t cat, int value, const
 
 }
 
-void simcall_HANDLER_process_killall(smx_simcall_t simcall)
-{
-  SIMIX_process_killall(simcall->issuer);
-}
 /**
  * \brief Kills all running processes.
  * \param issuer this one will not be killed
index 254652c..d685e4b 100644 (file)
@@ -177,15 +177,6 @@ e_smx_state_t simcall_execution_test(smx_activity_t execution)
   return (e_smx_state_t)simcall_BODY_execution_test(execution);
 }
 
-/**
- * \ingroup simix_process_management
- * \brief Kills all SIMIX processes.
- */
-void simcall_process_killall()
-{
-  simcall_BODY_process_killall();
-}
-
 void simcall_process_join(smx_actor_t process, double timeout)
 {
   simcall_BODY_process_join(process, timeout);
index 698a84a..5d8c7d1 100644 (file)
@@ -1347,7 +1347,6 @@ static inline void simcall_run_blocking__set__code(smx_simcall_t simcall, std::f
 
 /* The prototype of all simcall handlers, automatically generated for you */
 
-XBT_PRIVATE void simcall_HANDLER_process_killall(smx_simcall_t simcall);
 XBT_PRIVATE void simcall_HANDLER_process_suspend(smx_simcall_t simcall, smx_actor_t process);
 XBT_PRIVATE void simcall_HANDLER_process_join(smx_simcall_t simcall, smx_actor_t process, double timeout);
 XBT_PRIVATE void simcall_HANDLER_process_sleep(smx_simcall_t simcall, double duration);
index 458aa72..c0f8318 100644 (file)
@@ -37,13 +37,6 @@ inline static R simcall(e_smx_simcall_t call, T const&... t)
   return simgrid::simix::unmarshal<R>(self->simcall.result);
 }
 
-inline static void simcall_BODY_process_killall()
-{
-  if (0) /* Go to that function to follow the code flow through the simcall barrier */
-    simcall_HANDLER_process_killall(&SIMIX_process_self()->simcall);
-  return simcall<void>(SIMCALL_PROCESS_KILLALL);
-}
-
 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 6cfa5c1..2c83ae2 100644 (file)
@@ -19,7 +19,6 @@
  */
 typedef enum {
   SIMCALL_NONE,
-  SIMCALL_PROCESS_KILLALL,
   SIMCALL_PROCESS_SUSPEND,
   SIMCALL_PROCESS_JOIN,
   SIMCALL_PROCESS_SLEEP,
index dcf2093..d4502d9 100644 (file)
@@ -28,7 +28,6 @@ XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(simix_popping);
 /** @brief Simcalls' names (generated from src/simix/simcalls.in) */
 const char* simcall_names[] = {
     "SIMCALL_NONE",
-    "SIMCALL_PROCESS_KILLALL",
     "SIMCALL_PROCESS_SUSPEND",
     "SIMCALL_PROCESS_JOIN",
     "SIMCALL_PROCESS_SLEEP",
@@ -73,11 +72,6 @@ void SIMIX_simcall_handle(smx_simcall_t simcall, int value) {
   if (simcall->issuer->context->iwannadie)
     return;
   switch (simcall->call) {
-case SIMCALL_PROCESS_KILLALL:
-  simcall_HANDLER_process_killall(simcall);
-  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 aeda3cd..0801732 100644 (file)
@@ -35,7 +35,6 @@
 # Last but not the least, you should declare the new simix call in
 # ./include/simgrid/simix.h (otherwise you will get a warning at compile time)
 
-void process_killall();
 void process_suspend(smx_actor_t process) [[block]];
 int  process_join(smx_actor_t process, double timeout) [[block]];
 int  process_sleep(double duration) [[block]];