This source file includes following definitions.
- MPI_Info_get_nthkey
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21 #include "ompi_config.h"
22
23 #include "ompi/mpi/c/bindings.h"
24 #include "ompi/runtime/params.h"
25 #include "ompi/communicator/communicator.h"
26 #include "ompi/errhandler/errhandler.h"
27 #include "ompi/info/info.h"
28 #include <string.h>
29
30 #if OMPI_BUILD_MPI_PROFILING
31 #if OPAL_HAVE_WEAK_SYMBOLS
32 #pragma weak MPI_Info_get_nthkey = PMPI_Info_get_nthkey
33 #endif
34 #define MPI_Info_get_nthkey PMPI_Info_get_nthkey
35 #endif
36
37 static const char FUNC_NAME[] = "MPI_Info_get_nthkey";
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52 int MPI_Info_get_nthkey(MPI_Info info, int n, char *key)
53 {
54 int nkeys;
55 int err;
56
57
58
59
60
61
62 if (MPI_PARAM_CHECK) {
63 OMPI_ERR_INIT_FINALIZE(FUNC_NAME);
64 if (NULL == info || MPI_INFO_NULL == info ||
65 ompi_info_is_freed(info)) {
66 return OMPI_ERRHANDLER_INVOKE (MPI_COMM_WORLD, MPI_ERR_INFO,
67 FUNC_NAME);
68 }
69 if (0 > n) {
70 return OMPI_ERRHANDLER_INVOKE (MPI_COMM_WORLD, MPI_ERR_ARG,
71 FUNC_NAME);
72 }
73 if (NULL == key) {
74 return OMPI_ERRHANDLER_INVOKE (MPI_COMM_WORLD, MPI_ERR_INFO_KEY,
75 FUNC_NAME);
76 }
77 }
78
79 OPAL_CR_ENTER_LIBRARY();
80
81
82
83
84
85 err = ompi_info_get_nkeys(info, &nkeys);
86 OMPI_ERRHANDLER_CHECK(err, MPI_COMM_WORLD, err, FUNC_NAME);
87 if (n > (nkeys - 1)) {
88 OPAL_CR_EXIT_LIBRARY();
89 return OMPI_ERRHANDLER_INVOKE (MPI_COMM_WORLD, MPI_ERR_INFO_KEY,
90 FUNC_NAME);
91 }
92
93
94
95 err = ompi_info_get_nthkey (info, n, key);
96 OMPI_ERRHANDLER_RETURN(err, MPI_COMM_WORLD, err, FUNC_NAME);
97 }