Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Add an unused (for the moment) module file
[simgrid.git] / src / smpi / smpi_pmpi.c
index 581cd1d..d229642 100644 (file)
@@ -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,
@@ -17,19 +16,7 @@ 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 (!TRACE_is_enabled()){
-    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();
 }
@@ -635,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;