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 */
/* 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"
*/
int MSG_process_killall()
{
- simcall_process_killall();
-
+ simgrid::s4u::Actor::kill_all();
return 0;
}
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()
}
-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
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);
/* 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);
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 */
*/
typedef enum {
SIMCALL_NONE,
- SIMCALL_PROCESS_KILLALL,
SIMCALL_PROCESS_SUSPEND,
SIMCALL_PROCESS_JOIN,
SIMCALL_PROCESS_SLEEP,
/** @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",
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;
# 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]];