X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/07c319ec54d6fc778ee3cc5e75a747242006723e..e8f8350f07c1b13dd8628f56d5a5050da18264d3:/src/smpi/smpi_pmpi.c diff --git a/src/smpi/smpi_pmpi.c b/src/smpi/smpi_pmpi.c index 23e4796985..0422b98b76 100644 --- a/src/smpi/smpi_pmpi.c +++ b/src/smpi/smpi_pmpi.c @@ -5,7 +5,6 @@ * under the terms of the license (GNU LGPL) which comes with this package. */ #include "private.h" -#include "smpi_coll_private.h" #include "smpi_mpi_dt_private.h" XBT_LOG_NEW_DEFAULT_SUBCATEGORY(smpi_pmpi, smpi, @@ -13,26 +12,13 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(smpi_pmpi, smpi, #ifdef HAVE_TRACING //this function need to be here because of the calls to smpi_bench -int TRACE_smpi_set_category(const char *category) +void TRACE_smpi_set_category(const char *category) { //need to end bench otherwise categories for execution tasks are wrong smpi_bench_end(); - int ret; - if (!IS_TRACING){ - ret = 1; - }else{ - if (category != NULL) { - ret = TRACE_category(category); - TRACE_category_set(SIMIX_process_self(), category); - }else{ - //if category is NULL, trace of platform is disabled for this process - TRACE_category_unset(SIMIX_process_self()); - ret = 0; - } - } + TRACE_internal_smpi_set_category (category); //begin bench after changing process's category smpi_bench_begin(); - return ret; } #endif @@ -636,6 +622,8 @@ int PMPI_Comm_rank(MPI_Comm comm, int *rank) smpi_bench_end(); if (comm == MPI_COMM_NULL) { retval = MPI_ERR_COMM; + } else if (rank == NULL) { + retval = MPI_ERR_ARG; } else { *rank = smpi_comm_rank(comm); retval = MPI_SUCCESS; @@ -661,6 +649,23 @@ int PMPI_Comm_size(MPI_Comm comm, int *size) return retval; } +int PMPI_Comm_get_name (MPI_Comm comm, char* name, int* len) +{ + int retval; + + smpi_bench_end(); + if (comm == MPI_COMM_NULL) { + retval = MPI_ERR_COMM; + } else if (name == NULL || len == NULL) { + retval = MPI_ERR_ARG; + } else { + smpi_comm_get_name(comm, name, len); + retval = MPI_SUCCESS; + } + smpi_bench_begin(); + return retval; +} + int PMPI_Comm_group(MPI_Comm comm, MPI_Group * group) { int retval;