X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/3502bf1993d45e8fd54892262565aef8b1914b3d..eff6e71fac6ed5fa431bec9d4bd5bad22e9a0244:/src/simix/smx_host.cpp diff --git a/src/simix/smx_host.cpp b/src/simix/smx_host.cpp index eca8a19f85..e4592493c0 100644 --- a/src/simix/smx_host.cpp +++ b/src/simix/smx_host.cpp @@ -5,11 +5,10 @@ #include "mc/mc.h" #include "smx_private.h" +#include "src/kernel/activity/CommImpl.hpp" #include "src/mc/mc_replay.h" #include "src/plugins/vm/VirtualMachineImpl.hpp" -#include - -#include "src/kernel/activity/SynchroComm.hpp" +#include "xbt/ex.hpp" XBT_LOG_NEW_DEFAULT_SUBCATEGORY(simix_host, simix, "SIMIX hosts"); @@ -19,7 +18,7 @@ namespace simgrid { Host::Host() { - if (!Host::EXTENSION_ID.valid()) + if (not Host::EXTENSION_ID.valid()) Host::EXTENSION_ID = s4u::Host::extension_create(); simgrid::simix::ActorImpl act; @@ -129,7 +128,7 @@ void SIMIX_host_add_auto_restart_process( arg->properties = properties; arg->auto_restart = auto_restart; - if (host->isOff() && !xbt_dict_get_or_null(watched_hosts_lib, host->cname())) { + 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()); } @@ -162,10 +161,10 @@ smx_activity_t SIMIX_execution_start(smx_actor_t issuer, const char *name, doubl double bound){ /* alloc structures and initialize */ - simgrid::kernel::activity::Exec *exec = new simgrid::kernel::activity::Exec(name, issuer->host); + simgrid::kernel::activity::ExecImpl* exec = new simgrid::kernel::activity::ExecImpl(name, issuer->host); /* set surf's action */ - if (!MC_is_active() && !MC_record_replay_is_active()) { + if (not MC_is_active() && not MC_record_replay_is_active()) { exec->surf_exec = issuer->host->pimpl_cpu->execution_start(flops_amount); exec->surf_exec->setData(exec); @@ -185,7 +184,7 @@ smx_activity_t SIMIX_execution_parallel_start(const char* name, int host_nb, sg_ { /* alloc structures and initialize */ - simgrid::kernel::activity::Exec *exec = new simgrid::kernel::activity::Exec(name, nullptr); + simgrid::kernel::activity::ExecImpl* exec = new simgrid::kernel::activity::ExecImpl(name, nullptr); /* set surf's synchro */ sg_host_t *host_list_cpy = xbt_new0(sg_host_t, host_nb); @@ -200,7 +199,7 @@ smx_activity_t SIMIX_execution_parallel_start(const char* name, int host_nb, sg_ } /* set surf's synchro */ - if (!MC_is_active() && !MC_record_replay_is_active()) { + if (not MC_is_active() && not MC_record_replay_is_active()) { exec->surf_exec = surf_host_model->executeParallelTask(host_nb, host_list_cpy, flops_amount, bytes_amount, rate); exec->surf_exec->setData(exec); if (timeout > 0) { @@ -216,7 +215,7 @@ smx_activity_t SIMIX_execution_parallel_start(const char* name, int host_nb, sg_ void SIMIX_execution_cancel(smx_activity_t synchro) { XBT_DEBUG("Cancel synchro %p", synchro); - simgrid::kernel::activity::Exec *exec = static_cast(synchro); + simgrid::kernel::activity::ExecImpl* exec = static_cast(synchro); if (exec->surf_exec) exec->surf_exec->cancel(); @@ -224,21 +223,21 @@ void SIMIX_execution_cancel(smx_activity_t synchro) void SIMIX_execution_set_priority(smx_activity_t synchro, double priority) { - simgrid::kernel::activity::Exec *exec = static_cast(synchro); + simgrid::kernel::activity::ExecImpl* exec = static_cast(synchro); if(exec->surf_exec) exec->surf_exec->setPriority(priority); } void SIMIX_execution_set_bound(smx_activity_t synchro, double bound) { - simgrid::kernel::activity::Exec *exec = static_cast(synchro); + simgrid::kernel::activity::ExecImpl* exec = static_cast(synchro); if(exec->surf_exec) static_cast(exec->surf_exec)->setBound(bound); } void simcall_HANDLER_execution_wait(smx_simcall_t simcall, smx_activity_t synchro) { - simgrid::kernel::activity::Exec *exec = static_cast(synchro); + simgrid::kernel::activity::ExecImpl* exec = static_cast(synchro); XBT_DEBUG("Wait for execution of synchro %p, state %d", synchro, (int)synchro->state); /* Associate this simcall to the synchro */ @@ -257,7 +256,7 @@ void simcall_HANDLER_execution_wait(smx_simcall_t simcall, smx_activity_t synchr SIMIX_execution_finish(exec); } -void SIMIX_execution_finish(simgrid::kernel::activity::Exec *exec) +void SIMIX_execution_finish(simgrid::kernel::activity::ExecImpl* exec) { for (smx_simcall_t simcall : exec->simcalls) { switch (exec->state) { @@ -305,13 +304,13 @@ void SIMIX_set_category(smx_activity_t synchro, const char *category) if (synchro->state != SIMIX_RUNNING) return; - simgrid::kernel::activity::Exec *exec = dynamic_cast(synchro); + simgrid::kernel::activity::ExecImpl* exec = dynamic_cast(synchro); if (exec != nullptr) { exec->surf_exec->setCategory(category); return; } - simgrid::kernel::activity::Comm *comm = dynamic_cast(synchro); + simgrid::kernel::activity::CommImpl* comm = dynamic_cast(synchro); if (comm != nullptr) { comm->surf_comm->setCategory(category); }