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.
11 int main( int argc, char **argv)
19 MTest_Init( &argc, &argv );
20 MPI_Comm_size( MPI_COMM_WORLD, &size );
21 MPI_Comm_rank( MPI_COMM_WORLD, &rank );
23 MPI_Comm_get_attr( MPI_COMM_WORLD, MPI_TAG_UB, &v, &flag );
26 fprintf( stderr, "Could not get TAG_UB\n" );
32 fprintf( stderr, "Got too-small value (%d) for TAG_UB\n", vval );
36 MPI_Comm_get_attr( MPI_COMM_WORLD, MPI_HOST, &v, &flag );
39 fprintf( stderr, "Could not get HOST\n" );
43 if ((vval < 0 || vval >= size) && vval != MPI_PROC_NULL) {
45 fprintf( stderr, "Got invalid value %d for HOST\n", vval );
48 MPI_Comm_get_attr( MPI_COMM_WORLD, MPI_IO, &v, &flag );
51 fprintf( stderr, "Could not get IO\n" );
55 if ((vval < 0 || vval >= size) && vval != MPI_ANY_SOURCE &&
56 vval != MPI_PROC_NULL) {
58 fprintf( stderr, "Got invalid value %d for IO\n", vval );
62 MPI_Comm_get_attr( MPI_COMM_WORLD, MPI_WTIME_IS_GLOBAL, &v, &flag );
64 /* Wtime need not be set */
66 if (vval < 0 || vval > 1) {
68 fprintf( stderr, "Invalid value for WTIME_IS_GLOBAL (got %d)\n",
73 /* MPI 2.0, section 5.5.3 - MPI_APPNUM should be set if the program is
74 started with more than one executable name (e.g., in MPMD instead
75 of SPMD mode). This is independent of the dynamic process routines,
76 and should be supported even if MPI_COMM_SPAWN and friends are not. */
77 MPI_Comm_get_attr( MPI_COMM_WORLD, MPI_APPNUM, &v, &flag );
78 /* appnum need not be set */
83 fprintf( stderr, "MPI_APPNUM is defined as %d but must be nonnegative\n", vval );
87 /* MPI 2.0 section 5.5.1. MPI_UNIVERSE_SIZE need not be set, but
89 MPI_Comm_get_attr( MPI_COMM_WORLD, MPI_UNIVERSE_SIZE, &v, &flag );
90 /* MPI_UNIVERSE_SIZE need not be set */
92 /* But if it is set, it must be at least the size of comm_world */
96 fprintf( stderr, "MPI_UNIVERSE_SIZE = %d, less than comm world (%d)\n", vval, size );
100 MPI_Comm_get_attr( MPI_COMM_WORLD, MPI_LASTUSEDCODE, &v, &flag );
101 /* Last used code must be defined and >= MPI_ERR_LASTCODE */
104 if (vval < MPI_ERR_LASTCODE) {
106 fprintf( stderr, "MPI_LASTUSEDCODE points to an integer (%d) smaller than MPI_ERR_LASTCODE (%d)\n", vval, MPI_ERR_LASTCODE );
111 fprintf( stderr, "MPI_LASTUSECODE is not defined\n" );
114 MTest_Finalize( errs );