Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
remove warning with mc
[simgrid.git] / teshsuite / smpi / mpich3-test / coll / coll6.c
index 6e8ea36..e0973f9 100644 (file)
@@ -30,6 +30,7 @@ int main( int argc, char **argv )
        fprintf( stderr, "Number of processors must divide %d\n",
                MAX_PROCESSES );
        MPI_Abort( MPI_COMM_WORLD, 1 );
+        exit(1);
        }
     MPI_Comm_split(MPI_COMM_WORLD, rank<participants, rank, &test_comm);
 
@@ -53,9 +54,14 @@ int main( int argc, char **argv )
          table[i][j] = rank + 10;
       
       /* Everybody gets the gathered data */
-      MPI_Allgatherv(&table[begin_row][0], send_count, MPI_INT, 
-                    &table[0][0], recv_counts, displs, 
-                     MPI_INT, test_comm);
+      if ((char *) &table[begin_row][0] != (char *) table + displs[rank]*sizeof(int))
+          MPI_Allgatherv(&table[begin_row][0], send_count, MPI_INT,
+                         &table[0][0], recv_counts, displs,
+                         MPI_INT, test_comm);
+      else
+          MPI_Allgatherv(MPI_IN_PLACE, send_count, MPI_INT,
+                         &table[0][0], recv_counts, displs,
+                         MPI_INT, test_comm);
 
       /* Everybody should have the same table now.