Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[MBI] Make a real copy of 'patterns' into 'replace'.
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Wed, 30 Mar 2022 18:58:39 +0000 (20:58 +0200)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Wed, 30 Mar 2022 19:11:34 +0000 (21:11 +0200)
Makes minor changes to the generated output.

24 files changed:
teshsuite/smpi/MBI/CollArgGenerator.py
teshsuite/smpi/MBI/CollComGenerator.py
teshsuite/smpi/MBI/CollLocalConcurrencyGenerator.py
teshsuite/smpi/MBI/CollMatchingGenerator.py
teshsuite/smpi/MBI/CollP2PMatchingGenerator.py
teshsuite/smpi/MBI/CollP2PMessageRaceGenerator.py
teshsuite/smpi/MBI/CollTopoGenerator.py
teshsuite/smpi/MBI/MissingWaitandStartGenerator.py
teshsuite/smpi/MBI/P2PArgGenerator.py
teshsuite/smpi/MBI/P2PComGenerator.py
teshsuite/smpi/MBI/P2PInvalidComGenerator.py
teshsuite/smpi/MBI/P2PLocalConcurrencyGenerator.py
teshsuite/smpi/MBI/P2PMatchingANYSRCGenerator.py
teshsuite/smpi/MBI/P2PMatchingGenerator.py
teshsuite/smpi/MBI/P2PProbeGenerator.py
teshsuite/smpi/MBI/RMAArgGenerator.py
teshsuite/smpi/MBI/RMAInvalidArgGenerator.py
teshsuite/smpi/MBI/RMALocalLocalConcurrencyGenerator.py
teshsuite/smpi/MBI/RMAP2PGlobalConcurrencyGenerator.py
teshsuite/smpi/MBI/RMARemoteLocalConcurrencyGenerator.py
teshsuite/smpi/MBI/RMARemoteRemoteConcurrencyGenerator.py
teshsuite/smpi/MBI/RMAReqLifecycleGenerator.py
teshsuite/smpi/MBI/RMAWinBufferGenerator.py
teshsuite/smpi/MBI/ResleakGenerator.py

index 456deb7..42a655d 100755 (executable)
@@ -92,7 +92,7 @@ for c in gen.tcoll4color:
     patterns['change_arg'] = ''
 
     # Generate the code with invalid color
-    replace = patterns
+    replace = patterns.copy()
     replace['shortdesc'] = 'Invalid color in @{c}@'
     replace['longdesc'] = 'invalid color in @{c}@'
     replace['outcome'] = 'ERROR: InvalidOtherArg'
@@ -121,7 +121,7 @@ for c in gen.coll4root + gen.icoll4root:
     patterns['change_arg'] = ''
 
     # Generate an incorrect root matching (root mismatch)
-    replace = patterns
+    replace = patterns.copy()
     replace['shortdesc'] = 'Collective @{c}@ with a root mismatch'
     replace['longdesc'] = 'Odd ranks use 0 as a root while even ranks use 1 as a root'
     replace['outcome'] = 'ERROR: RootMatching'
@@ -130,7 +130,7 @@ for c in gen.coll4root + gen.icoll4root:
     gen.make_file(template, f'ParamMatching_Root_{c}_nok.c', replace)
 
     # Generate the call with root=-1 (invalid root)
-    replace = patterns
+    replace = patterns.copy()
     replace['shortdesc'] = f'Collective {c} with root = -1'
     replace['longdesc'] = f'Collective {c} with root = -1'
     replace['outcome'] = 'ERROR: InvalidRoot'
@@ -139,7 +139,7 @@ for c in gen.coll4root + gen.icoll4root:
     gen.make_file(template, f'InvalidParam_RootNeg_{c}_nok.c', replace)
 
     # Generate the call with root=2 (root not in communicator)
-    replace = patterns
+    replace = patterns.copy()
     replace['shortdesc'] = f'Collective {c} with root out of the communicator'
     replace['longdesc'] = f'Collective {c} with root = 2 (there is only 2 ranks)'
     replace['outcome'] = 'ERROR: InvalidRoot'
@@ -169,7 +169,7 @@ for c in gen.coll + gen.icoll:
         patterns['change_arg'] = ''
 
         # Generate the incorrect matching (datatype Mmismatch)
-        replace = patterns
+        replace = patterns.copy()
         replace['shortdesc'] = 'Collective @{c}@ with a datatype mismatch'
         replace['longdesc'] = 'Odd ranks use MPI_INT as the datatype while even ranks use MPI_FLOAT'
         replace['outcome'] = 'ERROR: DatatypeMatching'
@@ -178,7 +178,7 @@ for c in gen.coll + gen.icoll:
         gen.make_file(template, f'ParamMatching_Data_{c}_nok.c', replace)
 
         # Generate the call with null type (invalid datatype)
-        replace = patterns
+        replace = patterns.copy()
         replace['shortdesc'] = 'Collective @{c}@ with an invalid datatype '
         replace['longdesc'] = 'Collective @{c}@ with an invalid datatype '
         replace['outcome'] = 'ERROR: InvalidDatatype'
@@ -207,7 +207,7 @@ for c in gen.coll4op + gen.icoll4op:
     patterns['change_arg'] = ''
 
     # Generate the incorrect matching (op mismatch)
-    replace = patterns
+    replace = patterns.copy()
     replace['shortdesc'] = 'Collective @{c}@ with an operator  mismatch'
     replace['longdesc'] = 'Odd ranks use MPI_SUM as the operator while even ranks use MPI_MAX'
     replace['outcome'] = 'ERROR: OperatorMatching'
@@ -216,7 +216,7 @@ for c in gen.coll4op + gen.icoll4op:
     gen.make_file(template, f'ParamMatching_Op_{c}_nok.c', replace)
 
     # Generate the call with Op=MPI_OP_NULL (invalid op)
-    replace = patterns
+    replace = patterns.copy()
     replace['shortdesc'] = 'Collective @{c}@ with an invalid operator '
     replace['longdesc'] = 'Collective @{c}@ with an invalid operator '
     replace['outcome'] = 'ERROR: InvalidOperator'
index 7ecfd2a..667404d 100755 (executable)
@@ -89,7 +89,7 @@ for c in gen.coll + gen.icoll + gen.ibarrier:
     patterns['operation'] = gen.operation[c]("1")
 
     # Generate the correct code => to remove?
-    replace = patterns
+    replace = patterns.copy()
     replace['shortdesc'] = 'Collective @{c}@ with correct arguments'
     replace['longdesc'] = f'All ranks in newcom call {c} with correct arguments'
     replace['outcome'] = 'OK'
@@ -98,7 +98,7 @@ for c in gen.coll + gen.icoll + gen.ibarrier:
     gen.make_file(template, f'ParamMatching_Com_{c}_ok.c', replace)
 
     # Generate the incorrect communicator matching
-    replace = patterns
+    replace = patterns.copy()
     replace['shortdesc'] = 'Collective @{c}@ with a communicator mismatch'
     replace['longdesc'] = 'Odd ranks call the collective on newcom while even ranks call the collective on MPI_COMM_WORLD'
     replace['outcome'] = 'ERROR: CommunicatorMatching'
@@ -107,7 +107,7 @@ for c in gen.coll + gen.icoll + gen.ibarrier:
     gen.make_file(template, f'ParamMatching_Com_{c}_nok.c', replace)
 
     # Generate the coll with newcom=MPI_COMM_NULL
-    replace = patterns
+    replace = patterns.copy()
     replace['shortdesc'] = f'Collective @{c}@ with newcom=MPI_COMM_NULL'
     replace['longdesc'] = f'Collective @{c}@ with newcom=MPI_COMM_NULL'
     replace['outcome'] = 'ERROR: InvalidCommunicator'
index 0043f48..2ff3357 100755 (executable)
@@ -82,7 +82,7 @@ for c in gen.icoll + gen.pcoll:
     patterns['write'] = gen.write[c]("1")
     patterns['free'] = gen.free[c]("1")
 
-    replace = patterns
+    replace = patterns.copy()
     replace['shortdesc'] = 'Local concurrency with a collective'
     replace['longdesc'] = f'The buffer in {c} is modified before the call has been completed.'
     replace['outcome'] = 'ERROR: LocalConcurrency'
index ac666e2..952f85f 100755 (executable)
@@ -108,14 +108,14 @@ for c1 in gen.coll + gen.icoll + gen.ibarrier:
 
         if c1 == c2:
             # Generate the correct code using the same collective twice
-            replace = patterns
+            replace = patterns.copy()
             replace['shortdesc'] = 'Correct collective ordering'
             replace['longdesc'] = f'All ranks call {c1} twice'
             replace['outcome'] = 'OK'
             replace['errormsg'] = ''
             gen.make_file(template, f'CallOrdering_{c1}_{c2}_ok.c', replace)
             # Generate the correct code using the collective once
-            replace = patterns
+            replace = patterns.copy()
             replace['shortdesc'] = 'Correct collective ordering'
             replace['longdesc'] = f'All ranks call {c1} once'
             replace['outcome'] = 'OK'
@@ -129,14 +129,14 @@ for c1 in gen.coll + gen.icoll + gen.ibarrier:
             gen.make_file(template, f'CallOrdering_{c1}_ok.c', replace)
         else:
             # Generate the correct ordering with two different collectives
-            replace = patterns
+            replace = patterns.copy()
             replace['shortdesc'] = 'Correct collective ordering'
             replace['longdesc'] = f'All ranks call {c1} and then {c2}'
             replace['outcome'] = 'OK'
             replace['errormsg'] = ''
             gen.make_file(template, f'CallOrdering_{c1}_{c2}_ok.c', replace)
             # Generate the incorrect ordering with two different collectives
-            replace = patterns
+            replace = patterns.copy()
             replace['shortdesc'] = 'Incorrect collective ordering'
             replace['longdesc'] = f'Odd ranks call {c1} and then {c2} while even ranks call these collectives in the other order'
             replace['outcome'] = 'ERROR: CallMatching'
@@ -153,7 +153,7 @@ for c1 in gen.coll + gen.icoll + gen.ibarrier:
             gen.make_file(template, f'CallOrdering_{c1}_{c2}_nok.c', replace)
 
     # Generate the incorrect ordering with one collective
-    replace = patterns
+    replace = patterns.copy()
     replace['shortdesc'] = 'Incorrect collective ordering'
     replace['longdesc'] = f'Odd ranks call {c1} while even ranks do not call any collective'
     replace['outcome'] = 'ERROR: CallMatching'
@@ -161,19 +161,27 @@ for c1 in gen.coll + gen.icoll + gen.ibarrier:
     replace['operation1b'] = ''  # Remove functions
     replace['operation2b'] = ''
     replace['operation2a'] = ''
+    replace['init2'] = ''
     replace['fini1b'] = ''
     replace['fini2a'] = ''
     replace['fini2b'] = ''
+    replace['free1'] = gen.free[c1]("1")
+    replace['free2'] = ''
     gen.make_file(template, f'CallOrdering_{c1}_none_nok.c', replace)
     # Generate a correct ordering with a conditional not depending on ranks
-    replace = patterns
+    replace = patterns.copy()
     replace['shortdesc'] = 'Correct collective ordering'
     replace['longdesc'] = f'All ranks call {c1}'
     replace['outcome'] = 'OK'
     replace['errormsg'] = ''
     replace['change_cond'] = 'nprocs<256'
-    replace['operation2b'] = '' # Remove functions
+    replace['operation1b'] = '' # Remove functions
+    replace['operation2b'] = ''
     replace['operation2a'] = ''
+    replace['init2'] = ''
+    replace['fini1b'] = ''
+    replace['fini2a'] = ''
     replace['fini2b'] = ''
-    replace['free2a'] = ''
+    replace['free1'] = gen.free[c1]("1")
+    replace['free2'] = ''
     gen.make_file(template, f'CallOrdering_{c1}_none_ok.c', replace)
index 598667b..6a184f1 100755 (executable)
@@ -111,7 +111,7 @@ for s in gen.send + gen.isend:
             patterns['operation3'] = gen.operation[c]("3")
 
             # Generate the incorrect matching because of the conditional
-            replace = patterns
+            replace = patterns.copy()
             replace['shortdesc'] = 'Point to point & collective mismatch'
             replace['longdesc'] = 'The @{s}@ corresponding to the @{r}@ is after @{c}@, while @{r}@ is before @{c}@. This is a deadlock.'
             replace['outcome'] = 'ERROR: CallMatching'
@@ -119,7 +119,7 @@ for s in gen.send + gen.isend:
             gen.make_file(template, f'CallOrdering_{r}_{s}_{c}_nok.c', replace)
 
             # Generate the incorrect code depending on buffering
-            #  replace = patterns
+            #  replace = patterns.copy()
             #  replace['shortdesc'] = 'Point to point & collective mismatch'
             #  replace['longdesc'] = 'Point to point @{s}@ is matched with @{c}@ which causes a deadlock depending on the buffering mode.'
             #  replace['outcome'] = 'ERROR: BufferingHazard'
index aa9e78e..2c3233b 100755 (executable)
@@ -131,7 +131,7 @@ for s in gen.send + gen.isend:
             patterns['operation4'] = gen.operation[r]("4")
 
             # Generate the incorrect matching because of the conditional
-            replace = patterns
+            replace = patterns.copy()
             replace['shortdesc'] = 'Message race'
             replace['longdesc'] = 'Message race in @{r}@ with @{c}@.'
             replace['outcome'] = 'ERROR: MessageRace'
index 6c7d267..7a137bd 100755 (executable)
@@ -85,9 +85,10 @@ for c in gen.tcoll4topo:
     patterns['init'] = gen.init[c]("1")
     patterns['fini'] = gen.fini[c]("1")
     patterns['operation'] = gen.operation[c]("1")
+    patterns['change_dims'] = '/* No error injected here */'
 
     # Generate the correct code
-    replace = patterns
+    replace = patterns.copy()
     replace['shortdesc'] = 'Function @{c}@ with correct arguments'
     replace['longdesc'] = f'All ranks in comm call {c} with correct arguments'
     replace['outcome'] = 'OK'
@@ -97,7 +98,7 @@ for c in gen.tcoll4topo:
     gen.make_file(template, f'InvalidParam_{c}_ok.c', replace)
 
     # Generate the incorrect code
-    replace = patterns
+    replace = patterns.copy()
     replace['shortdesc'] = 'The code tries to get cartesian information of MPI_COMM_WORLD.'
     replace['longdesc'] = 'The code creates a cartesian communicator, and tries to get cartesian information of MPI_COMM_WORLD.'
     replace['outcome'] = 'ERROR: InvalidCommunicator'
@@ -106,7 +107,7 @@ for c in gen.tcoll4topo:
     gen.make_file(template, f'InvalidParam_Com_{c}_nok.c', replace)
 
     # Generate the code with newcom=MPI_COMM_NULL
-    replace = patterns
+    replace = patterns.copy()
     replace['shortdesc'] = 'Function @{c}@ called with comm=MPI_COMM_NULL'
     replace['longdesc'] = 'Function @{c}@ called with comm=MPI_COMM_NULL'
     replace['outcome'] = 'ERROR: InvalidCommunicator'
@@ -115,7 +116,7 @@ for c in gen.tcoll4topo:
     gen.make_file(template, f'InvalidParam_ComNull_{c}_nok.c', replace)
 
     # Generate the code with invalid dimension
-    replace = patterns
+    replace = patterns.copy()
     replace['shortdesc'] = 'Creates a cartesian communicator with a negative entry in the dims attribute'
     replace['longdesc'] = 'Creates a cartesian communicator with a negative entry in the dims attribute, which is a usage error'
     replace['outcome'] = 'ERROR: InvalidOtherArg'
index 7c6a5ed..e169bdf 100755 (executable)
@@ -107,7 +107,7 @@ for s in gen.isend + gen.psend:
         patterns['free2'] = gen.free[r]("2")
 
         # Generate the correct code
-        replace = patterns
+        replace = patterns.copy()
         replace['shortdesc'] = 'Correct matching'
         replace['longdesc'] = 'No error'
         replace['outcome'] = 'OK'
@@ -115,7 +115,7 @@ for s in gen.isend + gen.psend:
         gen.make_file(template, f'ReqLifecycle_{s}_{r}_ok.c', replace)
 
         # Generate the code with a missing wait
-        replace = patterns
+        replace = patterns.copy()
         replace['shortdesc'] = 'Missing wait'
         replace['longdesc'] = 'Missing Wait. @{s}@ at @{filename}@:@{line:MBIERROR}@ has no completion.'
         replace['outcome'] = 'ERROR: MissingWait'
@@ -125,7 +125,7 @@ for s in gen.isend + gen.psend:
 
         if s in gen.psend:
             # Generate the code with a missing start - persistent only
-            replace = patterns
+            replace = patterns.copy()
             replace['shortdesc'] = 'Missing start'
             replace['longdesc'] = 'Missing start. @{s}@ at @{filename}@:@{line:MBIERROR}@ has no start'
             replace['outcome'] = 'ERROR: MissingStart'
@@ -134,7 +134,7 @@ for s in gen.isend + gen.psend:
             replace['start1'] = ' /* MBIERROR MISSING: ' + startPers + ' */'
             gen.make_file(template, f'ReqLifecycle_MissingStart_{s}_{r}_nok.c', replace)
             # Generate the code with a missing free - persistent only
-            replace = patterns
+            replace = patterns.copy()
             replace['shortdesc'] = 'Missing free'
             replace['longdesc'] = 'Missing free. @{s}@ at @{filename}@:@{line:MBIERROR}@ has no free'
             replace['outcome'] = 'ERROR: RequestLeak'
@@ -169,7 +169,7 @@ for c in gen.pcoll + gen.icoll + gen.ibarrier:
     patterns['free2'] = ""
 
     # Generate the code with a missing wait
-    replace = patterns
+    replace = patterns.copy()
     replace['shortdesc'] = 'Missing wait'
     replace['longdesc'] = 'Missing Wait. @{c}@ at @{filename}@:@{line:MBIERROR}@ has no completion'
     replace['outcome'] = 'ERROR: MissingWait'
@@ -180,7 +180,7 @@ for c in gen.pcoll + gen.icoll + gen.ibarrier:
 
     if c in gen.pcoll:
         # Generate the code with a missing start - persistent only
-        replace = patterns
+        replace = patterns.copy()
         replace['shortdesc'] = 'Missing start functio'
         replace['longdesc'] = 'Missing Start. @{c}@ at @{filename}@:@{line:MBIERROR}@ has no start'
         replace['outcome'] = 'ERROR: MissingStart'
@@ -190,7 +190,7 @@ for c in gen.pcoll + gen.icoll + gen.ibarrier:
         gen.make_file(template, f'ReqLifecycle_MissingStart_{c}_nok.c', replace)
 
         # Generate the code with a resleak (no free) - persistent only
-        replace = patterns
+        replace = patterns.copy()
         replace['shortdesc'] = 'Missing free'
         replace['longdesc'] = 'Missing free. @{c}@ at @{filename}@:@{line:MBIERROR}@ has no free'
         replace['outcome'] = 'ERROR: RequestLeak'
index 84b13dc..ae0f2d0 100755 (executable)
@@ -102,7 +102,7 @@ for p1 in gen.allsend:
         patterns['free2'] = gen.free[p2]("2")
 
         # Generate the incorrect matching
-        replace = patterns
+        replace = patterns.copy()
         replace['shortdesc'] = 'Point to point @{p1}@ and @{p2}@ have a datatype mismatch'
         replace['longdesc'] = 'Process 0 uses MPI_FLOAT as the datatype while process 1 uses MPI_INT.'
         replace['outcome'] = 'ERROR: DatatypeMatching'
@@ -111,7 +111,7 @@ for p1 in gen.allsend:
         gen.make_file(template, f'ParamMatching_Data_{p1}_{p2}_nok.c', replace)
 
         # Generate code with a null type
-        replace = patterns
+        replace = patterns.copy()
         replace['shortdesc'] = 'Use of invalid datatype in point-to-point communication'
         replace['longdesc'] = 'Point to point @{p1}@ and @{p2}@ have MPI_DATATYPE_NULL as a type'
         replace['outcome'] = 'ERROR: InvalidDatatype'
@@ -120,7 +120,7 @@ for p1 in gen.allsend:
         gen.make_file(template, f'InvalidParam_DatatypeNull_{p1}_{p2}_nok.c', replace)
 
         # Generate code with an invalid datatype
-        replace = patterns
+        replace = patterns.copy()
         replace['shortdesc'] = 'Use of invalid datatype in point-to-point communication'
         replace['longdesc'] = 'Point to point @{p1}@ and @{p2}@ have an invalid datatype'
         replace['outcome'] = 'ERROR: InvalidDatatype'
@@ -155,7 +155,7 @@ for p1 in gen.allsend:
         patterns['change_arg'] = ""
 
         # Generate the incorrect tag matching
-        replace = patterns
+        replace = patterns.copy()
         replace['shortdesc'] = 'Point to point @{p1}@ and @{p2}@ have a tag mismatch'
         replace['longdesc'] = 'Point to point @{p1}@ and @{p2}@ have a tag mismatch.'
         replace['outcome'] = 'ERROR: TagMatching'
@@ -164,7 +164,7 @@ for p1 in gen.allsend:
         gen.make_file(template, f'ParamMatching_Tag_{p1}_{p2}_nok.c', replace)
 
         # Generate the code with an invalid tag
-        replace = patterns
+        replace = patterns.copy()
         replace['shortdesc'] = 'Point to point @{p1}@ and @{p2}@ have an invalid tag'
         replace['longdesc'] = 'Point to point @{p1}@ and @{p2}@ have an invalid tag.'
         replace['outcome'] = 'ERROR: InvalidTag'
@@ -173,7 +173,7 @@ for p1 in gen.allsend:
         gen.make_file(template, f'InvalidParam_Tag_{p1}_{p2}_nok.c', replace)
 
         # Generate a correct code using MPI_ANY_TAG
-        replace = patterns
+        replace = patterns.copy()
         replace['shortdesc'] = 'Correct code'
         replace['longdesc'] = 'Correct code'
         replace['outcome'] = 'OK'
index e15c74d..6382267 100755 (executable)
@@ -103,9 +103,10 @@ for p1 in gen.send + gen.isend + gen.psend:
         patterns['free1'] = gen.free[p1]("1")
         patterns['free2'] = gen.free[p2]("2")
         patterns['change_srcdest'] = ""
+        patterns['change_com'] = ""
 
         # Generate the incorrect matching
-        replace = patterns
+        replace = patterns.copy()
         replace['shortdesc'] = 'Point to point @{p1}@ and @{p2}@ have a communicator mismatch'
         replace['longdesc'] = 'Process 1 uses newcom as the communicator while process 0 uses MPI_COMM_WORLD.'
         replace['outcome'] = 'ERROR: CommunicatorMatching'
@@ -114,7 +115,7 @@ for p1 in gen.send + gen.isend + gen.psend:
         gen.make_file(template, f'ParamMatching_Com_{p1}_{p2}_nok.c', replace)
 
         # Generate the code with an invalid communicator
-        replace = patterns
+        replace = patterns.copy()
         replace['shortdesc'] = 'Point to point @{p1}@ and @{p2}@ have an invalid communicator'
         replace['longdesc'] = 'Point to point @{p1}@ and @{p2}@ have an invalid communicator.'
         replace['outcome'] = 'ERROR: InvalidCommunicator'
@@ -123,7 +124,7 @@ for p1 in gen.send + gen.isend + gen.psend:
         gen.make_file(template, f'InvalidParam_Com_{p1}_{p2}_nok.c', replace)
 
         #  Generate the code with an invalid communicator ==> TO CHECK
-        #replace = patterns
+        #replace = patterns.copy()
         #replace['shortdesc'] = 'Point to point @{p1}@ and @{p2}@ have an invalid communicator'
        # replace['longdesc'] = 'Point to point @{p1}@ and @{p2}@ have an invalid communicator.'
        # replace['outcome'] = 'ERROR: InvalidCommunicator'
@@ -133,7 +134,7 @@ for p1 in gen.send + gen.isend + gen.psend:
        # gen.make_file(template, f'InvalidParam_Com_{p1}_{p2}_nok.c', replace)
 
         # Generate the code with an invalid dest
-        replace = patterns
+        replace = patterns.copy()
         replace['origin'] = "MBI"
         replace['shortdesc'] = 'Point to point @{p1}@ has an invalid argument'
         replace['longdesc'] = 'Point to point @{p1}@ and @{p2}@ have an invalid communicator.'
@@ -144,7 +145,7 @@ for p1 in gen.send + gen.isend + gen.psend:
         gen.make_file(template, f'InvalidParam_Dest_{p1}_{p2}_nok.c', replace)
 
         # Generate the code with an invalid src
-        replace = patterns
+        replace = patterns.copy()
         replace['shortdesc'] = 'Point to point @{p2}@ has an invalid argument'
         replace['longdesc'] = 'Point to point @{p1}@ and @{p2}@ have an invalid communicator.'
         replace['outcome'] = 'ERROR: InvalidSrcDest'
index fc9e673..2a8a515 100755 (executable)
@@ -101,7 +101,7 @@ for p1 in gen.send + gen.isend + gen.psend:
         patterns['change_com1'] = ""
         patterns['change_com2'] = ""
 
-        replace = patterns
+        replace = patterns.copy()
         replace['origin'] = "inspired from MPI-Corrbench"
         replace['shortdesc'] = 'Point to point @{p2}@ has an invalid communicator'
         replace['longdesc'] = 'MPI_COMM_NULL used in point to point @{p2}@'
@@ -110,7 +110,7 @@ for p1 in gen.send + gen.isend + gen.psend:
         replace['change_com2'] = 'newcom = MPI_COMM_NULL;'
         gen.make_file(template, f'InvalidParam_ComNull_{p2}_{p1}nok.c', replace)
 
-        replace = patterns
+        replace = patterns.copy()
         replace['shortdesc'] = 'Point to point @{p2}@ has an invalid communicator'
         replace['longdesc'] = 'MPI_COMM_NULL used in point to point @{p2}@'
         replace['outcome'] = 'ERROR: InvalidCommunicator'
index 29bbe8f..1316cc0 100755 (executable)
@@ -104,21 +104,21 @@ for s in gen.send + gen.isend + gen.psend:
 
         # Generate a message race
         if s in gen.send and r in gen.irecv + gen.precv:
-            replace = patterns
+            replace = patterns.copy()
             replace['shortdesc'] = ' Local Concurrency with a P2P'
             replace['longdesc'] = f'The message buffer in {r} is modified before the call has been completed.'
             replace['outcome'] = 'ERROR: LocalConcurrency'
             replace['errormsg'] = 'Local Concurrency with a P2P. The receive buffer in @{r}@ is modified at @{filename}@:@{line:MBIERROR2}@ whereas there is no guarantee the message has been received.'
             gen.make_file(template, f'LocalConcurrency_{r}_{s}_nok.c', replace)
         if s in gen.isend + gen.psend and r in gen.recv:
-            replace = patterns
+            replace = patterns.copy()
             replace['shortdesc'] = ' Local Concurrency with a P2P'
             replace['longdesc'] = f'The message buffer in {s} is modified before the call has been completed.'
             replace['outcome'] = 'ERROR: LocalConcurrency'
             replace['errormsg'] = 'Local Concurrency with a P2P. The send buffer in @{s}@ is modified at @{filename}@:@{line:MBIERROR1}@ whereas there is no guarantee the message has been sent.'
             gen.make_file(template, f'LocalConcurrency_{r}_{s}_nok.c', replace)
         if s in gen.isend + gen.psend and r in gen.irecv + gen.precv:
-            replace = patterns
+            replace = patterns.copy()
             replace['shortdesc'] = ' Local Concurrency with a P2P'
             replace['longdesc'] = f'The message buffer in {s} and {r} are modified before the calls have completed.'
             replace['outcome'] = 'ERROR: LocalConcurrency'
index 5bdbe6c..ce489af 100755 (executable)
@@ -100,7 +100,7 @@ for s in gen.send + gen.isend:
         patterns['operation1'] = gen.operation[r]("1")
 
         # Generate the incorrect matching
-        replace = patterns
+        replace = patterns.copy()
         replace['shortdesc'] = 'The message ordering is non-deterministic.'
         replace['longdesc'] = 'The code assumes a fixed order in the reception of messages while the message ordering is non-deterministic.'
         replace['outcome'] = 'ERROR: MessageRace'
index b7e7f66..f449148 100755 (executable)
@@ -90,7 +90,7 @@ for p in gen.send + gen.ssend + gen.bsend + gen.recv + gen.irecv + gen.isend:
     patterns['change_cond'] = 'rank == 1'
 
     # Generate the incorrect matching with one call
-    replace = patterns
+    replace = patterns.copy()
     replace['shortdesc'] = 'Point to point @{p}@ is not matched'
     replace['longdesc'] = 'Process 0 calls @{p}@ and is not matched'
     replace['outcome'] = 'ERROR: CallMatching'
@@ -98,7 +98,7 @@ for p in gen.send + gen.ssend + gen.bsend + gen.recv + gen.irecv + gen.isend:
     gen.make_file(template, f'CallOrdering_{p}_nok.c', replace)
 
     # Generate the incorrect matching with two calls
-    replace = patterns
+    replace = patterns.copy()
     replace['shortdesc'] = 'Both point to point @{p}@ are not matched'
     replace['longdesc'] = 'Processes 0 and 1 both call @{p}@ which are not matched'
     replace['outcome'] = 'ERROR: CallMatching'
@@ -125,7 +125,7 @@ for s in gen.send + gen.isend + gen.ssend + gen.bsend:
         patterns['change_cond'] = '(rank == 1) && (its_raining)'
 
         # Generate the incorrect matching because of the conditional
-        replace = patterns
+        replace = patterns.copy()
         replace['shortdesc'] = 'Point to point @{r}@ is never called.'
         replace['longdesc'] = 'Point to point @{r}@ is never executed. Process 1 calls MPI_Finalize and causes a deadlock.'
         replace['outcome'] = 'ERROR: CallMatching'
index 4504493..917859c 100755 (executable)
@@ -130,7 +130,7 @@ for p in gen.probe:
             patterns['operation2c'] = gen.operation[s]("4")
 
             # Generate the incorrect matching
-            replace = patterns
+            replace = patterns.copy()
             replace['shortdesc'] = 'MPI_Probe is called before MPI_Recv.'
             replace['longdesc'] = 'MPI_Probe is a blocking call that returns only after a matching message has been found. By calling MPI_Probe before MPI_Recv, a deadlock is created.'
             replace['outcome'] = 'ERROR: CallMatching'
@@ -138,7 +138,7 @@ for p in gen.probe:
             gen.make_file(template, f'CallOrdering_{p}_{r}_{s}_nok.c', replace)
 
             # Generate a correct matching
-            replace = patterns
+            replace = patterns.copy()
             replace['shortdesc'] = 'Correct use of MPI_Probe.'
             replace['longdesc'] = 'Correct use of MPI_Probe.'
             replace['outcome'] = 'OK'
index 5e42794..5cab47b 100755 (executable)
@@ -91,7 +91,7 @@ for e in gen.epoch:
         patterns['change_arg'] = ""
 
         # Generate a code with a null type
-        replace = patterns
+        replace = patterns.copy()
         replace['shortdesc'] = 'Invalid argument in one-sided operation.'
         replace['longdesc'] = 'A one-sided operation has MPI_DATATYPE_NULL as a type.'
         replace['outcome'] = 'ERROR: InvalidDatatype'
@@ -100,7 +100,7 @@ for e in gen.epoch:
         gen.make_file(template, f'InvalidParam_BufferNullCond_{e}_{p}_nok.c', replace)
 
         # Generate a code with an invalid type
-        replace = patterns
+        replace = patterns.copy()
         replace['shortdesc'] = 'Invalid argument in one-sided operation.'
         replace['longdesc'] = 'Use of an invalid datatype in one-sided operation.'
         replace['outcome'] = 'ERROR: InvalidDatatype'
index d562305..afe656c 100755 (executable)
@@ -90,7 +90,7 @@ for e in gen.epoch:
         patterns['malloc'] = "malloc(N * sizeof(int));"
 
         # Generate a code with a null type
-        replace = patterns
+        replace = patterns.copy()
         replace['shortdesc'] = 'Invalid argument in one-sided operation.'
         replace['longdesc'] = 'A one-sided operation has MPI_DATATYPE_NULL as a type.'
         replace['outcome'] = 'ERROR: InvalidDatatype'
@@ -99,7 +99,7 @@ for e in gen.epoch:
         gen.make_file(template, f'InvalidParam_DatatypeNull_{e}_{p}_nok.c', replace)
 
         # Generate a code with a null buffer (move to RMAWinBufferGenerator)
-        # replace = patterns
+        # replace = patterns.copy()
         # replace['origin'] = 'MPI-Corrbench'
         # replace['shortdesc'] = 'nullptr is invalid in one-sided operation.'
         # replace['longdesc'] = 'A one-sided operation has an invalid buffer.'
@@ -111,7 +111,7 @@ for e in gen.epoch:
         # gen.make_file(template, f'InvalidParam_BufferNull_{e}_{p}_nok.c', replace)
 
         # Generate a code with an invalid type
-        replace = patterns
+        replace = patterns.copy()
         replace['origin'] = 'MBI'
         replace['shortdesc'] = 'Invalid argument in one-sided operation.'
         replace['longdesc'] = 'Use of an invalid datatype in one-sided operation.'
@@ -121,14 +121,14 @@ for e in gen.epoch:
         gen.make_file(template, f'InvalidParam_Datatype_{e}_{p}_nok.c', replace)
 
         # Generate a code with invalid buffer
-        replace = patterns
+        replace = patterns.copy()
         patterns['origin'] = "MPI-Corrbench"
         replace['shortdesc'] = 'Invalid invalid buffer (buffer must be allocated)'
         replace['longdesc'] = 'Use of an invalid buffer in MPI_Win_create.'
         replace['outcome'] = 'ERROR: InvalidBuffer'
-        patterns['malloc'] = "NULL; /* MBIERROR2 */"
+        replace['malloc'] = "NULL; /* MBIERROR2 */"
         replace['init'] = ""
-        patterns['operation'] = ""
+        replace['operation'] = ""
         replace['change_arg'] = ""
         replace['errormsg'] = 'Invalid buffer in Win_create at @{filename}@:@{line:MBIERROR2}@'
         gen.make_file(template, f'InvalidParam_InvalidBufferWinCreate_{e}_{p}_nok.c', replace)
index 00777e3..458fe21 100755 (executable)
@@ -93,7 +93,7 @@ for e in gen.epoch:
             patterns['operation2'] = gen.operation[p2]("1")
 
             # Generate a data race (Get + Get/load/store/Put)
-            replace = patterns
+            replace = patterns.copy()
             replace['shortdesc'] = 'Local Concurrency error.'
             replace['longdesc'] = 'Local Concurrency error. @{p2}@ conflicts with @{p1}@'
             replace['outcome'] = 'ERROR: LocalConcurrency'
@@ -101,7 +101,7 @@ for e in gen.epoch:
             gen.make_file(template, f'LocalConcurrency_lloutwindow_{e}_{p1}_{p2}_nok.c', replace)
             # Generate a correct code by switching operation1 and  operation2
             if p2 in gen.store + gen.load + gen.loadstore:
-                replace = patterns
+                replace = patterns.copy()
                 replace['shortdesc'] = 'Correct code using RMA operations'
                 replace['longdesc'] = 'Correct code using RMA operations'
                 replace['outcome'] = 'OK'
@@ -110,7 +110,7 @@ for e in gen.epoch:
                 replace['operation2'] = gen.operation[p1]("1")
                 gen.make_file(template, f'LocalConcurrency_lloutwindow_{e}_{p2}_{p1}_ok.c', replace)
         # Generate a correct code by removing operation2
-        replace = patterns
+        replace = patterns.copy()
         replace['shortdesc'] = 'Correct code using RMA operations'
         replace['longdesc'] = 'Correct code using RMA operations'
         replace['outcome'] = 'OK'
@@ -137,14 +137,14 @@ for e in gen.epoch:
             patterns['operation2'] = gen.operation[p2]("1")
 
             # Generate a data race (Put + store)
-            replace = patterns
+            replace = patterns.copy()
             replace['shortdesc'] = 'Local Concurrency error.'
             replace['longdesc'] = 'Local Concurrency error. @{p2}@ conflicts with @{p1}@'
             replace['outcome'] = 'ERROR: LocalConcurrency'
             replace['errormsg'] = 'Local Concurrency error. @{p2}@ at @{filename}@:@{line:MBIERROR2}@ conflicts with @{p1}@ line @{line:MBIERROR1}@'
             gen.make_file(template, f'LocalConcurrency_lloutwindow_{e}_{p1}_{p2}_nok.c', replace)
             # Generate a correct code by switching operation1 and operation2
-            replace = patterns
+            replace = patterns.copy()
             replace['shortdesc'] = 'Correct code using RMA operations'
             replace['longdesc'] = 'Correct code using RMA operations'
             replace['outcome'] = 'OK'
@@ -154,7 +154,7 @@ for e in gen.epoch:
             gen.make_file(template, f'LocalConcurrency_lloutwindow_{e}_{p2}_{p1}_ok.c', replace)
 
             # Generate a correct code by removing operation2
-            replace = patterns
+            replace = patterns.copy()
             replace['shortdesc'] = 'Correct code using RMA operations'
             replace['longdesc'] = 'Correct code using RMA operations'
             replace['outcome'] = 'OK'
index f6a239f..fee996d 100755 (executable)
@@ -113,7 +113,7 @@ for p in gen.put + gen.get:
             patterns['operation2'] = gen.operation[s]("2") #send
             patterns['operation3'] = gen.operation[r]("3") #recv
 
-            replace = patterns
+            replace = patterns.copy()
             replace['shortdesc'] = 'Global Concurrency error.'
             replace['longdesc'] = 'Global Concurrency error. Concurrent access of variable winbuf by @{p}@ and @{r}@'
             replace['outcome'] = 'ERROR: GlobalConcurrency'
index 9a28409..5f20134 100755 (executable)
@@ -95,7 +95,7 @@ for e in gen.epoch:
             patterns['operation2'] = gen.operation[p2]("1")
 
             # Generate a data race (Get + Get/load/store/Put)
-            replace = patterns
+            replace = patterns.copy()
             replace['shortdesc'] = 'Global Concurrency error.'
             replace['longdesc'] = 'Global Concurrency error. @{p2}@ conflicts with @{p1}@'
             replace['outcome'] = 'ERROR: GlobalConcurrency'
@@ -127,7 +127,7 @@ for e in gen.epoch:
             patterns['operation2'] = gen.operation[p2]("1")
 
             # Generate a data race (Put + store)
-            replace = patterns
+            replace = patterns.copy()
             replace['shortdesc'] = 'Global Concurrency error.'
             replace['longdesc'] = 'Global Concurrency error. @{p2}@ conflicts with @{p1}@'
             replace['outcome'] = 'ERROR: GlobalConcurrency'
index 78116e8..7a9f77a 100755 (executable)
@@ -88,7 +88,7 @@ for e in gen.epoch:
         patterns['operation1'] = gen.operation[p1]("1")
 
         # Generate a data race (Get + Get/load/store/Put)
-        replace = patterns
+        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'
index 5ca2f65..b946f97 100755 (executable)
@@ -97,7 +97,7 @@ for e1 in gen.epoch:
         patterns['operation'] = gen.operation[p]("1")
 
         # Generate a code correct
-        replace = patterns
+        replace = patterns.copy()
         replace['shortdesc'] = 'Correct code'
         replace['longdesc'] = 'Correct code'
         replace['outcome'] = 'OK'
@@ -105,7 +105,7 @@ for e1 in gen.epoch:
         gen.make_file(template, f'ReqLifecycle_RMA_{e1}_{p}_ok.c', replace)
 
         # Generate a code with missing open epoch
-        replace = patterns
+        replace = patterns.copy()
         replace['shortdesc'] = f"Request lifecycle, missing open {e1} epoch"
         replace['longdesc'] = f"Request lifecycle, missing open {e1} epoch"
         replace['outcome'] = 'ERROR: MissingStart'
@@ -114,7 +114,7 @@ for e1 in gen.epoch:
         gen.make_file(template, f'ReqLifecycle_RMA_MissingOpen_{e1}_{p}_nok.c', replace)
 
         # Generate a code with missing close epoch
-        replace = patterns
+        replace = patterns.copy()
         replace['shortdesc'] = f"Request lifecycle, missing close {e1} epoch"
         replace['longdesc'] = f"Request lifecycle, missing close {e1} epoch"
         replace['outcome'] = 'ERROR: MissingWait'
@@ -142,7 +142,7 @@ for e1 in gen.epoch:
             patterns['operation'] = gen.operation[p]("1")
 
             # Generate a code with epoch into an epoch
-            replace = patterns
+            replace = patterns.copy()
             replace['shortdesc'] = f"Request lifecycle, {e2} epoch into {e1} epoch"
             replace['longdesc'] = f"Request lifecycle, {e2} epoch into {e1} epoch"
             replace['outcome'] = 'ERROR: MissingWait' #FIXME: New type of error
index 0830075..bae8efa 100755 (executable)
@@ -91,7 +91,7 @@ for b in ['missing', 'null', 'malloc', 'bufferSize']:
     patterns['generatedby'] = f'DO NOT EDIT: this file was generated by {os.path.basename(sys.argv[0])}. DO NOT EDIT.'
     patterns['rmafeature'] = 'Yes'
 
-    replace = patterns
+    replace = patterns.copy()
     replace['shortdesc'] = 'Invalid buffer in window creation.'
     replace['longdesc'] = 'Invalid buffer in window creation.'
     replace['outcome'] = 'ERROR: InvalidBuffer'
index 1273773..a9ff22f 100755 (executable)
@@ -95,7 +95,7 @@ for call in gen.tcoll:
     patterns['end'] = ''
 
     # Generate the correct code
-    replace = patterns
+    replace = patterns.copy()
     replace['shortdesc'] = '@{call}@ is correctly used'
     replace['longdesc'] = f'{call} correctly used'
     replace['outcome'] = 'OK'
@@ -103,7 +103,7 @@ for call in gen.tcoll:
     gen.make_file(template, f'ResLeak_{call}_ok.c', replace)
 
     # Generate the resleak
-    replace = patterns
+    replace = patterns.copy()
     replace['shortdesc'] = '@{call}@ has no free'
     replace['longdesc'] = '@{call}@ has no free'
     replace['outcome'] = f'ERROR: {gen.error[call]}'
@@ -112,7 +112,7 @@ for call in gen.tcoll:
     gen.make_file(template, f'ResLeak_{call}_nok.c', replace)
 
     # Generate multiple resleak
-    replace = patterns
+    replace = patterns.copy()
     replace['shortdesc'] = '@{call}@ lacks several free'
     replace['longdesc'] = '@{call}@ lacks several free'
     replace['outcome'] = f'ERROR: {gen.error[call]}'