X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/6287c14ec0b01d759a8d50da1e7cee38c67f525d..5c9583c94b9cef3f02ffec69b6cc245b1739f97e:/src/smpi/internals/smpi_global.cpp diff --git a/src/smpi/internals/smpi_global.cpp b/src/smpi/internals/smpi_global.cpp index 0b497fb09f..34327f6171 100644 --- a/src/smpi/internals/smpi_global.cpp +++ b/src/smpi/internals/smpi_global.cpp @@ -79,9 +79,7 @@ std::map units2papi_ std::unordered_map location2speedup; static std::map process_data; -int process_count = 0; static int smpi_exit_status = 0; -int smpi_universe_size = 0; extern double smpi_total_benched_time; xbt_os_timer_t global_timer; static std::vector privatize_libs_paths; @@ -108,11 +106,6 @@ static simgrid::config::Flag smpi_init_sleep( void (*smpi_comm_copy_data_callback)(simgrid::kernel::activity::CommImpl*, void*, size_t) = &smpi_comm_copy_buffer_callback; -int smpi_process_count() -{ - return process_count; -} - simgrid::smpi::ActorExt* smpi_process() { simgrid::s4u::ActorPtr me = simgrid::s4u::Actor::self(); @@ -239,7 +232,7 @@ static void smpi_check_options() xbt_assert(simgrid::config::get_value("smpi/async-small-thresh") <= simgrid::config::get_value("smpi/send-is-detached-thresh")); - if (simgrid::config::is_default("smpi/host-speed")) { + if (simgrid::config::is_default("smpi/host-speed") && not MC_is_active()) { XBT_INFO("You did not set the power of the host running the simulation. " "The timings will certainly not be accurate. " "Use the option \"--cfg=smpi/host-speed:\" to set its value. " @@ -378,8 +371,10 @@ static void smpi_init_options(){ simgrid::smpi::Colls::set_collectives(); simgrid::smpi::Colls::smpi_coll_cleanup_callback = nullptr; smpi_cpu_threshold = simgrid::config::get_value("smpi/cpu-threshold"); - smpi_host_speed = simgrid::config::get_value("smpi/host-speed"); - xbt_assert(smpi_host_speed > 0.0, "You're trying to set the host_speed to a non-positive value (given: %f)", smpi_host_speed); + if (smpi_cpu_threshold < 0) + smpi_cpu_threshold = DBL_MAX; + + smpi_host_speed = simgrid::config::get_value("smpi/host-speed"); std::string smpi_privatize_option = simgrid::config::get_value("smpi/privatization"); if (smpi_privatize_option == "no" || smpi_privatize_option == "0") smpi_privatize_global_variables = SmpiPrivStrategies::NONE; @@ -401,9 +396,6 @@ static void smpi_init_options(){ smpi_privatize_global_variables = SmpiPrivStrategies::DLOPEN; } - if (smpi_cpu_threshold < 0) - smpi_cpu_threshold = DBL_MAX; - std::string val = simgrid::config::get_value("smpi/shared-malloc"); if ((val == "yes") || (val == "1") || (val == "on") || (val == "global")) { smpi_cfg_shared_malloc = SharedMallocType::GLOBAL; @@ -564,13 +556,11 @@ static void smpi_init_privatization_dlopen(const std::string& executable) char fullpath[512] = {'\0'}; strncpy(fullpath, libname.c_str(), 511); #if not defined(__APPLE__) && not defined(__HAIKU__) - int ret = dl_iterate_phdr(visit_libs, fullpath); - if (ret == 0) - xbt_die("Can't find a linked %s - check the setting you gave to smpi/privatize-libs", fullpath); - else - XBT_DEBUG("Extra lib to privatize found : %s", fullpath); + xbt_assert(0 != dl_iterate_phdr(visit_libs, fullpath), + "Can't find a linked %s - check your settings in smpi/privatize-libs", fullpath); + XBT_DEBUG("Extra lib to privatize '%s' found", fullpath); #else - xbt_die("smpi/privatize-libs is not (yet) compatible with OSX"); + xbt_die("smpi/privatize-libs is not (yet) compatible with OSX nor with Haiku"); #endif privatize_libs_paths.push_back(fullpath); dlclose(libhandle); @@ -686,8 +676,6 @@ int smpi_main(const char* executable, int argc, char* argv[]) SMPI_app_instance_register(smpi_default_instance_name.c_str(), nullptr, process_data.size()); // This call has a side effect on process_count... MPI_COMM_WORLD = *smpi_deployment_comm_world(smpi_default_instance_name); - smpi_universe_size = process_count; - /* Clean IO before the run */ fflush(stdout); @@ -721,7 +709,7 @@ int smpi_main(const char* executable, int argc, char* argv[]) void SMPI_init(){ simgrid::s4u::Actor::on_creation.connect([](simgrid::s4u::Actor& actor) { if (not actor.is_daemon()) { - process_data.insert({&actor, new simgrid::smpi::ActorExt(&actor, nullptr)}); + process_data.insert({&actor, new simgrid::smpi::ActorExt(&actor)}); } }); simgrid::s4u::Actor::on_destruction.connect([](simgrid::s4u::Actor const& actor) {