Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
modify reduce test to provide better coverage
authorAugustin Degomme <degomme@idpann.imag.fr>
Tue, 25 Jun 2013 13:04:34 +0000 (15:04 +0200)
committerAugustin Degomme <degomme@idpann.imag.fr>
Tue, 25 Jun 2013 14:29:22 +0000 (16:29 +0200)
teshsuite/smpi/reduce_coll.c
teshsuite/smpi/reduce_coll.tesh

index df40dc2..65ecebd 100644 (file)
@@ -34,16 +34,16 @@ int main(int argc, char *argv[])
     sb[i] = rank*size + i;
     rb[i] = 0;
   }
     sb[i] = rank*size + i;
     rb[i] = 0;
   }
-
   printf("[%d] sndbuf=[", rank);
   for (i = 0; i < size; i++)
     printf("%d ", sb[i]);
   printf("]\n");
   printf("[%d] sndbuf=[", rank);
   for (i = 0; i < size; i++)
     printf("%d ", sb[i]);
   printf("]\n");
-
-  status = MPI_Reduce(sb, rb, size, MPI_INT, MPI_SUM, 0, MPI_COMM_WORLD);
+  
+  int root=0;
+  status = MPI_Reduce(sb, rb, size, MPI_INT, MPI_SUM, root, MPI_COMM_WORLD);
   MPI_Barrier(MPI_COMM_WORLD);
 
   MPI_Barrier(MPI_COMM_WORLD);
 
-  if (rank == 0) {
+  if (rank == root) {
     printf("[%d] rcvbuf=[", rank);
     for (i = 0; i < size; i++)
       printf("%d ", rb[i]);
     printf("[%d] rcvbuf=[", rank);
     for (i = 0; i < size; i++)
       printf("%d ", rb[i]);
@@ -53,6 +53,27 @@ int main(int argc, char *argv[])
       fflush(stdout);
     }
   }
       fflush(stdout);
     }
   }
+  
+  
+  printf("[%d] second sndbuf=[", rank);
+  for (i = 0; i < 1; i++)
+    printf("%d ", sb[i]);
+  printf("]\n");
+  
+  root=size-1;
+  status = MPI_Reduce(sb, rb, 1, MPI_INT, MPI_PROD, root, MPI_COMM_WORLD);
+  MPI_Barrier(MPI_COMM_WORLD);
+
+  if (rank == root) {
+    printf("[%d] rcvbuf=[", rank);
+    for (i = 0; i < 1; i++)
+      printf("%d ", rb[i]);
+    printf("]\n");
+    if (status != MPI_SUCCESS) {
+      printf("all_to_all returned %d\n", status);
+      fflush(stdout);
+    }
+  }
   free(sb);
   free(rb);
   MPI_Finalize();
   free(sb);
   free(rb);
   MPI_Finalize();
index ae94a6c..ddc2ad5 100644 (file)
@@ -5,37 +5,55 @@
 p Test allreduce
 $ ../../bin/smpirun -map -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../../examples/msg/small_platform.xml -np 16 --log=xbt_cfg.thres:critical ./reduce_coll
 > You requested to use 16 processes, but there is only 5 processes in your hostfile...
 p Test allreduce
 $ ../../bin/smpirun -map -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../../examples/msg/small_platform.xml -np 16 --log=xbt_cfg.thres:critical ./reduce_coll
 > You requested to use 16 processes, but there is only 5 processes in your hostfile...
-> [rank 0] -> Tremblay
-> [rank 1] -> Jupiter
-> [rank 2] -> Fafard
-> [rank 3] -> Ginette
-> [rank 4] -> Bourassa
-> [rank 5] -> Tremblay
-> [rank 6] -> Jupiter
-> [rank 7] -> Fafard
-> [rank 8] -> Ginette
-> [rank 9] -> Bourassa
-> [rank 10] -> Tremblay
-> [rank 11] -> Jupiter
-> [rank 12] -> Fafard
-> [rank 13] -> Ginette
-> [rank 14] -> Bourassa
-> [rank 15] -> Tremblay
 > [0.000000] [surf_config/INFO] Switching workstation model to compound since you changed the network and/or cpu model(s)
 > [0.000000] [surf_config/INFO] Switching workstation model to compound since you changed the network and/or cpu model(s)
+> [0] rcvbuf=[1920 1936 1952 1968 1984 2000 2016 2032 2048 2064 2080 2096 2112 2128 2144 2160 ]
+> [0] second sndbuf=[0 ]
 > [0] sndbuf=[0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 ]
 > [0] sndbuf=[0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 ]
+> [10] second sndbuf=[160 ]
+> [10] sndbuf=[160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 ]
+> [11] second sndbuf=[176 ]
+> [11] sndbuf=[176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 ]
+> [12] second sndbuf=[192 ]
+> [12] sndbuf=[192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 ]
+> [13] second sndbuf=[208 ]
+> [13] sndbuf=[208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 ]
+> [14] second sndbuf=[224 ]
+> [14] sndbuf=[224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 ]
+> [15] rcvbuf=[0 ]
+> [15] second sndbuf=[240 ]
+> [15] sndbuf=[240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 ]
+> [1] second sndbuf=[16 ]
 > [1] sndbuf=[16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 ]
 > [1] sndbuf=[16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 ]
+> [2] second sndbuf=[32 ]
 > [2] sndbuf=[32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 ]
 > [2] sndbuf=[32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 ]
+> [3] second sndbuf=[48 ]
 > [3] sndbuf=[48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 ]
 > [3] sndbuf=[48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 ]
+> [4] second sndbuf=[64 ]
 > [4] sndbuf=[64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 ]
 > [4] sndbuf=[64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 ]
+> [5] second sndbuf=[80 ]
 > [5] sndbuf=[80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 ]
 > [5] sndbuf=[80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 ]
+> [6] second sndbuf=[96 ]
 > [6] sndbuf=[96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 ]
 > [6] sndbuf=[96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 ]
+> [7] second sndbuf=[112 ]
 > [7] sndbuf=[112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 ]
 > [7] sndbuf=[112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 ]
+> [8] second sndbuf=[128 ]
 > [8] sndbuf=[128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 ]
 > [8] sndbuf=[128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 ]
+> [9] second sndbuf=[144 ]
 > [9] sndbuf=[144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 ]
 > [9] sndbuf=[144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 ]
-> [10] sndbuf=[160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 ]
-> [11] sndbuf=[176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 ]
-> [12] sndbuf=[192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 ]
-> [13] sndbuf=[208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 ]
-> [14] sndbuf=[224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 ]
-> [15] sndbuf=[240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 ]
-> [0] rcvbuf=[1920 1936 1952 1968 1984 2000 2016 2032 2048 2064 2080 2096 2112 2128 2144 2160 ]
+> [rank 0] -> Tremblay
+> [rank 10] -> Tremblay
+> [rank 11] -> Jupiter
+> [rank 12] -> Fafard
+> [rank 13] -> Ginette
+> [rank 14] -> Bourassa
+> [rank 15] -> Tremblay
+> [rank 1] -> Jupiter
+> [rank 2] -> Fafard
+> [rank 3] -> Ginette
+> [rank 4] -> Bourassa
+> [rank 5] -> Tremblay
+> [rank 6] -> Jupiter
+> [rank 7] -> Fafard
+> [rank 8] -> Ginette
+> [rank 9] -> Bourassa
+