Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
only test for these on non-root processes
[simgrid.git] / src / smpi / bindings / smpi_pmpi_comm.cpp
index f658bfe..85d57ca 100644 (file)
@@ -1,18 +1,17 @@
-/* Copyright (c) 2007-2017. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2007-2018. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 #include <climits>
 
-#include "private.h"
+#include "private.hpp"
 #include "smpi_comm.hpp"
 #include "smpi_process.hpp"
 
 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(smpi_pmpi);
 
 /* PMPI User level calls */
-extern "C" { // Obviously, the C MPI interface should use the C linkage
 
 int PMPI_Comm_rank(MPI_Comm comm, int *rank)
 {
@@ -102,7 +101,7 @@ int PMPI_Comm_create(MPI_Comm comm, MPI_Group group, MPI_Comm * newcomm)
     return MPI_ERR_GROUP;
   } else if (newcomm == nullptr) {
     return MPI_ERR_ARG;
-  } else if(group->rank(smpi_process()->index())==MPI_UNDEFINED){
+  } else if (group->rank(simgrid::s4u::this_actor::getPid()) == MPI_UNDEFINED) {
     *newcomm= MPI_COMM_NULL;
     return MPI_SUCCESS;
   }else{
@@ -265,5 +264,3 @@ int PMPI_Attr_put(MPI_Comm comm, int keyval, void* attr_value) {
   else
   return comm->attr_put<simgrid::smpi::Comm>(keyval, attr_value);
 }
-
-}