X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/e85fdc5e3b4e74c39e0255980cc7c15c1759c276..cc309f0bc25802386a5f6d8bf2cfc487139ca1e3:/teshsuite/smpi/MBI/CollComGenerator.py diff --git a/teshsuite/smpi/MBI/CollComGenerator.py b/teshsuite/smpi/MBI/CollComGenerator.py index a01dbe5bad..707e9f3122 100755 --- a/teshsuite/smpi/MBI/CollComGenerator.py +++ b/teshsuite/smpi/MBI/CollComGenerator.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 //////////////////////// @@ -75,18 +75,18 @@ int main(int argc, char **argv) { # Generate code with one collective -for c in coll + icoll + ibarrier: +for c in gen.coll + gen.icoll + gen.ibarrier: patterns = {} patterns = {'c': c} patterns['generatedby'] = f'DO NOT EDIT: this file was generated by {os.path.basename(sys.argv[0])}. DO NOT EDIT.' - patterns['collfeature'] = 'Yes' if c in coll else 'Lacking' - patterns['icollfeature'] = 'Yes' if c in icoll + ibarrier else 'Lacking' + patterns['collfeature'] = 'Yes' if c in gen.coll else 'Lacking' + patterns['icollfeature'] = 'Yes' if c in gen.icoll + gen.ibarrier else 'Lacking' patterns['c'] = c - patterns['init'] = init[c]("1") - patterns['start'] = start[c]("1") - patterns['fini'] = fini[c]("1") - patterns['free'] = free[c]("1") - patterns['operation'] = operation[c]("1") + patterns['init'] = gen.init[c]("1") + patterns['start'] = gen.start[c]("1") + patterns['fini'] = gen.fini[c]("1") + patterns['free'] = gen.free[c]("1") + patterns['operation'] = gen.operation[c]("1") # Generate the correct code => to remove? replace = patterns @@ -95,7 +95,7 @@ for c in coll + icoll + ibarrier: replace['outcome'] = 'OK' replace['errormsg'] = '' replace['change_com'] = '/* No error injected here */' - make_file(template, f'ParamMatching_Com_{c}_ok.c', replace) + gen.make_file(template, f'ParamMatching_Com_{c}_ok.c', replace) # Generate the incorrect communicator matching replace = patterns @@ -104,7 +104,7 @@ for c in coll + icoll + ibarrier: replace['outcome'] = 'ERROR: CommunicatorMatching' replace['errormsg'] = 'Communicator mistmatch in collectives. @{c}@ at @{filename}@:@{line:MBIERROR}@ has newcom or MPI_COMM_WORLD as a communicator.' replace['change_com'] = 'if (rank % 2)\n newcom = MPI_COMM_WORLD; /* MBIERROR */' - make_file(template, f'ParamMatching_Com_{c}_nok.c', replace) + gen.make_file(template, f'ParamMatching_Com_{c}_nok.c', replace) # Generate the coll with newcom=MPI_COMM_NULL replace = patterns @@ -113,4 +113,4 @@ for c in coll + icoll + ibarrier: replace['outcome'] = 'ERROR: InvalidCommunicator' replace['errormsg'] = 'Invalid communicator. @{c}@ at @{filename}@:@{line:MBIERROR}@ has MPI_COMM_NULL as a communicator.' replace['change_com'] = 'newcom = MPI_COMM_NULL; /* MBIERROR */' - make_file(template, f'InvalidParam_ComNull_{c}_nok.c', replace) + gen.make_file(template, f'InvalidParam_ComNull_{c}_nok.c', replace)