1 /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
4 * (C) 2003 by Argonne National Laboratory.
5 * See COPYRIGHT in top-level directory.
11 int main( int argc, char *argv[] )
15 int dims[2], periods[2];
18 MTest_Init( &argc, &argv );
20 /* Create a new cartesian communicator in a subset of the processes */
21 MPI_Comm_size( MPI_COMM_WORLD, &size );
22 MPI_Comm_rank( MPI_COMM_WORLD, &rank );
24 fprintf( stderr, "This test needs at least 2 processes\n" );
25 MPI_Abort( MPI_COMM_WORLD, 1 );
29 MPI_Cart_create( MPI_COMM_WORLD, 1, dims, periods, 0, &comm );
31 if (comm != MPI_COMM_NULL) {
33 MPI_Comm_size( comm, &csize );
34 if (csize != dims[0]) {
37 "Sizes is wrong in cart communicator. Is %d, should be %d\n",
42 MPI_Comm_free( &comm );
44 else if (rank < dims[0]) {
46 fprintf( stderr, "Communicator returned is null!" );
49 MTest_Finalize( errs );