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_delete = PMPI_Info_delete
00014 #elif defined(HAVE_PRAGMA_HP_SEC_DEF)
00015 #pragma _HP_SECONDARY_DEF PMPI_Info_delete MPI_Info_delete
00016 #elif defined(HAVE_PRAGMA_CRI_DUP)
00017 #pragma _CRI duplicate MPI_Info_delete as PMPI_Info_delete
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 int MPI_Info_delete(MPI_Info info, char *key)
00036 {
00037 MPI_Info prev, curr;
00038 int done;
00039
00040 if ((info <= (MPI_Info) 0) || (info->cookie != MPIR_INFO_COOKIE)) {
00041 FPRINTF(stderr, "MPI_Info_delete: Invalid info object\n");
00042 MPI_Abort(MPI_COMM_WORLD, 1);
00043 }
00044
00045 if (key <= (char *) 0) {
00046 FPRINTF(stderr, "MPI_Info_delete: key is an invalid address\n");
00047 MPI_Abort(MPI_COMM_WORLD, 1);
00048 }
00049
00050 if (strlen(key) > MPI_MAX_INFO_KEY) {
00051 FPRINTF(stderr, "MPI_Info_delete: key is longer than MPI_MAX_INFO_KEY\n");
00052 MPI_Abort(MPI_COMM_WORLD, 1);
00053 }
00054
00055 if (!strlen(key)) {
00056 FPRINTF(stderr, "MPI_Info_delete: key is a null string\n");
00057 MPI_Abort(MPI_COMM_WORLD, 1);
00058 }
00059
00060 prev = info;
00061 curr = info->next;
00062 done = 0;
00063
00064 while (curr) {
00065 if (!strcmp(curr->key, key)) {
00066 ADIOI_Free(curr->key);
00067 ADIOI_Free(curr->value);
00068 prev->next = curr->next;
00069 ADIOI_Free(curr);
00070 done = 1;
00071 break;
00072 }
00073 prev = curr;
00074 curr = curr->next;
00075 }
00076
00077 if (!done) {
00078 FPRINTF(stderr, "MPI_Info_delete: key not defined in info\n");
00079 MPI_Abort(MPI_COMM_WORLD, 1);
00080 }
00081
00082 return MPI_SUCCESS;
00083 }