X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/97e2219ed6c0e511f6165460cec79afadf42f589..a46b20e2007bf3a1a675ea590511672f051d38da:/teshsuite/smpi/MBI/RMAP2PGlobalConcurrencyGenerator.py diff --git a/teshsuite/smpi/MBI/RMAP2PGlobalConcurrencyGenerator.py b/teshsuite/smpi/MBI/RMAP2PGlobalConcurrencyGenerator.py index b9535e10bc..a6723fac19 100755 --- a/teshsuite/smpi/MBI/RMAP2PGlobalConcurrencyGenerator.py +++ b/teshsuite/smpi/MBI/RMAP2PGlobalConcurrencyGenerator.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 //////////////////////// @@ -41,7 +41,7 @@ int main(int argc, char **argv) { int nprocs = -1; int rank = -1; MPI_Win win; - int * winbuf = malloc(N * sizeof(int)); // Window buffer + int * winbuf = (int *)malloc(N * sizeof(int)); // Window buffer int buff_size = 1; MPI_Init(&argc, &argv); @@ -92,30 +92,30 @@ int main(int argc, char **argv) { """ -for p in put + get: - for s in send + isend: - for r in recv + irecv: - patterns = {} - patterns = {'p': p, '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['rmafeature'] = 'Yes' - patterns['p2pfeature'] = 'Yes' if s in send or r in recv else 'Lacking' - patterns['ip2pfeature'] = 'Yes' if s in isend or r in irecv else 'Lacking' - patterns['p'] = p - patterns['s'] = s - patterns['r'] = r - patterns['init1'] = init[p]("1") - patterns['init2'] = init[s]("2") - patterns['init3'] = init[r]("3") - patterns['fini2'] = fini[s]("2") - patterns['fini3'] = fini[r]("3") - patterns['operation1'] = operation[p]("1") #put or get - patterns['operation2'] = operation[s]("2") #send - patterns['operation3'] = operation[r]("3") #recv - - replace = patterns - replace['shortdesc'] = 'Global Concurrency error.' - replace['longdesc'] = 'Global Concurrency error. Concurrent access of variable winbuf by @{p}@ and @{r}@' - replace['outcome'] = 'ERROR: GlobalConcurrency' - replace['errormsg'] = 'Global Concurrency error. @{p}@ at @{filename}@:@{line:MBIERROR1}@ accesses the window of process 1. Process 1 receives data from process 2 and uses variable winbuf. winbuf in process 1 is then nondeterministic.' - make_file(template, f'GlobalConcurrency_{p}_{s}_{r}_nok.c', replace) +for p in gen.put + gen.get: + for s in gen.send + gen.isend: + for r in gen.recv + gen.irecv: + patterns = {} + patterns = {'p': p, '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['rmafeature'] = 'Yes' + patterns['p2pfeature'] = 'Yes' if s in gen.send or r in gen.recv else 'Lacking' + patterns['ip2pfeature'] = 'Yes' if s in gen.isend or r in gen.irecv else 'Lacking' + patterns['p'] = p + patterns['s'] = s + patterns['r'] = r + patterns['init1'] = gen.init[p]("1") + patterns['init2'] = gen.init[s]("2") + patterns['init3'] = gen.init[r]("3") + patterns['fini2'] = gen.fini[s]("2") + patterns['fini3'] = gen.fini[r]("3") + patterns['operation1'] = gen.operation[p]("1") #put or get + patterns['operation2'] = gen.operation[s]("2") #send + patterns['operation3'] = gen.operation[r]("3") #recv + + 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' + replace['errormsg'] = 'Global Concurrency error. @{p}@ at @{filename}@:@{line:MBIERROR1}@ accesses the window of process 1. Process 1 receives data from process 2 and uses variable winbuf. winbuf in process 1 is then nondeterministic.' + gen.make_file(template, f'GlobalConcurrency_{p}_{s}_{r}_nok.c', replace)