X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/2b4010b2a5fda082278a02a35a9e9eb18b58e110..38ea8eebef9013b0666d21d82493a559b5a27ac6:/src/smpi/smpi_global.c diff --git a/src/smpi/smpi_global.c b/src/smpi/smpi_global.c index 8e48139f26..4aa048971a 100644 --- a/src/smpi/smpi_global.c +++ b/src/smpi/smpi_global.c @@ -28,13 +28,13 @@ typedef struct s_smpi_process_data { smx_rdv_t mailbox_small; xbt_os_timer_t timer; MPI_Comm comm_self; + MPI_Comm comm_intra; MPI_Comm* comm_world; void *data; /* user data */ int index; char state; int sampling; /* inside an SMPI_SAMPLE_ block? */ char* instance_id; - int nb_wins; xbt_bar_t finalization_barrier; } s_smpi_process_data_t; @@ -103,9 +103,9 @@ void smpi_process_init(int *argc, char ***argv) (*argc)-=2; data->argc = argc; data->argv = argv; - data->nb_wins=0; // set the process attached to the mailbox simcall_rdv_set_receiver(data->mailbox_small, proc); + XBT_DEBUG("<%d> New process in the game: %p", index, proc); if(smpi_privatize_global_variables){ @@ -132,10 +132,14 @@ void smpi_process_destroy(void) */ void smpi_process_finalize(void) { + // This leads to an explosion of the search graph + // which cannot be reduced: + if(MC_is_active()) + return; + int index = smpi_process_index(); // wait for all pending asynchronous comms to finish xbt_barrier_wait(process_data[index_to_process_data[index]]->finalization_barrier); - } /** @@ -205,20 +209,6 @@ void *smpi_process_get_user_data() return process_data->data; } - -int smpi_process_get_win_id() -{ - smpi_process_data_t process_data = smpi_process_data(); - return process_data->nb_wins; -} - -void smpi_process_set_win_id(int id) -{ - smpi_process_data_t process_data = smpi_process_data(); - process_data->nb_wins = id; -} - - int smpi_process_count(void) { return process_count; @@ -231,6 +221,11 @@ int smpi_process_index(void) return data ? data->index : MPI_UNDEFINED; } +int smpi_process_index_of_smx_process(smx_process_t process) { + smpi_process_data_t data = SIMIX_process_get_data(process); + return data ? data->index : MPI_UNDEFINED; +} + MPI_Comm smpi_process_comm_world(void) { smpi_process_data_t data = smpi_process_data(); @@ -293,6 +288,18 @@ MPI_Comm smpi_process_comm_self(void) return data->comm_self; } +MPI_Comm smpi_process_get_comm_intra(void) +{ + smpi_process_data_t data = smpi_process_data(); + return data->comm_intra; +} + +void smpi_process_set_comm_intra(MPI_Comm comm) +{ + smpi_process_data_t data = smpi_process_data(); + data->comm_intra = comm; +} + void smpi_process_set_sampling(int s) { smpi_process_data_t data = smpi_process_data(); @@ -305,6 +312,7 @@ int smpi_process_get_sampling(void) return data->sampling; } + void print_request(const char *message, MPI_Request request) { XBT_DEBUG @@ -366,7 +374,7 @@ static void smpi_check_options(){ 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/running_power:\" to set its value." - "Check http://simgrid.org/simgrid/latest/doc/options.html#options_smpi_bench for more information. "); + "Check http://simgrid.org/simgrid/latest/doc/options.html#options_smpi_bench for more information."); } } @@ -399,6 +407,7 @@ void smpi_global_init(void) if (MC_is_active()) MC_ignore_heap(process_data[i]->timer, xbt_os_timer_size()); process_data[i]->comm_self = MPI_COMM_NULL; + process_data[i]->comm_intra = MPI_COMM_NULL; process_data[i]->comm_world = NULL; process_data[i]->state = SMPI_UNINITIALIZED; process_data[i]->sampling = 0; @@ -440,6 +449,10 @@ void smpi_global_destroy(void) smpi_group_unuse(smpi_comm_group(process_data[i]->comm_self)); smpi_comm_destroy(process_data[i]->comm_self); } + if(process_data[i]->comm_intra!=MPI_COMM_NULL){ + smpi_group_unuse(smpi_comm_group(process_data[i]->comm_intra)); + smpi_comm_destroy(process_data[i]->comm_intra); + } xbt_os_timer_free(process_data[i]->timer); simcall_rdv_destroy(process_data[i]->mailbox); simcall_rdv_destroy(process_data[i]->mailbox_small);