X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/eb5b6b0c3c4d9a38bb205b2c8bc9aeeba8674a25..f82324570da0d9e5ada9db953e969b760e9b7016:/src/smpi/smpi_global.c diff --git a/src/smpi/smpi_global.c b/src/smpi/smpi_global.c index 02d4a9f729..dda28d93eb 100644 --- a/src/smpi/smpi_global.c +++ b/src/smpi/smpi_global.c @@ -79,9 +79,6 @@ void smpi_process_init(int *argc, char ***argv) int rank = atoi((*argv)[2]); index = SIMIX_process_get_PID(proc) -1; -#ifdef SMPI_F2C - smpi_current_rank = index; -#endif if(!index_to_process_data){ index_to_process_data=(int*)xbt_malloc(SIMIX_process_count()*sizeof(int)); } @@ -133,10 +130,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); - } /** @@ -172,33 +173,6 @@ void smpi_process_mark_as_initialized(void) } -#ifdef SMPI_F2C -int smpi_process_argc(void) -{ - smpi_process_data_t data = smpi_process_data(); - return data->argc ? *(data->argc) - 1 : 0; -} - -int smpi_process_getarg(integer * index, char *dst, ftnlen len) -{ - smpi_process_data_t data = smpi_process_data(); - char *arg; - ftnlen i; - - if (!data->argc || !data->argv || *index < 1 || *index >= *(data->argc)) { - return -1; - } - arg = (*data->argv)[*index]; - for (i = 0; i < len && arg[i] != '\0'; i++) { - dst[i] = arg[i]; - } - for (; i < len; i++) { - dst[i] = ' '; - } - return 0; -} -#endif - int smpi_global_size(void) { char *value = getenv("SMPI_GLOBAL_SIZE"); @@ -245,6 +219,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(); @@ -380,10 +359,14 @@ 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."); } } +int smpi_enabled(void) { + return process_data != NULL; +} + void smpi_global_init(void) { int i; @@ -464,12 +447,6 @@ void smpi_global_destroy(void) smpi_free_static(); } -/* Fortran specific stuff */ -/* With smpicc, the following weak symbols are used */ -/* With smpiff, the following weak symbols are replaced by those in libf2c */ -int __attribute__ ((weak)) xargc; -char ** __attribute__ ((weak)) xargv; - #ifndef WIN32 void __attribute__ ((weak)) user_main_() { @@ -489,10 +466,6 @@ int __attribute__ ((weak)) main(int argc, char **argv) return smpi_main(smpi_simulated_main_, argc, argv); } -int __attribute__ ((weak)) MAIN__() -{ - return smpi_main(smpi_simulated_main_, xargc, xargv); -}; #endif static void smpi_init_logs(){ @@ -517,6 +490,7 @@ static void smpi_init_logs(){ XBT_LOG_CONNECT(smpi_mpi_dt); XBT_LOG_CONNECT(smpi_pmpi); XBT_LOG_CONNECT(smpi_replay); + XBT_LOG_CONNECT(smpi_rma); }