Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
check we don't allow 0 here
[simgrid.git] / teshsuite / smpi / coll-alltoallv / coll-alltoallv.c
index fced26e3958370d0416cd453c7ea4a5aa2a47be6..107179fe0107d2e7ca8f7026e75bd7b01544d66a 100644 (file)
@@ -68,6 +68,10 @@ int main(int argc, char **argv)
 
   /* Create the buffer */
   MPI_Comm_size(comm, &size);
 
   /* Create the buffer */
   MPI_Comm_size(comm, &size);
+  if(size<=0){
+    printf("error : comm size <= 0, run with mpirun\n");
+    return -1;
+  }
   MPI_Comm_rank(comm, &rank);
   int* sbuf = (int *) xbt_malloc(size * size * sizeof(int));
   int* rbuf = (int *) xbt_malloc(size * size * sizeof(int));
   MPI_Comm_rank(comm, &rank);
   int* sbuf = (int *) xbt_malloc(size * size * sizeof(int));
   int* rbuf = (int *) xbt_malloc(size * size * sizeof(int));