X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/e85fdc5e3b4e74c39e0255980cc7c15c1759c276..5843ccab4e336d47ca34f54e68760ac78d242f36:/teshsuite/smpi/MBI/RMALocalLocalConcurrencyGenerator.py diff --git a/teshsuite/smpi/MBI/RMALocalLocalConcurrencyGenerator.py b/teshsuite/smpi/MBI/RMALocalLocalConcurrencyGenerator.py index faefb85430..a34c0ea41e 100755 --- a/teshsuite/smpi/MBI/RMALocalLocalConcurrencyGenerator.py +++ b/teshsuite/smpi/MBI/RMALocalLocalConcurrencyGenerator.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 //////////////////////// @@ -76,9 +76,9 @@ int main(int argc, char **argv) { """ -for e in epoch: - for p1 in get: - for p2 in put + store + load + get + loadstore: +for e in gen.epoch: + for p1 in gen.get: + for p2 in gen.put + gen.store + gen.load + gen.get + gen.loadstore: 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.' @@ -86,43 +86,44 @@ for e in epoch: patterns['p1'] = p1 patterns['p2'] = p2 patterns['e'] = e - patterns['epoch'] = epoch[e]("1") - patterns['finEpoch'] = finEpoch[e]("1") - patterns['init1'] = init[p1]("1") - patterns['operation1'] = operation[p1]("1") - patterns['operation2'] = operation[p2]("1") + 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['operation2'] = gen.operation[p2]("1") + shortdesc_rma = 'Correct code using RMA operations' # 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' replace['errormsg'] = 'Local Concurrency error. @{p2}@ at @{filename}@:@{line:MBIERROR2}@ conflicts with @{p1}@ line @{line:MBIERROR1}@' - make_file(template, f'LocalConcurrency_lloutwindow_{e}_{p1}_{p2}_nok.c', replace) + 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 store + load + loadstore: - replace = patterns - replace['shortdesc'] = 'Correct code using RMA operations' - replace['longdesc'] = 'Correct code using RMA operations' + if p2 in gen.store + gen.load + gen.loadstore: + replace = patterns.copy() + replace['shortdesc'] = shortdesc_rma + replace['longdesc'] = shortdesc_rma replace['outcome'] = 'OK' replace['errormsg'] = 'OK' - replace['operation1'] = operation[p2]("1") - replace['operation2'] = operation[p1]("1") - make_file(template, f'LocalConcurrency_lloutwindow_{e}_{p2}_{p1}_ok.c', replace) + replace['operation1'] = gen.operation[p2]("1") + 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['shortdesc'] = 'Correct code using RMA operations' - replace['longdesc'] = 'Correct code using RMA operations' + replace = patterns.copy() + replace['shortdesc'] = shortdesc_rma + replace['longdesc'] = shortdesc_rma replace['outcome'] = 'OK' replace['errormsg'] = 'OK' - replace['operation1'] = operation[p1]("1") + replace['operation1'] = gen.operation[p1]("1") replace['operation2'] = '' - make_file(template, f'LocalConcurrency_{e}_{p1}_ok.c', replace) + gen.make_file(template, f'LocalConcurrency_{e}_{p1}_ok.c', replace) -for e in epoch: - for p1 in put: - for p2 in store: +for e in gen.epoch: + for p1 in gen.put: + for p2 in gen.store: 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.' @@ -130,35 +131,35 @@ for e in epoch: patterns['p1'] = p1 patterns['p2'] = p2 patterns['e'] = e - patterns['epoch'] = epoch[e]("1") - patterns['finEpoch'] = finEpoch[e]("1") - patterns['init1'] = init[p1]("1") - patterns['operation1'] = operation[p1]("1") - patterns['operation2'] = operation[p2]("1") + 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['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}@' - make_file(template, f'LocalConcurrency_lloutwindow_{e}_{p1}_{p2}_nok.c', replace) + 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['shortdesc'] = 'Correct code using RMA operations' - replace['longdesc'] = 'Correct code using RMA operations' + replace = patterns.copy() + replace['shortdesc'] = shortdesc_rma + replace['longdesc'] = shortdesc_rma replace['outcome'] = 'OK' replace['errormsg'] = 'OK' - replace['operation1'] = operation[p2]("1") - replace['operation2'] = operation[p1]("1") - make_file(template, f'LocalConcurrency_lloutwindow_{e}_{p2}_{p1}_ok.c', replace) + replace['operation1'] = gen.operation[p2]("1") + 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['shortdesc'] = 'Correct code using RMA operations' - replace['longdesc'] = 'Correct code using RMA operations' + replace = patterns.copy() + replace['shortdesc'] = shortdesc_rma + replace['longdesc'] = shortdesc_rma replace['outcome'] = 'OK' replace['errormsg'] = 'OK' - replace['operation1'] = operation[p1]("1") + replace['operation1'] = gen.operation[p1]("1") replace['operation2'] = '' - make_file(template, f'LocalConcurrency_{e}_{p1}_ok.c', replace) + gen.make_file(template, f'LocalConcurrency_{e}_{p1}_ok.c', replace)