00001
00002
00003
00004
00005
00006
00007
00008
00009 #include "mpioimpl.h"
00010
00011 #ifdef HAVE_WEAK_SYMBOLS
00012
00013 #if defined(HAVE_PRAGMA_WEAK)
00014 #pragma weak MPI_Info_get_valuelen = PMPI_Info_get_valuelen
00015 #elif defined(HAVE_PRAGMA_HP_SEC_DEF)
00016 #pragma _HP_SECONDARY_DEF PMPI_Info_get_valuelen MPI_Info_get_valuelen
00017 #elif defined(HAVE_PRAGMA_CRI_DUP)
00018 #pragma _CRI duplicate MPI_Info_get_valuelen as PMPI_Info_get_valuelen
00019
00020 #endif
00021
00022
00023 #define MPIO_BUILD_PROFILING
00024 #include "mpioprof.h"
00025 #endif
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040 int MPI_Info_get_valuelen(MPI_Info info, char *key, int *valuelen, int *flag)
00041 {
00042 MPI_Info curr;
00043
00044 if ((info <= (MPI_Info) 0) || (info->cookie != MPIR_INFO_COOKIE)) {
00045 FPRINTF(stderr, "MPI_Info_get_valuelen: Invalid info object\n");
00046 MPI_Abort(MPI_COMM_WORLD, 1);
00047 }
00048
00049 if (key <= (char *) 0) {
00050 FPRINTF(stderr, "MPI_Info_get_valuelen: key is an invalid address\n");
00051 MPI_Abort(MPI_COMM_WORLD, 1);
00052 }
00053
00054 if (strlen(key) > MPI_MAX_INFO_KEY) {
00055 FPRINTF(stderr, "MPI_Info_get_valuelen: key is longer than MPI_MAX_INFO_KEY\n");
00056 MPI_Abort(MPI_COMM_WORLD, 1);
00057 }
00058
00059 if (!strlen(key)) {
00060 FPRINTF(stderr, "MPI_Info_get_valuelen: key is a null string\n");
00061 MPI_Abort(MPI_COMM_WORLD, 1);
00062 }
00063
00064 curr = info->next;
00065 *flag = 0;
00066
00067 while (curr) {
00068 if (!strcmp(curr->key, key)) {
00069 *valuelen = strlen(curr->value);
00070 *flag = 1;
00071 break;
00072 }
00073 curr = curr->next;
00074 }
00075
00076 return MPI_SUCCESS;
00077 }