X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/ccedb07575381e28a3143247e9028fe4f73bcd96..6d4434a0ebdb34758d95faec8b47088a3f760df2:/src/smpi/smpi_global.c diff --git a/src/smpi/smpi_global.c b/src/smpi/smpi_global.c index 95d44578c6..24e869c468 100644 --- a/src/smpi/smpi_global.c +++ b/src/smpi/smpi_global.c @@ -35,6 +35,10 @@ static int process_count = 0; MPI_Comm MPI_COMM_WORLD = MPI_COMM_NULL; +MPI_Errhandler* MPI_ERRORS_RETURN = NULL; +MPI_Errhandler* MPI_ERRORS_ARE_FATAL = NULL; +MPI_Errhandler* MPI_ERRHANDLER_NULL = NULL; + #define MAILBOX_NAME_MAXLEN (5 + sizeof(int) * 2 + 1) static char* get_mailbox_name(char* str, int index) { @@ -89,13 +93,13 @@ void smpi_process_finalize(void) } } +#ifdef SMPI_F2C int smpi_process_argc(void) { smpi_process_data_t data = smpi_process_data(); return data->argc ? *(data->argc) - 1 : 0; } -#ifdef SMPI_F2C int smpi_process_getarg(integer* index, char* dst, ftnlen len) { smpi_process_data_t data = smpi_process_data(); char* arg; @@ -114,7 +118,6 @@ int smpi_process_getarg(integer* index, char* dst, ftnlen len) { } return 0; } -#endif int smpi_global_size(void) { char* value = getenv("SMPI_GLOBAL_SIZE"); @@ -125,6 +128,7 @@ int smpi_global_size(void) { } return atoi(value); } +#endif smpi_process_data_t smpi_process_data(void) { @@ -263,6 +267,7 @@ void smpi_global_destroy(void) int i; smpi_bench_destroy(); + smpi_group_destroy(smpi_comm_group(MPI_COMM_WORLD)); smpi_comm_destroy(MPI_COMM_WORLD); MPI_COMM_WORLD = MPI_COMM_NULL; for (i = 0; i < count; i++) { @@ -281,33 +286,16 @@ void smpi_global_destroy(void) /* 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; - -int __attribute__((weak)) main(int argc, char** argv) { - xargc = argc; - xargv = argv; - return MAIN__(); -} - -#ifdef WIN32 -#include - int __attribute__((weak)) smpi_simulated_main(int argc, char** argv) { xbt_die("Should not be in this smpi_simulated_main"); return 1; } -/* TODO FOR WIN32 */ -/* Dummy prototype to make gcc happy */ -int APIENTRY WinMain(HINSTANCE hInst,HINSTANCE hInst2,LPSTR lpstr01,int nCmdShow) -{ - return MAIN__(); +int __attribute__((weak)) main(int argc, char** argv) { + return MAIN__(smpi_simulated_main,argc,argv); } -#endif - -int MAIN__(void) +int MAIN__(int (*realmain) (int argc, char *argv[]),int argc, char *argv[]) { srand(SMPI_RAND_SEED); @@ -328,22 +316,23 @@ int MAIN__(void) XBT_LOG_CONNECT(smpi_mpi); XBT_LOG_CONNECT(smpi_mpi_dt); XBT_LOG_CONNECT(smpi_pmpi); + XBT_LOG_CONNECT(smpi_replay); #ifdef HAVE_TRACING - TRACE_global_init(&xargc, xargv); + TRACE_global_init(&argc, argv); #endif - SIMIX_global_init(&xargc, xargv); + SIMIX_global_init(&argc, argv); #ifdef HAVE_TRACING TRACE_start(); #endif // parse the platform file: get the host list - SIMIX_create_environment(xargv[1]); + SIMIX_create_environment(argv[1]); - SIMIX_function_register_default(smpi_simulated_main); - SIMIX_launch_application(xargv[2]); + SIMIX_function_register_default(realmain); + SIMIX_launch_application(argv[2]); smpi_global_init(); @@ -356,7 +345,7 @@ int MAIN__(void) else SIMIX_run(); - if (xbt_cfg_get_int(_surf_cfg_set, "smpi/display_timing")) + if (surf_cfg_get_int("smpi/display_timing")) XBT_INFO("Simulation time: %g seconds.", SIMIX_get_clock()); smpi_global_destroy();