Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[MBI] Less duplication of constant strings (sonar).
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Wed, 30 Mar 2022 19:31:19 +0000 (21:31 +0200)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Wed, 30 Mar 2022 19:31:19 +0000 (21:31 +0200)
teshsuite/smpi/MBI/CollMatchingGenerator.py
teshsuite/smpi/MBI/P2PLocalConcurrencyGenerator.py
teshsuite/smpi/MBI/RMALocalLocalConcurrencyGenerator.py

index 952f85f..206baff 100755 (executable)
@@ -105,18 +105,19 @@ for c1 in gen.coll + gen.icoll + gen.ibarrier:
         patterns['operation2a'] = gen.operation[c2]("2")
         patterns['operation2b'] = gen.operation[c2]("2")
         patterns['change_cond'] = 'rank % 2'
+        shortdesc = ' collective ordering'
 
         if c1 == c2:
             # Generate the correct code using the same collective twice
             replace = patterns.copy()
-            replace['shortdesc'] = 'Correct collective ordering'
+            replace['shortdesc'] = 'Correct' + shortdesc
             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.copy()
-            replace['shortdesc'] = 'Correct collective ordering'
+            replace['shortdesc'] = 'Correct' + shortdesc
             replace['longdesc'] = f'All ranks call {c1} once'
             replace['outcome'] = 'OK'
             replace['errormsg'] = ''
@@ -130,14 +131,14 @@ for c1 in gen.coll + gen.icoll + gen.ibarrier:
         else:
             # Generate the correct ordering with two different collectives
             replace = patterns.copy()
-            replace['shortdesc'] = 'Correct collective ordering'
+            replace['shortdesc'] = 'Correct' + shortdesc
             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.copy()
-            replace['shortdesc'] = 'Incorrect collective ordering'
+            replace['shortdesc'] = 'Incorrect' + shortdesc
             replace['longdesc'] = f'Odd ranks call {c1} and then {c2} while even ranks call these collectives in the other order'
             replace['outcome'] = 'ERROR: CallMatching'
             replace['errormsg'] = 'Collective mistmatch. @{c1}@ at @{filename}@:@{line:MBIERROR1}@ is matched with @{c2}@ line @{filename}@:@{line:MBIERROR2}@.'
@@ -154,7 +155,7 @@ for c1 in gen.coll + gen.icoll + gen.ibarrier:
 
     # Generate the incorrect ordering with one collective
     replace = patterns.copy()
-    replace['shortdesc'] = 'Incorrect collective ordering'
+    replace['shortdesc'] = 'Incorrect' + shortdesc
     replace['longdesc'] = f'Odd ranks call {c1} while even ranks do not call any collective'
     replace['outcome'] = 'ERROR: CallMatching'
     replace['errormsg'] = 'Collective mistmatch. @{c1}@ at @{filename}@:@{line:MBIERROR1}@ is not matched.'
@@ -170,7 +171,7 @@ for c1 in gen.coll + gen.icoll + gen.ibarrier:
     gen.make_file(template, f'CallOrdering_{c1}_none_nok.c', replace)
     # Generate a correct ordering with a conditional not depending on ranks
     replace = patterns.copy()
-    replace['shortdesc'] = 'Correct collective ordering'
+    replace['shortdesc'] = 'Correct' + shortdesc
     replace['longdesc'] = f'All ranks call {c1}'
     replace['outcome'] = 'OK'
     replace['errormsg'] = ''
index 1316cc0..0f18127 100755 (executable)
@@ -101,25 +101,26 @@ for s in gen.send + gen.isend + gen.psend:
         patterns['write2'] = gen.write[r]("2")
         patterns['free1'] = gen.free[s]("1")
         patterns['free2'] = gen.free[r]("2")
+        shortdesc = ' Local Concurrency with a P2P'
 
-        # Generate a message race
+        # Gtenerate a message race
         if s in gen.send and r in gen.irecv + gen.precv:
             replace = patterns.copy()
-            replace['shortdesc'] = ' Local Concurrency with a P2P'
+            replace['shortdesc'] = shortdesc
             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.copy()
-            replace['shortdesc'] = ' Local Concurrency with a P2P'
+            replace['shortdesc'] = shortdesc
             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.copy()
-            replace['shortdesc'] = ' Local Concurrency with a P2P'
+            replace['shortdesc'] = shortdesc
             replace['longdesc'] = f'The message buffer in {s} and {r} are modified before the calls have completed.'
             replace['outcome'] = 'ERROR: LocalConcurrency'
             replace['errormsg'] = 'Local Concurrency with a P2P. The message buffers in @{s}@ and @{r}@ are modified at @{filename}@:@{line:MBIERROR1}@ and @{filename}@:@{line:MBIERROR2}@ whereas there is no guarantee the calls have been completed.'
index 458fe21..a34c0ea 100755 (executable)
@@ -91,6 +91,7 @@ for e in gen.epoch:
             patterns['init1'] = gen.init[p1]("1")
             patterns['operation1'] = gen.operation[p1]("1")
             patterns['operation2'] = gen.operation[p2]("1")
+            shortdesc_rma = 'Correct code using RMA operations'
 
             # Generate a data race (Get + Get/load/store/Put)
             replace = patterns.copy()
@@ -102,8 +103,8 @@ for e in gen.epoch:
             # Generate a correct code by switching operation1 and  operation2
             if p2 in gen.store + gen.load + gen.loadstore:
                 replace = patterns.copy()
-                replace['shortdesc'] = 'Correct code using RMA operations'
-                replace['longdesc'] = 'Correct code using RMA operations'
+                replace['shortdesc'] = shortdesc_rma
+                replace['longdesc'] = shortdesc_rma
                 replace['outcome'] = 'OK'
                 replace['errormsg'] = 'OK'
                 replace['operation1'] = gen.operation[p2]("1")
@@ -111,8 +112,8 @@ 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.copy()
-        replace['shortdesc'] = 'Correct code using RMA operations'
-        replace['longdesc'] = 'Correct code using RMA operations'
+        replace['shortdesc'] = shortdesc_rma
+        replace['longdesc'] = shortdesc_rma
         replace['outcome'] = 'OK'
         replace['errormsg'] = 'OK'
         replace['operation1'] = gen.operation[p1]("1")
@@ -145,8 +146,8 @@ 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
             replace = patterns.copy()
-            replace['shortdesc'] = 'Correct code using RMA operations'
-            replace['longdesc'] = 'Correct code using RMA operations'
+            replace['shortdesc'] = shortdesc_rma
+            replace['longdesc'] = shortdesc_rma
             replace['outcome'] = 'OK'
             replace['errormsg'] = 'OK'
             replace['operation1'] = gen.operation[p2]("1")
@@ -155,8 +156,8 @@ for e in gen.epoch:
 
             # Generate a correct code by removing operation2
             replace = patterns.copy()
-            replace['shortdesc'] = 'Correct code using RMA operations'
-            replace['longdesc'] = 'Correct code using RMA operations'
+            replace['shortdesc'] = shortdesc_rma
+            replace['longdesc'] = shortdesc_rma
             replace['outcome'] = 'OK'
             replace['errormsg'] = 'OK'
             replace['operation1'] = gen.operation[p1]("1")