X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/dccf1b41e9c7b5a696f01abceaa2779fe65f154f..1f32679abc2f9c0cae9e27951b643a0f70d71b3a:/src/smpi/smpi_pmpi.cpp diff --git a/src/smpi/smpi_pmpi.cpp b/src/smpi/smpi_pmpi.cpp index dc589718ec..62ca0f186c 100644 --- a/src/smpi/smpi_pmpi.cpp +++ b/src/smpi/smpi_pmpi.cpp @@ -184,6 +184,21 @@ int PMPI_Type_size(MPI_Datatype datatype, int *size) return retval; } +int PMPI_Type_size_x(MPI_Datatype datatype, MPI_Count *size) +{ + int retval = 0; + + if (datatype == MPI_DATATYPE_NULL) { + retval = MPI_ERR_TYPE; + } else if (size == nullptr) { + retval = MPI_ERR_ARG; + } else { + *size = static_cast(smpi_datatype_size(datatype)); + retval = MPI_SUCCESS; + } + return retval; +} + int PMPI_Type_get_extent(MPI_Datatype datatype, MPI_Aint * lb, MPI_Aint * extent) { int retval = 0; @@ -499,7 +514,7 @@ int PMPI_Group_excl(MPI_Group group, int n, int *ranks, MPI_Group * newgroup) } else { if (n == 0) { *newgroup = group; - if(group!= smpi_comm_group(MPI_COMM_WORLD) && group != MPI_GROUP_NULL + if (group != smpi_comm_group(MPI_COMM_WORLD) && group != smpi_comm_group(MPI_COMM_SELF) && group != MPI_GROUP_EMPTY) smpi_group_use(group); } else if (n == smpi_group_size(group)) { @@ -602,7 +617,7 @@ int PMPI_Group_range_excl(MPI_Group group, int n, int ranges[][3], MPI_Group * n } else { if (n == 0) { *newgroup = group; - if(group!= smpi_comm_group(MPI_COMM_WORLD) && group != MPI_GROUP_NULL + if (group!= smpi_comm_group(MPI_COMM_WORLD) && group != smpi_comm_group(MPI_COMM_SELF) && group != MPI_GROUP_EMPTY) smpi_group_use(group); } else { @@ -1346,7 +1361,7 @@ int PMPI_Test(MPI_Request * request, int *flag, MPI_Status * status) smpi_empty_status(status); retval = MPI_SUCCESS; } else { - int rank = (request!=nullptr && (*request)->comm != MPI_COMM_NULL) ? smpi_process_index() : -1; + int rank = ((*request)->comm != MPI_COMM_NULL) ? smpi_process_index() : -1; instr_extra_data extra = xbt_new0(s_instr_extra_data_t,1); extra->type = TRACING_TEST; @@ -1654,15 +1669,15 @@ int PMPI_Barrier(MPI_Comm comm) if (comm == MPI_COMM_NULL) { retval = MPI_ERR_COMM; } else { - int rank = comm != MPI_COMM_NULL ? smpi_process_index() : -1; - instr_extra_data extra = xbt_new0(s_instr_extra_data_t,1); - extra->type = TRACING_BARRIER; - TRACE_smpi_collective_in(rank, -1, __FUNCTION__, extra); + int rank = comm != MPI_COMM_NULL ? smpi_process_index() : -1; + instr_extra_data extra = xbt_new0(s_instr_extra_data_t, 1); + extra->type = TRACING_BARRIER; + TRACE_smpi_collective_in(rank, -1, __FUNCTION__, extra); - mpi_coll_barrier_fun(comm); - retval = MPI_SUCCESS; + mpi_coll_barrier_fun(comm); + retval = MPI_SUCCESS; - TRACE_smpi_collective_out(rank, -1, __FUNCTION__); + TRACE_smpi_collective_out(rank, -1, __FUNCTION__); } smpi_bench_begin();