This source file includes following definitions.
- mpit_is_initialized
- mpit_copy_string
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15 #if !defined(MPIT_INTERNAL_H)
16 #define MPIT_INTERNAL_H
17
18 #include "opal/util/string_copy.h"
19 #include "opal/mca/base/mca_base_var.h"
20 #include "opal/mca/base/mca_base_pvar.h"
21
22 #include "ompi/include/ompi_config.h"
23 #include "ompi/runtime/params.h"
24 #include "ompi/communicator/communicator.h"
25 #include "ompi/constants.h"
26 #include "ompi/datatype/ompi_datatype.h"
27
28 #include "mpi.h"
29
30 #include <string.h>
31
32 typedef struct ompi_mpit_cvar_handle_t {
33 const mca_base_var_t *var;
34
35 void *bound_object;
36 } ompi_mpit_cvar_handle_t;
37
38 void ompi_mpit_lock (void);
39 void ompi_mpit_unlock (void);
40
41 extern volatile uint32_t ompi_mpit_init_count;
42
43 int ompit_var_type_to_datatype (mca_base_var_type_t type, MPI_Datatype *datatype);
44 int ompit_opal_to_mpit_error (int rc);
45
46 static inline int mpit_is_initialized (void)
47 {
48 return !!ompi_mpit_init_count;
49 }
50
51 static inline void mpit_copy_string (char *dest, int *len, const char *source)
52 {
53 if (NULL == len)
54 return;
55
56 if (NULL == source) {
57 *len = 0;
58 if (NULL != dest) {
59 dest[0] = '\0';
60 }
61
62 return;
63 }
64
65 if (0 != *len && NULL != dest) {
66 if ((int) strlen (source) < *len) {
67 *len = strlen (source) + 1;
68 }
69
70 opal_string_copy (dest, source, *len);
71 } else {
72 *len = strlen (source) + 1;
73 }
74 }
75
76 #endif