This source file includes following definitions.
- OMPI_CR_Quiesce_start
- extract_info_into_datum
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 #include "ompi_config.h"
17 #include <stdio.h>
18
19 #include "ompi/mpi/c/bindings.h"
20 #include "ompi/info/info.h"
21 #include "ompi/runtime/params.h"
22 #include "ompi/communicator/communicator.h"
23 #include "orte/mca/snapc/snapc.h"
24
25 #include "ompi/mpiext/cr/c/mpiext_cr_c.h"
26
27 static const char FUNC_NAME[] = "OMPI_CR_Quiesce_start";
28
29 int OMPI_CR_Quiesce_start(MPI_Comm commP, MPI_Info *info)
30 {
31 int ret = MPI_SUCCESS;
32 MPI_Comm comm = MPI_COMM_WORLD;
33 orte_snapc_base_request_op_t *datum = NULL;
34 int my_rank;
35
36
37 if (MPI_PARAM_CHECK) {
38 OMPI_ERR_INIT_FINALIZE(FUNC_NAME);
39 }
40
41
42
43
44 datum = OBJ_NEW(orte_snapc_base_request_op_t);
45 datum->event = ORTE_SNAPC_OP_QUIESCE_START;
46 datum->is_active = true;
47
48 MPI_Comm_rank(comm, &my_rank);
49 if( 0 == my_rank ) {
50 datum->leader = OMPI_PROC_MY_NAME->vpid;
51 } else {
52 datum->leader = -1;
53 }
54
55
56
57
58 MPI_Barrier(comm);
59
60
61
62
63 OPAL_CR_ENTER_LIBRARY();
64 ret = orte_snapc.request_op(datum);
65
66 if( OMPI_SUCCESS != ret ) {
67 OBJ_RELEASE(datum);
68 OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_OTHER,
69 FUNC_NAME);
70 }
71
72 OPAL_CR_EXIT_LIBRARY();
73
74 datum->is_active = false;
75 OBJ_RELEASE(datum);
76
77
78
79
80
81
82 return ret;
83 }
84
85
86
87
88 #if 0
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127 static int extract_info_into_datum(opal_info_t *info, orte_snapc_base_quiesce_t *datum)
128 {
129 int info_flag = false;
130 int max_crs_len = 32;
131 bool info_bool = false;
132 char *info_char = NULL;
133
134 info_char = (char *) malloc(sizeof(char) * (OPAL_PATH_MAX+1));
135
136
137
138
139 opal_info_get(info, "crs", max_crs_len, info_char, &info_flag);
140 if( info_flag) {
141 datum->crs_name = strdup(info_char);
142 }
143
144
145
146
147 opal_info_get(info, "cmdline", OPAL_PATH_MAX, info_char, &info_flag);
148 if( info_flag) {
149 datum->cmdline = strdup(info_char);
150 }
151
152
153
154
155 opal_info_get(info, "handle", OPAL_PATH_MAX, info_char, &info_flag);
156 if( info_flag) {
157 datum->handle = strdup(info_char);
158 }
159
160
161
162
163 opal_info_get(info, "target", OPAL_PATH_MAX, info_char, &info_flag);
164 if( info_flag) {
165 datum->target_dir = strdup(info_char);
166 }
167
168
169
170
171 opal_info_get_bool(info, "restarting", &info_bool, &info_flag);
172 if( info_flag ) {
173 datum->restarting = info_bool;
174 } else {
175 datum->restarting = false;
176 }
177
178
179
180
181 opal_info_get_bool(info, "checkpointing", &info_bool, &info_flag);
182 if( info_flag ) {
183 datum->checkpointing = info_bool;
184 } else {
185 datum->checkpointing = false;
186 }
187
188
189
190
191 OPAL_OUTPUT_VERBOSE((3, mca_crcp_bkmrk_component.super.output_handle,
192 "crcp:bkmrk: %s extract_info: Info('crs' = '%s')",
193 OMPI_NAME_PRINT(OMPI_PROC_MY_NAME),
194 (NULL == datum->crs_name ? "Default (none)" : datum->crs_name)));
195 OPAL_OUTPUT_VERBOSE((3, mca_crcp_bkmrk_component.super.output_handle,
196 "crcp:bkmrk: %s extract_info: Info('cmdline' = '%s')",
197 OMPI_NAME_PRINT(OMPI_PROC_MY_NAME),
198 (NULL == datum->cmdline ? "Default ()" : datum->cmdline)));
199 OPAL_OUTPUT_VERBOSE((3, mca_crcp_bkmrk_component.super.output_handle,
200 "crcp:bkmrk: %s extract_info: Info('checkpointing' = '%c')",
201 OMPI_NAME_PRINT(OMPI_PROC_MY_NAME),
202 (datum->checkpointing ? 'T' : 'F')));
203 OPAL_OUTPUT_VERBOSE((3, mca_crcp_bkmrk_component.super.output_handle,
204 "crcp:bkmrk: %s extract_info: Info('restarting' = '%c')",
205 OMPI_NAME_PRINT(OMPI_PROC_MY_NAME),
206 (datum->restarting ? 'T' : 'F')));
207
208 if( NULL != info_char ) {
209 free(info_char);
210 info_char = NULL;
211 }
212
213 return OMPI_SUCCESS;
214 }
215 #endif