4 import generator_utils as gen
6 template = """// @{generatedby}@
7 /* ///////////////////////// The MPI Bugs Initiative ////////////////////////
11 Description: @{shortdesc}@
14 Version of MPI: Conforms to MPI 3, requires MPI 3 implementation
18 P2P!nonblocking: Lacking
19 P2P!persistent: Lacking
21 COLL!nonblocking: @{icollfeature}@
22 COLL!persistent: @{pcollfeature}@
32 ////////////////////// End of MBI headers /////////////////// */
40 int main(int argc, char **argv) {
45 MPI_Init(&argc, &argv);
46 MPI_Comm_size(MPI_COMM_WORLD, &nprocs);
47 MPI_Comm_rank(MPI_COMM_WORLD, &rank);
48 printf("Hello from rank %d \\n", rank);
51 printf("MBI ERROR: This test needs at least 2 processes to produce a bug!\\n");
53 int dbs = sizeof(int)*nprocs; /* Size of the dynamic buffers for alltoall and friends */
55 MPI_Comm newcom = MPI_COMM_WORLD;
56 MPI_Datatype type = MPI_INT;
61 @{write}@ /* MBIERROR */
66 printf("Rank %d finished normally\\n", rank);
71 for c in gen.icoll + gen.pcoll:
74 patterns['generatedby'] = f'DO NOT EDIT: this file was generated by {os.path.basename(sys.argv[0])}. DO NOT EDIT.'
75 patterns['icollfeature'] = 'Yes' if c in gen.icoll else 'Lacking'
76 patterns['pcollfeature'] = 'Yes' if c in gen.pcoll else 'Lacking'
78 patterns['init'] = gen.init[c]("1")
79 patterns['start'] = gen.start[c]("1")
80 patterns['fini'] = gen.fini[c]("1")
81 patterns['operation'] = gen.operation[c]("1")
82 patterns['write'] = gen.write[c]("1")
83 patterns['free'] = gen.free[c]("1")
85 replace = patterns.copy()
86 replace['shortdesc'] = 'Local concurrency with a collective'
87 replace['longdesc'] = f'The buffer in {c} is modified before the call has been completed.'
88 replace['outcome'] = 'ERROR: LocalConcurrency'
89 replace['errormsg'] = 'Local Concurrency with a collective. The buffer in @{c}@ is modified at @{filename}@:@{line:MBIERROR}@ whereas there is no guarantee the call has been completed.'
90 gen.make_file(template, f'LocalConcurrency_{c}_nok.c', replace)