This source file includes following definitions.
- MPI_Info_get_valuelen
1
2
3
4
5
6
7
8 #include "mpioimpl.h"
9
10 #ifdef HAVE_WEAK_SYMBOLS
11
12 #if defined(HAVE_PRAGMA_WEAK)
13 #pragma weak MPI_Info_get_valuelen = PMPI_Info_get_valuelen
14 #elif defined(HAVE_PRAGMA_HP_SEC_DEF)
15 #pragma _HP_SECONDARY_DEF PMPI_Info_get_valuelen MPI_Info_get_valuelen
16 #elif defined(HAVE_PRAGMA_CRI_DUP)
17 #pragma _CRI duplicate MPI_Info_get_valuelen as PMPI_Info_get_valuelen
18
19 #endif
20
21
22 #define MPIO_BUILD_PROFILING
23 #include "mpioprof.h"
24 #endif
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39 int MPI_Info_get_valuelen(MPI_Info info, char *key, int *valuelen, int *flag)
40 {
41 MPI_Info curr;
42
43 if ((info <= (MPI_Info) 0) || (info->cookie != MPIR_INFO_COOKIE)) {
44 FPRINTF(stderr, "MPI_Info_get_valuelen: Invalid info object\n");
45 MPI_Abort(MPI_COMM_WORLD, 1);
46 }
47
48 if (key <= (char *) 0) {
49 FPRINTF(stderr, "MPI_Info_get_valuelen: key is an invalid address\n");
50 MPI_Abort(MPI_COMM_WORLD, 1);
51 }
52
53 if (strlen(key) > MPI_MAX_INFO_KEY) {
54 FPRINTF(stderr, "MPI_Info_get_valuelen: key is longer than MPI_MAX_INFO_KEY\n");
55 MPI_Abort(MPI_COMM_WORLD, 1);
56 }
57
58 if (!strlen(key)) {
59 FPRINTF(stderr, "MPI_Info_get_valuelen: key is a null string\n");
60 MPI_Abort(MPI_COMM_WORLD, 1);
61 }
62
63 curr = info->next;
64 *flag = 0;
65
66 while (curr) {
67 if (!strcmp(curr->key, key)) {
68 *valuelen = strlen(curr->value);
69 *flag = 1;
70 break;
71 }
72 curr = curr->next;
73 }
74
75 return MPI_SUCCESS;
76 }