X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/dd1018cf4004d465e9c334191671d70c775f8718..cc309f0bc25802386a5f6d8bf2cfc487139ca1e3:/teshsuite/smpi/MBI/P2PLocalConcurrencyGenerator.py?ds=sidebyside diff --git a/teshsuite/smpi/MBI/P2PLocalConcurrencyGenerator.py b/teshsuite/smpi/MBI/P2PLocalConcurrencyGenerator.py index 460a65fa89..29bbe8f196 100755 --- a/teshsuite/smpi/MBI/P2PLocalConcurrencyGenerator.py +++ b/teshsuite/smpi/MBI/P2PLocalConcurrencyGenerator.py @@ -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 //////////////////////// @@ -79,48 +79,48 @@ int main(int argc, char **argv) { """ -for s in send + isend + psend: - for r in irecv + precv + recv: +for s in gen.send + gen.isend + gen.psend: + for r in gen.irecv + gen.precv + gen.recv: patterns = {} patterns = {'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['p2pfeature'] = 'Yes' if s in send else 'Lacking' - patterns['ip2pfeature'] = 'Yes' if r in irecv else 'Lacking' - patterns['persfeature'] = 'Yes' if r in precv else 'Lacking' + patterns['p2pfeature'] = 'Yes' if s in gen.send else 'Lacking' + patterns['ip2pfeature'] = 'Yes' if r in gen.irecv else 'Lacking' + patterns['persfeature'] = 'Yes' if r in gen.precv else 'Lacking' patterns['s'] = s patterns['r'] = r - patterns['init1'] = init[s]("1") - patterns['init2'] = init[r]("2") - patterns['fini1'] = fini[s]("1") - patterns['fini2'] = fini[r]("2") - patterns['start1'] = start[s]("1") - patterns['start2'] = start[r]("2") - patterns['operation1'] = operation[s]("1") - patterns['operation2'] = operation[r]("2") - patterns['write1'] = write[s]("1") - patterns['write2'] = write[r]("2") - patterns['free1'] = free[s]("1") - patterns['free2'] = free[r]("2") + patterns['init1'] = gen.init[s]("1") + patterns['init2'] = gen.init[r]("2") + patterns['fini1'] = gen.fini[s]("1") + patterns['fini2'] = gen.fini[r]("2") + patterns['start1'] = gen.start[s]("1") + patterns['start2'] = gen.start[r]("2") + patterns['operation1'] = gen.operation[s]("1") + patterns['operation2'] = gen.operation[r]("2") + patterns['write1'] = gen.write[s]("1") + patterns['write2'] = gen.write[r]("2") + patterns['free1'] = gen.free[s]("1") + patterns['free2'] = gen.free[r]("2") # Generate a message race - if s in send and r in irecv + precv: + if s in gen.send and r in gen.irecv + gen.precv: replace = patterns 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.' - make_file(template, f'LocalConcurrency_{r}_{s}_nok.c', replace) - if s in isend + psend and r in recv: + 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['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.' - make_file(template, f'LocalConcurrency_{r}_{s}_nok.c', replace) - if s in isend + psend and r in irecv + precv: + 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['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' 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.' - make_file(template, f'LocalConcurrency_{r}_{s}_nok.c', replace) + gen.make_file(template, f'LocalConcurrency_{r}_{s}_nok.c', replace)