00001
00002
00003
00004
00005
00006
00007
00008 #include "mpioimpl.h"
00009
00010 #ifdef HAVE_WEAK_SYMBOLS
00011
00012 #if defined(HAVE_PRAGMA_WEAK)
00013 #pragma weak MPI_Info_get_nkeys = PMPI_Info_get_nkeys
00014 #elif defined(HAVE_PRAGMA_HP_SEC_DEF)
00015 #pragma _HP_SECONDARY_DEF PMPI_Info_get_nkeys MPI_Info_get_nkeys
00016 #elif defined(HAVE_PRAGMA_CRI_DUP)
00017 #pragma _CRI duplicate MPI_Info_get_nkeys as PMPI_Info_get_nkeys
00018
00019 #endif
00020
00021
00022 #define MPIO_BUILD_PROFILING
00023 #include "mpioprof.h"
00024 #endif
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037 int MPI_Info_get_nkeys(MPI_Info info, int *nkeys)
00038 {
00039 MPI_Info curr;
00040
00041 if ((info <= (MPI_Info) 0) || (info->cookie != MPIR_INFO_COOKIE)) {
00042 FPRINTF(stderr, "MPI_Info_get_nkeys: Invalid info object\n");
00043 MPI_Abort(MPI_COMM_WORLD, 1);
00044 }
00045
00046 curr = info->next;
00047 *nkeys = 0;
00048
00049 while (curr) {
00050 curr = curr->next;
00051 (*nkeys)++;
00052 }
00053
00054 return MPI_SUCCESS;
00055 }