void smpi_process_destroy(void)
{
int index = smpi_process_index();
-
+ process_data[index]->index=-100;
XBT_DEBUG("<%d> Process left the game", index);
}
}
}
+/**
+ * @brief Check if a process is finalized
+ */
+int smpi_process_finalized()
+{
+ // If finalized, this value has been set to -100;
+ return process_data[smpi_process_index()]->index==-100;
+}
+
+
#ifdef SMPI_F2C
int smpi_process_argc(void) {
smpi_process_data_t data = smpi_process_data();
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_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;
+
+ int barrier_id = find_coll_description(mpi_coll_barrier_description,
+ sg_cfg_get_string("smpi/barrier"));
+ mpi_coll_barrier_fun = (int (*)(MPI_Comm comm))
+ mpi_coll_barrier_description[barrier_id].coll;
+
smpi_global_init();
/* Clean IO before the run */
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();