~ubuntu-branches/ubuntu/vivid/mpich/vivid-proposed

« back to all changes in this revision

Viewing changes to test/mpi/comm/comm_idup_mul.c

  • Committer: Package Import Robot
  • Author(s): Anton Gladky
  • Date: 2014-04-01 20:24:20 UTC
  • mfrom: (5.2.4 sid)
  • Revision ID: package-import@ubuntu.com-20140401202420-t5ey1ia2klt5dkq3
Tags: 3.1-4
* [c3e3398] Disable test_primitives, which is unreliable on some platforms.
            (Closes: #743047)
* [265a699] Add minimal autotest.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
 
2
/*
 
3
 *  (C) 2012 by Argonne National Laboratory.
 
4
 *      See COPYRIGHT in top-level directory.
 
5
 */
 
6
 
 
7
/*
 
8
 * Test creating multiple communicators with MPI_Comm_idup.
 
9
 */
 
10
 
 
11
#include <stdio.h>
 
12
#include <mpi.h>
 
13
 
 
14
#define NUM_ITER    2
 
15
 
 
16
int main(int argc, char **argv)
 
17
{
 
18
    int i, rank;
 
19
    MPI_Comm comms[NUM_ITER];
 
20
    MPI_Request req[NUM_ITER];
 
21
 
 
22
    MPI_Init(&argc, &argv);
 
23
    MPI_Comm_rank(MPI_COMM_WORLD, &rank);
 
24
 
 
25
    for (i = 0; i < NUM_ITER; i++)
 
26
        MPI_Comm_idup(MPI_COMM_WORLD, &comms[i], &req[i]);
 
27
 
 
28
    MPI_Waitall(NUM_ITER, req, MPI_STATUSES_IGNORE);
 
29
 
 
30
    for (i = 0; i < NUM_ITER; i++)
 
31
        MPI_Comm_free(&comms[i]);
 
32
 
 
33
    if (rank == 0)
 
34
        printf(" No Errors\n");
 
35
 
 
36
    MPI_Finalize();
 
37
 
 
38
    return 0;
 
39
}