Description: @{shortdesc}@
@{longdesc}@
- Version of MPI: Conforms to MPI 1.1, does not require MPI 2 implementation
+ Version of MPI: Conforms to MPI 1.1, does not require MPI 2 implementation
BEGIN_MPI_FEATURES
- P2P!basic: Lacking
- P2P!nonblocking: Lacking
- P2P!persistent: Lacking
- COLL!basic: @{collfeature}@
- COLL!nonblocking: @{icollfeature}@
- COLL!persistent: Lacking
- COLL!tools: @{toolfeature}@
- RMA: Lacking
+ P2P!basic: Lacking
+ P2P!nonblocking: Lacking
+ P2P!persistent: Lacking
+ COLL!basic: @{collfeature}@
+ COLL!nonblocking: @{icollfeature}@
+ COLL!persistent: Lacking
+ COLL!tools: @{toolfeature}@
+ RMA: Lacking
END_MPI_FEATURES
BEGIN_MBI_TESTS
int main(int argc, char **argv) {
int nprocs = -1;
int rank = -1;
- int root = 0;
- int size = 1, j=0, color=0;
+ int root = 0;
+ int size = 1, j=0, color=0;
MPI_Init(&argc, &argv);
MPI_Comm_size(MPI_COMM_WORLD, &nprocs);
if (nprocs < 2)
printf("MBI ERROR: This test needs at least 2 processes to produce a bug!\\n");
- MPI_Comm newcom = MPI_COMM_WORLD;
- MPI_Op op = MPI_SUM;
- MPI_Datatype type = MPI_INT;
+ MPI_Comm newcom = MPI_COMM_WORLD;
+ MPI_Op op = MPI_SUM;
+ MPI_Datatype type = MPI_INT;
- int dbs = sizeof(int)*nprocs; /* Size of the dynamic buffers for alltoall and friends */
+ int dbs = sizeof(int)*nprocs; /* Size of the dynamic buffers for alltoall and friends */
@{init}@
@{start}@
@{change_arg}@
- @{operation}@ /* MBIERROR2 */
- @{fini}@
- @{free}@
+ @{operation}@ /* MBIERROR2 */
+ @{fini}@
+ @{free}@
MPI_Finalize();
printf("Rank %d finished normally\\n", rank);
# Generate code with color mismatch in MPI_Comm_split
#####################################################
-for c in tcoll4color:
+for c in tcoll4color:
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['operation'] = operation[c]("1")
patterns['fini'] = fini[c]("1")
patterns['free'] = free[c]("1")
- patterns['change_arg'] = ''
+ patterns['change_arg'] = ''
# Generate the code with invalid color
replace = patterns
patterns['fini'] = fini[c]("1")
patterns['free'] = free[c]("1")
patterns['operation'] = operation[c]("1")
- patterns['change_arg'] = ''
+ patterns['change_arg'] = ''
# Generate an incorrect root matching (root mismatch)
replace = patterns
- replace['shortdesc'] = 'Collective @{c}@ with a root mismatch'
- replace['longdesc'] = f'Odd ranks use 0 as a root while even ranks use 1 as a root'
- replace['outcome'] = 'ERROR: RootMatching'
- replace['errormsg'] = 'Collective root mistmatch. @{c}@ at @{filename}@:@{line:MBIERROR2}@ has 0 or 1 as a root.'
- replace['change_arg'] = 'if (rank % 2)\n root = 1; /* MBIERROR1 */'
+ replace['shortdesc'] = 'Collective @{c}@ with a root mismatch'
+ replace['longdesc'] = f'Odd ranks use 0 as a root while even ranks use 1 as a root'
+ replace['outcome'] = 'ERROR: RootMatching'
+ replace['errormsg'] = 'Collective root mistmatch. @{c}@ at @{filename}@:@{line:MBIERROR2}@ has 0 or 1 as a root.'
+ replace['change_arg'] = 'if (rank % 2)\n root = 1; /* MBIERROR1 */'
make_file(template, f'ParamMatching_Root_{c}_nok.c', replace)
# Generate the call with root=-1 (invalid root)
replace['change_arg'] = 'root = -1; /* MBIERROR1 */'
make_file(template, f'InvalidParam_RootNeg_{c}_nok.c', replace)
- # Generate the call with root=2 (root not in communicator)
+ # Generate the call with root=2 (root not in communicator)
replace = patterns
replace['shortdesc'] = f'Collective {c} with root out of the communicator'
replace['longdesc'] = f'Collective {c} with root = 2 (there is only 2 ranks)'
replace['outcome'] = 'ERROR: InvalidRoot'
- replace['errormsg'] = 'Invalid collective root. @{c}@ at @{filename}@:@{line:MBIERROR2}@ has 2 as a root while communicator MPI_COMM_WORLD requires ranks in range 0 to 1.'
+ replace['errormsg'] = 'Invalid collective root. @{c}@ at @{filename}@:@{line:MBIERROR2}@ has 2 as a root while communicator MPI_COMM_WORLD requires ranks in range 0 to 1.'
replace['change_arg'] = 'root = nprocs; /* MBIERROR1 */'
make_file(template, f'InvalidParam_RootTooLarge_{c}_nok.c', replace)
# Generate code with type mismatch
##################################
-for c in coll + icoll:
+for c in coll + icoll:
if c != 'MPI_Barrier': # Barrier has no Data to mismatch or to nullify
patterns = {}
patterns = {'c': c}
patterns['fini'] = fini[c]("1")
patterns['operation'] = operation[c]("1")
patterns['free'] = free[c]("1")
- patterns['change_arg'] = ''
+ patterns['change_arg'] = ''
# Generate the incorrect matching (datatype Mmismatch)
replace = patterns
# Generate the call with null type (invalid datatype)
replace = patterns
replace['shortdesc'] = 'Collective @{c}@ with an invalid datatype '
- replace['longdesc'] = 'Collective @{c}@ with an invalid datatype '
+ replace['longdesc'] = 'Collective @{c}@ with an invalid datatype '
replace['outcome'] = 'ERROR: InvalidDatatype'
replace['errormsg'] = 'Invalid Datatype. @{c}@ at @{filename}@:@{line:MBIERROR2}@ has an invalid datatype.'
replace['change_arg'] = 'type=MPI_DATATYPE_NULL; /* MBIERROR1 */'
# Generate code with Op mismatch
##################################
-for c in coll4op + icoll4op:
+for c in coll4op + icoll4op:
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['fini'] = fini[c]("1")
patterns['operation'] = operation[c]("1")
patterns['free'] = free[c]("1")
- patterns['change_arg'] = ''
+ patterns['change_arg'] = ''
# Generate the incorrect matching (op mismatch)
replace = patterns
# Generate the call with Op=MPI_OP_NULL (invalid op)
replace = patterns
replace['shortdesc'] = 'Collective @{c}@ with an invalid operator '
- replace['longdesc'] = 'Collective @{c}@ with an invalid operator '
+ replace['longdesc'] = 'Collective @{c}@ with an invalid operator '
replace['outcome'] = 'ERROR: InvalidOperator'
replace['errormsg'] = 'Invalid Operator. @{c}@ at @{filename}@:@{line:MBIERROR2}@ has MPI_OP_NULL as an operator.'
replace['change_arg'] = 'op = MPI_OP_NULL; /* MBIERROR1 */'
Description: @{shortdesc}@
@{longdesc}@
- Version of MPI: Conforms to MPI 1.1, does not require MPI 2 implementation
+ Version of MPI: Conforms to MPI 1.1, does not require MPI 2 implementation
BEGIN_MPI_FEATURES
- P2P!basic: Lacking
- P2P!nonblocking: Lacking
- P2P!persistent: Lacking
- COLL!basic: @{collfeature}@
- COLL!nonblocking: @{icollfeature}@
- COLL!persistent: Lacking
- COLL!tools: Yes
- RMA: Lacking
+ P2P!basic: Lacking
+ P2P!nonblocking: Lacking
+ P2P!persistent: Lacking
+ COLL!basic: @{collfeature}@
+ COLL!nonblocking: @{icollfeature}@
+ COLL!persistent: Lacking
+ COLL!tools: Yes
+ RMA: Lacking
END_MPI_FEATURES
BEGIN_MBI_TESTS
int main(int argc, char **argv) {
int nprocs = -1;
int rank = -1;
- int root = 0;
+ int root = 0;
MPI_Init(&argc, &argv);
MPI_Comm_size(MPI_COMM_WORLD, &nprocs);
if (nprocs < 2)
printf("MBI ERROR: This test needs at least 2 processes to produce a bug!\\n");
-
+
MPI_Op op = MPI_SUM;
MPI_Datatype type = MPI_INT;
- MPI_Comm newcom;
+ MPI_Comm newcom;
MPI_Comm_split(MPI_COMM_WORLD, 0, nprocs - rank, &newcom);
@{change_com}@
- int dbs = sizeof(int)*nprocs; /* Size of the dynamic buffers for alltoall and friends */
+ int dbs = sizeof(int)*nprocs; /* Size of the dynamic buffers for alltoall and friends */
@{init}@
@{start}@
- @{operation}@ /* MBIERROR */
- @{fini}@
- @{free}@
+ @{operation}@ /* MBIERROR */
+ @{fini}@
+ @{free}@
- if(newcom != MPI_COMM_NULL && newcom != MPI_COMM_WORLD)
- MPI_Comm_free(&newcom);
+ if(newcom != MPI_COMM_NULL && newcom != MPI_COMM_WORLD)
+ MPI_Comm_free(&newcom);
MPI_Finalize();
printf("Rank %d finished normally\\n", rank);
# Generate the coll with newcom=MPI_COMM_NULL
replace = patterns
- replace['shortdesc'] = f'Collective @{c}@ with newcom=MPI_COMM_NULL'
+ replace['shortdesc'] = f'Collective @{c}@ with newcom=MPI_COMM_NULL'
replace['longdesc'] = f'Collective @{c}@ with newcom=MPI_COMM_NULL'
replace['outcome'] = 'ERROR: InvalidCommunicator'
replace['errormsg'] = 'Invalid communicator. @{c}@ at @{filename}@:@{line:MBIERROR}@ has MPI_COMM_NULL as a communicator.'
Description: @{shortdesc}@
@{longdesc}@
- Version of MPI: Conforms to MPI 3, requires MPI 3 implementation
+ Version of MPI: Conforms to MPI 3, requires MPI 3 implementation
BEGIN_MPI_FEATURES
- P2P!basic: Lacking
- P2P!nonblocking: Lacking
- P2P!persistent: Lacking
- COLL!basic: Lacking
- COLL!nonblocking: @{icollfeature}@
- COLL!persistent: @{pcollfeature}@
- COLL!tools: Lacking
- RMA: Lacking
+ P2P!basic: Lacking
+ P2P!nonblocking: Lacking
+ P2P!persistent: Lacking
+ COLL!basic: Lacking
+ COLL!nonblocking: @{icollfeature}@
+ COLL!persistent: @{pcollfeature}@
+ COLL!tools: Lacking
+ RMA: Lacking
END_MPI_FEATURES
BEGIN_MBI_TESTS
int main(int argc, char **argv) {
int nprocs = -1;
int rank = -1;
- int root = 0;
+ int root = 0;
MPI_Init(&argc, &argv);
MPI_Comm_size(MPI_COMM_WORLD, &nprocs);
int dbs = sizeof(int)*nprocs; /* Size of the dynamic buffers for alltoall and friends */
MPI_Op op = MPI_SUM;
- MPI_Comm newcom = MPI_COMM_WORLD;
- MPI_Datatype type = MPI_INT;
+ MPI_Comm newcom = MPI_COMM_WORLD;
+ MPI_Datatype type = MPI_INT;
@{init}@
@{start}@
- @{operation}@
- @{write}@ /* MBIERROR */
- @{fini}@
- @{free}@
+ @{operation}@
+ @{write}@ /* MBIERROR */
+ @{fini}@
+ @{free}@
MPI_Finalize();
printf("Rank %d finished normally\\n", rank);
for c in icoll + pcoll:
patterns = {}
- patterns = {'c': c}
+ patterns = {'c': c}
patterns['generatedby'] = f'DO NOT EDIT: this file was generated by {os.path.basename(sys.argv[0])}. DO NOT EDIT.'
patterns['icollfeature'] = 'Yes' if c in icoll else 'Lacking'
patterns['pcollfeature'] = 'Yes' if c in pcoll else 'Lacking'
patterns['write'] = write[c]("1")
patterns['free'] = free[c]("1")
- replace = patterns
+ replace = patterns
replace['shortdesc'] = 'Local concurrency with a collective'
replace['longdesc'] = f'The buffer in {c} is modified before the call has been completed.'
- replace['outcome'] = 'ERROR: LocalConcurrency'
+ replace['outcome'] = 'ERROR: LocalConcurrency'
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.'
make_file(template, f'LocalConcurrency_{c}_nok.c', replace)
Description: @{shortdesc}@
@{longdesc}@
- Version of MPI: Conforms to MPI 1.1, does not require MPI 2 implementation
+ Version of MPI: Conforms to MPI 1.1, does not require MPI 2 implementation
BEGIN_MPI_FEATURES
- P2P!basic: Lacking
- P2P!nonblocking: Lacking
- P2P!persistent: Lacking
- COLL!basic: @{collfeature}@
- COLL!nonblocking: @{icollfeature}@
- COLL!persistent: Lacking
- COLL!tools: Lacking
- RMA: Lacking
+ P2P!basic: Lacking
+ P2P!nonblocking: Lacking
+ P2P!persistent: Lacking
+ COLL!basic: @{collfeature}@
+ COLL!nonblocking: @{icollfeature}@
+ COLL!persistent: Lacking
+ COLL!tools: Lacking
+ RMA: Lacking
END_MPI_FEATURES
BEGIN_MBI_TESTS
int main(int argc, char **argv) {
int nprocs = -1;
int rank = -1;
- int root = 0;
+ int root = 0;
MPI_Init(&argc, &argv);
MPI_Comm_size(MPI_COMM_WORLD, &nprocs);
if (nprocs < 2)
printf("MBI ERROR: This test needs at least 2 processes to produce a bug.\\n");
- MPI_Comm newcom = MPI_COMM_WORLD;
- MPI_Datatype type = MPI_INT;
+ MPI_Comm newcom = MPI_COMM_WORLD;
+ MPI_Datatype type = MPI_INT;
MPI_Op op = MPI_SUM;
int dbs = sizeof(int)*nprocs; /* Size of the dynamic buffers for alltoall and friends */
if (@{change_cond}@) {
@{operation1a}@ /* MBIERROR1 */
- @{fini1a}@
+ @{fini1a}@
@{operation2a}@
- @{fini2a}@
+ @{fini2a}@
} else {
@{operation1b}@ /* MBIERROR2 */
- @{fini1b}@
+ @{fini1b}@
@{operation2b}@
- @{fini2b}@
+ @{fini2b}@
}
@{free1}@
@{free2}@
-
+
MPI_Finalize();
printf("Rank %d finished normally\\n", rank);
return 0;
replace['fini2a'] = fini[c2]("2")
replace['fini1b'] = fini[c2]("2") # Inversion
replace['fini2b'] = fini[c1]("1")
- replace['free1'] = free[c2]("2")
+ replace['free1'] = free[c2]("2")
replace['free2'] = free[c1]("1")
make_file(template, f'CallOrdering_{c1}_{c2}_nok.c', replace)
Description: @{shortdesc}@
@{longdesc}@
- Version of MPI: Conforms to MPI 1.1, does not require MPI 2 implementation
+ Version of MPI: Conforms to MPI 1.1, does not require MPI 2 implementation
BEGIN_MPI_FEATURES
- P2P!basic: @{p2pfeature}@
- P2P!nonblocking: @{ip2pfeature}@
- P2P!persistent: Lacking
- COLL!basic: @{collfeature}@
- COLL!nonblocking: Lacking
- COLL!persistent: Lacking
- COLL!tools: Lacking
- RMA: Lacking
+ P2P!basic: @{p2pfeature}@
+ P2P!nonblocking: @{ip2pfeature}@
+ P2P!persistent: Lacking
+ COLL!basic: @{collfeature}@
+ COLL!nonblocking: Lacking
+ COLL!persistent: Lacking
+ COLL!tools: Lacking
+ RMA: Lacking
END_MPI_FEATURES
BEGIN_MBI_TESTS
int rank = -1;
int dest, src;
int root = 0;
- int stag = 0, rtag = 0;
- int buff_size = 1;
+ int stag = 0, rtag = 0;
+ int buff_size = 1;
MPI_Init(&argc, &argv);
MPI_Comm_size(MPI_COMM_WORLD, &nprocs);
printf("MBI ERROR: This test needs at least 2 processes to produce a bug!\\n");
int dbs = sizeof(int)*nprocs; /* Size of the dynamic buffers for alltoall and friends */
- MPI_Comm newcom = MPI_COMM_WORLD;
- MPI_Datatype type = MPI_INT;
- MPI_Op op = MPI_SUM;
+ MPI_Comm newcom = MPI_COMM_WORLD;
+ MPI_Datatype type = MPI_INT;
+ MPI_Op op = MPI_SUM;
@{init1}@
@{init2}@
@{init3}@
- if (rank == 0) {
- dest=1;src=1;
- @{operation3}@ /* MBIERROR1 */
- @{fini3}@
- @{operation1}@
- @{fini1}@
- }else if (rank==1) {
- dest=0;src=0;
- @{operation2}@ /* MBIERROR2 */
- @{fini2}@
- @{operation3}@
- @{fini3}@
- }
-
- @{free1}@
- @{free2}@
- @{free3}@
-
- MPI_Finalize();
+ if (rank == 0) {
+ dest=1;src=1;
+ @{operation3}@ /* MBIERROR1 */
+ @{fini3}@
+ @{operation1}@
+ @{fini1}@
+ }else if (rank==1) {
+ dest=0;src=0;
+ @{operation2}@ /* MBIERROR2 */
+ @{fini2}@
+ @{operation3}@
+ @{fini3}@
+ }
+
+ @{free1}@
+ @{free2}@
+ @{free3}@
+
+ MPI_Finalize();
printf("Rank %d finished normally\\n", rank);
return 0;
}
patterns['operation3'] = operation[c]("3")
# Generate the incorrect matching because of the conditional
- replace = patterns
+ replace = patterns
replace['shortdesc'] = 'Point to point & collective mismatch'
- replace['longdesc'] = 'Point to point @{r}@ is matched with @{c}@ which causes a deadlock.'
- replace['outcome'] = 'ERROR: CallMatching'
+ replace['longdesc'] = 'Point to point @{r}@ is matched with @{c}@ which causes a deadlock.'
+ replace['outcome'] = 'ERROR: CallMatching'
replace['errormsg'] = 'P2P & Collective mistmatch. @{r}@ at @{filename}@:@{line:MBIERROR2}@ is matched with @{c}@ at @{filename}@:@{line:MBIERROR1}@ wich causes a deadlock.'
make_file(template, f'CallOrdering_{r}_{s}_{c}_nok.c', replace)
# Generate the incorrect code depending on buffering
- # replace = patterns
+ # replace = patterns
# replace['shortdesc'] = 'Point to point & collective mismatch'
- # replace['longdesc'] = 'Point to point @{s}@ is matched with @{c}@ which causes a deadlock depending on the buffering mode.'
- # replace['outcome'] = 'ERROR: BufferingHazard'
+ # replace['longdesc'] = 'Point to point @{s}@ is matched with @{c}@ which causes a deadlock depending on the buffering mode.'
+ # replace['outcome'] = 'ERROR: BufferingHazard'
# replace['errormsg'] = 'P2P & Collective mistmatch. @{s}@ at @{filename}@:@{line:MBIERROR2}@ is matched with @{c}@ at @{filename}@:@{line:MBIERROR1}@ wich causes a deadlock.'
- # replace['init1'] = init[s]("1")
- # replace['init2'] = init[r]("2")
+ # replace['init1'] = init[s]("1")
+ # replace['init2'] = init[r]("2")
# replace['operation1'] = operation[r]("2")
# replace['operation2'] = operation[s]("1")
- # replace['fini1'] = fini[r]("2")
- # replace['fini2'] = fini[s]("1")
+ # replace['fini1'] = fini[r]("2")
+ # replace['fini2'] = fini[s]("1")
# make_file(template, f'CollP2PBuffering_{r}_{s}_{c}_nok.c', replace)
Description: @{shortdesc}@
@{longdesc}@
- Version of MPI: Conforms to MPI 1.1, does not require MPI 2 implementation
+ Version of MPI: Conforms to MPI 1.1, does not require MPI 2 implementation
BEGIN_MPI_FEATURES
- P2P!basic: @{p2pfeature}@
- P2P!nonblocking: @{ip2pfeature}@
- P2P!persistent: Lacking
- COLL!basic: @{collfeature}@
- COLL!nonblocking: Lacking
- COLL!persistent: Lacking
- COLL!tools: Lacking
- RMA: Lacking
+ P2P!basic: @{p2pfeature}@
+ P2P!nonblocking: @{ip2pfeature}@
+ P2P!persistent: Lacking
+ COLL!basic: @{collfeature}@
+ COLL!nonblocking: Lacking
+ COLL!persistent: Lacking
+ COLL!tools: Lacking
+ RMA: Lacking
END_MPI_FEATURES
BEGIN_MBI_TESTS
int nprocs = -1;
int rank = -1;
int dest, src;
- int i=0;
+ int i=0;
int root = 0;
- int stag = 0, rtag = 0;
- int buff_size = 1;
+ int stag = 0, rtag = 0;
+ int buff_size = 1;
MPI_Init(&argc, &argv);
MPI_Comm_size(MPI_COMM_WORLD, &nprocs);
printf("MBI ERROR: This test needs 4 processes to produce a bug!\\n");
int dbs = sizeof(int)*nprocs; /* Size of the dynamic buffers for alltoall and friends */
- MPI_Comm newcom = MPI_COMM_WORLD;
- MPI_Datatype type = MPI_INT;
- MPI_Op op = MPI_SUM;
+ MPI_Comm newcom = MPI_COMM_WORLD;
+ MPI_Datatype type = MPI_INT;
+ MPI_Op op = MPI_SUM;
@{init2}@
@{init3}@
@{init4}@
- if (rank == 0) {
- dest=1;
- @{operation1}@
- @{fini1}@
- @{operation2}@
- @{fini2}@
- }else if (rank==2) {
- dest=1;
- @{operation1}@
- @{fini1}@
- @{operation2}@
- @{fini2}@
- }else if (rank==1) {
- src = MPI_ANY_SOURCE;
- rtag = MPI_ANY_TAG;
- @{operation3}@ /* MBIERROR1 */
- @{operation1}@
- @{fini1}@
- @{operation4}@ /* MBIERROR2 */
- @{fini3}@
- @{fini4}@
- }else if (rank==3) {
- @{operation1}@
- @{fini1}@
- }
-
- @{free1}@
- @{free2}@
- @{free3}@
- @{free4}@
-
- MPI_Finalize();
+ if (rank == 0) {
+ dest=1;
+ @{operation1}@
+ @{fini1}@
+ @{operation2}@
+ @{fini2}@
+ }else if (rank==2) {
+ dest=1;
+ @{operation1}@
+ @{fini1}@
+ @{operation2}@
+ @{fini2}@
+ }else if (rank==1) {
+ src = MPI_ANY_SOURCE;
+ rtag = MPI_ANY_TAG;
+ @{operation3}@ /* MBIERROR1 */
+ @{operation1}@
+ @{fini1}@
+ @{operation4}@ /* MBIERROR2 */
+ @{fini3}@
+ @{fini4}@
+ }else if (rank==3) {
+ @{operation1}@
+ @{fini1}@
+ }
+
+ @{free1}@
+ @{free2}@
+ @{free3}@
+ @{free4}@
+
+ MPI_Finalize();
printf("Rank %d finished normally\\n", rank);
return 0;
}
patterns['operation4'] = operation[r]("4")
# Generate the incorrect matching because of the conditional
- replace = patterns
+ replace = patterns
replace['shortdesc'] = 'Message race'
replace['longdesc'] = 'Message race in @{r}@ with @{c}@.'
- replace['outcome'] = 'ERROR: MessageRace'
+ replace['outcome'] = 'ERROR: MessageRace'
replace['errormsg'] = 'Message race. The use of wildcard receive calls (@{r}@ at @{filename}@:@{line:MBIERROR1}@ and @{r}@ at @{filename}@:@{line:MBIERROR2}@) leads to nondeterministic matching.'
make_file(template, f'MessageRace_{c}_{s}_{r}_nok.c', replace)
Description: @{shortdesc}@
@{longdesc}@
- Version of MPI: Conforms to MPI 1.1, does not require MPI 2 implementation
+ Version of MPI: Conforms to MPI 1.1, does not require MPI 2 implementation
BEGIN_MPI_FEATURES
- P2P!basic: Lacking
- P2P!nonblocking: Lacking
- P2P!persistent: Lacking
- COLL!basic: Lacking
- COLL!nonblocking: Lacking
- COLL!persistent: Lacking
- COLL!tools: @{toolfeature}@
- RMA: Lacking
+ P2P!basic: Lacking
+ P2P!nonblocking: Lacking
+ P2P!persistent: Lacking
+ COLL!basic: Lacking
+ COLL!nonblocking: Lacking
+ COLL!persistent: Lacking
+ COLL!tools: @{toolfeature}@
+ RMA: Lacking
END_MPI_FEATURES
BEGIN_MBI_TESTS
if (nprocs < 2)
printf("MBI ERROR: This test needs at least 2 processes to produce a bug!\\n");
- MPI_Comm newcom;
+ MPI_Comm newcom;
int dims[2], periods[2], coords[2];
int source, dest;
dims[0] = 2;
dims[1] = 1;
periods[0] = 1;
periods[1] = 1;
-
+
@{change_dims}@
MPI_Cart_create(MPI_COMM_WORLD, 2, dims, periods, 0, &newcom); /* create a cartesian communicator */
@{init}@
@{operation}@ /* MBIERROR2 */
- @{fini}@
-
+ @{fini}@
+
if (newcom != MPI_COMM_NULL)
MPI_Comm_free(&newcom);
}
"""
-for c in tcoll4topo:
+for c in tcoll4topo:
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['fini'] = fini[c]("1")
patterns['operation'] = operation[c]("1")
- # Generate the correct code
+ # Generate the correct code
replace = patterns
replace['shortdesc'] = 'Function @{c}@ with correct arguments'
replace['longdesc'] = f'All ranks in comm call {c} with correct arguments'
# Generate the code with newcom=MPI_COMM_NULL
replace = patterns
- replace['shortdesc'] = 'Function @{c}@ called with comm=MPI_COMM_NULL'
+ replace['shortdesc'] = 'Function @{c}@ called with comm=MPI_COMM_NULL'
replace['longdesc'] = 'Function @{c}@ called with comm=MPI_COMM_NULL'
replace['outcome'] = 'ERROR: InvalidCommunicator'
replace['errormsg'] = 'Invalid communicator. @{c}@ at @{filename}@:@{line:MBIERROR2}@ has MPI_COMM_NULL as a communicator.'
# Generate the code with invalid dimension
replace = patterns
- replace['shortdesc'] = 'Creates a cartesian communicator with a negative entry in the dims attribute'
+ replace['shortdesc'] = 'Creates a cartesian communicator with a negative entry in the dims attribute'
replace['longdesc'] = 'Creates a cartesian communicator with a negative entry in the dims attribute, which is a usage error'
replace['outcome'] = 'ERROR: InvalidOtherArg'
replace['errormsg'] = 'Invalid Argument. MPI_Cart_create has invalid dimensions.'
- replace['change_com'] = ""
+ replace['change_com'] = ""
replace['change_dims'] = 'dims[0] = -2; dims[1] = -1; /* MBIERROR1 */'
make_file(template, f'InvalidParam_Dim_MPI_Cart_create_nok.c', replace)
#! /usr/bin/env python3
-# Copyright 2021-2022. The SimGrid Team. All rights reserved.
+# Copyright 2021-2022. The SimGrid Team. All rights reserved.
# This program is free software; you can redistribute it and/or modify it
# under the terms of the license (GNU LGPL) which comes with this package.
-# Copyright 2021-2022. The MBI project. All rights reserved.
+# Copyright 2021-2022. The MBI project. All rights reserved.
# This program is free software; you can redistribute it and/or modify it under the terms of the license (GNU GPL).
import os
possible_details = {
# scope limited to one call
'InvalidBuffer':'AInvalidParam', 'InvalidCommunicator':'AInvalidParam', 'InvalidDatatype':'AInvalidParam', 'InvalidRoot':'AInvalidParam', 'InvalidTag':'AInvalidParam', 'InvalidWindow':'AInvalidParam', 'InvalidOperator':'AInvalidParam', 'InvalidOtherArg':'AInvalidParam', 'ActualDatatype':'AInvalidParam',
- 'InvalidSrcDest':'AInvalidParam',
+ 'InvalidSrcDest':'AInvalidParam',
# scope: Process-wide
-# 'OutOfInitFini':'BInitFini',
+# 'OutOfInitFini':'BInitFini',
'CommunicatorLeak':'BResLeak', 'DatatypeLeak':'BResLeak', 'GroupLeak':'BResLeak', 'OperatorLeak':'BResLeak', 'TypeLeak':'BResLeak', 'RequestLeak':'BResLeak',
'MissingStart':'BReqLifecycle', 'MissingWait':'BReqLifecycle',
'LocalConcurrency':'BLocalConcurrency',
# scope: communicator
- 'CallMatching':'DMatch',
+ 'CallMatching':'DMatch',
'CommunicatorMatching':'CMatch', 'DatatypeMatching':'CMatch', 'OperatorMatching':'CMatch', 'RootMatching':'CMatch', 'TagMatching':'CMatch',
- 'MessageRace':'DRace',
-
+ 'MessageRace':'DRace',
+
'GlobalConcurrency':'DGlobalConcurrency',
# larger scope
# 'BufferingHazard':'EBufferingHazard',
def run_cmd(buildcmd, execcmd, cachefile, filename, binary, timeout, batchinfo, read_line_lambda=None):
"""
Runs the test on need. Returns True if the test was ran, and False if it was cached.
-
+
The result is cached if possible, and the test is rerun only if the `test.txt` (containing the tool output) or the `test.elapsed` (containing the timing info) do not exist, or if `test.md5sum` (containing the md5sum of the code to compile) does not match.
Parameters:
- - buildcmd and execcmd are shell commands to run. buildcmd can be any shell line (incuding && groups), but execcmd must be a single binary to run.
+ - buildcmd and execcmd are shell commands to run. buildcmd can be any shell line (incuding && groups), but execcmd must be a single binary to run.
- cachefile is the name of the test
- filename is the source file containing the code
- binary the file name in which to compile the code
for chunk in iter(lambda: sourcefile.read(4096), b""):
hashed.update(chunk)
outfile.write(hashed.hexdigest())
-
+
return True
Description: @{shortdesc}@
@{longdesc}@
-
- Version of MPI: Conforms to MPI 1.1, does not require MPI 2 implementation
+
+ Version of MPI: Conforms to MPI 1.1, does not require MPI 2 implementation
BEGIN_MPI_FEATURES
- P2P!basic: Lacking
- P2P!nonblocking: @{ip2pfeature}@
- P2P!persistent: @{persfeature}@
- COLL!basic: Lacking
- COLL!nonblocking: @{icollfeature}@
- COLL!persistent: @{cpersfeature}@
- COLL!tools: Lacking
- RMA: Lacking
+ P2P!basic: Lacking
+ P2P!nonblocking: @{ip2pfeature}@
+ P2P!persistent: @{persfeature}@
+ COLL!basic: Lacking
+ COLL!nonblocking: @{icollfeature}@
+ COLL!persistent: @{cpersfeature}@
+ COLL!tools: Lacking
+ RMA: Lacking
END_MPI_FEATURES
BEGIN_MBI_TESTS
int main(int argc, char **argv) {
int nprocs = -1;
int rank = -1;
- int root = 0;
+ int root = 0;
MPI_Init(&argc, &argv);
MPI_Comm_size(MPI_COMM_WORLD, &nprocs);
if (nprocs < 2)
printf("MBI ERROR: This test needs at least 2 processes to produce a bug!\\n");
- MPI_Comm newcom = MPI_COMM_WORLD;
- MPI_Datatype type = MPI_INT;
+ MPI_Comm newcom = MPI_COMM_WORLD;
+ MPI_Datatype type = MPI_INT;
MPI_Op op = MPI_SUM;
- int stag = 0, rtag = 0;
+ int stag = 0, rtag = 0;
int buff_size = 1;
- int dbs = sizeof(int)*nprocs; /* Size of the dynamic buffers for alltoall and friends */
+ int dbs = sizeof(int)*nprocs; /* Size of the dynamic buffers for alltoall and friends */
int dest = (rank == nprocs - 1) ? (0) : (rank + 1);
- int src = (rank == 0) ? (nprocs - 1) : (rank - 1);
+ int src = (rank == 0) ? (nprocs - 1) : (rank - 1);
@{init1}@
@{init2}@
- @{operation1}@ /* MBIERROR */
+ @{operation1}@ /* MBIERROR */
@{start1}@
- @{operation2}@
+ @{operation2}@
@{start2}@
- @{fini1}@
- @{fini2}@
+ @{fini1}@
+ @{fini2}@
- @{free1}@
- @{free2}@
+ @{free1}@
+ @{free2}@
MPI_Finalize();
printf("Rank %d finished normally\\n", rank);
for r in irecv + precv:
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['generatedby'] = f'DO NOT EDIT: this file was generated by {os.path.basename(sys.argv[0])}. DO NOT EDIT.'
patterns['persfeature'] = 'Yes' if s in psend or r in precv else 'Lacking'
- patterns['ip2pfeature'] = 'Yes' if s in isend or r in irecv else 'Lacking'
- patterns['icollfeature'] = 'Lacking'
- patterns['cpersfeature'] = 'Lacking'
- patterns['s'] = s
- patterns['r'] = r
- patterns['init1'] = init[s]("1")
- patterns['init2'] = init[r]("2")
- patterns['start1'] = start[s]("1")
- startPers = patterns['start1']
+ patterns['ip2pfeature'] = 'Yes' if s in isend or r in irecv else 'Lacking'
+ patterns['icollfeature'] = 'Lacking'
+ patterns['cpersfeature'] = 'Lacking'
+ patterns['s'] = s
+ patterns['r'] = r
+ patterns['init1'] = init[s]("1")
+ patterns['init2'] = init[r]("2")
+ patterns['start1'] = start[s]("1")
+ startPers = patterns['start1']
patterns['start2'] = start[r]("2")
- patterns['operation1'] = operation[s]("1")
- patterns['operation2'] = operation[r]("2")
- patterns['fini1'] = fini[s]("1")
- wait = patterns['fini1']
- patterns['fini2'] = fini[r]("2")
- patterns['free1'] = free[s]("1")
- Reqfree = patterns['free1']
- patterns['free2'] = free[r]("2")
-
- # Generate the correct code
- replace = patterns
- replace['shortdesc'] = 'Correct matching'
+ patterns['operation1'] = operation[s]("1")
+ patterns['operation2'] = operation[r]("2")
+ patterns['fini1'] = fini[s]("1")
+ wait = patterns['fini1']
+ patterns['fini2'] = fini[r]("2")
+ patterns['free1'] = free[s]("1")
+ Reqfree = patterns['free1']
+ patterns['free2'] = free[r]("2")
+
+ # Generate the correct code
+ replace = patterns
+ replace['shortdesc'] = 'Correct matching'
replace['longdesc'] = f'No error'
- replace['outcome'] = 'OK'
- replace['errormsg'] = 'OK'
+ replace['outcome'] = 'OK'
+ replace['errormsg'] = 'OK'
make_file(template, f'ReqLifecycle_{s}_{r}_ok.c', replace)
- # Generate the code with a missing wait
- replace = patterns
- replace['shortdesc'] = 'Missing wait'
- replace['longdesc'] = 'Missing Wait. @{s}@ at @{filename}@:@{line:MBIERROR}@ has no completion.'
- replace['outcome'] = 'ERROR: MissingWait'
- replace['errormsg'] = 'ERROR: MissingWait'
- replace['fini1'] = ' /* MBIERROR MISSING: ' + wait + ' */'
+ # Generate the code with a missing wait
+ replace = patterns
+ replace['shortdesc'] = 'Missing wait'
+ replace['longdesc'] = 'Missing Wait. @{s}@ at @{filename}@:@{line:MBIERROR}@ has no completion.'
+ replace['outcome'] = 'ERROR: MissingWait'
+ replace['errormsg'] = 'ERROR: MissingWait'
+ replace['fini1'] = ' /* MBIERROR MISSING: ' + wait + ' */'
make_file(template, f'ReqLifecycle_MissingWait_{s}_{r}_nok.c', replace)
-
+
if s in psend:
- # Generate the code with a missing start - persistent only
+ # Generate the code with a missing start - persistent only
replace = patterns
replace['shortdesc'] = 'Missing start'
replace['longdesc'] = 'Missing start. @{s}@ at @{filename}@:@{line:MBIERROR}@ has no start'
replace['errormsg'] = 'ERROR: MissingStart'
replace['fini1'] = fini[s]("1")
replace['start1'] = ' /* MBIERROR MISSING: ' + startPers + ' */'
- make_file(template, f'ReqLifecycle_MissingStart_{s}_{r}_nok.c', replace)
- # Generate the code with a missing free - persistent only
+ make_file(template, f'ReqLifecycle_MissingStart_{s}_{r}_nok.c', replace)
+ # Generate the code with a missing free - persistent only
replace = patterns
replace['shortdesc'] = 'Missing free'
replace['longdesc'] = 'Missing free. @{s}@ at @{filename}@:@{line:MBIERROR}@ has no free'
replace['errormsg'] = 'ERROR: RequestLeak'
replace['start1'] = start[s]("1")
replace['free1'] = ' /* MBIERROR MISSING: ' + Reqfree + ' */'
- make_file(template, f'ResLeak_nofree_{s}_{r}_nok.c', replace)
+ make_file(template, f'ResLeak_nofree_{s}_{r}_nok.c', replace)
# Collectives only
patterns['c'] = c
patterns['init1'] = init[c]("1")
patterns['operation1'] = operation[c]("1")
- patterns['start1'] = start[c]("1")
+ patterns['start1'] = start[c]("1")
patterns['fini1'] = fini[c]("1")
patterns['free1'] = free[c]("1")
opstart = patterns['start1']
- opwait = patterns['fini1']
- opfree = patterns['free1']
+ opwait = patterns['fini1']
+ opfree = patterns['free1']
patterns['init2'] = ""
patterns['operation2'] = ""
patterns['start2'] = ""
- patterns['fini2'] = ""
- patterns['free2'] = ""
+ patterns['fini2'] = ""
+ patterns['free2'] = ""
- # Generate the code with a missing wait
+ # Generate the code with a missing wait
replace = patterns
replace['shortdesc'] = 'Missing wait'
- replace['longdesc'] = 'Missing Wait. @{c}@ at @{filename}@:@{line:MBIERROR}@ has no completion'
+ replace['longdesc'] = 'Missing Wait. @{c}@ at @{filename}@:@{line:MBIERROR}@ has no completion'
replace['outcome'] = 'ERROR: MissingWait'
replace['errormsg'] = 'ERROR: MissingWait'
- replace['fini1'] = ' /* MBIERROR MISSING: ' + opwait + ' */'
+ replace['fini1'] = ' /* MBIERROR MISSING: ' + opwait + ' */'
replace['free1'] = ' /* MISSING: ' + replace['free1'] + ' (to not free the buffer before an internal wait */'
make_file(template, f'ReqLifecycle_MissingWait_{c}_nok.c', replace)
- if c in pcoll:
- # Generate the code with a missing start - persistent only
- replace = patterns
- replace['shortdesc'] = 'Missing start functio'
- replace['longdesc'] = 'Missing Start. @{c}@ at @{filename}@:@{line:MBIERROR}@ has no start'
+ if c in pcoll:
+ # Generate the code with a missing start - persistent only
+ replace = patterns
+ replace['shortdesc'] = 'Missing start functio'
+ replace['longdesc'] = 'Missing Start. @{c}@ at @{filename}@:@{line:MBIERROR}@ has no start'
replace['outcome'] = 'ERROR: MissingStart'
replace['errormsg'] = 'ERROR: MissingStart'
- replace['fini1'] = fini[c]("1")
- replace['start1'] = ' /* MBIERROR MISSING: ' + opstart + ' */'
+ replace['fini1'] = fini[c]("1")
+ replace['start1'] = ' /* MBIERROR MISSING: ' + opstart + ' */'
make_file(template, f'ReqLifecycle_MissingStart_{c}_nok.c', replace)
- # Generate the code with a resleak (no free) - persistent only
+ # Generate the code with a resleak (no free) - persistent only
replace = patterns
replace['shortdesc'] = 'Missing free'
- replace['longdesc'] = 'Missing free. @{c}@ at @{filename}@:@{line:MBIERROR}@ has no free'
+ replace['longdesc'] = 'Missing free. @{c}@ at @{filename}@:@{line:MBIERROR}@ has no free'
replace['outcome'] = 'ERROR: RequestLeak'
replace['errormsg'] = 'ERROR: RequestLeak'
replace['start1'] = start[c]("1")
- replace['free1'] = ' /* MBIERROR MISSING: ' + opfree + ' */'
+ replace['free1'] = ' /* MBIERROR MISSING: ' + opfree + ' */'
make_file(template, f'ResLeak_nofree_{c}_nok.c', replace)
Description: @{shortdesc}@
@{longdesc}@
- Version of MPI: Conforms to MPI 1.1, does not require MPI 2 implementation
+ Version of MPI: Conforms to MPI 1.1, does not require MPI 2 implementation
BEGIN_MPI_FEATURES
- P2P!basic: @{p2pfeature}@
- P2P!nonblocking: @{ip2pfeature}@
- P2P!persistent: @{persfeature}@
- COLL!basic: Lacking
- COLL!nonblocking: Lacking
- COLL!persistent: Lacking
- COLL!tools: Lacking
- RMA: Lacking
+ P2P!basic: @{p2pfeature}@
+ P2P!nonblocking: @{ip2pfeature}@
+ P2P!persistent: @{persfeature}@
+ COLL!basic: Lacking
+ COLL!nonblocking: Lacking
+ COLL!persistent: Lacking
+ COLL!tools: Lacking
+ RMA: Lacking
END_MPI_FEATURES
BEGIN_MBI_TESTS
int main(int argc, char **argv) {
int nprocs = -1;
int rank = -1;
- int src=0, dest=1;
- int stag=0, rtag=0;
- int buff_size = 1;
+ int src=0, dest=1;
+ int stag=0, rtag=0;
+ int buff_size = 1;
MPI_Init(&argc, &argv);
MPI_Comm_size(MPI_COMM_WORLD, &nprocs);
if (nprocs < 2)
printf("MBI ERROR: This test needs at least 2 processes to produce a bug!\\n");
-
- MPI_Comm newcom = MPI_COMM_WORLD;
- MPI_Datatype type = MPI_INT;
+
+ MPI_Comm newcom = MPI_COMM_WORLD;
+ MPI_Datatype type = MPI_INT;
@{change_arg}@
@{init1}@
@{init2}@
- if (rank == 0) {
- @{operation1}@ /* MBIERROR1 */
- @{start1}@
- @{fini1}@
- }else if (rank == 1) {
- @{operation2}@ /* MBIERROR2 */
- @{start2}@
- @{fini2}@
- }
+ if (rank == 0) {
+ @{operation1}@ /* MBIERROR1 */
+ @{start1}@
+ @{fini1}@
+ }else if (rank == 1) {
+ @{operation2}@ /* MBIERROR2 */
+ @{start2}@
+ @{fini2}@
+ }
@{free1}@
@{free2}@
for p2 in allrecv:
patterns = {}
patterns = {'p1': p1, 'p2': p2}
- patterns['generatedby'] = f'DO NOT EDIT: this file was generated by {os.path.basename(sys.argv[0])}. DO NOT EDIT.'
+ patterns['generatedby'] = f'DO NOT EDIT: this file was generated by {os.path.basename(sys.argv[0])}. DO NOT EDIT.'
patterns['p2pfeature'] = 'Yes' if p1 in send + ssend + bsend or p2 in recv else 'Lacking'
- patterns['ip2pfeature'] = 'Yes' if p1 in isend or p2 in irecv else 'Lacking'
- patterns['persfeature'] = 'Yes' if p1 in psend or p2 in precv else 'Lacking'
- patterns['p1'] = p1
- patterns['p2'] = p2
- patterns['init1'] = init[p1]("1")
+ patterns['ip2pfeature'] = 'Yes' if p1 in isend or p2 in irecv else 'Lacking'
+ patterns['persfeature'] = 'Yes' if p1 in psend or p2 in precv else 'Lacking'
+ patterns['p1'] = p1
+ patterns['p2'] = p2
+ patterns['init1'] = init[p1]("1")
patterns['init2'] = init[p2]("2")
- patterns['start1'] = start[p1]("1")
+ patterns['start1'] = start[p1]("1")
patterns['start2'] = start[p2]("2")
- patterns['fini1'] = fini[p1]("1")
- patterns['fini2'] = fini[p2]("2")
+ patterns['fini1'] = fini[p1]("1")
+ patterns['fini2'] = fini[p2]("2")
patterns['operation1'] = operation[p1]("1") #send
patterns['operation2'] = operation[p2]("2") #recv
- patterns['free1'] = free[p1]("1")
- patterns['free2'] = free[p2]("2")
-
- # Generate the incorrect matching
- replace = patterns
- replace['shortdesc'] = 'Point to point @{p1}@ and @{p2}@ have a datatype mismatch'
- replace['longdesc'] = 'Process 0 uses MPI_FLOAT as the datatype while process 1 uses MPI_INT.'
- replace['outcome'] = 'ERROR: DatatypeMatching'
- replace['errormsg'] = 'P2P Datatype mismatch. @{p1}@ at @{filename}@:@{line:MBIERROR1}@ and @{p2}@ at @{filename}@:@{line:MBIERROR2}@ have MPI_INT and MPI_FLOAT as a datatype'
+ patterns['free1'] = free[p1]("1")
+ patterns['free2'] = free[p2]("2")
+
+ # Generate the incorrect matching
+ replace = patterns
+ replace['shortdesc'] = 'Point to point @{p1}@ and @{p2}@ have a datatype mismatch'
+ replace['longdesc'] = 'Process 0 uses MPI_FLOAT as the datatype while process 1 uses MPI_INT.'
+ replace['outcome'] = 'ERROR: DatatypeMatching'
+ replace['errormsg'] = 'P2P Datatype mismatch. @{p1}@ at @{filename}@:@{line:MBIERROR1}@ and @{p2}@ at @{filename}@:@{line:MBIERROR2}@ have MPI_INT and MPI_FLOAT as a datatype'
replace['change_arg'] = 'if (rank == 0)\n type = MPI_FLOAT; /* MBIERROR3 */'
make_file(template, f'ParamMatching_Data_{p1}_{p2}_nok.c', replace)
- # Generate code with a null type
- replace = patterns
- replace['shortdesc'] = 'Use of invalid datatype in point-to-point communication'
+ # Generate code with a null type
+ replace = patterns
+ replace['shortdesc'] = 'Use of invalid datatype in point-to-point communication'
replace['longdesc'] = 'Point to point @{p1}@ and @{p2}@ have MPI_DATATYPE_NULL as a type'
- replace['outcome'] = 'ERROR: InvalidDatatype'
- replace['errormsg'] = 'Invalid datatype in P2P. @{p1}@ at @{filename}@:@{line:MBIERROR1}@ and @{p2}@ at @{filename}@:@{line:MBIERROR2}@ have MPI_DATATYPE_NULL as a type'
+ replace['outcome'] = 'ERROR: InvalidDatatype'
+ replace['errormsg'] = 'Invalid datatype in P2P. @{p1}@ at @{filename}@:@{line:MBIERROR1}@ and @{p2}@ at @{filename}@:@{line:MBIERROR2}@ have MPI_DATATYPE_NULL as a type'
replace['change_arg'] = 'type = MPI_DATATYPE_NULL; /* MBIERROR3 */'
make_file(template, f'InvalidParam_DatatypeNull_{p1}_{p2}_nok.c', replace)
- # Generate code with an invalid datatype
- replace = patterns
- replace['shortdesc'] = 'Use of invalid datatype in point-to-point communication'
+ # Generate code with an invalid datatype
+ replace = patterns
+ replace['shortdesc'] = 'Use of invalid datatype in point-to-point communication'
replace['longdesc'] = 'Point to point @{p1}@ and @{p2}@ have an invalid datatype'
- replace['outcome'] = 'ERROR: InvalidDatatype'
- replace['errormsg'] = 'Invalid datatype in P2P. @{p1}@ at @{filename}@:@{line:MBIERROR1}@ and @{p2}@ at @{filename}@:@{line:MBIERROR2}@ have an invalid datatype'
+ replace['outcome'] = 'ERROR: InvalidDatatype'
+ replace['errormsg'] = 'Invalid datatype in P2P. @{p1}@ at @{filename}@:@{line:MBIERROR1}@ and @{p2}@ at @{filename}@:@{line:MBIERROR2}@ have an invalid datatype'
replace['change_arg'] = 'MPI_Type_contiguous (2, MPI_INT, &type); MPI_Type_commit(&type);MPI_Type_free(&type); /* MBIERROR3 */'
make_file(template, f'InvalidParam_Datatype_{p1}_{p2}_nok.c', replace)
# Generate code with tag mismatch
#################################
-for p1 in allsend:
+for p1 in allsend:
for p2 in allrecv:
patterns = {}
patterns = {'p1': p1, 'p2': p2}
- patterns['generatedby'] = f'DO NOT EDIT: this file was generated by {os.path.basename(sys.argv[0])}. DO NOT EDIT.'
+ patterns['generatedby'] = f'DO NOT EDIT: this file was generated by {os.path.basename(sys.argv[0])}. DO NOT EDIT.'
patterns['p2pfeature'] = 'Yes' if p1 in send + ssend + bsend or p2 in recv else 'Lacking'
- patterns['ip2pfeature'] = 'Yes' if p1 in isend or p2 in irecv else 'Lacking'
- patterns['persfeature'] = 'Yes' if p1 in psend or p2 in precv else 'Lacking'
- patterns['p1'] = p1
- patterns['p2'] = p2
- patterns['init1'] = init[p1]("1")
+ patterns['ip2pfeature'] = 'Yes' if p1 in isend or p2 in irecv else 'Lacking'
+ patterns['persfeature'] = 'Yes' if p1 in psend or p2 in precv else 'Lacking'
+ patterns['p1'] = p1
+ patterns['p2'] = p2
+ patterns['init1'] = init[p1]("1")
patterns['init2'] = init[p2]("2")
- patterns['start1'] = start[p1]("1")
+ patterns['start1'] = start[p1]("1")
patterns['start2'] = start[p2]("2")
- patterns['fini1'] = fini[p1]("1")
- patterns['fini2'] = fini[p2]("2")
+ patterns['fini1'] = fini[p1]("1")
+ patterns['fini2'] = fini[p2]("2")
patterns['operation1'] = operation[p1]("1") #send
patterns['operation2'] = operation[p2]("2") #recv
- patterns['free1'] = free[p1]("1")
- patterns['free2'] = free[p2]("2")
- patterns['change_arg'] = ""
-
- # Generate the incorrect tag matching
- replace = patterns
- replace['shortdesc'] = 'Point to point @{p1}@ and @{p2}@ have a tag mismatch'
- replace['longdesc'] = 'Point to point @{p1}@ and @{p2}@ have a tag mismatch.'
- replace['outcome'] = 'ERROR: TagMatching'
+ patterns['free1'] = free[p1]("1")
+ patterns['free2'] = free[p2]("2")
+ patterns['change_arg'] = ""
+
+ # Generate the incorrect tag matching
+ replace = patterns
+ replace['shortdesc'] = 'Point to point @{p1}@ and @{p2}@ have a tag mismatch'
+ replace['longdesc'] = 'Point to point @{p1}@ and @{p2}@ have a tag mismatch.'
+ replace['outcome'] = 'ERROR: TagMatching'
replace['errormsg'] = 'P2P tag mismatch. @{p1}@ at @{filename}@:@{line:MBIERROR1}@ and @{p2}@ at @{filename}@:@{line:MBIERROR2}@ use different tag.'
replace['change_arg'] = 'stag=0; rtag=1;/* MBIERROR */'
make_file(template, f'ParamMatching_Tag_{p1}_{p2}_nok.c', replace)
- # Generate the code with an invalid tag
- replace = patterns
- replace['shortdesc'] = 'Point to point @{p1}@ and @{p2}@ have an invalid tag'
- replace['longdesc'] = 'Point to point @{p1}@ and @{p2}@ have an invalid tag.'
- replace['outcome'] = 'ERROR: InvalidTag'
- replace['errormsg'] = 'Invalid Tag. @{p1}@ at @{filename}@:@{line:MBIERROR1}@ and @{p2}@ at @{filename}@:@{line:MBIERROR2}@ use an invalid tag.'
+ # Generate the code with an invalid tag
+ replace = patterns
+ replace['shortdesc'] = 'Point to point @{p1}@ and @{p2}@ have an invalid tag'
+ replace['longdesc'] = 'Point to point @{p1}@ and @{p2}@ have an invalid tag.'
+ replace['outcome'] = 'ERROR: InvalidTag'
+ replace['errormsg'] = 'Invalid Tag. @{p1}@ at @{filename}@:@{line:MBIERROR1}@ and @{p2}@ at @{filename}@:@{line:MBIERROR2}@ use an invalid tag.'
replace['change_arg'] = 'stag=-1; rtag=-2;/* MBIERROR */'
make_file(template, f'InvalidParam_Tag_{p1}_{p2}_nok.c', replace)
- # Generate a correct code using MPI_ANY_TAG
- replace = patterns
- replace['shortdesc'] = 'Correct code'
- replace['longdesc'] = 'Correct code'
- replace['outcome'] = 'OK'
+ # Generate a correct code using MPI_ANY_TAG
+ replace = patterns
+ replace['shortdesc'] = 'Correct code'
+ replace['longdesc'] = 'Correct code'
+ replace['outcome'] = 'OK'
replace['errormsg'] = 'OK'
replace['change_arg'] = 'rtag=MPI_ANY_TAG;'
make_file(template, f'ParamMatching_Tag_{p1}_{p2}_ok.c', replace)
Description: @{shortdesc}@
@{longdesc}@
- Version of MPI: Conforms to MPI 1.1, does not require MPI 2 implementation
+ Version of MPI: Conforms to MPI 1.1, does not require MPI 2 implementation
BEGIN_MPI_FEATURES
- P2P!basic: @{p2pfeature}@
- P2P!nonblocking: @{ip2pfeature}@
- P2P!persistent: @{persfeature}@
- COLL!basic: Lacking
- COLL!nonblocking: Lacking
- COLL!persistent: Lacking
- COLL!tools: Yes
- RMA: Lacking
+ P2P!basic: @{p2pfeature}@
+ P2P!nonblocking: @{ip2pfeature}@
+ P2P!persistent: @{persfeature}@
+ COLL!basic: Lacking
+ COLL!nonblocking: Lacking
+ COLL!persistent: Lacking
+ COLL!tools: Yes
+ RMA: Lacking
END_MPI_FEATURES
BEGIN_MBI_TESTS
int main(int argc, char **argv) {
int nprocs = -1;
int rank = -1;
- int src=0, dest=1;
+ int src=0, dest=1;
int stag = 0, rtag = 0;
int buff_size = 1;
if (nprocs < 2)
printf("MBI ERROR: This test needs at least 2 processes to produce a bug!\\n");
- MPI_Datatype type = MPI_INT;
- MPI_Comm newcom;
+ MPI_Datatype type = MPI_INT;
+ MPI_Comm newcom;
MPI_Comm_split(MPI_COMM_WORLD, 0, nprocs - rank, &newcom);
@{change_com}@
@{change_srcdest}@
@{init1}@
@{init2}@
- if (rank == 0) {
- @{operation1}@ /* MBIERROR1 */
- @{start1}@
- @{fini1}@
- }else if (rank == 1) {
- @{operation2}@ /* MBIERROR2 */
- @{start2}@
- @{fini2}@
- }
+ if (rank == 0) {
+ @{operation1}@ /* MBIERROR1 */
+ @{start1}@
+ @{fini1}@
+ }else if (rank == 1) {
+ @{operation2}@ /* MBIERROR2 */
+ @{start2}@
+ @{fini2}@
+ }
@{free1}@
@{free2}@
- if(newcom != MPI_COMM_NULL && newcom != MPI_COMM_WORLD)
- MPI_Comm_free(&newcom);
+ if(newcom != MPI_COMM_NULL && newcom != MPI_COMM_WORLD)
+ MPI_Comm_free(&newcom);
MPI_Finalize();
printf("Rank %d finished normally\\n", rank);
for p2 in recv + irecv + precv:
patterns = {}
patterns = {'p1': p1, 'p2': p2}
- patterns['origin'] = "MBI"
- patterns['generatedby'] = f'DO NOT EDIT: this file was generated by {os.path.basename(sys.argv[0])}. DO NOT EDIT.'
+ patterns['origin'] = "MBI"
+ patterns['generatedby'] = f'DO NOT EDIT: this file was generated by {os.path.basename(sys.argv[0])}. DO NOT EDIT.'
patterns['p2pfeature'] = 'Yes' if p1 in send or p2 in recv else 'Lacking'
- patterns['ip2pfeature'] = 'Yes' if p1 in isend or p2 in irecv else 'Lacking'
- patterns['persfeature'] = 'Yes' if p1 in psend or p2 in precv else 'Lacking'
- patterns['p1'] = p1
- patterns['p2'] = p2
- patterns['init1'] = init[p1]("1")
+ patterns['ip2pfeature'] = 'Yes' if p1 in isend or p2 in irecv else 'Lacking'
+ patterns['persfeature'] = 'Yes' if p1 in psend or p2 in precv else 'Lacking'
+ patterns['p1'] = p1
+ patterns['p2'] = p2
+ patterns['init1'] = init[p1]("1")
patterns['init2'] = init[p2]("2")
- patterns['start1'] = start[p1]("1")
+ patterns['start1'] = start[p1]("1")
patterns['start2'] = start[p2]("2")
- patterns['fini1'] = fini[p1]("1")
- patterns['fini2'] = fini[p2]("2")
+ patterns['fini1'] = fini[p1]("1")
+ patterns['fini2'] = fini[p2]("2")
patterns['operation1'] = operation[p1]("1") #send
patterns['operation2'] = operation[p2]("2") #recv
- patterns['free1'] = free[p1]("1")
- patterns['free2'] = free[p2]("2")
- patterns['change_srcdest'] = ""
-
- # Generate the incorrect matching
- replace = patterns
- replace['shortdesc'] = 'Point to point @{p1}@ and @{p2}@ have a communicator mismatch'
- replace['longdesc'] = 'Process 1 uses newcom as the communicator while process 0 uses MPI_COMM_WORLD.'
- replace['outcome'] = 'ERROR: CommunicatorMatching'
- replace['errormsg'] = 'P2P Communicator mismatch. @{p1}@ at @{filename}@:@{line:MBIERROR1}@ and @{p2}@ at @{filename}@:@{line:MBIERROR2}@ have newcom or MPI_COMM_WORLD as a communicator.'
+ patterns['free1'] = free[p1]("1")
+ patterns['free2'] = free[p2]("2")
+ patterns['change_srcdest'] = ""
+
+ # Generate the incorrect matching
+ replace = patterns
+ replace['shortdesc'] = 'Point to point @{p1}@ and @{p2}@ have a communicator mismatch'
+ replace['longdesc'] = 'Process 1 uses newcom as the communicator while process 0 uses MPI_COMM_WORLD.'
+ replace['outcome'] = 'ERROR: CommunicatorMatching'
+ replace['errormsg'] = 'P2P Communicator mismatch. @{p1}@ at @{filename}@:@{line:MBIERROR1}@ and @{p2}@ at @{filename}@:@{line:MBIERROR2}@ have newcom or MPI_COMM_WORLD as a communicator.'
replace['change_com'] = 'if (rank==0)\n newcom = MPI_COMM_WORLD; /* MBIERROR */'
make_file(template, f'ParamMatching_Com_{p1}_{p2}_nok.c', replace)
- # Generate the code with an invalid communicator
- replace = patterns
- replace['shortdesc'] = 'Point to point @{p1}@ and @{p2}@ have an invalid communicator'
- replace['longdesc'] = 'Point to point @{p1}@ and @{p2}@ have an invalid communicator.'
- replace['outcome'] = 'ERROR: InvalidCommunicator'
- replace['errormsg'] = 'Invalid Communicator. @{p1}@ at @{filename}@:@{line:MBIERROR1}@ and @{p2}@ at @{filename}@:@{line:MBIERROR2}@ use a communicator that is freed line @{line:MBIERROR}@.'
+ # Generate the code with an invalid communicator
+ replace = patterns
+ replace['shortdesc'] = 'Point to point @{p1}@ and @{p2}@ have an invalid communicator'
+ replace['longdesc'] = 'Point to point @{p1}@ and @{p2}@ have an invalid communicator.'
+ replace['outcome'] = 'ERROR: InvalidCommunicator'
+ replace['errormsg'] = 'Invalid Communicator. @{p1}@ at @{filename}@:@{line:MBIERROR1}@ and @{p2}@ at @{filename}@:@{line:MBIERROR2}@ use a communicator that is freed line @{line:MBIERROR}@.'
replace['change_com'] = 'MPI_Comm_free(&newcom); /* MBIERROR */'
make_file(template, f'InvalidParam_Com_{p1}_{p2}_nok.c', replace)
- # Generate the code with an invalid communicator ==> TO CHECK
- #replace = patterns
- #replace['shortdesc'] = 'Point to point @{p1}@ and @{p2}@ have an invalid communicator'
- # replace['longdesc'] = 'Point to point @{p1}@ and @{p2}@ have an invalid communicator.'
- # replace['outcome'] = 'ERROR: InvalidCommunicator'
- # replace['errormsg'] = 'Invalid Communicator. @{p1}@ at @{filename}@:@{line:MBIERROR1}@ and @{p2}@ at @{filename}@:@{line:MBIERROR2}@ use different communicators'
+ # Generate the code with an invalid communicator ==> TO CHECK
+ #replace = patterns
+ #replace['shortdesc'] = 'Point to point @{p1}@ and @{p2}@ have an invalid communicator'
+ # replace['longdesc'] = 'Point to point @{p1}@ and @{p2}@ have an invalid communicator.'
+ # replace['outcome'] = 'ERROR: InvalidCommunicator'
+ # replace['errormsg'] = 'Invalid Communicator. @{p1}@ at @{filename}@:@{line:MBIERROR1}@ and @{p2}@ at @{filename}@:@{line:MBIERROR2}@ use different communicators'
# replace['origin'] = "MPI-Corrbench"
# replace['change_com'] = ""
# make_file(template, f'InvalidParam_Com_{p1}_{p2}_nok.c', replace)
- # Generate the code with an invalid dest
- replace = patterns
+ # Generate the code with an invalid dest
+ replace = patterns
replace['origin'] = "MBI"
- replace['shortdesc'] = 'Point to point @{p1}@ has an invalid argument'
- replace['longdesc'] = 'Point to point @{p1}@ and @{p2}@ have an invalid communicator.'
- replace['outcome'] = 'ERROR: InvalidSrcDest'
- replace['errormsg'] = 'InvalidSrcDest. @{p1}@ at @{filename}@:@{line:MBIERROR1}@ performs a send with a dest not in communicator (dest is changed line @{line:MBIERROR}@).'
+ replace['shortdesc'] = 'Point to point @{p1}@ has an invalid argument'
+ replace['longdesc'] = 'Point to point @{p1}@ and @{p2}@ have an invalid communicator.'
+ replace['outcome'] = 'ERROR: InvalidSrcDest'
+ replace['errormsg'] = 'InvalidSrcDest. @{p1}@ at @{filename}@:@{line:MBIERROR1}@ performs a send with a dest not in communicator (dest is changed line @{line:MBIERROR}@).'
replace['change_com'] = ""
replace['change_srcdest'] = 'dest=4; /* MBIERROR */'
make_file(template, f'InvalidParam_Dest_{p1}_{p2}_nok.c', replace)
- # Generate the code with an invalid src
- replace = patterns
+ # Generate the code with an invalid src
+ replace = patterns
replace['shortdesc'] = 'Point to point @{p2}@ has an invalid argument'
- replace['longdesc'] = 'Point to point @{p1}@ and @{p2}@ have an invalid communicator.'
- replace['outcome'] = 'ERROR: InvalidSrcDest'
- replace['errormsg'] = 'InvalidSrcDest. @{p2}@ at @{filename}@:@{line:MBIERROR2}@ performs a recv with a negative integer as source (src is changed line @{line:MBIERROR}@).'
+ replace['longdesc'] = 'Point to point @{p1}@ and @{p2}@ have an invalid communicator.'
+ replace['outcome'] = 'ERROR: InvalidSrcDest'
+ replace['errormsg'] = 'InvalidSrcDest. @{p2}@ at @{filename}@:@{line:MBIERROR2}@ performs a recv with a negative integer as source (src is changed line @{line:MBIERROR}@).'
replace['change_srcdest'] = 'src=-1; /* MBIERROR */'
make_file(template, f'InvalidParam_Src_{p1}_{p2}_nok.c', replace)
Description: @{shortdesc}@
@{longdesc}@
- Version of MPI: Conforms to MPI 1.1, does not require MPI 2 implementation
+ Version of MPI: Conforms to MPI 1.1, does not require MPI 2 implementation
BEGIN_MPI_FEATURES
- P2P!basic: @{p2pfeature}@
- P2P!nonblocking: @{ip2pfeature}@
- P2P!persistent: @{persfeature}@
- COLL!basic: Lacking
- COLL!nonblocking: Lacking
- COLL!persistent: Lacking
- COLL!tools: Yes
- RMA: Lacking
+ P2P!basic: @{p2pfeature}@
+ P2P!nonblocking: @{ip2pfeature}@
+ P2P!persistent: @{persfeature}@
+ COLL!basic: Lacking
+ COLL!nonblocking: Lacking
+ COLL!persistent: Lacking
+ COLL!tools: Yes
+ RMA: Lacking
END_MPI_FEATURES
BEGIN_MBI_TESTS
int main(int argc, char **argv) {
int nprocs = -1;
int rank = -1;
- int src=0, dest=1;
+ int src=0, dest=1;
int stag = 0, rtag = 0;
int buff_size = 1;
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
printf("Hello from rank %d \\n", rank);
- MPI_Datatype type = MPI_INT;
- MPI_Comm newcom = MPI_COMM_WORLD;
+ MPI_Datatype type = MPI_INT;
+ MPI_Comm newcom = MPI_COMM_WORLD;
@{init1}@
@{init2}@
- if (rank == 0) {
- @{change_com1}@
- @{operation1}@ /* MBIERROR1 */
- @{start1}@
- @{fini1}@
- }else if (rank == 1) {
- @{change_com2}@
- @{operation2}@ /* MBIERROR2 */
- @{start2}@
- @{fini2}@
- }
+ if (rank == 0) {
+ @{change_com1}@
+ @{operation1}@ /* MBIERROR1 */
+ @{start1}@
+ @{fini1}@
+ }else if (rank == 1) {
+ @{change_com2}@
+ @{operation2}@ /* MBIERROR2 */
+ @{start2}@
+ @{fini2}@
+ }
@{free1}@
@{free2}@
- if(newcom != MPI_COMM_NULL && newcom != MPI_COMM_WORLD)
- MPI_Comm_free(&newcom);
+ if(newcom != MPI_COMM_NULL && newcom != MPI_COMM_WORLD)
+ MPI_Comm_free(&newcom);
MPI_Finalize();
printf("Rank %d finished normally\\n", rank);
for p2 in recv + irecv + precv:
patterns = {}
patterns = {'p1': p1, 'p2': p2}
- patterns['origin'] = "MBI"
- patterns['generatedby'] = f'DO NOT EDIT: this file was generated by {os.path.basename(sys.argv[0])}. DO NOT EDIT.'
+ patterns['origin'] = "MBI"
+ patterns['generatedby'] = f'DO NOT EDIT: this file was generated by {os.path.basename(sys.argv[0])}. DO NOT EDIT.'
patterns['p2pfeature'] = 'Yes' if p1 in send or p2 in recv else 'Lacking'
- patterns['ip2pfeature'] = 'Yes' if p1 in isend or p2 in irecv else 'Lacking'
- patterns['persfeature'] = 'Yes' if p1 in psend or p2 in precv else 'Lacking'
- patterns['p1'] = p1
- patterns['p2'] = p2
- patterns['init1'] = init[p1]("1")
+ patterns['ip2pfeature'] = 'Yes' if p1 in isend or p2 in irecv else 'Lacking'
+ patterns['persfeature'] = 'Yes' if p1 in psend or p2 in precv else 'Lacking'
+ patterns['p1'] = p1
+ patterns['p2'] = p2
+ patterns['init1'] = init[p1]("1")
patterns['init2'] = init[p2]("2")
- patterns['start1'] = start[p1]("1")
+ patterns['start1'] = start[p1]("1")
patterns['start2'] = start[p2]("2")
- patterns['fini1'] = fini[p1]("1")
- patterns['fini2'] = fini[p2]("2")
+ patterns['fini1'] = fini[p1]("1")
+ patterns['fini2'] = fini[p2]("2")
patterns['operation1'] = operation[p1]("1") #send
patterns['operation2'] = operation[p2]("2") #recv
- patterns['free1'] = free[p1]("1")
- patterns['free2'] = free[p2]("2")
- patterns['change_com1'] = ""
- patterns['change_com2'] = ""
+ patterns['free1'] = free[p1]("1")
+ patterns['free2'] = free[p2]("2")
+ patterns['change_com1'] = ""
+ patterns['change_com2'] = ""
- replace = patterns
+ replace = patterns
replace['origin'] = "inspired from MPI-Corrbench"
- replace['shortdesc'] = 'Point to point @{p2}@ has an invalid communicator'
- replace['longdesc'] = 'MPI_COMM_NULL used in point to point @{p2}@'
- replace['outcome'] = 'ERROR: InvalidCommunicator'
- replace['errormsg'] = 'Invalid Communicator. @{p2}@ at @{filename}@:@{line:MBIERROR2}@ uses a null communicator.'
+ replace['shortdesc'] = 'Point to point @{p2}@ has an invalid communicator'
+ replace['longdesc'] = 'MPI_COMM_NULL used in point to point @{p2}@'
+ replace['outcome'] = 'ERROR: InvalidCommunicator'
+ replace['errormsg'] = 'Invalid Communicator. @{p2}@ at @{filename}@:@{line:MBIERROR2}@ uses a null communicator.'
replace['change_com2'] = 'newcom = MPI_COMM_NULL;'
make_file(template, f'InvalidParam_ComNull_{p2}_{p1}nok.c', replace)
- replace = patterns
- replace['shortdesc'] = 'Point to point @{p2}@ has an invalid communicator'
- replace['longdesc'] = 'MPI_COMM_NULL used in point to point @{p2}@'
- replace['outcome'] = 'ERROR: InvalidCommunicator'
- replace['errormsg'] = 'Invalid Communicator. @{p1}@ at @{filename}@:@{line:MBIERROR1}@ uses a null communicator.'
+ replace = patterns
+ replace['shortdesc'] = 'Point to point @{p2}@ has an invalid communicator'
+ replace['longdesc'] = 'MPI_COMM_NULL used in point to point @{p2}@'
+ replace['outcome'] = 'ERROR: InvalidCommunicator'
+ replace['errormsg'] = 'Invalid Communicator. @{p1}@ at @{filename}@:@{line:MBIERROR1}@ uses a null communicator.'
replace['change_com1'] = 'newcom = MPI_COMM_NULL;'
replace['change_com2'] = ""
make_file(template, f'InvalidParam_ComNull_{p1}_{p2}nok.c', replace)
Description: @{shortdesc}@
@{longdesc}@
- Version of MPI: Conforms to MPI 1.1, does not require MPI 2 implementation
+ Version of MPI: Conforms to MPI 1.1, does not require MPI 2 implementation
BEGIN_MPI_FEATURES
- P2P!basic: @{p2pfeature}@
- P2P!nonblocking: @{ip2pfeature}@
- P2P!persistent: @{persfeature}@
- COLL!basic: Lacking
- COLL!nonblocking: Lacking
- COLL!persistent: Lacking
- COLL!tools: Lacking
- RMA: Lacking
+ P2P!basic: @{p2pfeature}@
+ P2P!nonblocking: @{ip2pfeature}@
+ P2P!persistent: @{persfeature}@
+ COLL!basic: Lacking
+ COLL!nonblocking: Lacking
+ COLL!persistent: Lacking
+ COLL!tools: Lacking
+ RMA: Lacking
END_MPI_FEATURES
BEGIN_MBI_TESTS
int main(int argc, char **argv) {
int nprocs = -1;
int rank = -1;
- int dest=0, src=0;
- int stag = 0, rtag = 0;
+ int dest=0, src=0;
+ int stag = 0, rtag = 0;
int buff_size = 1;
MPI_Init(&argc, &argv);
printf("MBI ERROR: This test needs at least 2 processes to produce a bug!\\n");
MPI_Comm newcom = MPI_COMM_WORLD;
- MPI_Datatype type = MPI_INT;
+ MPI_Datatype type = MPI_INT;
@{init1}@
@{init2}@
- if (rank == 0) {
- dest = 1; src = 1;
- @{operation1}@
- @{start1}@
- @{write1}@ /* MBIERROR1 */
- @{fini1}@
- @{free1}@
- }else if (rank == 1){
- dest = 0; src = 0;
- @{operation2}@
- @{start2}@
- @{write2}@ /* MBIERROR2 */
- @{fini2}@
- @{free2}@
- }
+ if (rank == 0) {
+ dest = 1; src = 1;
+ @{operation1}@
+ @{start1}@
+ @{write1}@ /* MBIERROR1 */
+ @{fini1}@
+ @{free1}@
+ }else if (rank == 1){
+ dest = 0; src = 0;
+ @{operation2}@
+ @{start2}@
+ @{write2}@ /* MBIERROR2 */
+ @{fini2}@
+ @{free2}@
+ }
MPI_Finalize();
printf("Rank %d finished normally\\n", rank);
# Generate a message race
if s in send and r in irecv + precv:
- replace = patterns
+ 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['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:
- replace = patterns
+ 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['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:
- replace = patterns
+ 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['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)
Description: @{shortdesc}@
@{longdesc}@
- Version of MPI: Conforms to MPI 1.1, does not require MPI 2 implementation
+ Version of MPI: Conforms to MPI 1.1, does not require MPI 2 implementation
BEGIN_MPI_FEATURES
- P2P!basic: @{p2pfeature}@
- P2P!nonblocking: @{ip2pfeature}@
- P2P!persistent: Lacking
- COLL!basic: Lacking
- COLL!nonblocking: Lacking
- COLL!persistent: Lacking
- COLL!tools: Lacking
- RMA: Lacking
+ P2P!basic: @{p2pfeature}@
+ P2P!nonblocking: @{ip2pfeature}@
+ P2P!persistent: Lacking
+ COLL!basic: Lacking
+ COLL!nonblocking: Lacking
+ COLL!persistent: Lacking
+ COLL!tools: Lacking
+ RMA: Lacking
END_MPI_FEATURES
BEGIN_MBI_TESTS
int main(int argc, char **argv) {
int nprocs = -1;
int rank = -1;
- int src=MPI_ANY_SOURCE, dest=0;
- int stag = 42, rtag = MPI_ANY_TAG;
- int buff_size = 1;
+ int src=MPI_ANY_SOURCE, dest=0;
+ int stag = 42, rtag = MPI_ANY_TAG;
+ int buff_size = 1;
MPI_Init(&argc, &argv);
MPI_Comm_size(MPI_COMM_WORLD, &nprocs);
if (nprocs < 2)
printf("MBI ERROR: This test needs at least 2 processes to produce a bug!\\n");
- int recv_buffer=-1;
- int send_buffer=rank;
+ int recv_buffer=-1;
+ int send_buffer=rank;
- MPI_Datatype type = MPI_INT;
- MPI_Comm newcom = MPI_COMM_WORLD;
+ MPI_Datatype type = MPI_INT;
+ MPI_Comm newcom = MPI_COMM_WORLD;
@{init1}@
@{init2}@
if (rank == 0) {
for (int i = 0; i < nprocs - 1; i++) {
- @{operation1}@ /* MBIERROR */
- @{fini1}@
+ @{operation1}@ /* MBIERROR */
+ @{fini1}@
}
- if (@{cond}@ != 3) {
+ if (@{cond}@ != 3) {
printf("MBI_MSG_RACE: The last received message is not 3 but %d!\\n", recv_buffer);
fflush(stdout);
abort();
}
}else{
- @{operation2}@
- @{fini2}@
+ @{operation2}@
+ @{fini2}@
}
patterns['operation1'] = operation[r]("1")
# Generate the incorrect matching
- replace = patterns
+ replace = patterns
replace['shortdesc'] = 'The message ordering is non-deterministic.'
- replace['longdesc'] = f'The code assumes a fixed order in the reception of messages while the message ordering is non-deterministic.'
- replace['outcome'] = 'ERROR: MessageRace'
+ replace['longdesc'] = f'The code assumes a fixed order in the reception of messages while the message ordering is non-deterministic.'
+ replace['outcome'] = 'ERROR: MessageRace'
replace['errormsg'] = 'P2P message race which can cause a deadlock. @{r}@ at @{filename}@:@{line:MBIERROR}@ is called with ANY_SRC.'
make_file(template, f'MessageRace_{r}_{s}_nok.c', replace)
Description: @{shortdesc}@
@{longdesc}@
- Version of MPI: Conforms to MPI 1.1, does not require MPI 2 implementation
+ Version of MPI: Conforms to MPI 1.1, does not require MPI 2 implementation
BEGIN_MPI_FEATURES
- P2P!basic: @{p2pfeature}@
- P2P!nonblocking: @{ip2pfeature}@
- P2P!persistent: @{persfeature}0@
- COLL!basic: Lacking
- COLL!nonblocking: Lacking
- COLL!persistent: Lacking
- COLL!tools: Lacking
- RMA: Lacking
+ P2P!basic: @{p2pfeature}@
+ P2P!nonblocking: @{ip2pfeature}@
+ P2P!persistent: @{persfeature}0@
+ COLL!basic: Lacking
+ COLL!nonblocking: Lacking
+ COLL!persistent: Lacking
+ COLL!tools: Lacking
+ RMA: Lacking
END_MPI_FEATURES
BEGIN_MBI_TESTS
int nprocs = -1;
int rank = -1;
int its_raining = 0;
- int src=0, dest=1;
- int stag=0, rtag=0;
+ int src=0, dest=1;
+ int stag=0, rtag=0;
MPI_Init(&argc, &argv);
MPI_Comm_size(MPI_COMM_WORLD, &nprocs);
if (nprocs < 2)
printf("MBI ERROR: This test needs at least 2 processes to produce a bug!\\n");
- MPI_Comm newcom = MPI_COMM_WORLD;
- MPI_Datatype type = MPI_INT;
+ MPI_Comm newcom = MPI_COMM_WORLD;
+ MPI_Datatype type = MPI_INT;
@{init1}@
@{init2}@
- if (rank == 0) {
- @{operation1}@ /* MBIERROR1 */
- @{fini1}@
- }else if (@{change_cond}@){
- @{operation2}@ /* MBIERROR2 */
- @{fini2}@
- }
+ if (rank == 0) {
+ @{operation1}@ /* MBIERROR1 */
+ @{fini1}@
+ }else if (@{change_cond}@){
+ @{operation2}@ /* MBIERROR2 */
+ @{fini2}@
+ }
MPI_Finalize();
printf("Rank %d finished normally\\n", rank);
# Generate the incorrect matching with one call
replace = patterns
- replace['shortdesc'] = 'Point to point @{p}@ is not matched'
+ replace['shortdesc'] = 'Point to point @{p}@ is not matched'
replace['longdesc'] = 'Process 0 calls @{p}@ and is not matched'
replace['outcome'] = 'ERROR: CallMatching'
replace['errormsg'] = 'P2P mistmatch. @{p}@ at @{filename}@:@{line:MBIERROR1}@ is not matched.'
# Generate the incorrect matching with two calls
replace = patterns
- replace['shortdesc'] = 'Both point to point @{p}@ are not matched'
+ replace['shortdesc'] = 'Both point to point @{p}@ are not matched'
replace['longdesc'] = 'Processes 0 and 1 both call @{p}@ which are not matched'
replace['outcome'] = 'ERROR: CallMatching'
replace['errormsg'] = 'P2P mismatch. @{p}@ at @{filename}@:@{line:MBIERROR1}@ and @{p}@ at @{filename}@:@{line:MBIERROR2}@ are not matched.'
patterns['change_cond'] = '(rank == 1) && (its_raining)'
# Generate the incorrect matching because of the conditional
- replace = patterns
+ replace = patterns
replace['shortdesc'] = 'Point to point @{r}@ is never called.'
- replace['longdesc'] = 'Point to point @{r}@ is never executed. Process 1 calls MPI_Finalize and causes a deadlock.'
- replace['outcome'] = 'ERROR: CallMatching'
- replace['errormsg'] = 'P2P mistmatch. @{r}@ at @{filename}@:@{line:MBIERROR2}@ is never called because of the conditional (@{change_cond}@).'
+ replace['longdesc'] = 'Point to point @{r}@ is never executed. Process 1 calls MPI_Finalize and causes a deadlock.'
+ replace['outcome'] = 'ERROR: CallMatching'
+ replace['errormsg'] = 'P2P mistmatch. @{r}@ at @{filename}@:@{line:MBIERROR2}@ is never called because of the conditional (@{change_cond}@).'
replace['operation1'] = operation[s]("1")
replace['operation2'] = operation[r]("2")
make_file(template, f'CallOrdering_{r}_{s}_nok.c', replace)
Description: @{shortdesc}@
@{longdesc}@
- Version of MPI: Conforms to MPI 1.1, does not require MPI 2 implementation
+ Version of MPI: Conforms to MPI 1.1, does not require MPI 2 implementation
BEGIN_MPI_FEATURES
- P2P!basic: @{p2pfeature}@
- P2P!nonblocking: @{ip2pfeature}@
- P2P!persistent: Lacking
- COLL!basic: Lacking
- COLL!nonblocking: Lacking
- COLL!persistent: Lacking
- COLL!tools: Lacking
- RMA: Lacking
+ P2P!basic: @{p2pfeature}@
+ P2P!nonblocking: @{ip2pfeature}@
+ P2P!persistent: Lacking
+ COLL!basic: Lacking
+ COLL!nonblocking: Lacking
+ COLL!persistent: Lacking
+ COLL!tools: Lacking
+ RMA: Lacking
END_MPI_FEATURES
BEGIN_MBI_TESTS
int main(int argc, char **argv) {
int nprocs = -1;
int rank = -1;
- MPI_Status sta;
- int src,dest;
- int stag=0, rtag=0;
- int buff_size = 1;
+ MPI_Status sta;
+ int src,dest;
+ int stag=0, rtag=0;
+ int buff_size = 1;
MPI_Init(&argc, &argv);
MPI_Comm_size(MPI_COMM_WORLD, &nprocs);
if (nprocs < 2)
printf("MBI ERROR: This test needs at least 2 processes to produce a bug!\\n");
- MPI_Comm newcom = MPI_COMM_WORLD;
- MPI_Datatype type = MPI_INT;
+ MPI_Comm newcom = MPI_COMM_WORLD;
+ MPI_Datatype type = MPI_INT;
@{init1a}@
@{init1b}@
@{init2b}@
@{init2c}@
- if (rank == 0) {
- dest=1, src=1;
- @{operation1a}@ /* MBIERROR1 */
- @{operation1b}@
- @{operation1c}@
+ if (rank == 0) {
+ dest=1, src=1;
+ @{operation1a}@ /* MBIERROR1 */
+ @{operation1b}@
+ @{operation1c}@
@{fini1a}@
@{fini1b}@
@{fini1c}@
- }else if (rank == 1){
- dest=0, src=0;
- @{operation2a}@ /* MBIERROR2 */
- @{operation2b}@
- @{operation2c}@
+ }else if (rank == 1){
+ dest=0, src=0;
+ @{operation2a}@ /* MBIERROR2 */
+ @{operation2b}@
+ @{operation2c}@
@{fini2a}@
@{fini2b}@
@{fini2c}@
- }
+ }
@{free1a}@
@{free1b}@
@{free1c}@
patterns['operation2a'] = operation[p]("1")
patterns['operation2b'] = operation[r]("3")
patterns['operation2c'] = operation[s]("4")
-
- # Generate the incorrect matching
- replace = patterns
+
+ # Generate the incorrect matching
+ replace = patterns
replace['shortdesc'] = 'MPI_Probe is called before MPI_Recv.'
replace['longdesc'] = 'MPI_Probe is a blocking call that returns only after a matching message has been found. By calling MPI_Probe before MPI_Recv, a deadlock is created.'
- replace['outcome'] = 'ERROR: CallMatching'
- replace['errormsg'] = 'P2P mistmatch. @{p}@ at @{filename}@:@{line:MBIERROR1}@ and @{filename}@:@{line:MBIERROR2}@ are called before @{r}@.'
+ replace['outcome'] = 'ERROR: CallMatching'
+ replace['errormsg'] = 'P2P mistmatch. @{p}@ at @{filename}@:@{line:MBIERROR1}@ and @{filename}@:@{line:MBIERROR2}@ are called before @{r}@.'
make_file(template, f'CallOrdering_{p}_{r}_{s}_nok.c', replace)
- # Generate a correct matching
- replace = patterns
+ # Generate a correct matching
+ replace = patterns
replace['shortdesc'] = 'Correct use of MPI_Probe.'
replace['longdesc'] = 'Correct use of MPI_Probe.'
- replace['outcome'] = 'OK'
+ replace['outcome'] = 'OK'
replace['errormsg'] = 'OK'
replace['operation1a'] = operation[s]("1")
replace['operation1b'] = operation[p]("1")
template = """// @{generatedby}@
/* ///////////////////////// The MPI Bugs Initiative ////////////////////////
- Origin: @{origin}@
+ Origin: @{origin}@
Description: @{shortdesc}@
@{longdesc}@
BEGIN_MPI_FEATURES
- P2P!basic: Lacking
- P2P!nonblocking: Lacking
- P2P!persistent: Lacking
- COLL!basic: Lacking
- COLL!nonblocking: Lacking
- COLL!persistent: Lacking
- COLL!tools: Lacking
- RMA: @{rmafeature}@
+ P2P!basic: Lacking
+ P2P!nonblocking: Lacking
+ P2P!persistent: Lacking
+ COLL!basic: Lacking
+ COLL!nonblocking: Lacking
+ COLL!persistent: Lacking
+ COLL!tools: Lacking
+ RMA: @{rmafeature}@
END_MPI_FEATURES
BEGIN_MBI_TESTS
MPI_Comm_size(MPI_COMM_WORLD, &numProcs);
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
- int *winbuf = malloc(N * sizeof(int));
+ int *winbuf = malloc(N * sizeof(int));
- MPI_Win win;
+ MPI_Win win;
MPI_Win_create(&winbuf, N * sizeof(int), 1, MPI_INFO_NULL, MPI_COMM_WORLD, &win);
- MPI_Datatype type = MPI_INT;
- int target = (rank + 1) % numProcs;
+ MPI_Datatype type = MPI_INT;
+ int target = (rank + 1) % numProcs;
- if(rank == 0){
- @{epoch}@
- @{change_arg}@
- @{init}@
- @{operation}@ /* MBIERROR2 */
+ if(rank == 0){
+ @{epoch}@
+ @{change_arg}@
+ @{init}@
+ @{operation}@ /* MBIERROR2 */
- @{finEpoch}@
- } else {
- @{epoch}@
+ @{finEpoch}@
+ } else {
+ @{epoch}@
- @{finEpoch}@
- }
+ @{finEpoch}@
+ }
MPI_Win_free(&win);
- free(winbuf);
+ free(winbuf);
MPI_Finalize();
return 0;
for e in epoch:
- for p in rma:
+ for p in rma:
patterns = {}
patterns = {'e': e, 'p': p}
patterns['origin'] = "MBI"
- patterns['generatedby'] = f'DO NOT EDIT: this file was generated by {os.path.basename(sys.argv[0])}. DO NOT EDIT.'
+ patterns['generatedby'] = f'DO NOT EDIT: this file was generated by {os.path.basename(sys.argv[0])}. DO NOT EDIT.'
patterns['rmafeature'] = 'Yes'
- patterns['p'] = p
- patterns['e'] = e
- patterns['epoch'] = epoch[e]("1")
- patterns['finEpoch'] = finEpoch[e]("1")
- patterns['init'] = init[p]("1")
- patterns['operation'] = operation[p]("1")
+ patterns['p'] = p
+ patterns['e'] = e
+ patterns['epoch'] = epoch[e]("1")
+ patterns['finEpoch'] = finEpoch[e]("1")
+ patterns['init'] = init[p]("1")
+ patterns['operation'] = operation[p]("1")
patterns['change_arg'] = ""
- # Generate a code with a null type
- replace = patterns
- replace['shortdesc'] = 'Invalid argument in one-sided operation.'
+ # Generate a code with a null type
+ replace = patterns
+ replace['shortdesc'] = 'Invalid argument in one-sided operation.'
replace['longdesc'] = 'A one-sided operation has MPI_DATATYPE_NULL as a type.'
- replace['outcome'] = 'ERROR: InvalidDatatype'
- replace['change_arg'] = 'type = MPI_DATATYPE_NULL;'
+ replace['outcome'] = 'ERROR: InvalidDatatype'
+ replace['change_arg'] = 'type = MPI_DATATYPE_NULL;'
replace['errormsg'] = '@{p}@ at @{filename}@:@{line:MBIERROR}@ has MPI_DATATYPE_NULL as a type'
make_file(template, f'InvalidParam_BufferNullCond_{e}_{p}_nok.c', replace)
- # Generate a code with an invalid type
- replace = patterns
- replace['shortdesc'] = 'Invalid argument in one-sided operation.'
+ # Generate a code with an invalid type
+ replace = patterns
+ replace['shortdesc'] = 'Invalid argument in one-sided operation.'
replace['longdesc'] = 'Use of an invalid datatype in one-sided operation.'
- replace['outcome'] = 'ERROR: InvalidDatatype'
- replace['change_arg'] = 'MPI_Type_contiguous (2, MPI_INT, &type); MPI_Type_commit(&type);MPI_Type_free(&type); /* MBIERROR2 */'
+ replace['outcome'] = 'ERROR: InvalidDatatype'
+ replace['change_arg'] = 'MPI_Type_contiguous (2, MPI_INT, &type); MPI_Type_commit(&type);MPI_Type_free(&type); /* MBIERROR2 */'
replace['errormsg'] = 'Invalid Datatype in @{p}@ at @{filename}@:@{line:MBIERROR}@'
make_file(template, f'InvalidParam_DatatypeCond_{e}_{p}_nok.c', replace)
Description: @{shortdesc}@
@{longdesc}@
- Version of MPI: Conforms to MPI 2, requires MPI 3 implementation (for lock_all/unlock_all epochs)
+ Version of MPI: Conforms to MPI 2, requires MPI 3 implementation (for lock_all/unlock_all epochs)
BEGIN_MPI_FEATURES
- P2P!basic: Lacking
- P2P!nonblocking: Lacking
- P2P!persistent: Lacking
- COLL!basic: Lacking
- COLL!nonblocking: Lacking
- COLL!persistent: Lacking
- COLL!tools: Lacking
- RMA: @{rmafeature}@
+ P2P!basic: Lacking
+ P2P!nonblocking: Lacking
+ P2P!persistent: Lacking
+ COLL!basic: Lacking
+ COLL!nonblocking: Lacking
+ COLL!persistent: Lacking
+ COLL!tools: Lacking
+ RMA: @{rmafeature}@
END_MPI_FEATURES
BEGIN_MBI_TESTS
int main(int argc, char **argv) {
int nprocs = -1;
int rank = -1;
- MPI_Win win;
+ MPI_Win win;
int winbuf[100] = {0};
MPI_Init(&argc, &argv);
if (nprocs < 2)
printf("MBI ERROR: This test needs at least 2 processes to produce a bug!\\n");
- MPI_Datatype type = MPI_INT;
- int target = 1;
+ MPI_Datatype type = MPI_INT;
+ int target = 1;
MPI_Win_create(&winbuf, 100 * sizeof(int), sizeof(int), MPI_INFO_NULL, MPI_COMM_WORLD, &win);
- winbuf[0] = 12345;
- @{init1}@
+ winbuf[0] = 12345;
+ @{init1}@
@{epoch}@
- if (rank == 0) {
- @{operation1}@ /* MBIERROR1 */
- @{operation2}@ /* MBIERROR2 */
- }
+ if (rank == 0) {
+ @{operation1}@ /* MBIERROR1 */
+ @{operation2}@ /* MBIERROR2 */
+ }
@{finEpoch}@
for e in epoch:
- for p1 in get:
+ for p1 in get:
for p2 in put + store + load + get + 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.'
+ patterns['generatedby'] = f'DO NOT EDIT: this file was generated by {os.path.basename(sys.argv[0])}. DO NOT EDIT.'
patterns['rmafeature'] = 'Yes'
- 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")
-
- # Generate a data race (Get + Get/load/store/Put)
- replace = patterns
- replace['shortdesc'] = 'Local Concurrency error.'
- replace['longdesc'] = 'Local Concurrency error. @{p2}@ conflicts with @{p1}@'
- replace['outcome'] = 'ERROR: LocalConcurrency'
+ 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")
+
+ # Generate a data race (Get + Get/load/store/Put)
+ replace = patterns
+ 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)
- # Generate a correct code by switching operation1 and operation2
+ # 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'
- 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)
- # Generate a correct code by removing operation2
- replace = patterns
- replace['shortdesc'] = 'Correct code using RMA operations'
- replace['longdesc'] = 'Correct code using RMA operations'
- replace['outcome'] = 'OK'
+ replace = patterns
+ replace['shortdesc'] = 'Correct code using RMA operations'
+ replace['longdesc'] = 'Correct code using RMA operations'
+ 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)
+ # Generate a correct code by removing operation2
+ replace = patterns
+ replace['shortdesc'] = 'Correct code using RMA operations'
+ replace['longdesc'] = 'Correct code using RMA operations'
+ replace['outcome'] = 'OK'
replace['errormsg'] = 'OK'
replace['operation1'] = operation[p1]("1")
replace['operation2'] = ''
for e in epoch:
- for p1 in put:
+ for p1 in put:
for p2 in 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.'
+ patterns['generatedby'] = f'DO NOT EDIT: this file was generated by {os.path.basename(sys.argv[0])}. DO NOT EDIT.'
patterns['rmafeature'] = 'Yes'
- 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")
-
- # Generate a data race (Put + store)
- replace = patterns
- replace['shortdesc'] = 'Local Concurrency error.'
- replace['longdesc'] = 'Local Concurrency error. @{p2}@ conflicts with @{p1}@'
- replace['outcome'] = 'ERROR: LocalConcurrency'
+ 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")
+
+ # Generate a data race (Put + store)
+ replace = patterns
+ 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)
- # 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['outcome'] = 'OK'
+ # 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['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)
- # Generate a correct code by removing operation2
- replace = patterns
- replace['shortdesc'] = 'Correct code using RMA operations'
- replace['longdesc'] = 'Correct code using RMA operations'
- replace['outcome'] = 'OK'
+ # Generate a correct code by removing operation2
+ replace = patterns
+ replace['shortdesc'] = 'Correct code using RMA operations'
+ replace['longdesc'] = 'Correct code using RMA operations'
+ replace['outcome'] = 'OK'
replace['errormsg'] = 'OK'
replace['operation1'] = operation[p1]("1")
replace['operation2'] = ''
Description: @{shortdesc}@
@{longdesc}@
- Version of MPI: Conforms to MPI 2, requires MPI 3 implementation (for lock_all/unlock_all epochs)
+ Version of MPI: Conforms to MPI 2, requires MPI 3 implementation (for lock_all/unlock_all epochs)
BEGIN_MPI_FEATURES
- P2P!basic: Lacking
- P2P!nonblocking: Lacking
- P2P!persistent: Lacking
- COLL!basic: Lacking
- COLL!nonblocking: Lacking
- COLL!persistent: Lacking
- COLL!tools: Lacking
- RMA: @{rmafeature}@
+ P2P!basic: Lacking
+ P2P!nonblocking: Lacking
+ P2P!persistent: Lacking
+ COLL!basic: Lacking
+ COLL!nonblocking: Lacking
+ COLL!persistent: Lacking
+ COLL!tools: Lacking
+ RMA: @{rmafeature}@
END_MPI_FEATURES
BEGIN_MBI_TESTS
int main(int argc, char **argv) {
int nprocs = -1;
int rank = -1;
- MPI_Win win;
+ MPI_Win win;
int winbuf[100] = {0};
MPI_Init(&argc, &argv);
if (nprocs < 2)
printf("MBI ERROR: This test needs at least 2 processes to produce a bug!\\n");
- MPI_Datatype type = MPI_INT;
- int target = 1;
+ MPI_Datatype type = MPI_INT;
+ int target = 1;
MPI_Win_create(&winbuf, 100 * sizeof(int), sizeof(int), MPI_INFO_NULL, MPI_COMM_WORLD, &win);
- @{init1}@
+ @{init1}@
@{epoch}@
- if (rank == 0) {
- @{operation1}@ /* MBIERROR1 */
- }
- if(rank == 1){
- target = 0;
- @{operation2}@ /* MBIERROR2 */
- }
+ if (rank == 0) {
+ @{operation1}@ /* MBIERROR1 */
+ }
+ if(rank == 1){
+ target = 0;
+ @{operation2}@ /* MBIERROR2 */
+ }
@{finEpoch}@
for e in epoch:
- for p1 in get:
+ for p1 in get:
for p2 in put + rstore + rload + get :
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.'
+ patterns['generatedby'] = f'DO NOT EDIT: this file was generated by {os.path.basename(sys.argv[0])}. DO NOT EDIT.'
patterns['rmafeature'] = 'Yes'
- 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")
-
- # Generate a data race (Get + Get/load/store/Put)
- replace = patterns
- replace['shortdesc'] = 'Global Concurrency error.'
- replace['longdesc'] = 'Global Concurrency error. @{p2}@ conflicts with @{p1}@'
- replace['outcome'] = 'ERROR: GlobalConcurrency'
+ 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")
+
+ # Generate a data race (Get + Get/load/store/Put)
+ replace = patterns
+ replace['shortdesc'] = 'Global Concurrency error.'
+ replace['longdesc'] = 'Global Concurrency error. @{p2}@ conflicts with @{p1}@'
+ replace['outcome'] = 'ERROR: GlobalConcurrency'
replace['errormsg'] = 'Global Concurrency error. @{p2}@ at @{filename}@:@{line:MBIERROR2}@ conflicts with @{p1}@ line @{line:MBIERROR1}@'
# Replace Put and Get first argument
for e in epoch:
- for p1 in put:
+ for p1 in put:
for p2 in rstore + rload + put:
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.'
+ patterns['generatedby'] = f'DO NOT EDIT: this file was generated by {os.path.basename(sys.argv[0])}. DO NOT EDIT.'
patterns['rmafeature'] = 'Yes'
- 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")
-
- # Generate a data race (Put + store)
- replace = patterns
- replace['shortdesc'] = 'Global Concurrency error.'
- replace['longdesc'] = 'Global Concurrency error. @{p2}@ conflicts with @{p1}@'
- replace['outcome'] = 'ERROR: LocalConcurrency'
+ 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")
+
+ # Generate a data race (Put + store)
+ replace = patterns
+ replace['shortdesc'] = 'Global Concurrency error.'
+ replace['longdesc'] = 'Global Concurrency error. @{p2}@ conflicts with @{p1}@'
+ replace['outcome'] = 'ERROR: LocalConcurrency'
replace['errormsg'] = 'Global Concurrency error. @{p2}@ at @{filename}@:@{line:MBIERROR2}@ conflicts with @{p1}@ line @{line:MBIERROR1}@'
# Replace Put first argument
if p2 in put:
- replace['operation2'] = 'MPI_Put(&winbuf[20], N, MPI_INT, target, 0, N, type, win);'
-
+ replace['operation2'] = 'MPI_Put(&winbuf[20], N, MPI_INT, target, 0, N, type, win);'
+
make_file(template, f'GlobalConcurrency_rl_{e}_{p1}_{p2}_nok.c', replace)
Description: @{shortdesc}@
@{longdesc}@
- Version of MPI: Conforms to MPI 2, requires MPI 3 implementation (for lock_all/unlock_all epochs)
+ Version of MPI: Conforms to MPI 2, requires MPI 3 implementation (for lock_all/unlock_all epochs)
BEGIN_MPI_FEATURES
- P2P!basic: Lacking
- P2P!nonblocking: Lacking
- P2P!persistent: Lacking
- COLL!basic: Lacking
- COLL!nonblocking: Lacking
- COLL!persistent: Lacking
- COLL!tools: Lacking
- RMA: @{rmafeature}@
+ P2P!basic: Lacking
+ P2P!nonblocking: Lacking
+ P2P!persistent: Lacking
+ COLL!basic: Lacking
+ COLL!nonblocking: Lacking
+ COLL!persistent: Lacking
+ COLL!tools: Lacking
+ RMA: @{rmafeature}@
END_MPI_FEATURES
BEGIN_MBI_TESTS
int main(int argc, char **argv) {
int nprocs = -1;
int rank = -1;
- MPI_Win win;
+ MPI_Win win;
int winbuf[100] = {0};
MPI_Init(&argc, &argv);
if (nprocs < 2)
printf("MBI ERROR: This test needs at least 2 processes to produce a bug!\\n");
- MPI_Datatype type = MPI_INT;
- int target = 1;
+ MPI_Datatype type = MPI_INT;
+ int target = 1;
MPI_Win_create(&winbuf, 100 * sizeof(int), sizeof(int), MPI_INFO_NULL, MPI_COMM_WORLD, &win);
- @{init1}@
+ @{init1}@
@{epoch}@
- if (rank == 0 || rank == 2) {
- @{operation1}@ /* MBIERROR1 */
- }
+ if (rank == 0 || rank == 2) {
+ @{operation1}@ /* MBIERROR1 */
+ }
@{finEpoch}@
for e in epoch:
- for p1 in get + put:
+ for p1 in get + put:
patterns = {}
patterns = {'e': e, 'p1': p1}
- patterns['generatedby'] = f'DO NOT EDIT: this file was generated by {os.path.basename(sys.argv[0])}. DO NOT EDIT.'
+ patterns['generatedby'] = f'DO NOT EDIT: this file was generated by {os.path.basename(sys.argv[0])}. DO NOT EDIT.'
patterns['rmafeature'] = 'Yes'
- patterns['p1'] = p1
- patterns['e'] = e
- patterns['epoch'] = epoch[e]("1")
- patterns['finEpoch'] = finEpoch[e]("1")
- patterns['init1'] = init[p1]("1")
- patterns['operation1'] = operation[p1]("1")
-
- # Generate a data race (Get + Get/load/store/Put)
- replace = patterns
- replace['shortdesc'] = 'Global Concurrency error.'
+ patterns['p1'] = p1
+ patterns['e'] = e
+ patterns['epoch'] = epoch[e]("1")
+ patterns['finEpoch'] = finEpoch[e]("1")
+ patterns['init1'] = init[p1]("1")
+ patterns['operation1'] = operation[p1]("1")
+
+ # Generate a data race (Get + Get/load/store/Put)
+ replace = patterns
+ replace['shortdesc'] = 'Global Concurrency error.'
replace['longdesc'] = 'Global Concurrency error. Both processes 0 and 2 access the window in process 1 with @{p1}@'
- replace['outcome'] = 'ERROR: GlobalConcurrency'
+ replace['outcome'] = 'ERROR: GlobalConcurrency'
replace['errormsg'] = 'Global Concurrency error. @{p1}@ at @{filename}@:@{line:MBIERROR1}@ conflicts in process 1'
make_file(template, f'GlobalConcurrency_rr_{e}_{p1}_nok.c', replace)
Description: @{shortdesc}@
@{longdesc}@
- Version of MPI: Conforms to MPI 1.1, does not require MPI 2 implementation
+ Version of MPI: Conforms to MPI 1.1, does not require MPI 2 implementation
BEGIN_MPI_FEATURES
- P2P!basic: Lacking
- P2P!nonblocking: Lacking
- P2P!persistent: Lacking
- COLL!basic: Lacking
- COLL!nonblocking: Lacking
- COLL!persistent: Lacking
- COLL!tools: @{toolfeature}@
- RMA: Lacking
+ P2P!basic: Lacking
+ P2P!nonblocking: Lacking
+ P2P!persistent: Lacking
+ COLL!basic: Lacking
+ COLL!nonblocking: Lacking
+ COLL!persistent: Lacking
+ COLL!tools: @{toolfeature}@
+ RMA: Lacking
END_MPI_FEATURES
BEGIN_MBI_TESTS
int main(int argc, char **argv) {
int nprocs = -1;
int rank = -1;
- int i=1, j=1, size=1;
- int color =0;
+ int i=1, j=1, size=1;
+ int color =0;
MPI_Init(&argc, &argv);
MPI_Comm_size(MPI_COMM_WORLD, &nprocs);
if (nprocs < 2)
printf("MBI ERROR: This test needs at least 2 processes to produce a bug!\\n");
- @{change_size}@
+ @{change_size}@
@{init}@
- @{loop}@
- @{operation}@
- @{cond}@
- @{fini}@
- @{end}@
+ @{loop}@
+ @{operation}@
+ @{cond}@
+ @{fini}@
+ @{end}@
- @{free}@
+ @{free}@
MPI_Finalize();
printf("Rank %d finished normally\\n", rank);
patterns = {}
patterns = {'call': call}
patterns['generatedby'] = f'DO NOT EDIT: this file was generated by {os.path.basename(sys.argv[0])}. DO NOT EDIT.'
- patterns['toolfeature'] = 'Yes'
+ patterns['toolfeature'] = 'Yes'
patterns['call'] = call
patterns['operation'] = operation[call]("1")
patterns['init'] = init[call]("1")
# Generate the correct code
replace = patterns
- replace['shortdesc'] = '@{call}@ is correctly used'
- replace['longdesc'] = f'{call} correctly used'
+ replace['shortdesc'] = '@{call}@ is correctly used'
+ replace['longdesc'] = f'{call} correctly used'
replace['outcome'] = 'OK'
replace['errormsg'] = ''
make_file(template, f'ResLeak_{call}_ok.c', replace)
replace['outcome'] = f'ERROR: {error[call]}'
replace['errormsg'] = 'Resleak. @{call}@ at @{filename}@:@{line:MBIERROR}@ lacks several free.'
replace['change_size'] = 'size=PARAM_PER_ITERATION;'
- replace['loop'] = 'for (i = 0; i < ITERATIONS; i++) {\n for (j = 0; j < PARAM_PER_ITERATION; j++) {'
- replace['cond'] = ' if (j < PARAM_PER_ITERATION - PARAM_LOST_PER_ITERATION) {'
+ replace['loop'] = 'for (i = 0; i < ITERATIONS; i++) {\n for (j = 0; j < PARAM_PER_ITERATION; j++) {'
+ replace['cond'] = ' if (j < PARAM_PER_ITERATION - PARAM_LOST_PER_ITERATION) {'
replace['fini'] = fini[call]("1") + ' /* MBIERROR */'
- replace['end'] = ' }\n }\n }'
+ replace['end'] = ' }\n }\n }'
make_file(template, f'ResLeak_multiple_{call}_nok.c', replace)
-# Copyright 2021-2022. The MBI project. All rights reserved.
+# Copyright 2021-2022. The MBI project. All rights reserved.
# This program is free software; you can redistribute it and/or modify it under the terms of the license (GNU GPL).
# This is a simple templating system, dedicated to the systematic generation of MPI source code
icoll4root = ['MPI_Ireduce', 'MPI_Ibcast', 'MPI_Igather', 'MPI_Iscatter']
pcoll = []
tcoll = ['MPI_Comm_split', 'MPI_Op_create', 'MPI_Comm_dup', 'MPI_Type_contiguous', 'MPI_Comm_create', 'MPI_Group_excl'] # MPI_Comm_dup removed
-tcoll4color = ['MPI_Comm_split']
+tcoll4color = ['MPI_Comm_split']
tcoll4topo = ['MPI_Cart_get']
# P2P
allsend = ['MPI_Send', 'MPI_Isend', 'MPI_Ssend', 'MPI_Bsend','MPI_Send_init']
-allrecv = ['MPI_Recv', 'MPI_Irecv', 'MPI_Recv_init']
+allrecv = ['MPI_Recv', 'MPI_Irecv', 'MPI_Recv_init']
send = ['MPI_Send']
ssend = ['MPI_Ssend']
bsend = ['MPI_Bsend']
isend = ['MPI_Isend']
psend = ['MPI_Send_init']
-recv = ['MPI_Recv']
-irecv = ['MPI_Irecv']
-precv = ['MPI_Recv_init']
+recv = ['MPI_Recv']
+irecv = ['MPI_Irecv']
+precv = ['MPI_Recv_init']
probe = ['MPI_Probe']
# RMA
epoch = ['MPI_Win_fence', 'MPI_Win_lock', 'MPI_Win_lock_all']
rma = ['MPI_Get', 'MPI_Put']
get = ['MPI_Get']
-put = ['MPI_Put']
+put = ['MPI_Put']
store = ['store']
load = ['load']
rstore = ['rstore']
start = {}
operation = {}
fini = {}
-free = {}
+free = {}
write = {}
error = {}
epoch = {}
write['MPI_Exscan'] = lambda n: ""
init['MPI_Allgather'] = lambda n: f"int val{n}=1, *rbuf{n} = (int*)malloc(dbs);"
-start['MPI_Allgather'] = lambda n: ""
+start['MPI_Allgather'] = lambda n: ""
operation['MPI_Allgather'] = lambda n: f"MPI_Allgather(&val{n}, 1, type, rbuf{n}, 1, type, newcom);"
fini['MPI_Allgather'] = lambda n: ""
-free['MPI_Allgather'] = lambda n: f"free(rbuf{n});"
-write['MPI_Allgather'] = lambda n: ""
+free['MPI_Allgather'] = lambda n: f"free(rbuf{n});"
+write['MPI_Allgather'] = lambda n: ""
init['MPI_Alltoallv'] = lambda n: (f"int *sbuf{n}=(int*)malloc(dbs*2), *rbuf{n}=(int*)malloc(dbs*2), *scounts{n}=(int*)malloc(dbs), *rcounts{n}=(int*)malloc(dbs), *sdispls{n}=(int*)malloc(dbs), *rdispls{n}=(int*)malloc(dbs);\n"
+ " for (int i = 0; i < nprocs; i++) {\n"
+ f" sdispls{n}[i] = (nprocs - (i + 1)) * 2;\n"
+ f" rdispls{n}[i] = i * 2;\n"
+ " }")
-start['MPI_Alltoallv'] = lambda n: ""
+start['MPI_Alltoallv'] = lambda n: ""
operation['MPI_Alltoallv'] = lambda n: f"MPI_Alltoallv(sbuf{n}, scounts{n}, sdispls{n}, type, rbuf{n}, rcounts{n}, rdispls{n}, type, newcom);"
-fini['MPI_Alltoallv'] = lambda n: ""
+fini['MPI_Alltoallv'] = lambda n: ""
free['MPI_Alltoallv'] = lambda n: f"free(sbuf{n});free(rbuf{n});free(scounts{n});free(rcounts{n});free(sdispls{n});free(rdispls{n});"
-write['MPI_Alltoallv'] = lambda n: ""
+write['MPI_Alltoallv'] = lambda n: ""
init['MPI_Alltoall'] = lambda n: f"int *sbuf{n} = (int*)malloc(dbs), *rbuf{n} = (int*)malloc(dbs);"
-start['MPI_Alltoall'] = lambda n: ""
+start['MPI_Alltoall'] = lambda n: ""
operation['MPI_Alltoall'] = lambda n: f"MPI_Alltoall(sbuf{n}, 1, type, rbuf{n}, 1, type, newcom);"
-fini['MPI_Alltoall'] = lambda n: ""
+fini['MPI_Alltoall'] = lambda n: ""
free['MPI_Alltoall'] = lambda n: f"free(sbuf{n});free(rbuf{n});"
-write['MPI_Alltoall'] = lambda n: ""
+write['MPI_Alltoall'] = lambda n: ""
-init['MPI_Allgatherv'] = lambda n: (f"int *rbuf{n} = (int*)malloc(dbs*2), *rcounts{n}=(int*)malloc(dbs), *displs{n}=(int*)malloc(dbs);\n"
+init['MPI_Allgatherv'] = lambda n: (f"int *rbuf{n} = (int*)malloc(dbs*2), *rcounts{n}=(int*)malloc(dbs), *displs{n}=(int*)malloc(dbs);\n"
+ " for (int i = 0; i < nprocs; i++) {\n"
+ f" rcounts{n}[i] = 1;\n"
+ f" displs{n}[i] = 2 * (nprocs - (i + 1));\n"
+ " }")
-start['MPI_Allgatherv'] = lambda n: ""
+start['MPI_Allgatherv'] = lambda n: ""
operation['MPI_Allgatherv'] = lambda n: f"MPI_Allgatherv(&rank, 1, type, rbuf{n}, rcounts{n}, displs{n}, type, newcom);"
-fini['MPI_Allgatherv'] = lambda n: ""
+fini['MPI_Allgatherv'] = lambda n: ""
free['MPI_Allgatherv'] = lambda n: f"free(rbuf{n});free(rcounts{n});free(displs{n});"
-write['MPI_Allgatherv'] = lambda n: ""
+write['MPI_Allgatherv'] = lambda n: ""
### COLL:nonblocking
init['MPI_Ireduce'] = lambda n: f"MPI_Request req{n}=MPI_REQUEST_NULL; MPI_Status stat{n}; int sum{n}, val{n} = 1;"
start['MPI_Ireduce'] = lambda n: ""
operation['MPI_Ireduce'] = lambda n: f"MPI_Ireduce(&val{n}, &sum{n}, 1, type, op, root, newcom, &req{n});"
-fini['MPI_Ireduce'] = lambda n: f"MPI_Wait(&req{n}, &stat{n});"
+fini['MPI_Ireduce'] = lambda n: f"MPI_Wait(&req{n}, &stat{n});"
free['MPI_Ireduce'] = lambda n: f'if(req{n} != MPI_REQUEST_NULL) MPI_Request_free(&req{n});'
write['MPI_Ireduce'] = lambda n: f"sum{n}++;"
write['MPI_Ibcast'] = lambda n: f'buf{n}[0]++;'
init['MPI_Igather'] = lambda n: f"int val{n}=1, buf{n}[buff_size];MPI_Request req{n}=MPI_REQUEST_NULL;MPI_Status sta{n};"
-start['MPI_Igather'] = lambda n: ""
+start['MPI_Igather'] = lambda n: ""
operation['MPI_Igather'] = lambda n: f'MPI_Igather(&val{n}, 1, type, &buf{n},1, type, root, newcom, &req{n});'
write['MPI_Igather'] = lambda n: f'val{n}=3;'
fini['MPI_Igather'] = lambda n: f'MPI_Wait(&req{n},&sta{n});'
-free['MPI_Igather'] = lambda n: f'if(req{n} != MPI_REQUEST_NULL) MPI_Request_free(&req{n});'
+free['MPI_Igather'] = lambda n: f'if(req{n} != MPI_REQUEST_NULL) MPI_Request_free(&req{n});'
init['MPI_Iscatter'] = lambda n: f"MPI_Request req{n}=MPI_REQUEST_NULL;MPI_Status sta{n};int val{n}, buf{n}[buff_size];"
start['MPI_Iscatter'] = lambda n: ""
write['MPI_Iexscan'] = lambda n: f'outbuf{n}[0]++;'
init['MPI_Iallgather'] = lambda n: f"MPI_Request req{n}=MPI_REQUEST_NULL;MPI_Status sta{n};int val{n}=1, *rbuf{n} = (int*)malloc(dbs);"
-start['MPI_Iallgather'] = lambda n: ""
+start['MPI_Iallgather'] = lambda n: ""
operation['MPI_Iallgather'] = lambda n: f"MPI_Iallgather(&val{n}, 1, type, rbuf{n}, 1, type, newcom,&req{n});"
fini['MPI_Iallgather'] = lambda n: f"MPI_Wait(&req{n},&sta{n});"
-free['MPI_Iallgather'] = lambda n: f"free(rbuf{n});"
+free['MPI_Iallgather'] = lambda n: f"free(rbuf{n});"
write['MPI_Iallgather'] = lambda n: f'val{n}++;'
-init['MPI_Iallgatherv'] = lambda n: (f"MPI_Request req{n}=MPI_REQUEST_NULL;MPI_Status sta{n};int *rbuf{n} = (int*)malloc(dbs*2), *rcounts{n}=(int*)malloc(dbs), *displs{n}=(int*)malloc(dbs);\n"
+init['MPI_Iallgatherv'] = lambda n: (f"MPI_Request req{n}=MPI_REQUEST_NULL;MPI_Status sta{n};int *rbuf{n} = (int*)malloc(dbs*2), *rcounts{n}=(int*)malloc(dbs), *displs{n}=(int*)malloc(dbs);\n"
+ " for (int i = 0; i < nprocs; i++) {\n"
+ f" rcounts{n}[i] = 1;\n"
+ f" displs{n}[i] = 2 * (nprocs - (i + 1));\n"
+ " }")
-start['MPI_Iallgatherv'] = lambda n: ""
+start['MPI_Iallgatherv'] = lambda n: ""
operation['MPI_Iallgatherv'] = lambda n: f"MPI_Iallgatherv(&rank, 1, type, rbuf{n}, rcounts{n}, displs{n}, type, newcom,&req{n});"
-fini['MPI_Iallgatherv'] = lambda n: f"MPI_Wait(&req{n},&sta{n});"
+fini['MPI_Iallgatherv'] = lambda n: f"MPI_Wait(&req{n},&sta{n});"
free['MPI_Iallgatherv'] = lambda n: f"free(rbuf{n});free(rcounts{n});free(displs{n});"
-write['MPI_Iallgatherv'] = lambda n: f"rbuf{n}[0]++;"
+write['MPI_Iallgatherv'] = lambda n: f"rbuf{n}[0]++;"
init['MPI_Ialltoall'] = lambda n: f"MPI_Request req{n}=MPI_REQUEST_NULL;MPI_Status sta{n};int *sbuf{n} = (int*)malloc(dbs), *rbuf{n} = (int*)malloc(dbs);"
-start['MPI_Ialltoall'] = lambda n: ""
+start['MPI_Ialltoall'] = lambda n: ""
operation['MPI_Ialltoall'] = lambda n: f"MPI_Ialltoall(sbuf{n}, 1, type, rbuf{n}, 1, type, newcom, &req{n});"
fini['MPI_Ialltoall'] = lambda n: f"MPI_Wait(&req{n},&sta{n});"
free['MPI_Ialltoall'] = lambda n: f"free(sbuf{n});free(rbuf{n});"
+ f" sdispls{n}[i] = (nprocs - (i + 1)) * 2;\n"
+ f" rdispls{n}[i] = i * 2;\n"
+ " }")
-start['MPI_Ialltoallv'] = lambda n: ""
+start['MPI_Ialltoallv'] = lambda n: ""
operation['MPI_Ialltoallv'] = lambda n: f"MPI_Ialltoallv(sbuf{n}, scounts{n}, sdispls{n}, type, rbuf{n}, rcounts{n}, rdispls{n}, type, newcom,&req{n});"
fini['MPI_Ialltoallv'] = lambda n: f"MPI_Wait(&req{n},&sta{n});"
free['MPI_Ialltoallv'] = lambda n: f"free(sbuf{n});free(rbuf{n});free(scounts{n});free(rcounts{n});free(sdispls{n});free(rdispls{n});"
operation['MPI_Comm_group'] = lambda n: 'MPI_Comm_group(MPI_COMM_WORLD, &grp[j]);'
error['MPI_Comm_group'] = 'GroupLeak'
fini['MPI_Comm_group'] = lambda n: "MPI_Group_free(&grp[j]);"
-free['MPI_Comm_group'] = lambda n: ""
+free['MPI_Comm_group'] = lambda n: ""
init['MPI_Group_excl'] = lambda n: 'MPI_Group worldgroup, grp[size];\n MPI_Comm_group(MPI_COMM_WORLD, &worldgroup);'
-operation['MPI_Group_excl'] = lambda n: 'MPI_Group_excl(worldgroup, 1, &rank, &grp[j]);'
+operation['MPI_Group_excl'] = lambda n: 'MPI_Group_excl(worldgroup, 1, &rank, &grp[j]);'
error['MPI_Group_excl'] = 'GroupLeak'
fini['MPI_Group_excl'] = lambda n: "MPI_Group_free(&grp[j]);"
free['MPI_Group_excl'] = lambda n: "MPI_Group_free(&worldgroup);"
operation['MPI_Comm_dup'] = lambda n: 'MPI_Comm_dup(MPI_COMM_WORLD, &com[j]);'
error['MPI_Comm_dup'] = 'CommunicatorLeak'
fini['MPI_Comm_dup'] = lambda n: "MPI_Comm_free(&com[j]);"
-free['MPI_Comm_dup'] = lambda n: ""
+free['MPI_Comm_dup'] = lambda n: ""
init['MPI_Type_contiguous'] = lambda n: 'MPI_Datatype type[size];'
operation['MPI_Type_contiguous'] = lambda n: 'MPI_Type_contiguous(2, MPI_DOUBLE, &type[j]);'
error['MPI_Type_contiguous'] = 'TypeLeak'
fini['MPI_Type_contiguous'] = lambda n: "MPI_Type_free(&type[j]);"
-free['MPI_Type_contiguous'] = lambda n: ""
+free['MPI_Type_contiguous'] = lambda n: ""
-### P2P:basic
+### P2P:basic
init['MPI_Send'] = lambda n: f'int buf{n}=rank;'
start['MPI_Send'] = lambda n: ""
write['MPI_Ssend'] = lambda n: ""
init['MPI_Bsend'] = lambda n: (f'int buf{n}=rank;\n'
- + f'int buffer_attached_size{n} = MPI_BSEND_OVERHEAD + sizeof(int);\n'
+ + f'int buffer_attached_size{n} = MPI_BSEND_OVERHEAD + sizeof(int);\n'
+ f'char* buffer_attached{n} = (char*)malloc(buffer_attached_size{n});\n'
+ f'MPI_Buffer_attach(buffer_attached{n}, buffer_attached_size{n});')
start['MPI_Bsend'] = lambda n: ""
### P2P:nonblocking
init['MPI_Isend'] = lambda n: f'int buf{n}=rank; MPI_Request req{n}=MPI_REQUEST_NULL;'
-start['MPI_Isend'] = lambda n: ""
+start['MPI_Isend'] = lambda n: ""
operation['MPI_Isend'] = lambda n: f'MPI_Isend(&buf{n}, buff_size, type, dest, stag, newcom, &req{n});'
fini['MPI_Isend'] = lambda n: f'MPI_Wait(&req{n}, MPI_STATUS_IGNORE);'
free['MPI_Isend'] = lambda n: f'if(req{n} != MPI_REQUEST_NULL) MPI_Request_free(&req{n});'
write['MPI_Isend'] = lambda n: f'buf{n}=4;'
init['MPI_Irecv'] = lambda n: f'int buf{n}=-1; MPI_Request req{n}=MPI_REQUEST_NULL;'
-start['MPI_Irecv'] = lambda n: ""
+start['MPI_Irecv'] = lambda n: ""
operation['MPI_Irecv'] = lambda n: f'MPI_Irecv(&buf{n}, buff_size, type, src, rtag, newcom, &req{n});'
fini['MPI_Irecv'] = lambda n: f' MPI_Wait(&req{n}, MPI_STATUS_IGNORE);'
free['MPI_Irecv'] = lambda n: f'if(req{n} != MPI_REQUEST_NULL) MPI_Request_free(&req{n});'
-write['MPI_Irecv'] = lambda n: f'buf{n}++;'
+write['MPI_Irecv'] = lambda n: f'buf{n}++;'
### P2P:persistent
init['MPI_Send_init'] = lambda n: f'int buf{n}=rank; MPI_Request req{n}=MPI_REQUEST_NULL;'
-operation['MPI_Send_init'] = lambda n: f'MPI_Send_init(&buf{n}, buff_size, type, dest, stag, newcom, &req{n});'
+operation['MPI_Send_init'] = lambda n: f'MPI_Send_init(&buf{n}, buff_size, type, dest, stag, newcom, &req{n});'
start['MPI_Send_init'] = lambda n: f'MPI_Start(&req{n});'
fini['MPI_Send_init'] = lambda n: f'MPI_Wait(&req{n}, MPI_STATUS_IGNORE);'
free['MPI_Send_init'] = lambda n: f'if(req{n} != MPI_REQUEST_NULL) MPI_Request_free(&req{n});'
-write['MPI_Send_init'] = lambda n: f'buf{n}=4;'
+write['MPI_Send_init'] = lambda n: f'buf{n}=4;'
init['MPI_Recv_init'] = lambda n: f'int buf{n}=-1; MPI_Request req{n}=MPI_REQUEST_NULL;'
start['MPI_Recv_init'] = lambda n: f'MPI_Start(&req{n});'
operation['MPI_Recv_init'] = lambda n: f'MPI_Recv_init(&buf{n}, buff_size, type, src, rtag, newcom, &req{n});'
fini['MPI_Recv_init'] = lambda n: f'MPI_Wait(&req{n}, MPI_STATUS_IGNORE);'
free['MPI_Recv_init'] = lambda n: f'if(req{n} != MPI_REQUEST_NULL) MPI_Request_free(&req{n});'
-write['MPI_Recv_init'] = lambda n: f'buf{n}++;'
+write['MPI_Recv_init'] = lambda n: f'buf{n}++;'
### RMA
operation['MPI_Put'] = lambda n: f'MPI_Put(&localbuf{n}, N, MPI_INT, target, 0, N, type, win);'
init['MPI_Get'] = lambda n: f'int localbuf{n}[N] = {{54321}};'
-operation['MPI_Get'] = lambda n: f'MPI_Get(&localbuf{n}, N, MPI_INT, target, 0, N, type, win);'
+operation['MPI_Get'] = lambda n: f'MPI_Get(&localbuf{n}, N, MPI_INT, target, 0, N, type, win);'
init['store'] = lambda n: f'int localbuf{n}[N] = {{0}};'
operation['store'] = lambda n: f'localbuf{n}[0] = 8;'
init['load'] = lambda n: f'int localbuf{n}[N] = {{0}};'
operation['load'] = lambda n: f'int load = localbuf{n}[0];'
-init['rload'] = lambda n: ""
+init['rload'] = lambda n: ""
operation['rload'] = lambda n: "int load = winbuf[20];"
init['loadstore'] = lambda n: f'int localbuf{n}[N] = {{0}};'
def teardown(self):
subprocess.run("find -type f -a -executable | xargs rm -f", shell=True, check=True) # Remove generated cruft (binary files)
- subprocess.run("rm -f smpitmp-* core", shell=True, check=True)
+ subprocess.run("rm -f smpitmp-* core", shell=True, check=True)
def parse(self, cachefile):
if os.path.exists(f'{cachefile}.timeout') or os.path.exists(f'logs/simgrid/{cachefile}.timeout'):