X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/f6d4ca5d06bb0d90e4d5505d8b289e2a1c8a39d1..be433eeb2c53b337a26b3d712f64b408fca53ae9:/src/simix/smx_global.cpp diff --git a/src/simix/smx_global.cpp b/src/simix/smx_global.cpp index 47184cb046..376c1b9177 100644 --- a/src/simix/smx_global.cpp +++ b/src/simix/smx_global.cpp @@ -27,9 +27,9 @@ #include "src/smpi/smpi_process.hpp" -#include "src/kernel/activity/SynchroExec.hpp" -#include "src/kernel/activity/SynchroComm.hpp" -#include "src/kernel/activity/SynchroSleep.hpp" +#include "src/kernel/activity/CommImpl.hpp" +#include "src/kernel/activity/ExecImpl.hpp" +#include "src/kernel/activity/SleepImpl.hpp" #include "src/kernel/activity/SynchroIo.hpp" #include "src/kernel/activity/SynchroRaw.hpp" @@ -38,7 +38,7 @@ #include "src/mc/remote/Client.hpp" #include "src/mc/remote/mc_protocol.h" #include -#endif +#endif #include "src/mc/mc_record.h" @@ -235,12 +235,11 @@ void SIMIX_global_init(int *argc, char **argv) }); simgrid::surf::storageCreatedCallbacks.connect([](simgrid::surf::StorageImpl* storage) { - const char* name = storage->cname(); - // TODO, create sg_storage_by_name - sg_storage_t s = xbt_lib_get_elm_or_null(storage_lib, name); - xbt_assert(s != nullptr, "Storage not found for name %s", name); + sg_storage_t s = simgrid::s4u::Storage::byName(storage->cname()); + xbt_assert(s != nullptr, "Storage not found for name %s", storage->cname()); }); } + if (not simix_timers) simix_timers = xbt_heap_new(8, [](void* p) { delete static_cast(p); @@ -341,8 +340,8 @@ static int process_syscall_color(void *p) case SIMCALL_NONE: case SIMCALL_PROCESS_KILL: return 2; - case SIMCALL_PROCESS_RESUME: - return 1; + // case SIMCALL_PROCESS_RESUME: + // return 1; default: return 0; } @@ -357,7 +356,7 @@ static void SIMIX_wake_processes() XBT_DEBUG("Handling the processes whose action failed (if any)"); while ((action = surf_model_extract_failed_action_set(model))) { XBT_DEBUG(" Handling Action %p",action); - SIMIX_simcall_exit((smx_activity_t) action->getData()); + SIMIX_simcall_exit(static_cast(action->getData())); } XBT_DEBUG("Handling the processes whose action terminated normally (if any)"); while ((action = surf_model_extract_done_action_set(model))) { @@ -365,7 +364,7 @@ static void SIMIX_wake_processes() if (action->getData() == nullptr) XBT_DEBUG("probably vcpu's action %p, skip", action); else - SIMIX_simcall_exit((smx_activity_t) action->getData()); + SIMIX_simcall_exit(static_cast(action->getData())); } } } @@ -541,7 +540,7 @@ void SIMIX_run() /* Autorestart all process */ for (auto host: host_that_restart) { - XBT_INFO("Restart processes on host %s", host->cname()); + XBT_INFO("Restart processes on host %s", host->getCname()); SIMIX_host_autorestart(host); } host_that_restart.clear(); @@ -654,19 +653,19 @@ void SIMIX_display_process_status() const char* synchro_description = "unknown"; - if (dynamic_cast(process->waiting_synchro) != nullptr) + if (boost::dynamic_pointer_cast(process->waiting_synchro) != nullptr) synchro_description = "execution"; - if (dynamic_cast(process->waiting_synchro) != nullptr) + if (boost::dynamic_pointer_cast(process->waiting_synchro) != nullptr) synchro_description = "communication"; - if (dynamic_cast(process->waiting_synchro) != nullptr) + if (boost::dynamic_pointer_cast(process->waiting_synchro) != nullptr) synchro_description = "sleeping"; - if (dynamic_cast(process->waiting_synchro) != nullptr) + if (boost::dynamic_pointer_cast(process->waiting_synchro) != nullptr) synchro_description = "synchronization"; - if (dynamic_cast(process->waiting_synchro) != nullptr) + if (boost::dynamic_pointer_cast(process->waiting_synchro) != nullptr) synchro_description = "I/O"; @@ -682,11 +681,11 @@ void SIMIX_display_process_status() */ XBT_INFO("Process %lu (%s@%s): waiting for %s synchro %p (%s) in state %d to finish", process->pid, - process->cname(), process->host->cname(), synchro_description, process->waiting_synchro, + process->cname(), process->host->getCname(), synchro_description, process->waiting_synchro.get(), process->waiting_synchro->name.c_str(), (int)process->waiting_synchro->state); } else { - XBT_INFO("Process %lu (%s@%s)", process->pid, process->cname(), process->host->cname()); + XBT_INFO("Process %lu (%s@%s)", process->pid, process->cname(), process->host->getCname()); } } }