X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/f58c9bcd23aa191e8071a41450d00dda0d182e34..da62b5cbd53ece70108a4f0eba4757e75f3dc00a:/src/smpi/smpi_global.c diff --git a/src/smpi/smpi_global.c b/src/smpi/smpi_global.c index ab6e4b21e6..d980dfc6b5 100644 --- a/src/smpi/smpi_global.c +++ b/src/smpi/smpi_global.c @@ -315,7 +315,7 @@ int __attribute__((weak)) MAIN__(){ int smpi_main(int (*realmain) (int argc, char *argv[]),int argc, char *argv[]) { srand(SMPI_RAND_SEED); - + if(getenv("SMPI_PRETEND_CC") != NULL) { /* Hack to ensure that smpicc can pretend to be a simple compiler. Particularly handy to pass it to the configuration tools */ return 0; @@ -360,6 +360,66 @@ int smpi_main(int (*realmain) (int argc, char *argv[]),int argc, char *argv[]) SIMIX_function_register_default(realmain); SIMIX_launch_application(argv[2]); + int gather_id = find_coll_description(mpi_coll_gather_description, + sg_cfg_get_string("smpi/gather")); + mpi_coll_gather_fun = (int (*)(void *, int, MPI_Datatype, + void*, int, MPI_Datatype, int, MPI_Comm)) + mpi_coll_gather_description[gather_id].coll; + + int allgather_id = find_coll_description(mpi_coll_allgather_description, + sg_cfg_get_string("smpi/allgather")); + mpi_coll_allgather_fun = (int (*)(void *, int, MPI_Datatype, + void*, int, MPI_Datatype, MPI_Comm)) + mpi_coll_allgather_description[allgather_id].coll; + + int allgatherv_id = find_coll_description(mpi_coll_allgatherv_description, + sg_cfg_get_string("smpi/allgatherv")); + mpi_coll_allgatherv_fun = (int (*)(void *, int, MPI_Datatype, + void*, int*, int*, MPI_Datatype, MPI_Comm)) + mpi_coll_allgatherv_description[allgatherv_id].coll; + + int allreduce_id = find_coll_description(mpi_coll_allreduce_description, + sg_cfg_get_string("smpi/allreduce")); + mpi_coll_allreduce_fun = (int (*)(void *sbuf, void *rbuf, int rcount, \ + MPI_Datatype dtype, MPI_Op op, MPI_Comm comm)) + mpi_coll_allreduce_description[allreduce_id].coll; + + int alltoall_id = find_coll_description(mpi_coll_alltoall_description, + sg_cfg_get_string("smpi/alltoall")); + mpi_coll_alltoall_fun = (int (*)(void *, int, MPI_Datatype, + void*, int, MPI_Datatype, MPI_Comm)) + mpi_coll_alltoall_description[alltoall_id].coll; + + int alltoallv_id = find_coll_description(mpi_coll_alltoallv_description, + sg_cfg_get_string("smpi/alltoallv")); + mpi_coll_alltoallv_fun = (int (*)(void *, int*, int*, MPI_Datatype, + void*, int*, int*, MPI_Datatype, MPI_Comm)) + mpi_coll_alltoallv_description[alltoallv_id].coll; + + int bcast_id = find_coll_description(mpi_coll_bcast_description, + sg_cfg_get_string("smpi/bcast")); + mpi_coll_bcast_fun = (int (*)(void *buf, int count, MPI_Datatype datatype, \ + int root, MPI_Comm com)) + mpi_coll_bcast_description[bcast_id].coll; + + int reduce_id = find_coll_description(mpi_coll_reduce_description, + sg_cfg_get_string("smpi/reduce")); + mpi_coll_reduce_fun = (int (*)(void *buf, void *rbuf, int count, MPI_Datatype datatype, \ + MPI_Op op, int root, MPI_Comm comm)) + mpi_coll_reduce_description[reduce_id].coll; + + int reduce_scatter_id = find_coll_description(mpi_coll_reduce_scatter_description, + sg_cfg_get_string("smpi/reduce_scatter")); + mpi_coll_reduce_scatter_fun = (int (*)(void *sbuf, void *rbuf, int *rcounts,\ + MPI_Datatype dtype,MPI_Op op,MPI_Comm comm)) + mpi_coll_reduce_scatter_description[reduce_scatter_id].coll; + + int scatter_id = find_coll_description(mpi_coll_scatter_description, + sg_cfg_get_string("smpi/scatter")); + mpi_coll_scatter_fun = (int (*)(void *sendbuf, int sendcount, MPI_Datatype sendtype,\ + void *recvbuf, int recvcount, MPI_Datatype recvtype,\ + int root, MPI_Comm comm)) + mpi_coll_scatter_description[scatter_id].coll; smpi_global_init(); /* Clean IO before the run */ @@ -371,7 +431,7 @@ int smpi_main(int (*realmain) (int argc, char *argv[]),int argc, char *argv[]) else SIMIX_run(); - if (sg_cfg_get_int("smpi/display_timing")) + if (sg_cfg_get_boolean("smpi/display_timing")) XBT_INFO("Simulation time: %g seconds.", SIMIX_get_clock()); smpi_global_destroy();