43
43
#include "opal/util/strncpy.h"
44
44
45
45
#include "opal/util/info.h"
46
- #ifdef XXX
47
- #include "ompi/runtime/mpiruntime.h"
48
- #include "ompi/runtime/params.h"
49
- #endif
50
-
51
46
52
47
/*
53
48
* Local functions
@@ -88,13 +83,13 @@ int opal_info_dup (opal_info_t *info, opal_info_t **newinfo)
88
83
OPAL_THREAD_LOCK (info -> i_lock );
89
84
OPAL_LIST_FOREACH (iterator , & info -> super , opal_info_entry_t ) {
90
85
err = opal_info_set (* newinfo , iterator -> ie_key , iterator -> ie_value );
91
- if (MPI_SUCCESS != err ) {
86
+ if (OPAL_SUCCESS != err ) {
92
87
OPAL_THREAD_UNLOCK (info -> i_lock );
93
88
return err ;
94
89
}
95
90
}
96
91
OPAL_THREAD_UNLOCK (info -> i_lock );
97
- return MPI_SUCCESS ;
92
+ return OPAL_SUCCESS ;
98
93
}
99
94
100
95
/*
@@ -115,8 +110,8 @@ int opal_info_dup_mode (opal_info_t *info, opal_info_t **newinfo,
115
110
{
116
111
int err , flag ;
117
112
opal_info_entry_t * iterator ;
118
- char savedkey [MPI_MAX_INFO_KEY ];
119
- char savedval [MPI_MAX_INFO_VAL ];
113
+ char savedkey [OPAL_MAX_INFO_KEY ];
114
+ char savedval [OPAL_MAX_INFO_VAL ];
120
115
char * valptr , * pkey ;
121
116
int is_IN_key ;
122
117
int exists_IN_key , exists_reg_key ;
@@ -144,9 +139,9 @@ int opal_info_dup_mode (opal_info_t *info, opal_info_t **newinfo,
144
139
exists_reg_key = 1 ;
145
140
146
141
// see if there is an __IN_<key> for the current <key>
147
- if (strlen (iterator -> ie_key ) + 5 < MPI_MAX_INFO_KEY ) {
142
+ if (strlen (iterator -> ie_key ) + 5 < OPAL_MAX_INFO_KEY ) {
148
143
sprintf (savedkey , "__IN_%s" , iterator -> ie_key );
149
- err = opal_info_get (info , savedkey , MPI_MAX_INFO_VAL ,
144
+ err = opal_info_get (info , savedkey , OPAL_MAX_INFO_VAL ,
150
145
savedval , & flag );
151
146
} else {
152
147
flag = 0 ;
@@ -166,7 +161,7 @@ int opal_info_dup_mode (opal_info_t *info, opal_info_t **newinfo,
166
161
// so base our behavior on the omit_ignored
167
162
if (!omit_ignored ) {
168
163
err = opal_info_set (* newinfo , pkey , iterator -> ie_value );
169
- if (MPI_SUCCESS != err ) {
164
+ if (OPAL_SUCCESS != err ) {
170
165
OPAL_THREAD_UNLOCK (info -> i_lock );
171
166
return err ;
172
167
}
@@ -191,15 +186,15 @@ int opal_info_dup_mode (opal_info_t *info, opal_info_t **newinfo,
191
186
}
192
187
if (valptr ) {
193
188
err = opal_info_set (* newinfo , pkey , valptr );
194
- if (MPI_SUCCESS != err ) {
189
+ if (OPAL_SUCCESS != err ) {
195
190
OPAL_THREAD_UNLOCK (info -> i_lock );
196
191
return err ;
197
192
}
198
193
}
199
194
}
200
195
}
201
196
OPAL_THREAD_UNLOCK (info -> i_lock );
202
- return MPI_SUCCESS ;
197
+ return OPAL_SUCCESS ;
203
198
}
204
199
205
200
/*
@@ -222,7 +217,7 @@ int opal_info_set (opal_info_t *info, const char *key, const char *value)
222
217
223
218
new_value = strdup (value );
224
219
if (NULL == new_value ) {
225
- return MPI_ERR_NO_MEM ;
220
+ return OPAL_ERR_OUT_OF_RESOURCE ;
226
221
}
227
222
228
223
OPAL_THREAD_LOCK (info -> i_lock );
@@ -238,14 +233,14 @@ int opal_info_set (opal_info_t *info, const char *key, const char *value)
238
233
if (NULL == new_info ) {
239
234
free (new_value );
240
235
OPAL_THREAD_UNLOCK (info -> i_lock );
241
- return MPI_ERR_NO_MEM ;
236
+ return OPAL_ERR_OUT_OF_RESOURCE ;
242
237
}
243
- strncpy (new_info -> ie_key , key , MPI_MAX_INFO_KEY );
238
+ strncpy (new_info -> ie_key , key , OPAL_MAX_INFO_KEY );
244
239
new_info -> ie_value = new_value ;
245
240
opal_list_append (& (info -> super ), (opal_list_item_t * ) new_info );
246
241
}
247
242
OPAL_THREAD_UNLOCK (info -> i_lock );
248
- return MPI_SUCCESS ;
243
+ return OPAL_SUCCESS ;
249
244
}
250
245
251
246
@@ -293,15 +288,15 @@ int opal_info_get (opal_info_t *info, const char *key, int valuelen,
293
288
strcpy (value , search -> ie_value );
294
289
} else {
295
290
opal_strncpy (value , search -> ie_value , valuelen );
296
- if (MPI_MAX_INFO_VAL == valuelen ) {
291
+ if (OPAL_MAX_INFO_VAL == valuelen ) {
297
292
value [valuelen - 1 ] = 0 ;
298
293
} else {
299
294
value [valuelen ] = 0 ;
300
295
}
301
296
}
302
297
}
303
298
OPAL_THREAD_UNLOCK (info -> i_lock );
304
- return MPI_SUCCESS ;
299
+ return OPAL_SUCCESS ;
305
300
}
306
301
307
302
int opal_info_get_value_enum (opal_info_t * info , const char * key , int * value ,
@@ -318,7 +313,7 @@ int opal_info_get_value_enum (opal_info_t *info, const char *key, int *value,
318
313
if (NULL == search ){
319
314
OPAL_THREAD_UNLOCK (info -> i_lock );
320
315
* flag = 0 ;
321
- return MPI_SUCCESS ;
316
+ return OPAL_SUCCESS ;
322
317
}
323
318
324
319
/* we found a mathing key. pass the string value to the enumerator and
@@ -346,7 +341,7 @@ int opal_info_get_bool(opal_info_t *info, char *key, bool *value, int *flag)
346
341
* value = opal_str_to_bool (str );
347
342
}
348
343
349
- return MPI_SUCCESS ;
344
+ return OPAL_SUCCESS ;
350
345
}
351
346
352
347
@@ -392,7 +387,7 @@ int opal_info_delete(opal_info_t *info, const char *key)
392
387
search = info_find_key (info , key );
393
388
if (NULL == search ){
394
389
OPAL_THREAD_UNLOCK (info -> i_lock );
395
- return MPI_ERR_INFO_NOKEY ;
390
+ return OPAL_ERR_NOT_FOUND ;
396
391
} else {
397
392
/*
398
393
* An entry with this key value was found. Remove the item
@@ -404,7 +399,7 @@ int opal_info_delete(opal_info_t *info, const char *key)
404
399
OBJ_RELEASE (search );
405
400
}
406
401
OPAL_THREAD_UNLOCK (info -> i_lock );
407
- return MPI_SUCCESS ;
402
+ return OPAL_SUCCESS ;
408
403
}
409
404
410
405
@@ -429,7 +424,7 @@ int opal_info_get_valuelen (opal_info_t *info, const char *key, int *valuelen,
429
424
* valuelen = strlen (search -> ie_value );
430
425
}
431
426
OPAL_THREAD_UNLOCK (info -> i_lock );
432
- return MPI_SUCCESS ;
427
+ return OPAL_SUCCESS ;
433
428
}
434
429
435
430
@@ -451,17 +446,17 @@ int opal_info_get_nthkey (opal_info_t *info, int n, char *key)
451
446
if (opal_list_get_end (& (info -> super )) ==
452
447
(opal_list_item_t * ) iterator ) {
453
448
OPAL_THREAD_UNLOCK (info -> i_lock );
454
- return MPI_ERR_ARG ;
449
+ return OPAL_ERR_BAD_PARAM ;
455
450
}
456
451
}
457
452
/*
458
453
* iterator is of the type opal_list_item_t. We have to
459
454
* cast it to opal_info_entry_t before we can use it to
460
455
* access the value
461
456
*/
462
- strncpy (key , iterator -> ie_key , MPI_MAX_INFO_KEY );
457
+ strncpy (key , iterator -> ie_key , OPAL_MAX_INFO_KEY );
463
458
OPAL_THREAD_UNLOCK (info -> i_lock );
464
- return MPI_SUCCESS ;
459
+ return OPAL_SUCCESS ;
465
460
}
466
461
467
462
@@ -506,7 +501,7 @@ static void info_destructor(opal_info_t *info)
506
501
static void info_entry_constructor (opal_info_entry_t * entry )
507
502
{
508
503
memset (entry -> ie_key , 0 , sizeof (entry -> ie_key ));
509
- entry -> ie_key [MPI_MAX_INFO_KEY ] = 0 ;
504
+ entry -> ie_key [OPAL_MAX_INFO_KEY ] = 0 ;
510
505
}
511
506
512
507
0 commit comments