X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/67634e9178fa9195d4b6fffb61e86ccd81a783d9..323124aa9c477698fe9e0670c3a0ad4d41af5b22:/src/simix/smx_global.cpp diff --git a/src/simix/smx_global.cpp b/src/simix/smx_global.cpp index 0c2a87f3f4..a8538f4ee6 100644 --- a/src/simix/smx_global.cpp +++ b/src/simix/smx_global.cpp @@ -228,7 +228,8 @@ void SIMIX_global_init(int *argc, char **argv) sg_platf_init(); simgrid::s4u::onPlatformCreated.connect(SIMIX_post_create_environment); simgrid::s4u::Host::onCreation.connect([](simgrid::s4u::Host& host) { - host.extension_set(new simgrid::simix::Host()); + if (host.extension() == nullptr) // another callback to the same signal may have created it + host.extension_set(new simgrid::simix::Host()); }); simgrid::surf::storageCreatedCallbacks.connect([](simgrid::surf::Storage* storage) { @@ -268,7 +269,7 @@ void SIMIX_clean() #if HAVE_SMPI if (SIMIX_process_count()>0){ - if(smpi_process_initialized()){ + if(smpi_process()->initialized()){ xbt_die("Process exited without calling MPI_Finalize - Killing simulation"); }else{ XBT_WARN("Process called exit when leaving - Skipping cleanups"); @@ -302,6 +303,9 @@ void SIMIX_clean() xbt_os_mutex_destroy(simix_global->mutex); simix_global->mutex = nullptr; +#if HAVE_MC + xbt_dynar_free(&simix_global->actors_vector); +#endif /* Let's free maestro now */ delete simix_global->maestro_process->context; @@ -541,7 +545,7 @@ void SIMIX_run() /* Clean processes to destroy */ SIMIX_process_empty_trash(); - XBT_DEBUG("### time %f, #processes %zu, #to_run %zu", time, simix_global->process_list.size(), + XBT_DEBUG("### time %f, #processes %zu, #to_run %lu", time, simix_global->process_list.size(), xbt_dynar_length(simix_global->process_to_run)); /* If only daemon processes remain, cancel their actions, mark them to die and reschedule them */ @@ -693,5 +697,6 @@ void SIMIX_display_process_status() int SIMIX_is_maestro() { - return simix_global==nullptr /*SimDag*/|| SIMIX_process_self() == simix_global->maestro_process; + smx_actor_t self = SIMIX_process_self(); + return simix_global == nullptr /*SimDag*/ || self == nullptr || self == simix_global->maestro_process; }