X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/0137f14a0c14e604049cfa61688d075686496f05..9be7b15cf2a06f451f9d7ee8d85abf5a7308760e:/src/smpi/smpi_global.c diff --git a/src/smpi/smpi_global.c b/src/smpi/smpi_global.c index 4f8fed000d..822f0cadec 100644 --- a/src/smpi/smpi_global.c +++ b/src/smpi/smpi_global.c @@ -2,7 +2,9 @@ #include "private.h" -XBT_LOG_NEW_DEFAULT_SUBCATEGORY(smpi, XBT_LOG_ROOT_CAT, "All SMPI categories"); +XBT_LOG_NEW_CATEGORY(smpi, "All SMPI categories"); + +XBT_LOG_NEW_DEFAULT_SUBCATEGORY(smpi_kernel, smpi, "Logging specific to SMPI (kernel)"); smpi_global_t smpi_global = NULL; @@ -122,8 +124,18 @@ void smpi_global_init() int size = SIMIX_host_get_number(); - smpi_global = xbt_new(s_smpi_global_t, 1); + /* Connect our log channels: that must be done manually under windows */ +#ifdef XBT_LOG_CONNECT + XBT_LOG_CONNECT(smpi_base, smpi); + XBT_LOG_CONNECT(smpi_bench, smpi); + XBT_LOG_CONNECT(smpi_kernel, smpi); + XBT_LOG_CONNECT(smpi_mpi, smpi); + XBT_LOG_CONNECT(smpi_receiver, smpi); + XBT_LOG_CONNECT(smpi_sender, smpi); + XBT_LOG_CONNECT(smpi_util, smpi); +#endif + smpi_global = xbt_new(s_smpi_global_t, 1); // config variable smpi_global->reference_speed = SMPI_DEFAULT_SPEED; @@ -166,10 +178,6 @@ void smpi_global_init() smpi_global->timer_mutex = SIMIX_mutex_init(); smpi_global->timer_cond = SIMIX_cond_init(); - smpi_global->execute_mutex = SIMIX_mutex_init(); - smpi_global->execute_cond = SIMIX_cond_init(); - smpi_global->execute_count = 0; - smpi_global->do_once_duration_nodes = NULL; smpi_global->do_once_duration = NULL; smpi_global->do_once_mutex = SIMIX_mutex_init(); @@ -211,8 +219,6 @@ void smpi_global_destroy() xbt_os_timer_free(smpi_global->timer); SIMIX_mutex_destroy(smpi_global->timer_mutex); SIMIX_cond_destroy(smpi_global->timer_cond); - SIMIX_mutex_destroy(smpi_global->execute_mutex); - SIMIX_cond_destroy(smpi_global->execute_cond); for(curr = smpi_global->do_once_duration_nodes; NULL != curr; curr = next) { next = curr->next; @@ -247,10 +253,23 @@ int smpi_host_index() { smx_host_t host = SIMIX_host_self(); smpi_host_data_t hdata = (smpi_host_data_t)SIMIX_host_get_data(host); - return hdata->index; } +smx_mutex_t smpi_host_mutex() +{ + smx_host_t host = SIMIX_host_self(); + smpi_host_data_t hdata = (smpi_host_data_t)SIMIX_host_get_data(host); + return hdata->mutex; +} + +smx_cond_t smpi_host_cond() +{ + smx_host_t host = SIMIX_host_self(); + smpi_host_data_t hdata = (smpi_host_data_t)SIMIX_host_get_data(host); + return hdata->cond; +} + int smpi_run_simulation(int *argc, char **argv) { smx_cond_t cond = NULL;