Blame test/mpi/topo/graphcr.c

Packit 0848f5
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
Packit 0848f5
/*
Packit 0848f5
 *
Packit 0848f5
 *  (C) 2003 by Argonne National Laboratory.
Packit 0848f5
 *      See COPYRIGHT in top-level directory.
Packit 0848f5
 */
Packit 0848f5
#include "mpi.h"
Packit 0848f5
#include <stdio.h>
Packit 0848f5
#include "mpitest.h"
Packit 0848f5
Packit 0848f5
/*
Packit 0848f5
static char MTEST_Descrip[] = "Create a communicator with a graph that contains no processes";
Packit 0848f5
*/
Packit 0848f5
Packit 0848f5
int main(int argc, char *argv[])
Packit 0848f5
{
Packit 0848f5
    int errs = 0;
Packit 0848f5
    int *index = 0, *edges = 0;
Packit 0848f5
    MPI_Comm comm;
Packit 0848f5
Packit 0848f5
    MTest_Init(&argc, &argv);
Packit 0848f5
Packit 0848f5
    /* MPI 2.1, page 246, lines 29-30 make it clear that this is a valid
Packit 0848f5
     * (not erroneous) call that must return MPI_COMM_NULL */
Packit 0848f5
    MPI_Graph_create(MPI_COMM_WORLD, 0, index, edges, 0, &comm);
Packit 0848f5
    if (comm != MPI_COMM_NULL) {
Packit 0848f5
        errs++;
Packit 0848f5
        fprintf(stderr, "Expected MPI_COMM_NULL from empty graph create\n");
Packit 0848f5
    }
Packit 0848f5
Packit 0848f5
    MTest_Finalize(errs);
Packit 0848f5
    MPI_Finalize();
Packit 0848f5
    return 0;
Packit 0848f5
}