Skip to content

Commit 2ede47c

Browse files
committed
pmix: fix misc missing conversion and type issues
1 parent a548232 commit 2ede47c

File tree

7 files changed

+50
-20
lines changed

7 files changed

+50
-20
lines changed

opal/mca/pmix/pmix112/pmix1.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
/*
22
* Copyright (c) 2014-2015 Intel, Inc. All rights reserved.
3+
* Copyright (c) 2016 Research Organization for Information Science
4+
* and Technology (RIST). All rights reserved.
35
* $COPYRIGHT$
46
*
57
* Additional copyrights may follow
@@ -161,6 +163,7 @@ OPAL_MODULE_DECLSPEC int pmix1_server_notify_error(int status,
161163
/**** COMPONENT UTILITY FUNCTIONS ****/
162164
OPAL_MODULE_DECLSPEC pmix_status_t pmix1_convert_opalrc(int rc);
163165
OPAL_MODULE_DECLSPEC int pmix1_convert_rc(pmix_status_t rc);
166+
OPAL_MODULE_DECLSPEC pmix_scope_t pmix1_convert_opalscope(opal_pmix_scope_t scope);
164167
OPAL_MODULE_DECLSPEC void pmix1_value_load(pmix_value_t *v,
165168
opal_value_t *kv);
166169
OPAL_MODULE_DECLSPEC int pmix1_value_unload(opal_value_t *kv,

opal/mca/pmix/pmix112/pmix1_client.c

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
22
/*
33
* Copyright (c) 2014-2015 Intel, Inc. All rights reserved.
4-
* Copyright (c) 2014-2015 Research Organization for Information Science
4+
* Copyright (c) 2014-2016 Research Organization for Information Science
55
* and Technology (RIST). All rights reserved.
66
* Copyright (c) 2014 Mellanox Technologies, Inc.
77
* All rights reserved.
@@ -156,13 +156,10 @@ int pmix1_client_finalize(void)
156156

157157
int pmix1_initialized(void)
158158
{
159-
pmix_status_t rc;
160-
161159
opal_output_verbose(1, opal_pmix_base_framework.framework_output,
162160
"PMIx_client initialized");
163161

164-
rc = PMIx_Initialized();
165-
return pmix1_convert_rc(rc);
162+
return PMIx_Initialized();
166163
}
167164

168165
int pmix1_abort(int flag, const char *msg,
@@ -391,10 +388,11 @@ int pmix1_fencenb(opal_list_t *procs, int collect_data,
391388

392389
}
393390

394-
int pmix1_put(opal_pmix_scope_t scope,
391+
int pmix1_put(opal_pmix_scope_t opal_scope,
395392
opal_value_t *val)
396393
{
397394
pmix_value_t kv;
395+
pmix_scope_t pmix_scope = pmix1_convert_opalscope(opal_scope);
398396
pmix_status_t rc;
399397

400398
opal_output_verbose(1, opal_pmix_base_framework.framework_output,
@@ -403,7 +401,7 @@ int pmix1_put(opal_pmix_scope_t scope,
403401
PMIX_VALUE_CONSTRUCT(&kv);
404402
pmix1_value_load(&kv, val);
405403

406-
rc = PMIx_Put(scope, val->key, &kv);
404+
rc = PMIx_Put(pmix_scope, val->key, &kv);
407405
PMIX_VALUE_DESTRUCT(&kv);
408406
return pmix1_convert_rc(rc);
409407
}

opal/mca/pmix/pmix112/pmix_pmix1.c

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
22
/*
33
* Copyright (c) 2014-2015 Intel, Inc. All rights reserved.
4-
* Copyright (c) 2014-2015 Research Organization for Information Science
4+
* Copyright (c) 2014-2016 Research Organization for Information Science
55
* and Technology (RIST). All rights reserved.
66
* Copyright (c) 2014 Mellanox Technologies, Inc.
77
* All rights reserved.
@@ -36,6 +36,7 @@
3636

3737
#include "pmix1.h"
3838
#include "opal/mca/pmix/base/base.h"
39+
#include "opal/mca/pmix/pmix_types.h"
3940

4041
#include "opal/mca/pmix/pmix112/pmix/include/pmix/pmix_common.h"
4142

@@ -269,6 +270,19 @@ int pmix1_convert_rc(pmix_status_t rc)
269270
}
270271
}
271272

273+
pmix_scope_t pmix1_convert_opalscope(opal_pmix_scope_t scope) {
274+
switch(scope) {
275+
case OPAL_PMIX_LOCAL:
276+
return PMIX_LOCAL;
277+
case OPAL_PMIX_REMOTE:
278+
return PMIX_REMOTE;
279+
case OPAL_PMIX_GLOBAL:
280+
return PMIX_GLOBAL;
281+
default:
282+
return PMIX_SCOPE_UNDEF;
283+
}
284+
}
285+
272286
void pmix1_value_load(pmix_value_t *v,
273287
opal_value_t *kv)
274288
{

opal/mca/pmix/pmix120/pmix120.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
/*
22
* Copyright (c) 2014-2015 Intel, Inc. All rights reserved.
3+
* Copyright (c) 2016 Research Organization for Information Science
4+
* and Technology (RIST). All rights reserved.
35
* $COPYRIGHT$
46
*
57
* Additional copyrights may follow
@@ -174,6 +176,7 @@ OPAL_MODULE_DECLSPEC int pmix120_server_notify_error(int status,
174176
/**** COMPONENT UTILITY FUNCTIONS ****/
175177
OPAL_MODULE_DECLSPEC pmix_status_t pmix120_convert_opalrc(int rc);
176178
OPAL_MODULE_DECLSPEC int pmix120_convert_rc(pmix_status_t rc);
179+
OPAL_MODULE_DECLSPEC pmix_scope_t pmix120_convert_opalscope(opal_pmix_scope_t scope);
177180
OPAL_MODULE_DECLSPEC void pmix120_value_load(pmix_value_t *v,
178181
opal_value_t *kv);
179182
OPAL_MODULE_DECLSPEC int pmix120_value_unload(opal_value_t *kv,

opal/mca/pmix/pmix120/pmix120_client.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -95,13 +95,10 @@ int pmix120_client_finalize(void)
9595

9696
int pmix120_initialized(void)
9797
{
98-
pmix_status_t rc;
99-
10098
opal_output_verbose(1, opal_pmix_base_framework.framework_output,
10199
"PMIx_client initialized");
102100

103-
rc = PMIx_Initialized();
104-
return pmix120_convert_rc(rc);
101+
return PMIx_Initialized();
105102
}
106103

107104
int pmix120_abort(int flag, const char *msg,
@@ -333,10 +330,11 @@ int pmix120_fencenb(opal_list_t *procs, int collect_data,
333330

334331
}
335332

336-
int pmix120_put(opal_pmix_scope_t scope,
333+
int pmix120_put(opal_pmix_scope_t opal_scope,
337334
opal_value_t *val)
338335
{
339336
pmix_value_t kv;
337+
pmix_scope_t pmix_scope = pmix120_convert_opalscope(opal_scope);
340338
pmix_status_t rc;
341339

342340
opal_output_verbose(1, opal_pmix_base_framework.framework_output,
@@ -345,7 +343,7 @@ int pmix120_put(opal_pmix_scope_t scope,
345343
PMIX_VALUE_CONSTRUCT(&kv);
346344
pmix120_value_load(&kv, val);
347345

348-
rc = PMIx_Put(scope, val->key, &kv);
346+
rc = PMIx_Put(pmix_scope, val->key, &kv);
349347
PMIX_VALUE_DESTRUCT(&kv);
350348
return pmix120_convert_rc(rc);
351349
}

opal/mca/pmix/pmix120/pmix_pmix120.c

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
22
/*
33
* Copyright (c) 2014-2015 Intel, Inc. All rights reserved.
4-
* Copyright (c) 2014-2015 Research Organization for Information Science
4+
* Copyright (c) 2014-2016 Research Organization for Information Science
55
* and Technology (RIST). All rights reserved.
66
* Copyright (c) 2014 Mellanox Technologies, Inc.
77
* All rights reserved.
@@ -466,6 +466,20 @@ int pmix120_convert_rc(pmix_status_t rc)
466466
}
467467
}
468468

469+
pmix_scope_t pmix120_convert_opalscope(opal_pmix_scope_t scope) {
470+
switch(scope) {
471+
case OPAL_PMIX_LOCAL:
472+
return PMIX_LOCAL;
473+
case OPAL_PMIX_REMOTE:
474+
return PMIX_REMOTE;
475+
case OPAL_PMIX_GLOBAL:
476+
return PMIX_GLOBAL;
477+
default:
478+
return PMIX_SCOPE_UNDEF;
479+
}
480+
}
481+
482+
469483
void pmix120_value_load(pmix_value_t *v,
470484
opal_value_t *kv)
471485
{

orte/orted/pmix/pmix_server_pub.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
* Copyright (c) 2013-2015 Intel, Inc. All rights reserved.
1717
* Copyright (c) 2014 Mellanox Technologies, Inc.
1818
* All rights reserved.
19-
* Copyright (c) 2014 Research Organization for Information Science
19+
* Copyright (c) 2014-2016 Research Organization for Information Science
2020
* and Technology (RIST). All rights reserved.
2121
* $COPYRIGHT$
2222
*
@@ -121,13 +121,13 @@ int pmix_server_publish_fn(opal_process_name_t *proc,
121121
pset = false;
122122
OPAL_LIST_FOREACH(iptr, info, opal_value_t) {
123123
if (0 == strcmp(iptr->key, OPAL_PMIX_RANGE)) {
124-
range = iptr->data.integer;
124+
range = (opal_pmix_data_range_t)iptr->data.integer;
125125
if (pset) {
126126
break;
127127
}
128128
rset = true;
129129
} else if (0 == strcmp(iptr->key, OPAL_PMIX_PERSISTENCE)) {
130-
persist = iptr->data.integer;
130+
persist = (opal_pmix_persistence_t)iptr->data.integer;
131131
if (rset) {
132132
break;
133133
}
@@ -214,7 +214,7 @@ int pmix_server_lookup_fn(opal_process_name_t *proc, char **keys,
214214
/* no help for it - need to search for range */
215215
OPAL_LIST_FOREACH(iptr, info, opal_value_t) {
216216
if (0 == strcmp(iptr->key, OPAL_PMIX_RANGE)) {
217-
range = iptr->data.integer;
217+
range = (opal_pmix_data_range_t)iptr->data.integer;
218218
break;
219219
}
220220
}
@@ -304,7 +304,7 @@ int pmix_server_unpublish_fn(opal_process_name_t *proc, char **keys,
304304
/* no help for it - need to search for range */
305305
OPAL_LIST_FOREACH(iptr, info, opal_value_t) {
306306
if (0 == strcmp(iptr->key, OPAL_PMIX_RANGE)) {
307-
range = iptr->data.integer;
307+
range = (opal_pmix_data_range_t)iptr->data.integer;
308308
break;
309309
}
310310
}

0 commit comments

Comments
 (0)