#include "colls/colls.h"
#include "simgrid/sg_config.h"
+XBT_LOG_NEW_DEFAULT_SUBCATEGORY(smpi_coll, smpi,
+ "Logging specific to SMPI (coll)");
+
s_mpi_coll_description_t mpi_coll_gather_description[] = {
{"default",
"gather default collective",
}
int find_coll_description(s_mpi_coll_description_t * table,
- char *name)
+ char *name, const char *desc)
{
int i;
char *name_list = NULL;
}
for (i = 0; table[i].name; i++)
if (!strcmp(name, table[i].name)) {
+ if (strcmp(table[i].name,"default"))
+ XBT_INFO("Switch to algorithm %s for collective %s",table[i].name,desc);
return i;
}
}
}
if (!table[0].name)
- xbt_die("No collective is valid! This is a bug.");
+ xbt_die("No collective is valid for '%s'! This is a bug.",name);
name_list = xbt_strdup(table[0].name);
for (i = 1; table[i].name; i++) {
name_list =
return -1;
}
-XBT_LOG_NEW_DEFAULT_SUBCATEGORY(smpi_coll, smpi,
- "Logging specific to SMPI (coll)");
-
int (*mpi_coll_gather_fun)(void *, int, MPI_Datatype, void*, int, MPI_Datatype, int root, MPI_Comm);
int (*mpi_coll_allgather_fun)(void *, int, MPI_Datatype, void*, int, MPI_Datatype, MPI_Comm);
int (*mpi_coll_allgatherv_fun)(void *, int, MPI_Datatype, void*, int*, int*, MPI_Datatype, MPI_Comm);
static void smpi_init_options(){
int gather_id = find_coll_description(mpi_coll_gather_description,
- sg_cfg_get_string("smpi/gather"));
+ sg_cfg_get_string("smpi/gather"),"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"));
+ sg_cfg_get_string("smpi/allgather"),"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"));
+ sg_cfg_get_string("smpi/allgatherv"),"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"));
+ sg_cfg_get_string("smpi/allreduce"),"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"));
+ sg_cfg_get_string("smpi/alltoall"),"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"));
+ sg_cfg_get_string("smpi/alltoallv"),"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"));
+ sg_cfg_get_string("smpi/bcast"),"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"));
+ sg_cfg_get_string("smpi/reduce"),"reduce");
mpi_coll_reduce_fun = (int (*)(void *buf, void *rbuf, int count,
MPI_Datatype datatype, MPI_Op op,
int root, MPI_Comm comm))
int reduce_scatter_id =
find_coll_description(mpi_coll_reduce_scatter_description,
- sg_cfg_get_string("smpi/reduce_scatter"));
+ sg_cfg_get_string("smpi/reduce_scatter"),"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"));
+ sg_cfg_get_string("smpi/scatter"),"scatter");
mpi_coll_scatter_fun = (int (*)(void *sendbuf, int sendcount,
MPI_Datatype sendtype, void *recvbuf,
int recvcount, MPI_Datatype recvtype,
mpi_coll_scatter_description[scatter_id].coll;
int barrier_id = find_coll_description(mpi_coll_barrier_description,
- sg_cfg_get_string("smpi/barrier"));
+ sg_cfg_get_string("smpi/barrier"),"barrier");
mpi_coll_barrier_fun = (int (*)(MPI_Comm comm))
mpi_coll_barrier_description[barrier_id].coll;