Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
convert between Fortran and C MPI_*_NULL handles
[simgrid.git] / src / smpi / bindings / smpi_pmpi_comm.cpp
index 7291ed2..73e4379 100644 (file)
@@ -217,10 +217,14 @@ int PMPI_Comm_create_group(MPI_Comm comm, MPI_Group group, int, MPI_Comm* comm_o
 }
 
 MPI_Comm PMPI_Comm_f2c(MPI_Fint comm){
+  if(comm==-1)
+    return MPI_COMM_NULL;
   return static_cast<MPI_Comm>(simgrid::smpi::Comm::f2c(comm));
 }
 
 MPI_Fint PMPI_Comm_c2f(MPI_Comm comm){
+  if(comm==MPI_COMM_NULL)
+    return -1;
   return comm->c2f();
 }