Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Check if the pointer is writable.
[simgrid.git] / src / smpi / smpi_pmpi.c
index b8d53b5..d229642 100644 (file)
@@ -622,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;