Skip to content
Snippets Groups Projects
Verified Commit 8ca189e7 authored by Simon Schwitanski's avatar Simon Schwitanski :slight_smile:
Browse files

Add missing source files

parent 18ccf13f
No related branches found
No related tags found
No related merge requests found
Showing
with 836 additions and 0 deletions
/* ///////////////////////// The MPI Bug Bench ////////////////////////
Description: ParamMatching: mpi_comm_create_from_group
Version of MPI: 4.0
BEGIN_MBB_TESTS
$ mpirun -np 2 ${EXE}
| ERROR ParamMatching
| ParamMatching-Comm-mpi_improbe
END_MBB_TESTS
////////////////////// End of MBI headers /////////////////// */
#include <mpi.h>
#include <stddef.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char **argv) {
int nprocs = -1;
int rank = -1;
MPI_Message mpi_message_0 = MPI_MESSAGE_NULL;
MPI_Request mpi_request_0 = MPI_REQUEST_NULL;
int int_0 = 0;
MPI_Comm mpi_comm_0 = MPI_COMM_NULL;
MPI_Init(&argc, &argv);
MPI_Comm_size(MPI_COMM_WORLD, &nprocs);
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
if (nprocs < 2)
printf(
"MBB ERROR: This test needs at least 2 processes to produce a bug!\n");
int *buf = (int *)calloc(10, sizeof(int));
MPI_Comm_create_from_group(&mpi_group_0, "0", MPI_INFO_NULL,
MPI_ERRORS_ARE_FATAL, &mpi_comm_0);
if (rank == 0) {
while (!int_0) {
/*MBBERROR_BEGIN*/ MPI_Improbe(1, 0, mpi_comm_0, &int_0, &mpi_message_0,
MPI_STATUS_IGNORE); /*MBBERROR_END*/
}
MPI_Mrecv(buf, 10, MPI_INT, &mpi_message_0, MPI_STATUS_IGNORE);
}
if (rank == 1) {
MPI_Send(buf, 10, MPI_INT, 0, 0, MPI_COMM_WORLD);
}
free(buf);
MPI_Comm_free(&mpi_comm_0);
MPI_Comm_free(&mpi_comm_0);
MPI_Finalize();
printf("Rank %d finished normally\n", rank);
return 0;
}
/* ///////////////////////// The MPI Bug Bench ////////////////////////
Description: ParamMatching: mpi_intercomm_create_from_groups
Version of MPI: 4.0
BEGIN_MBB_TESTS
$ mpirun -np 2 ${EXE}
| ERROR ParamMatching
| ParamMatching-Comm-mpi_improbe
END_MBB_TESTS
////////////////////// End of MBI headers /////////////////// */
#include <mpi.h>
#include <stddef.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char **argv) {
int nprocs = -1;
int rank = -1;
MPI_Message mpi_message_0 = MPI_MESSAGE_NULL;
MPI_Request mpi_request_0 = MPI_REQUEST_NULL;
int int_0 = 0;
MPI_Comm mpi_comm_0 = MPI_COMM_NULL;
MPI_Comm mpi_comm_1 = MPI_COMM_NULL;
MPI_Comm mpi_comm_2 = MPI_COMM_NULL;
MPI_Comm mpi_comm_3 = MPI_COMM_NULL;
MPI_Init(&argc, &argv);
MPI_Comm_size(MPI_COMM_WORLD, &nprocs);
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
if (nprocs < 2)
printf(
"MBB ERROR: This test needs at least 2 processes to produce a bug!\n");
int *buf = (int *)calloc(10, sizeof(int));
MPI_Intercomm_create_from_groups((rank % 2 ? mpi_comm_2 : mpi_comm_3), 0,
(!(rank % 2) ? mpi_comm_2 : mpi_comm_3), 0,
"0", MPI_INFO_NULL, MPI_ERRORS_ARE_FATAL,
&mpi_comm_0);
MPI_Group_incl(mpi_comm_1, 1, &triplet, mpi_comm_3);
triplet[0] = 1;
MPI_Group_incl(mpi_comm_1, 1, &triplet, mpi_comm_2);
int[3] triplet;
triplet[0] = 0;
triplet[1] = size;
triplet[2] = 2;
MPI_Comm_group(intercomm_base_comm, &intercomm_base_comm_group);
MPI_Comm_group(MPI_COMM_WORLD, &mpi_comm_1);
if (rank == 0) {
while (!int_0) {
/*MBBERROR_BEGIN*/ MPI_Improbe(0, 0, mpi_comm_0, &int_0, &mpi_message_0,
MPI_STATUS_IGNORE); /*MBBERROR_END*/
}
MPI_Mrecv(buf, 10, MPI_INT, &mpi_message_0, MPI_STATUS_IGNORE);
}
if (rank == 1) {
MPI_Send(buf, 10, MPI_INT, 0, 0, MPI_COMM_WORLD);
}
free(buf);
MPI_Comm_free(&mpi_comm_0);
MPI_Comm_free(&mpi_comm_0);
MPI_Finalize();
printf("Rank %d finished normally\n", rank);
return 0;
}
/* ///////////////////////// The MPI Bug Bench ////////////////////////
Description: ParamMatching: mpi_comm_create_from_group
Version of MPI: 4.0
BEGIN_MBB_TESTS
$ mpirun -np 2 ${EXE}
| ERROR ParamMatching
| ParamMatching-Comm-mpi_mprobe
END_MBB_TESTS
////////////////////// End of MBI headers /////////////////// */
#include <mpi.h>
#include <stddef.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char **argv) {
int nprocs = -1;
int rank = -1;
MPI_Message mpi_message_0 = MPI_MESSAGE_NULL;
MPI_Request mpi_request_0 = MPI_REQUEST_NULL;
int int_0 = 0;
MPI_Comm mpi_comm_0 = MPI_COMM_NULL;
MPI_Init(&argc, &argv);
MPI_Comm_size(MPI_COMM_WORLD, &nprocs);
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
if (nprocs < 2)
printf(
"MBB ERROR: This test needs at least 2 processes to produce a bug!\n");
int *buf = (int *)calloc(10, sizeof(int));
MPI_Comm_create_from_group(&mpi_group_0, "0", MPI_INFO_NULL,
MPI_ERRORS_ARE_FATAL, &mpi_comm_0);
if (rank == 0) {
/*MBBERROR_BEGIN*/ MPI_Mprobe(1, 0, mpi_comm_0, &mpi_message_0,
MPI_STATUS_IGNORE); /*MBBERROR_END*/
MPI_Mrecv(buf, 10, MPI_INT, &mpi_message_0, MPI_STATUS_IGNORE);
}
if (rank == 1) {
MPI_Send(buf, 10, MPI_INT, 0, 0, MPI_COMM_WORLD);
}
free(buf);
MPI_Comm_free(&mpi_comm_0);
MPI_Comm_free(&mpi_comm_0);
MPI_Finalize();
printf("Rank %d finished normally\n", rank);
return 0;
}
/* ///////////////////////// The MPI Bug Bench ////////////////////////
Description: ParamMatching: mpi_intercomm_create_from_groups
Version of MPI: 4.0
BEGIN_MBB_TESTS
$ mpirun -np 2 ${EXE}
| ERROR ParamMatching
| ParamMatching-Comm-mpi_mprobe
END_MBB_TESTS
////////////////////// End of MBI headers /////////////////// */
#include <mpi.h>
#include <stddef.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char **argv) {
int nprocs = -1;
int rank = -1;
MPI_Message mpi_message_0 = MPI_MESSAGE_NULL;
MPI_Request mpi_request_0 = MPI_REQUEST_NULL;
int int_0 = 0;
MPI_Comm mpi_comm_0 = MPI_COMM_NULL;
MPI_Comm mpi_comm_1 = MPI_COMM_NULL;
MPI_Comm mpi_comm_2 = MPI_COMM_NULL;
MPI_Comm mpi_comm_3 = MPI_COMM_NULL;
MPI_Init(&argc, &argv);
MPI_Comm_size(MPI_COMM_WORLD, &nprocs);
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
if (nprocs < 2)
printf(
"MBB ERROR: This test needs at least 2 processes to produce a bug!\n");
int *buf = (int *)calloc(10, sizeof(int));
MPI_Intercomm_create_from_groups((rank % 2 ? mpi_comm_2 : mpi_comm_3), 0,
(!(rank % 2) ? mpi_comm_2 : mpi_comm_3), 0,
"0", MPI_INFO_NULL, MPI_ERRORS_ARE_FATAL,
&mpi_comm_0);
MPI_Group_incl(mpi_comm_1, 1, &triplet, mpi_comm_3);
triplet[0] = 1;
MPI_Group_incl(mpi_comm_1, 1, &triplet, mpi_comm_2);
int[3] triplet;
triplet[0] = 0;
triplet[1] = size;
triplet[2] = 2;
MPI_Comm_group(intercomm_base_comm, &intercomm_base_comm_group);
MPI_Comm_group(MPI_COMM_WORLD, &mpi_comm_1);
if (rank == 0) {
/*MBBERROR_BEGIN*/ MPI_Mprobe(0, 0, mpi_comm_0, &mpi_message_0,
MPI_STATUS_IGNORE); /*MBBERROR_END*/
MPI_Mrecv(buf, 10, MPI_INT, &mpi_message_0, MPI_STATUS_IGNORE);
}
if (rank == 1) {
MPI_Send(buf, 10, MPI_INT, 0, 0, MPI_COMM_WORLD);
}
free(buf);
MPI_Comm_free(&mpi_comm_0);
MPI_Comm_free(&mpi_comm_0);
MPI_Finalize();
printf("Rank %d finished normally\n", rank);
return 0;
}
/* ///////////////////////// The MPI Bug Bench ////////////////////////
Description: ParamMatching: mpi_comm_create_from_group
Version of MPI: 4.0
BEGIN_MBB_TESTS
$ mpirun -np 2 ${EXE}
| ERROR ParamMatching
| ParamMatching-Comm-mpi_precv_init
END_MBB_TESTS
////////////////////// End of MBI headers /////////////////// */
#include <mpi.h>
#include <stddef.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char **argv) {
int nprocs = -1;
int rank = -1;
MPI_Request mpi_request_0 = MPI_REQUEST_NULL;
MPI_Comm mpi_comm_0 = MPI_COMM_NULL;
MPI_Init(&argc, &argv);
MPI_Comm_size(MPI_COMM_WORLD, &nprocs);
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
if (nprocs < 2)
printf(
"MBB ERROR: This test needs at least 2 processes to produce a bug!\n");
int *buf = (int *)calloc(10, sizeof(int));
MPI_Comm_create_from_group(&mpi_group_0, "0", MPI_INFO_NULL,
MPI_ERRORS_ARE_FATAL, &mpi_comm_0);
if (rank == 0) {
/*MBBERROR_BEGIN*/ MPI_Precv_init(buf, 1, 10, MPI_INT, 1, 0, mpi_comm_0,
MPI_INFO_NULL,
&mpi_request_0); /*MBBERROR_END*/
MPI_Start(&mpi_request_0);
MPI_Wait(&mpi_request_0, MPI_STATUS_IGNORE);
}
if (rank == 1) {
MPI_Send(buf, 10, MPI_INT, 0, 0, MPI_COMM_WORLD);
}
free(buf);
MPI_Comm_free(&mpi_comm_0);
MPI_Comm_free(&mpi_comm_0);
MPI_Finalize();
printf("Rank %d finished normally\n", rank);
return 0;
}
/* ///////////////////////// The MPI Bug Bench ////////////////////////
Description: ParamMatching: mpi_intercomm_create_from_groups
Version of MPI: 4.0
BEGIN_MBB_TESTS
$ mpirun -np 2 ${EXE}
| ERROR ParamMatching
| ParamMatching-Comm-mpi_precv_init
END_MBB_TESTS
////////////////////// End of MBI headers /////////////////// */
#include <mpi.h>
#include <stddef.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char **argv) {
int nprocs = -1;
int rank = -1;
MPI_Request mpi_request_0 = MPI_REQUEST_NULL;
MPI_Comm mpi_comm_0 = MPI_COMM_NULL;
MPI_Comm mpi_comm_1 = MPI_COMM_NULL;
MPI_Comm mpi_comm_2 = MPI_COMM_NULL;
MPI_Comm mpi_comm_3 = MPI_COMM_NULL;
MPI_Init(&argc, &argv);
MPI_Comm_size(MPI_COMM_WORLD, &nprocs);
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
if (nprocs < 2)
printf(
"MBB ERROR: This test needs at least 2 processes to produce a bug!\n");
int *buf = (int *)calloc(10, sizeof(int));
MPI_Intercomm_create_from_groups((rank % 2 ? mpi_comm_2 : mpi_comm_3), 0,
(!(rank % 2) ? mpi_comm_2 : mpi_comm_3), 0,
"0", MPI_INFO_NULL, MPI_ERRORS_ARE_FATAL,
&mpi_comm_0);
MPI_Group_incl(mpi_comm_1, 1, &triplet, mpi_comm_3);
triplet[0] = 1;
MPI_Group_incl(mpi_comm_1, 1, &triplet, mpi_comm_2);
int[3] triplet;
triplet[0] = 0;
triplet[1] = size;
triplet[2] = 2;
MPI_Comm_group(intercomm_base_comm, &intercomm_base_comm_group);
MPI_Comm_group(MPI_COMM_WORLD, &mpi_comm_1);
if (rank == 0) {
/*MBBERROR_BEGIN*/ MPI_Precv_init(buf, 1, 10, MPI_INT, 0, 0, mpi_comm_0,
MPI_INFO_NULL,
&mpi_request_0); /*MBBERROR_END*/
MPI_Start(&mpi_request_0);
MPI_Wait(&mpi_request_0, MPI_STATUS_IGNORE);
}
if (rank == 1) {
MPI_Send(buf, 10, MPI_INT, 0, 0, MPI_COMM_WORLD);
}
free(buf);
MPI_Comm_free(&mpi_comm_0);
MPI_Comm_free(&mpi_comm_0);
MPI_Finalize();
printf("Rank %d finished normally\n", rank);
return 0;
}
/* ///////////////////////// The MPI Bug Bench ////////////////////////
Description: ParamMatching: mpi_comm_create_from_group
Version of MPI: 4.0
BEGIN_MBB_TESTS
$ mpirun -np 2 ${EXE}
| ERROR ParamMatching
| ParamMatching-Comm-mpi_recv
END_MBB_TESTS
////////////////////// End of MBI headers /////////////////// */
#include <mpi.h>
#include <stddef.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char **argv) {
int nprocs = -1;
int rank = -1;
MPI_Comm mpi_comm_0 = MPI_COMM_NULL;
MPI_Init(&argc, &argv);
MPI_Comm_size(MPI_COMM_WORLD, &nprocs);
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
if (nprocs < 2)
printf(
"MBB ERROR: This test needs at least 2 processes to produce a bug!\n");
int *buf = (int *)calloc(10, sizeof(int));
MPI_Comm_create_from_group(&mpi_group_0, "0", MPI_INFO_NULL,
MPI_ERRORS_ARE_FATAL, &mpi_comm_0);
if (rank == 0) {
/*MBBERROR_BEGIN*/ MPI_Recv(buf, 10, MPI_INT, 1, 0, mpi_comm_0,
MPI_STATUS_IGNORE); /*MBBERROR_END*/
}
if (rank == 1) {
MPI_Send(buf, 10, MPI_INT, 0, 0, MPI_COMM_WORLD);
}
free(buf);
MPI_Comm_free(&mpi_comm_0);
MPI_Comm_free(&mpi_comm_0);
MPI_Finalize();
printf("Rank %d finished normally\n", rank);
return 0;
}
/* ///////////////////////// The MPI Bug Bench ////////////////////////
Description: ParamMatching: mpi_intercomm_create_from_groups
Version of MPI: 4.0
BEGIN_MBB_TESTS
$ mpirun -np 2 ${EXE}
| ERROR ParamMatching
| ParamMatching-Comm-mpi_recv
END_MBB_TESTS
////////////////////// End of MBI headers /////////////////// */
#include <mpi.h>
#include <stddef.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char **argv) {
int nprocs = -1;
int rank = -1;
MPI_Comm mpi_comm_0 = MPI_COMM_NULL;
MPI_Comm mpi_comm_1 = MPI_COMM_NULL;
MPI_Comm mpi_comm_2 = MPI_COMM_NULL;
MPI_Comm mpi_comm_3 = MPI_COMM_NULL;
MPI_Init(&argc, &argv);
MPI_Comm_size(MPI_COMM_WORLD, &nprocs);
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
if (nprocs < 2)
printf(
"MBB ERROR: This test needs at least 2 processes to produce a bug!\n");
int *buf = (int *)calloc(10, sizeof(int));
MPI_Intercomm_create_from_groups((rank % 2 ? mpi_comm_2 : mpi_comm_3), 0,
(!(rank % 2) ? mpi_comm_2 : mpi_comm_3), 0,
"0", MPI_INFO_NULL, MPI_ERRORS_ARE_FATAL,
&mpi_comm_0);
MPI_Group_incl(mpi_comm_1, 1, &triplet, mpi_comm_3);
triplet[0] = 1;
MPI_Group_incl(mpi_comm_1, 1, &triplet, mpi_comm_2);
int[3] triplet;
triplet[0] = 0;
triplet[1] = size;
triplet[2] = 2;
MPI_Comm_group(intercomm_base_comm, &intercomm_base_comm_group);
MPI_Comm_group(MPI_COMM_WORLD, &mpi_comm_1);
if (rank == 0) {
/*MBBERROR_BEGIN*/ MPI_Recv(buf, 10, MPI_INT, 0, 0, mpi_comm_0,
MPI_STATUS_IGNORE); /*MBBERROR_END*/
}
if (rank == 1) {
MPI_Send(buf, 10, MPI_INT, 0, 0, MPI_COMM_WORLD);
}
free(buf);
MPI_Comm_free(&mpi_comm_0);
MPI_Comm_free(&mpi_comm_0);
MPI_Finalize();
printf("Rank %d finished normally\n", rank);
return 0;
}
/* ///////////////////////// The MPI Bug Bench ////////////////////////
Description: ParamMatching: mpi_comm_create_from_group
Version of MPI: 4.0
BEGIN_MBB_TESTS
$ mpirun -np 2 ${EXE}
| ERROR ParamMatching
| ParamMatching-Comm-mpi_recv_init
END_MBB_TESTS
////////////////////// End of MBI headers /////////////////// */
#include <mpi.h>
#include <stddef.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char **argv) {
int nprocs = -1;
int rank = -1;
MPI_Request mpi_request_0 = MPI_REQUEST_NULL;
MPI_Comm mpi_comm_0 = MPI_COMM_NULL;
MPI_Init(&argc, &argv);
MPI_Comm_size(MPI_COMM_WORLD, &nprocs);
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
if (nprocs < 2)
printf(
"MBB ERROR: This test needs at least 2 processes to produce a bug!\n");
int *buf = (int *)calloc(10, sizeof(int));
MPI_Comm_create_from_group(&mpi_group_0, "0", MPI_INFO_NULL,
MPI_ERRORS_ARE_FATAL, &mpi_comm_0);
if (rank == 0) {
/*MBBERROR_BEGIN*/ MPI_Recv_init(buf, 10, MPI_INT, 1, 0, mpi_comm_0,
&mpi_request_0); /*MBBERROR_END*/
MPI_Start(&mpi_request_0);
MPI_Wait(&mpi_request_0, MPI_STATUS_IGNORE);
}
if (rank == 1) {
MPI_Send(buf, 10, MPI_INT, 0, 0, MPI_COMM_WORLD);
}
free(buf);
MPI_Comm_free(&mpi_comm_0);
MPI_Comm_free(&mpi_comm_0);
MPI_Finalize();
printf("Rank %d finished normally\n", rank);
return 0;
}
/* ///////////////////////// The MPI Bug Bench ////////////////////////
Description: ParamMatching: mpi_intercomm_create_from_groups
Version of MPI: 4.0
BEGIN_MBB_TESTS
$ mpirun -np 2 ${EXE}
| ERROR ParamMatching
| ParamMatching-Comm-mpi_recv_init
END_MBB_TESTS
////////////////////// End of MBI headers /////////////////// */
#include <mpi.h>
#include <stddef.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char **argv) {
int nprocs = -1;
int rank = -1;
MPI_Request mpi_request_0 = MPI_REQUEST_NULL;
MPI_Comm mpi_comm_0 = MPI_COMM_NULL;
MPI_Comm mpi_comm_1 = MPI_COMM_NULL;
MPI_Comm mpi_comm_2 = MPI_COMM_NULL;
MPI_Comm mpi_comm_3 = MPI_COMM_NULL;
MPI_Init(&argc, &argv);
MPI_Comm_size(MPI_COMM_WORLD, &nprocs);
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
if (nprocs < 2)
printf(
"MBB ERROR: This test needs at least 2 processes to produce a bug!\n");
int *buf = (int *)calloc(10, sizeof(int));
MPI_Intercomm_create_from_groups((rank % 2 ? mpi_comm_2 : mpi_comm_3), 0,
(!(rank % 2) ? mpi_comm_2 : mpi_comm_3), 0,
"0", MPI_INFO_NULL, MPI_ERRORS_ARE_FATAL,
&mpi_comm_0);
MPI_Group_incl(mpi_comm_1, 1, &triplet, mpi_comm_3);
triplet[0] = 1;
MPI_Group_incl(mpi_comm_1, 1, &triplet, mpi_comm_2);
int[3] triplet;
triplet[0] = 0;
triplet[1] = size;
triplet[2] = 2;
MPI_Comm_group(intercomm_base_comm, &intercomm_base_comm_group);
MPI_Comm_group(MPI_COMM_WORLD, &mpi_comm_1);
if (rank == 0) {
/*MBBERROR_BEGIN*/ MPI_Recv_init(buf, 10, MPI_INT, 0, 0, mpi_comm_0,
&mpi_request_0); /*MBBERROR_END*/
MPI_Start(&mpi_request_0);
MPI_Wait(&mpi_request_0, MPI_STATUS_IGNORE);
}
if (rank == 1) {
MPI_Send(buf, 10, MPI_INT, 0, 0, MPI_COMM_WORLD);
}
free(buf);
MPI_Comm_free(&mpi_comm_0);
MPI_Comm_free(&mpi_comm_0);
MPI_Finalize();
printf("Rank %d finished normally\n", rank);
return 0;
}
/* ///////////////////////// The MPI Bug Bench ////////////////////////
Description: ParamMatching: mpi_comm_create_from_group
Version of MPI: 4.0
BEGIN_MBB_TESTS
$ mpirun -np 2 ${EXE}
| ERROR ParamMatching
| ParamMatching-Comm-mpi_sendrecv
END_MBB_TESTS
////////////////////// End of MBI headers /////////////////// */
#include <mpi.h>
#include <stddef.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char **argv) {
int nprocs = -1;
int rank = -1;
MPI_Comm mpi_comm_0 = MPI_COMM_NULL;
MPI_Init(&argc, &argv);
MPI_Comm_size(MPI_COMM_WORLD, &nprocs);
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
if (nprocs < 2)
printf(
"MBB ERROR: This test needs at least 2 processes to produce a bug!\n");
int *buf = (int *)calloc(10, sizeof(int));
MPI_Comm_create_from_group(&mpi_group_0, "0", MPI_INFO_NULL,
MPI_ERRORS_ARE_FATAL, &mpi_comm_0);
if (rank == 0) {
/*MBBERROR_BEGIN*/ MPI_Sendrecv(buf, 10, MPI_INT, 0, 0, buf, 10, MPI_INT, 1,
0, mpi_comm_0,
MPI_STATUS_IGNORE); /*MBBERROR_END*/
}
if (rank == 1) {
MPI_Send(buf, 10, MPI_INT, 0, 0, MPI_COMM_WORLD);
}
free(buf);
MPI_Comm_free(&mpi_comm_0);
MPI_Comm_free(&mpi_comm_0);
MPI_Finalize();
printf("Rank %d finished normally\n", rank);
return 0;
}
/* ///////////////////////// The MPI Bug Bench ////////////////////////
Description: ParamMatching: mpi_intercomm_create_from_groups
Version of MPI: 4.0
BEGIN_MBB_TESTS
$ mpirun -np 2 ${EXE}
| ERROR ParamMatching
| ParamMatching-Comm-mpi_sendrecv
END_MBB_TESTS
////////////////////// End of MBI headers /////////////////// */
#include <mpi.h>
#include <stddef.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char **argv) {
int nprocs = -1;
int rank = -1;
MPI_Comm mpi_comm_0 = MPI_COMM_NULL;
MPI_Comm mpi_comm_1 = MPI_COMM_NULL;
MPI_Comm mpi_comm_2 = MPI_COMM_NULL;
MPI_Comm mpi_comm_3 = MPI_COMM_NULL;
MPI_Init(&argc, &argv);
MPI_Comm_size(MPI_COMM_WORLD, &nprocs);
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
if (nprocs < 2)
printf(
"MBB ERROR: This test needs at least 2 processes to produce a bug!\n");
int *buf = (int *)calloc(10, sizeof(int));
MPI_Intercomm_create_from_groups((rank % 2 ? mpi_comm_2 : mpi_comm_3), 0,
(!(rank % 2) ? mpi_comm_2 : mpi_comm_3), 0,
"0", MPI_INFO_NULL, MPI_ERRORS_ARE_FATAL,
&mpi_comm_0);
MPI_Group_incl(mpi_comm_1, 1, &triplet, mpi_comm_3);
triplet[0] = 1;
MPI_Group_incl(mpi_comm_1, 1, &triplet, mpi_comm_2);
int[3] triplet;
triplet[0] = 0;
triplet[1] = size;
triplet[2] = 2;
MPI_Comm_group(intercomm_base_comm, &intercomm_base_comm_group);
MPI_Comm_group(MPI_COMM_WORLD, &mpi_comm_1);
if (rank == 0) {
/*MBBERROR_BEGIN*/ MPI_Sendrecv(buf, 10, MPI_INT, 0, 0, buf, 10, MPI_INT, 0,
0, mpi_comm_0,
MPI_STATUS_IGNORE); /*MBBERROR_END*/
}
if (rank == 1) {
MPI_Send(buf, 10, MPI_INT, 0, 0, MPI_COMM_WORLD);
}
free(buf);
MPI_Comm_free(&mpi_comm_0);
MPI_Comm_free(&mpi_comm_0);
MPI_Finalize();
printf("Rank %d finished normally\n", rank);
return 0;
}
/* ///////////////////////// The MPI Bug Bench ////////////////////////
Description: ParamMatching: mpi_comm_create_from_group
Version of MPI: 4.0
BEGIN_MBB_TESTS
$ mpirun -np 2 ${EXE}
| ERROR ParamMatching
| ParamMatching-Comm-mpi_sendrecv_replace
END_MBB_TESTS
////////////////////// End of MBI headers /////////////////// */
#include <mpi.h>
#include <stddef.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char **argv) {
int nprocs = -1;
int rank = -1;
MPI_Comm mpi_comm_0 = MPI_COMM_NULL;
MPI_Init(&argc, &argv);
MPI_Comm_size(MPI_COMM_WORLD, &nprocs);
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
if (nprocs < 2)
printf(
"MBB ERROR: This test needs at least 2 processes to produce a bug!\n");
int *buf = (int *)calloc(10, sizeof(int));
MPI_Comm_create_from_group(&mpi_group_0, "0", MPI_INFO_NULL,
MPI_ERRORS_ARE_FATAL, &mpi_comm_0);
if (rank == 0) {
/*MBBERROR_BEGIN*/ MPI_Sendrecv_replace(buf, 10, MPI_INT, 0, 0, 1, 0,
mpi_comm_0,
MPI_STATUS_IGNORE); /*MBBERROR_END*/
}
if (rank == 1) {
MPI_Send(buf, 10, MPI_INT, 0, 0, MPI_COMM_WORLD);
}
free(buf);
MPI_Comm_free(&mpi_comm_0);
MPI_Comm_free(&mpi_comm_0);
MPI_Finalize();
printf("Rank %d finished normally\n", rank);
return 0;
}
/* ///////////////////////// The MPI Bug Bench ////////////////////////
Description: ParamMatching: mpi_intercomm_create_from_groups
Version of MPI: 4.0
BEGIN_MBB_TESTS
$ mpirun -np 2 ${EXE}
| ERROR ParamMatching
| ParamMatching-Comm-mpi_sendrecv_replace
END_MBB_TESTS
////////////////////// End of MBI headers /////////////////// */
#include <mpi.h>
#include <stddef.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char **argv) {
int nprocs = -1;
int rank = -1;
MPI_Comm mpi_comm_0 = MPI_COMM_NULL;
MPI_Comm mpi_comm_1 = MPI_COMM_NULL;
MPI_Comm mpi_comm_2 = MPI_COMM_NULL;
MPI_Comm mpi_comm_3 = MPI_COMM_NULL;
MPI_Init(&argc, &argv);
MPI_Comm_size(MPI_COMM_WORLD, &nprocs);
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
if (nprocs < 2)
printf(
"MBB ERROR: This test needs at least 2 processes to produce a bug!\n");
int *buf = (int *)calloc(10, sizeof(int));
MPI_Intercomm_create_from_groups((rank % 2 ? mpi_comm_2 : mpi_comm_3), 0,
(!(rank % 2) ? mpi_comm_2 : mpi_comm_3), 0,
"0", MPI_INFO_NULL, MPI_ERRORS_ARE_FATAL,
&mpi_comm_0);
MPI_Group_incl(mpi_comm_1, 1, &triplet, mpi_comm_3);
triplet[0] = 1;
MPI_Group_incl(mpi_comm_1, 1, &triplet, mpi_comm_2);
int[3] triplet;
triplet[0] = 0;
triplet[1] = size;
triplet[2] = 2;
MPI_Comm_group(intercomm_base_comm, &intercomm_base_comm_group);
MPI_Comm_group(MPI_COMM_WORLD, &mpi_comm_1);
if (rank == 0) {
/*MBBERROR_BEGIN*/ MPI_Sendrecv_replace(buf, 10, MPI_INT, 0, 0, 0, 0,
mpi_comm_0,
MPI_STATUS_IGNORE); /*MBBERROR_END*/
}
if (rank == 1) {
MPI_Send(buf, 10, MPI_INT, 0, 0, MPI_COMM_WORLD);
}
free(buf);
MPI_Comm_free(&mpi_comm_0);
MPI_Comm_free(&mpi_comm_0);
MPI_Finalize();
printf("Rank %d finished normally\n", rank);
return 0;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment