Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' into mq
[simgrid.git] / teshsuite / smpi / MBI / InputHazardGenerator.py
index ccff63c..d9f8a51 100755 (executable)
@@ -26,11 +26,11 @@ END_MPI_FEATURES
 
 BEGIN_MBI_TESTS
   $ mpirun -np 2 ${EXE} 1
-  | @{outcome}@
-  | @{errormsg}@
+  | @{outcome1}@
+  | @{errormsg1}@
   $ mpirun -np 2 ${EXE} 2
-  | @{outcome}@
-  | @{errormsg}@
+  | @{outcome2}@
+  | @{errormsg2}@
 END_MBI_TESTS
 //////////////////////       End of MBI headers        /////////////////// */
 
@@ -44,10 +44,10 @@ int main(int argc, char **argv) {
   int nprocs = -1;
   int rank = -1;
   MPI_Status sta;
-  int src,dest;
   int i=0;
   int root = 0;
-  int stag=0, rtag=0;
+  int stag=0;
+  int rtag=0;
   int buff_size = N;
 
   MPI_Init(&argc, &argv);
@@ -73,7 +73,6 @@ int main(int argc, char **argv) {
   @{init2}@
 
   if (rank == 0) {
-    dest=1, src=1;
     if ((n % 2) == 0) { @{errorcond}@
       @{operation1b}@
       @{fini1b}@
@@ -82,7 +81,6 @@ int main(int argc, char **argv) {
       @{fini1a}@
     }
   } else @{addcond}@ {
-    dest=0, src=0;
     @{operation2}@
     @{fini2}@
   }
@@ -111,14 +109,14 @@ for s in gen.send + gen.isend:
         patterns['r'] = r
 
         patterns['init1'] = gen.init[s]("1")
-        patterns['operation1a'] = gen.operation[s]("1").replace("buf1", "buffer")
-        patterns['operation1b'] = gen.operation[s]("1").replace("buf1", "buffer")
+        patterns['operation1a'] = gen.operation[s]("1").replace("buf1", "buffer").replace("dest", "1")
+        patterns['operation1b'] = gen.operation[s]("1").replace("buf1", "buffer").replace("dest", "1")
         patterns['fini1a'] = gen.fini[s]("1")
         patterns['fini1b'] = gen.fini[s]("1")
         patterns['free1'] = gen.free[s]("1")
 
         patterns['init2'] = gen.init[r]("2")
-        patterns['operation2'] = gen.operation[r]("2").replace("buf2", "buffer")
+        patterns['operation2'] = gen.operation[r]("2").replace("buf2", "buffer").replace("src", "0")
         patterns['fini2'] = gen.fini[r]("2")
         patterns['free2'] = gen.free[r]("2")
 
@@ -129,16 +127,20 @@ for s in gen.send + gen.isend:
         replace = patterns.copy()
         replace['shortdesc'] = 'Correct call ordering.'
         replace['longdesc'] = 'Correct call ordering.'
-        replace['outcome'] = 'OK'
-        replace['errormsg'] = 'OK'
+        replace['outcome1'] = 'OK'
+        replace['errormsg1'] = 'OK'
+        replace['outcome2'] = 'OK'
+        replace['errormsg2'] = 'OK'
         gen.make_file(template, f'InputHazardCallOrdering_{r}_{s}_ok.c', replace)
 
         # Generate the incorrect matching
         replace = patterns.copy()
         replace['shortdesc'] = 'Missing Send function.'
         replace['longdesc'] = 'Missing Send function call for a path depending to input, a deadlock is created.'
-        replace['outcome'] = 'ERROR: IHCallMatching'
-        replace['errormsg'] = 'P2P mistmatch. Missing @{r}@ at @{filename}@:@{line:MBIERROR}@.'
+        replace['outcome1'] = 'OK'
+        replace['errormsg1'] = 'OK'
+        replace['outcome2'] = 'ERROR: IHCallMatching'
+        replace['errormsg2'] = 'P2P mistmatch. Missing @{r}@ at @{filename}@:@{line:MBIERROR}@.'
         replace['errorcond'] = '/* MBIERROR */'
         replace['operation1b'] = ''
         replace['fini1b'] = ''
@@ -174,16 +176,20 @@ for c in gen.coll:
     replace = patterns.copy()
     replace['shortdesc'] = 'Correct call ordering.'
     replace['longdesc'] = 'Correct call ordering.'
-    replace['outcome'] = 'OK'
-    replace['errormsg'] = 'OK'
+    replace['outcome1'] = 'OK'
+    replace['errormsg1'] = 'OK'
+    replace['outcome2'] = 'OK'
+    replace['errormsg2'] = 'OK'
     gen.make_file(template, f'InputHazardCallOrdering_{c}_ok.c', replace)
 
     # Generate the incorrect matching
     replace = patterns.copy()
     replace['shortdesc'] = 'Missing collective function call.'
     replace['longdesc'] = 'Missing collective function call for a path depending to input, a deadlock is created.'
-    replace['outcome'] = 'ERROR: IHCallMatching'
-    replace['errormsg'] = 'P2P mistmatch. Missing @{c}@ at @{filename}@:@{line:MBIERROR}@.'
+    replace['outcome1'] = 'OK'
+    replace['errormsg1'] = 'OK'
+    replace['outcome2'] = 'ERROR: IHCallMatching'
+    replace['errormsg2'] = 'P2P mistmatch. Missing @{c}@ at @{filename}@:@{line:MBIERROR}@.'
     replace['errorcond'] = '/* MBIERROR */'
     replace['operation1b'] = ''
     replace['fini1b'] = ''