28 size_t * comp_idxs,
size_t num_comps,
int ref_size) ;
34 xt_initialize(MPI_COMM_WORLD);
37 MPI_Comm_rank(MPI_COMM_WORLD, &rank);
38 MPI_Comm_size(MPI_COMM_WORLD, &size);
42 PUT_ERR(
"ERROR: wrong number of processes\n");
54 if (rank < 6) utest_check_comm(instance, (
size_t[]){0, 1}, 2, 6);
57 if ((rank < 3) || (rank >= 6))
58 utest_check_comm(instance, (
size_t[]){0, 2}, 2, 6);
61 if (rank >= 3) utest_check_comm(instance, (
size_t[]){1, 2}, 2, 6);
64 utest_check_comm(instance, (
size_t[]){0, 1, 2}, 3, 9);
76 utest_check_comm(instance, (
size_t[]){0, 1}, 2, 9);
87 char const * comp_names[2];
93 }
else if (rank < 6) {
103 utest_check_comm(instance, (
size_t[]){0, 1}, 2, 9);
106 utest_check_comm(instance, (
size_t[]){0, 2}, 2, 9);
109 if ((rank < 3) || (rank >= 6))
110 utest_check_comm(instance, (
size_t[]){1, 2}, 2, 6);
113 utest_check_comm(instance, (
size_t[]){0, 1, 2}, 3, 9);
124 char const * comp_names[2];
133 if (rank < 8) utest_check_comm(instance, (
size_t[]){0, 1}, 2, 8);
136 if ((rank < 3) || (rank >= 6))
137 utest_check_comm(instance, (
size_t[]){0, 2}, 2, 6);
140 if (rank >= 3) utest_check_comm(instance, (
size_t[]){1, 2}, 2, 6);
143 utest_check_comm(instance, (
size_t[]){0, 1, 2}, 3, 9);
150 if ((rank % 3) == 2) {
164 MPI_Comm_free(&yac_comm);
171 utest_check_comm(instance, (
size_t[]){0, 1}, 2, 6);
183void utest_check_comm(
185 size_t * comp_idxs,
size_t num_comps,
int ref_size) {
187 char const ** comp_names =
xmalloc(num_comps *
sizeof(*comp_names));
188 for (
size_t i = 0;
i < num_comps; ++
i)
191 MPI_Comm comps_comm =
197 MPI_Comm_size(comps_comm, &comps_comm_size);
199 if (comps_comm_size != ref_size)
PUT_ERR(
"invalid size of comps_comm");
201 MPI_Comm_free(&comps_comm);
void yac_instance_delete(struct yac_instance *instance)
struct yac_instance * yac_instance_new(MPI_Comm comm)
void yac_instance_def_components(struct yac_instance *instance, char const **comp_names, size_t num_comps)
MPI_Comm yac_instance_get_comps_comm(struct yac_instance *instance, char const **comp_names, size_t num_comp_names)
static char const * component_names[3]
void yac_cmpi_handshake(MPI_Comm comm, size_t n, char const **group_names, MPI_Comm *group_comms)
const char * yac_cget_mpi_handshake_group_name(void)
Retrieve the MPI handshake group name used by YAC.