Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Return early on error.
authorArnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
Mon, 15 Apr 2013 13:11:15 +0000 (15:11 +0200)
committerArnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
Mon, 15 Apr 2013 16:16:18 +0000 (18:16 +0200)
Avoid to use X and Y when they may be uninitialized.

src/smpi/colls/allgather-2dmesh.c

index b5f5042..4e3a9c7 100644 (file)
@@ -119,7 +119,9 @@ smpi_coll_tuned_allgather_2dmesh(void *send_buff, int send_count, MPI_Datatype
 
   block_size = extent * send_count;
 
-  is_2dmesh(num_procs, &X, &Y);
+  if (!is_2dmesh(num_procs, &X, &Y))
+    return MPI_ERR_COMM;
+
   my_row_base = (rank / Y) * Y;
   my_col_base = rank % Y;