X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/cf51d55db1e6cb288ebc0a77a2977ec24f013bc0..d3d4c51aace6f9daab7ee7bf664d9d56c81070f8:/src/simix/smx_host.cpp?ds=sidebyside diff --git a/src/simix/smx_host.cpp b/src/simix/smx_host.cpp index ed49843c8a..a51febd7dd 100644 --- a/src/simix/smx_host.cpp +++ b/src/simix/smx_host.cpp @@ -85,12 +85,6 @@ void SIMIX_host_off(sg_host_t h, smx_actor_t issuer) } } -sg_host_t sg_host_self() -{ - smx_actor_t process = SIMIX_process_self(); - return (process == nullptr) ? nullptr : process->host; -} - /* needs to be public and without simcall for exceptions and logging events */ const char* sg_host_self_get_name() { @@ -112,21 +106,18 @@ void SIMIX_host_add_auto_restart_process(sg_host_t host, const char* name, std:: double kill_time, std::map* properties, int auto_restart) { - smx_process_arg_t arg = new simgrid::simix::ProcessArg(); - arg->name = name; - arg->code = std::move(code); - arg->data = data; - arg->host = host; - arg->kill_time = kill_time; + simgrid::simix::ProcessArg* arg = + new simgrid::simix::ProcessArg(name, code, data, host, kill_time, nullptr, auto_restart); arg->properties.reset(properties, [](decltype(properties)) {}); - arg->auto_restart = auto_restart; if (host->isOff() && watched_hosts.find(host->getCname()) == watched_hosts.end()) { watched_hosts.insert(host->getCname()); XBT_DEBUG("Push host %s to watched_hosts because state == SURF_RESOURCE_OFF", host->getCname()); } + XBT_DEBUG("Adding Process %s to the auto-restart list of Host %s", arg->name.c_str(), arg->host->getCname()); host->extension()->auto_restart_processes.push_back(arg); } + /** @brief Restart the list of processes that have been registered to the host */ void SIMIX_host_autorestart(sg_host_t host) { @@ -148,7 +139,6 @@ void SIMIX_host_autorestart(sg_host_t host) boost::intrusive_ptr SIMIX_execution_start(const char* name, double flops_amount, double priority, double bound, sg_host_t host) { - /* alloc structures and initialize */ simgrid::kernel::activity::ExecImplPtr exec = simgrid::kernel::activity::ExecImplPtr(new simgrid::kernel::activity::ExecImpl(name, host));