Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[MBI] Reduce scope for variables.
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Tue, 29 Mar 2022 16:44:36 +0000 (18:44 +0200)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Tue, 29 Mar 2022 21:13:09 +0000 (23:13 +0200)
teshsuite/smpi/MBI/CollArgGenerator.py
teshsuite/smpi/MBI/CollP2PMessageRaceGenerator.py
teshsuite/smpi/MBI/ResleakGenerator.py
teshsuite/smpi/MBI/generator_utils.py

index 7641aae..238394a 100755 (executable)
@@ -41,7 +41,8 @@ int main(int argc, char **argv) {
   int nprocs = -1;
   int rank = -1;
   int root = 0;
-  int size = 1, j=0, color=0;
+  int size = 1;
+  int j = 0;
 
   MPI_Init(&argc, &argv);
   MPI_Comm_size(MPI_COMM_WORLD, &nprocs);
index 8709da5..aa9e78e 100755 (executable)
@@ -40,7 +40,6 @@ int main(int argc, char **argv) {
   int nprocs = -1;
   int rank = -1;
   int dest, src;
-  int i=0;
   int root = 0;
   int stag = 0, rtag = 0;
   int buff_size = 1;
index d1d84ea..1273773 100755 (executable)
@@ -50,8 +50,8 @@ static void myOp(int *invec, int *inoutvec, int *len, MPI_Datatype *dtype) {
 int main(int argc, char **argv) {
   int nprocs = -1;
   int rank = -1;
-  int i=1, j=0, size=1;
-  int color =0;
+  int size = 1;
+  int j = 0;
 
   MPI_Init(&argc, &argv);
   MPI_Comm_size(MPI_COMM_WORLD, &nprocs);
@@ -118,7 +118,7 @@ for call in gen.tcoll:
     replace['outcome'] = f'ERROR: {gen.error[call]}'
     replace['errormsg'] = 'Resleak. @{call}@ at @{filename}@:@{line:MBIERROR}@ lacks several free.'
     replace['change_size'] = 'size=PARAM_PER_ITERATION;'
-    replace['loop'] = 'for (i = 0; i < ITERATIONS; i++) {\n    for (j = 0; j < PARAM_PER_ITERATION; j++) {'
+    replace['loop'] = 'for (int i = 0; i < ITERATIONS; i++) {\n    for (j = 0; j < PARAM_PER_ITERATION; j++) {'
     replace['cond'] = '      if (j < PARAM_PER_ITERATION - PARAM_LOST_PER_ITERATION) {'
     replace['fini'] = gen.fini[call]("1") + ' /* MBIERROR */'
     replace['end'] = '      }\n     }\n   }'
index 554c7bd..75e8673 100644 (file)
@@ -255,7 +255,7 @@ write['MPI_Ialltoallv'] = lambda n: f"rbuf{n}[0]++;"
 
 ### COLL:tools
 
-init['MPI_Comm_split'] = lambda n: f'MPI_Comm com[size]; color = rank % 2; int key = 1;'
+init['MPI_Comm_split'] = lambda n: f'MPI_Comm com[size]; int color = rank % 2; int key = 1;'
 start['MPI_Comm_split'] = lambda n: ""
 operation['MPI_Comm_split'] = lambda n: 'MPI_Comm_split(MPI_COMM_WORLD,color,key, &com[j]);'
 error['MPI_Comm_split'] = 'CommunicatorLeak'