Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Only compile stateless MC when libevent is found
[simgrid.git] / teshsuite / smpi / MBI / RMARemoteRemoteConcurrencyGenerator.py
index 78116e8..9361187 100755 (executable)
@@ -25,7 +25,7 @@ BEGIN_MPI_FEATURES
 END_MPI_FEATURES
 
 BEGIN_MBI_TESTS
-  $ mpirun -np 2 ${EXE}
+  $ mpirun -np 3 ${EXE}
   | @{outcome}@
   | @{errormsg}@
 END_MBI_TESTS
@@ -57,12 +57,16 @@ int main(int argc, char **argv) {
   MPI_Win_create(&winbuf, 100 * sizeof(int), sizeof(int), MPI_INFO_NULL, MPI_COMM_WORLD, &win);
 
   @{init1}@
+  @{init2}@
 
   @{epoch}@
 
-  if (rank == 0 || rank == 2) {
+  if (rank == 0) {
     @{operation1}@ /* MBIERROR1 */
   }
+  else if (rank == 2) {
+    @{operation2}@ /* MBIERROR2 */
+  }
 
   @{finEpoch}@
 
@@ -76,21 +80,25 @@ int main(int argc, char **argv) {
 
 for e in gen.epoch:
     for p1 in gen.get + gen.put:
-        patterns = {}
-        patterns = {'e': e, 'p1': p1}
-        patterns['generatedby'] = f'DO NOT EDIT: this file was generated by {os.path.basename(sys.argv[0])}. DO NOT EDIT.'
-        patterns['rmafeature'] = 'Yes'
-        patterns['p1'] = p1
-        patterns['e'] = e
-        patterns['epoch'] = gen.epoch[e]("1")
-        patterns['finEpoch'] = gen.finEpoch[e]("1")
-        patterns['init1'] = gen.init[p1]("1")
-        patterns['operation1'] = gen.operation[p1]("1")
-
-        # Generate a data race (Get + Get/load/store/Put)
-        replace = patterns
-        replace['shortdesc'] = 'Global Concurrency error.'
-        replace['longdesc'] = 'Global Concurrency error. Both processes 0 and 2 access the window in process 1 with @{p1}@'
-        replace['outcome'] = 'ERROR: GlobalConcurrency'
-        replace['errormsg'] = 'Global Concurrency error. @{p1}@ at @{filename}@:@{line:MBIERROR1}@ conflicts in process 1'
-        gen.make_file(template, f'GlobalConcurrency_rr_{e}_{p1}_nok.c', replace)
+        for p2 in gen.put:
+            patterns = {}
+            patterns = {'e': e, 'p1': p1, 'p2': p2}
+            patterns['generatedby'] = f'DO NOT EDIT: this file was generated by {os.path.basename(sys.argv[0])}. DO NOT EDIT.'
+            patterns['rmafeature'] = 'Yes'
+            patterns['p1'] = p1
+            patterns['p2'] = p2
+            patterns['e'] = e
+            patterns['epoch'] = gen.epoch[e]("1")
+            patterns['finEpoch'] = gen.finEpoch[e]("1")
+            patterns['init1'] = gen.init[p1]("1")
+            patterns['operation1'] = gen.operation[p1]("1")
+            patterns['init2'] = gen.init[p2]("2")
+            patterns['operation2'] = gen.operation[p2]("2")
+
+            # Generate a data race
+            replace = patterns.copy()
+            replace['shortdesc'] = 'Global Concurrency error.'
+            replace['longdesc'] = 'Global Concurrency error. Both processes 0 and 2 access the window in process 1 with @{p1}@'
+            replace['outcome'] = 'ERROR: GlobalConcurrency'
+            replace['errormsg'] = 'Global Concurrency error. @{p1}@ at @{filename}@:@{line:MBIERROR1}@ and @{p2}@ at @{filename}@:@{line:MBIERROR2}@ conflicts in process 1'
+            gen.make_file(template, f'GlobalConcurrency_rr_{e}_{p1}_{p2}_nok.c', replace)