Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[MBI] Import generator_utils as gen.
[simgrid.git] / teshsuite / smpi / MBI / RMAP2PGlobalConcurrencyGenerator.py
index b9535e1..f6a239f 100755 (executable)
@@ -1,7 +1,7 @@
 #! /usr/bin/python3
 import os
 import sys
-from generator_utils import *
+import generator_utils as gen
 
 template = """// @{generatedby}@
 /* ///////////////////////// The MPI Bugs Initiative ////////////////////////
@@ -92,30 +92,30 @@ int main(int argc, char **argv) {
 """
 
 
-for p in put + get:
-    for s in send + isend:
-         for r in recv + irecv:
-             patterns = {}
-             patterns = {'p': p, 's': s, 'r': r}
-             patterns['generatedby'] = f'DO NOT EDIT: this file was generated by {os.path.basename(sys.argv[0])}. DO NOT EDIT.'
-             patterns['rmafeature'] = 'Yes'
-             patterns['p2pfeature'] = 'Yes' if s in send or r in recv  else 'Lacking'
-             patterns['ip2pfeature'] = 'Yes' if s in isend or r in irecv  else 'Lacking'
-             patterns['p'] = p
-             patterns['s'] = s
-             patterns['r'] = r
-             patterns['init1'] = init[p]("1")
-             patterns['init2'] = init[s]("2")
-             patterns['init3'] = init[r]("3")
-             patterns['fini2'] = fini[s]("2")
-             patterns['fini3'] = fini[r]("3")
-             patterns['operation1'] = operation[p]("1") #put or get
-             patterns['operation2'] = operation[s]("2") #send
-             patterns['operation3'] = operation[r]("3") #recv
-
-             replace = patterns
-             replace['shortdesc'] = 'Global Concurrency error.'
-             replace['longdesc'] = 'Global Concurrency error. Concurrent access of variable winbuf by @{p}@ and @{r}@'
-             replace['outcome'] = 'ERROR: GlobalConcurrency'
-             replace['errormsg'] = 'Global Concurrency error. @{p}@ at @{filename}@:@{line:MBIERROR1}@ accesses the window of process 1. Process 1 receives data from process 2 and uses variable winbuf. winbuf in process 1 is then nondeterministic.'
-             make_file(template, f'GlobalConcurrency_{p}_{s}_{r}_nok.c', replace)
+for p in gen.put + gen.get:
+    for s in gen.send + gen.isend:
+        for r in gen.recv + gen.irecv:
+            patterns = {}
+            patterns = {'p': p, 's': s, 'r': r}
+            patterns['generatedby'] = f'DO NOT EDIT: this file was generated by {os.path.basename(sys.argv[0])}. DO NOT EDIT.'
+            patterns['rmafeature'] = 'Yes'
+            patterns['p2pfeature'] = 'Yes' if s in gen.send or r in gen.recv  else 'Lacking'
+            patterns['ip2pfeature'] = 'Yes' if s in gen.isend or r in gen.irecv  else 'Lacking'
+            patterns['p'] = p
+            patterns['s'] = s
+            patterns['r'] = r
+            patterns['init1'] = gen.init[p]("1")
+            patterns['init2'] = gen.init[s]("2")
+            patterns['init3'] = gen.init[r]("3")
+            patterns['fini2'] = gen.fini[s]("2")
+            patterns['fini3'] = gen.fini[r]("3")
+            patterns['operation1'] = gen.operation[p]("1") #put or get
+            patterns['operation2'] = gen.operation[s]("2") #send
+            patterns['operation3'] = gen.operation[r]("3") #recv
+
+            replace = patterns
+            replace['shortdesc'] = 'Global Concurrency error.'
+            replace['longdesc'] = 'Global Concurrency error. Concurrent access of variable winbuf by @{p}@ and @{r}@'
+            replace['outcome'] = 'ERROR: GlobalConcurrency'
+            replace['errormsg'] = 'Global Concurrency error. @{p}@ at @{filename}@:@{line:MBIERROR1}@ accesses the window of process 1. Process 1 receives data from process 2 and uses variable winbuf. winbuf in process 1 is then nondeterministic.'
+            gen.make_file(template, f'GlobalConcurrency_{p}_{s}_{r}_nok.c', replace)