Commit 98431efc authored by Huiwei Lu's avatar Huiwei Lu
Browse files

Adding a test case for MPI_Comm_idup



To cover the case when multiple communicators are created by
MPI_Comm_idup.
Signed-off-by: Pavan Balaji's avatarPavan Balaji <balaji@mcs.anl.gov>
parent 1d565e42
......@@ -35,4 +35,5 @@ noinst_PROGRAMS = \
comm_group_rand \
probe-intercomm \
comm_idup \
comm_idup_mul \
comm_info
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
/*
* (C) 2012 by Argonne National Laboratory.
* See COPYRIGHT in top-level directory.
*/
/*
* Test creating multiple communicators with MPI_Comm_idup.
*/
#include <stdio.h>
#include <mpi.h>
#define NUM_ITER 2
int main(int argc, char **argv)
{
int i, rank;
MPI_Comm comms[NUM_ITER];
MPI_Request req[NUM_ITER];
MPI_Init(&argc, &argv);
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
for (i = 0; i < NUM_ITER; i++)
MPI_Comm_idup(MPI_COMM_WORLD, &comms[i], &req[i]);
MPI_Waitall(NUM_ITER, req, MPI_STATUSES_IGNORE);
for (i = 0; i < NUM_ITER; i++)
MPI_Comm_free(&comms[i]);
if (rank == 0)
printf(" No Errors\n");
MPI_Finalize();
return 0;
}
......@@ -27,6 +27,7 @@ comm_group_rand 8 mpiversion=3.0
comm_idup 2 mpiversion=3.0
comm_idup 4 mpiversion=3.0
comm_idup 9 mpiversion=3.0
comm_idup_mul 2 mpiversion=3.0
dup_with_info 2 mpiversion=3.0
dup_with_info 4 mpiversion=3.0
dup_with_info 9 mpiversion=3.0
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment