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[] )
16 MPI_Group group, outgroup;
19 MTest_Init( &argc, &argv );
20 /* To improve reporting of problems about operations, we
21 change the error handler to errors return */
22 MPI_Comm_set_errhandler( MPI_COMM_WORLD, MPI_ERRORS_RETURN );
24 while (MTestGetComm( &comm, 1 )) {
25 if (comm == MPI_COMM_NULL) continue;
27 MPI_Comm_group( comm, &group );
28 rc = MPI_Group_incl( group, 0, 0, &outgroup );
31 MTestPrintError( rc );
32 printf( "Error in creating an empty group with (0,0)\n" );
34 /* Some MPI implementations may reject a null "ranks" pointer */
35 rc = MPI_Group_incl( group, 0, ranks, &outgroup );
38 MTestPrintError( rc );
39 printf( "Error in creating an empty group with (0,ranks)\n" );
43 if (outgroup != MPI_GROUP_EMPTY) {
44 /* Is the group equivalent to group empty? */
45 rc = MPI_Group_compare( outgroup, MPI_GROUP_EMPTY, &result );
46 if (result != MPI_IDENT) {
48 MTestPrintError( rc );
49 printf( "Did not create a group equivalent to an empty group\n" );
52 rc = MPI_Group_free( &group );
55 MTestPrintError( rc );
57 if (outgroup != MPI_GROUP_NULL) {
58 rc = MPI_Group_free( &outgroup );
61 MTestPrintError( rc );
65 MTestFreeComm( &comm );
68 MTest_Finalize( errs );