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 = PMPI_Info_get
00014 #elif defined(HAVE_PRAGMA_HP_SEC_DEF)
00015 #pragma _HP_SECONDARY_DEF PMPI_Info_get MPI_Info_get
00016 #elif defined(HAVE_PRAGMA_CRI_DUP)
00017 #pragma _CRI duplicate MPI_Info_get as PMPI_Info_get
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
00038
00039
00040 int MPI_Info_get(MPI_Info info, char *key, int valuelen, char *value, 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: Invalid info object\n");
00046 MPI_Abort(MPI_COMM_WORLD, 1);
00047 }
00048
00049 if (key <= (char *) 0) {
00050 FPRINTF(stderr, "MPI_Info_get: 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: 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: key is a null string\n");
00061 MPI_Abort(MPI_COMM_WORLD, 1);
00062 }
00063
00064 if (valuelen <= 0) {
00065 FPRINTF(stderr, "MPI_Info_get: Invalid valuelen argument\n");
00066 MPI_Abort(MPI_COMM_WORLD, 1);
00067 }
00068
00069 if (value <= (char *) 0) {
00070 FPRINTF(stderr, "MPI_Info_get: value is an invalid address\n");
00071 MPI_Abort(MPI_COMM_WORLD, 1);
00072 }
00073
00074 curr = info->next;
00075 *flag = 0;
00076
00077 while (curr) {
00078 if (!strcmp(curr->key, key)) {
00079 ADIOI_Strncpy(value, curr->value, valuelen);
00080 value[valuelen] = '\0';
00081 *flag = 1;
00082 break;
00083 }
00084 curr = curr->next;
00085 }
00086
00087 return MPI_SUCCESS;
00088 }