1 /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
4 * (C) 2001 by Argonne National Laboratory.
5 * See COPYRIGHT in top-level directory.
12 #include "mpitestconf.h"
17 int main( int argc, char *argv[] )
22 char name[MPI_MAX_OBJECT_NAME], nameout[MPI_MAX_OBJECT_NAME];
23 MTest_Init( &argc, &argv );
25 /* Check world and self firt */
27 MPI_Comm_get_name( MPI_COMM_WORLD, nameout, &rlen );
28 if (strcmp(nameout,"MPI_COMM_WORLD")) {
30 printf( "Name of comm world is %s, should be MPI_COMM_WORLD\n",
35 MPI_Comm_get_name( MPI_COMM_SELF, nameout, &rlen );
36 if (strcmp(nameout,"MPI_COMM_SELF")) {
38 printf( "Name of comm self is %s, should be MPI_COMM_SELF\n",
42 /* Now, handle other communicators, including world/self */
44 while (MTestGetComm( &comm, 1 )) {
45 if (comm == MPI_COMM_NULL) continue;
47 sprintf( name, "comm-%d", cnt );
49 MPI_Comm_set_name( comm, name );
51 MPI_Comm_get_name( comm, nameout, &rlen );
52 if (strcmp( name, nameout )) {
54 printf( "Unexpected name, was %s but should be %s\n",
58 MTestFreeComm( &comm );
61 MTest_Finalize( errs );