/* 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. */
/* 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 "smx_private.hpp"
#include "src/kernel/activity/SleepImpl.hpp"
#include "src/kernel/activity/SynchroIo.hpp"
#include "src/kernel/activity/SynchroRaw.hpp"
#include "src/mc/mc_replay.hpp"
#include "src/mc/remote/Client.hpp"
#include "smx_private.hpp"
#include "src/kernel/activity/SleepImpl.hpp"
#include "src/kernel/activity/SynchroIo.hpp"
#include "src/kernel/activity/SynchroRaw.hpp"
#include "src/mc/mc_replay.hpp"
#include "src/mc/remote/Client.hpp"
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(simix_process, simix, "Logging specific to SIMIX (process)");
unsigned long simix_process_maxpid = 0;
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(simix_process, simix, "Logging specific to SIMIX (process)");
unsigned long simix_process_maxpid = 0;
// retrieve the arguments of the old process
// FIXME: Factorize this with SIMIX_host_add_auto_restart_process ?
// retrieve the arguments of the old process
// FIXME: Factorize this with SIMIX_host_add_auto_restart_process ?
- THROWF(host_error, 0, "Host %s failed, you cannot sleep there.", host->getCname());
+ THROWF(host_error, 0, "Host %s failed, you cannot sleep there.", host->get_cname());
simgrid::kernel::activity::SleepImpl* synchro = new simgrid::kernel::activity::SleepImpl();
synchro->host = host;
synchro->surf_sleep = host->pimpl_cpu->sleep(duration);
simgrid::kernel::activity::SleepImpl* synchro = new simgrid::kernel::activity::SleepImpl();
synchro->host = host;
synchro->surf_sleep = host->pimpl_cpu->sleep(duration);
}
}
/** @brief Creates and runs the maestro process */
void SIMIX_maestro_create(void (*code)(void*), void* data)
{
}
}
/** @brief Creates and runs the maestro process */
void SIMIX_maestro_create(void (*code)(void*), void* data)
{
xbt_assert(code && host != nullptr, "Invalid parameters");
/* Process data */
process->pid = simix_process_maxpid++;
process->name = simgrid::xbt::string(name);
process->host = host;
xbt_assert(code && host != nullptr, "Invalid parameters");
/* Process data */
process->pid = simix_process_maxpid++;
process->name = simgrid::xbt::string(name);
process->host = host;
/* Now insert it in the global process list and in the process to run list */
simix_global->process_list[process->pid] = process;
/* Now insert it in the global process list and in the process to run list */
simix_global->process_list[process->pid] = process;
- /* Tracing the process creation */
- if (TRACE_actor_is_enabled())
- new simgrid::instr::Container(instr_pid(process->ciface()), "ACTOR",
- simgrid::instr::Container::byName(process->host->getName()));
/* The onCreation() signal must be delayed until there, where the pid and everything is set */
simgrid::s4u::ActorPtr tmp = process->iface(); // Passing this directly to onCreation will lead to crashes
/* The onCreation() signal must be delayed until there, where the pid and everything is set */
simgrid::s4u::ActorPtr tmp = process->iface(); // Passing this directly to onCreation will lead to crashes
/* Now insert it in the global process list and in the process to run list */
simix_global->process_list[process->pid] = process;
/* Now insert it in the global process list and in the process to run list */
simix_global->process_list[process->pid] = process;
- /* Tracing the process creation */
- if (TRACE_actor_is_enabled())
- new simgrid::instr::Container(instr_pid(process->ciface()), "ACTOR",
- simgrid::instr::Container::byName(process->host->getName()));
auto* context = dynamic_cast<simgrid::kernel::context::AttachContext*>(process->context);
if (not context)
xbt_die("Not a suitable context");
context->attach_start();
auto* context = dynamic_cast<simgrid::kernel::context::AttachContext*>(process->context);
if (not context)
xbt_die("Not a suitable context");
context->attach_start();
- XBT_DEBUG("Ignoring request to kill process %s@%s that is already dead", process->getCname(),
- process->host->getCname());
+ XBT_DEBUG("Ignoring request to kill process %s@%s that is already dead", process->get_cname(),
+ process->host->get_cname());
- XBT_DEBUG("Actor '%s'@%s is killing actor '%s'@%s", issuer->getCname(), issuer->host->getCname(), process->getCname(),
- process->host->getCname());
+ XBT_DEBUG("Actor '%s'@%s is killing actor '%s'@%s", issuer->get_cname(), issuer->host->get_cname(),
+ process->get_cname(), process->host->get_cname());
SIMIX_process_on_exit_runall(self);
/* Add the process to the list of process to restart, only if the host is down */
if (self->auto_restart && self->host->isOff()) {
SIMIX_process_on_exit_runall(self);
/* Add the process to the list of process to restart, only if the host is down */
if (self->auto_restart && self->host->isOff()) {
- SIMIX_host_add_auto_restart_process(self->host, self->getCname(), self->code, self->userdata,
+ SIMIX_host_add_auto_restart_process(self->host, self->get_cname(), self->code, self->getUserData(),
smx_process_exit_status_t exit_status = (process->context->iwannadie) ? SMX_EXIT_FAILURE : SMX_EXIT_SUCCESS;
while (not process->on_exit.empty()) {
s_smx_process_exit_fun_t exit_fun = process->on_exit.back();
smx_process_exit_status_t exit_status = (process->context->iwannadie) ? SMX_EXIT_FAILURE : SMX_EXIT_SUCCESS;
while (not process->on_exit.empty()) {
s_smx_process_exit_fun_t exit_fun = process->on_exit.back();
* \param code the main function of the process
* \param data a pointer to any data one may want to attach to the new object. It is for user-level information and can
* be nullptr.
* \param code the main function of the process
* \param data a pointer to any data one may want to attach to the new object. It is for user-level information and can
* be nullptr.
* \param argc first argument passed to \a code
* \param argv second argument passed to \a code
* \param properties the properties of the process
* \param argc first argument passed to \a code
* \param argv second argument passed to \a code
* \param properties the properties of the process
-extern "C" smx_actor_t simcall_process_create(const char* name, xbt_main_func_t code, void* data, sg_host_t host,
- int argc, char** argv, std::map<std::string, std::string>* properties)
+smx_actor_t simcall_process_create(const char* name, xbt_main_func_t code, void* data, sg_host_t host, int argc,
+ char** argv, std::map<std::string, std::string>* properties)