X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/a56afec84c545bff8857ec1ebc33a0db038aad37..b283430cb109f0ef78eaeba48f8942b512c659d2:/src/simix/smx_host.cpp diff --git a/src/simix/smx_host.cpp b/src/simix/smx_host.cpp index 69054e2849..bc6c5a7877 100644 --- a/src/simix/smx_host.cpp +++ b/src/simix/smx_host.cpp @@ -57,13 +57,13 @@ namespace simgrid { void Host::turnOn() { for (auto arg : boot_processes) { - XBT_DEBUG("Booting Process %s(%s) right now", arg->name.c_str(), arg->host->cname()); + XBT_DEBUG("Booting Process %s(%s) right now", arg->name.c_str(), arg->host->getCname()); smx_actor_t actor = simix_global->create_process_function(arg->name.c_str(), arg->code, nullptr, arg->host, arg->properties, nullptr); if (arg->kill_time >= 0) simcall_process_set_kill_time(actor, arg->kill_time); if (arg->auto_restart) - simcall_process_auto_restart_set(actor, arg->auto_restart); + actor->auto_restart = arg->auto_restart; } } @@ -84,11 +84,11 @@ void SIMIX_host_off(sg_host_t h, smx_actor_t issuer) smx_actor_t process = nullptr; xbt_swag_foreach(process, host->process_list) { SIMIX_process_kill(process, issuer); - XBT_DEBUG("Killing %s@%s on behalf of %s", process->cname(), process->host->cname(), issuer->cname()); + XBT_DEBUG("Killing %s@%s on behalf of %s", process->cname(), process->host->getCname(), issuer->cname()); } } } else { - XBT_INFO("Host %s is already off", h->cname()); + XBT_INFO("Host %s is already off", h->getCname()); } } @@ -105,7 +105,7 @@ const char* sg_host_self_get_name() if (host == nullptr || SIMIX_process_self() == simix_global->maestro_process) return ""; - return host->cname(); + return host->getCname(); } /** @@ -128,9 +128,9 @@ void SIMIX_host_add_auto_restart_process( arg->properties = properties; arg->auto_restart = auto_restart; - if (host->isOff() && not xbt_dict_get_or_null(watched_hosts_lib, host->cname())) { - xbt_dict_set(watched_hosts_lib, host->cname(), host, nullptr); - XBT_DEBUG("Push host %s to watched_hosts_lib because state == SURF_RESOURCE_OFF", host->cname()); + if (host->isOff() && not xbt_dict_get_or_null(watched_hosts_lib, host->getCname())) { + xbt_dict_set(watched_hosts_lib, host->getCname(), host, nullptr); + XBT_DEBUG("Push host %s to watched_hosts_lib because state == SURF_RESOURCE_OFF", host->getCname()); } host->extension()->auto_restart_processes.push_back(arg); } @@ -141,13 +141,13 @@ void SIMIX_host_autorestart(sg_host_t host) host->extension()->auto_restart_processes; for (auto arg : process_list) { - XBT_DEBUG("Restarting Process %s@%s right now", arg->name.c_str(), arg->host->cname()); + XBT_DEBUG("Restarting Process %s@%s right now", arg->name.c_str(), arg->host->getCname()); smx_actor_t actor = simix_global->create_process_function(arg->name.c_str(), arg->code, nullptr, arg->host, arg->properties, nullptr); if (arg->kill_time >= 0) simcall_process_set_kill_time(actor, arg->kill_time); if (arg->auto_restart) - simcall_process_auto_restart_set(actor, arg->auto_restart); + actor->auto_restart = arg->auto_restart; } process_list.clear(); } @@ -173,7 +173,7 @@ SIMIX_execution_start(smx_actor_t issuer, const char* name, double flops_amount, exec->surf_exec = issuer->host->pimpl_cpu->execution_start(flops_amount); exec->surf_exec->setData(exec.get()); - exec->surf_exec->setPriority(priority); + exec->surf_exec->setSharingWeight(priority); if (bound > 0) static_cast(exec->surf_exec)->setBound(bound); @@ -234,7 +234,7 @@ void SIMIX_execution_set_priority(smx_activity_t synchro, double priority) simgrid::kernel::activity::ExecImplPtr exec = boost::static_pointer_cast(synchro); if(exec->surf_exec) - exec->surf_exec->setPriority(priority); + exec->surf_exec->setSharingWeight(priority); } void SIMIX_execution_set_bound(smx_activity_t synchro, double bound) @@ -278,7 +278,7 @@ void SIMIX_execution_finish(simgrid::kernel::activity::ExecImplPtr exec) break; case SIMIX_FAILED: - XBT_DEBUG("SIMIX_execution_finished: host '%s' failed", simcall->issuer->host->cname()); + XBT_DEBUG("SIMIX_execution_finished: host '%s' failed", simcall->issuer->host->getCname()); simcall->issuer->context->iwannadie = 1; SMX_EXCEPTION(simcall->issuer, host_error, 0, "Host failed"); break;