Skip to content

Commit bd29ab0

Browse files
committed
Update dpm to handle deprecation of MPI_Info keys
Deprecate the current OMPI-specific MPI_Info key definitions for MPI_Comm_spawn and replace them with their PMIx equivalents. Issue a deprecation/conversion warning as this is done. Also issue deprecation warnings for options such as "ompi_non_mpi" that are no longer used. Handle both cases where the user might pass either the PMIx attribute name itself (e.g., "PMIX_MAPBY") or the string value of the attribute (e.g., PMIX_MAPBY, which translates to "pmix.mapby"). This can only be done for PMIx v4 and above, so protect that code. Silence a couple of Coverity warnings and add a test along the way. Signed-off-by: Ralph Castain <rhc@pmix.org>
1 parent 4318d41 commit bd29ab0

File tree

11 files changed

+648
-33
lines changed

11 files changed

+648
-33
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -464,6 +464,7 @@ test/simple/hello_output
464464
test/simple/hello_show_help
465465
test/simple/hello
466466
test/simple/hello++
467+
test/simple/intercomm1
467468
test/simple/interlib
468469
test/simple/loop_child
469470
test/simple/loop_spawn

ompi/dpm/Makefile.am

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# -*- makefile -*-
22
#
3-
# Copyright (c) 2015 Intel, Inc. All rights reserved.
3+
# Copyright (c) 2015-2020 Intel, Inc. All rights reserved.
44
# Copyright (c) 2016 IBM Corporation. All rights reserved.
55
# $COPYRIGHT$
66
#
@@ -11,6 +11,8 @@
1111

1212
# This makefile.am does not stand on its own - it is included from ompi/Makefile.am
1313

14+
dist_ompidata_DATA += dpm/help-dpm.txt
15+
1416
headers += \
1517
dpm/dpm.h
1618

ompi/dpm/dpm.c

Lines changed: 566 additions & 21 deletions
Large diffs are not rendered by default.

ompi/dpm/help-dpm.txt

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# -*- text -*-
2+
#
3+
# Copyright (c) 2020 Intel, Inc. All rights reserved.
4+
# $COPYRIGHT$
5+
#
6+
# Additional copyrights may follow
7+
#
8+
# $HEADER$
9+
#
10+
#
11+
#
12+
[deprecated-converted]
13+
WARNING: A deprecated MPI_Info key was used.
14+
15+
Deprecated key: %s
16+
Corrected key: %s
17+
18+
We have updated this for you and will proceed. However, this will be treated
19+
as an error in a future release. Please update your application.
20+
#
21+
[deprecated-inform]
22+
WARNING: A deprecated MPI_Info key was used.
23+
24+
Deprecated option: %s
25+
Reason: %s
26+
27+
This has been ignored as it is no longer meaningful. Please update
28+
your application.
29+
#
30+
[deprecated-fail]
31+
WARNING: A deprecated MPI_Info key was used. It is unclear how to update
32+
this option. Please contact the community for how best to resolve this issue.
33+
34+
Deprecated info key: %s
35+
Updated option: %s
36+
Reason: %s
37+
38+
We are not able to proceed. Please update your application.
39+
#
40+
[bad-ppr]
41+
The proc-per-resource MPI_Info key is not correct. The value must include both
42+
the number of procs for each resource and the type of resource to be used.
43+
44+
Specified value: %s
45+
46+
We are not able to proceed. Please correct your application.

ompi/info/info.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ int ompi_info_get_value_enum (ompi_info_t *info, const char *key, int *value,
230230
return opal_info_get_value_enum (&(info->super), key, value,
231231
default_value, var_enum, flag);
232232
}
233-
int ompi_info_get_bool(ompi_info_t *info, char *key, bool *value, int *flag) {
233+
int ompi_info_get_bool(ompi_info_t *info, const char *key, bool *value, int *flag) {
234234
return opal_info_get_bool(&(info->super), key, value, flag);
235235
}
236236
int ompi_info_delete (ompi_info_t *info, const char *key) {

ompi/info/info.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
* Copyright (c) 2012-2015 Los Alamos National Security, LLC. All rights
1616
* reserved.
1717
* Copyright (c) 2016-2017 IBM Corporation. All rights reserved.
18+
* Copyright (c) 2020 Intel, Inc. All rights reserved.
1819
* $COPYRIGHT$
1920
*
2021
* Additional copyrights may follow
@@ -119,7 +120,7 @@ OMPI_DECLSPEC int ompi_info_set_value_enum (ompi_info_t *info, const char *key,
119120
/**
120121
* ompi_info_foo() wrapper around various opal_info_foo() calls
121122
*/
122-
OMPI_DECLSPEC int ompi_info_get_bool (ompi_info_t *info, char *key, bool *value, int *flag);
123+
OMPI_DECLSPEC int ompi_info_get_bool (ompi_info_t *info, const char *key, bool *value, int *flag);
123124
/**
124125
* ompi_info_foo() wrapper around various opal_info_foo() calls
125126
*/

ompi/runtime/ompi_rte.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -561,7 +561,6 @@ int ompi_rte_init(int *pargc, char ***pargv)
561561
}
562562
opal_process_info.nodename = ev1; // ev1 is an allocated string
563563
}
564-
opal_process_info.nodename = opal_process_info.nodename;
565564

566565
/* get our local rank from PMIx */
567566
OPAL_MODEX_RECV_VALUE_OPTIONAL(rc, PMIX_LOCAL_RANK,

opal/mca/btl/vader/btl_vader_module.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -337,11 +337,6 @@ static int vader_add_procs (struct mca_btl_base_module_t* btl,
337337
return OPAL_SUCCESS;
338338
}
339339

340-
/* make sure that my local rank has been defined */
341-
if (0 > MCA_BTL_VADER_LOCAL_RANK) {
342-
return OPAL_ERROR;
343-
}
344-
345340
if (!vader_btl->btl_inited) {
346341
rc = vader_btl_first_time_init (vader_btl, 1 + MCA_BTL_VADER_NUM_LOCAL_PEERS);
347342
if (rc != OPAL_SUCCESS) {

opal/util/info.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
* Copyright (c) 2015-2017 Research Organization for Information Science
1818
* and Technology (RIST). All rights reserved.
1919
* Copyright (c) 2016-2018 IBM Corporation. All rights reserved.
20-
* Copyright (c) 2017 Intel, Inc. All rights reserved.
20+
* Copyright (c) 2017-2020 Intel, Inc. All rights reserved.
2121
* $COPYRIGHT$
2222
*
2323
* Additional copyrights may follow
@@ -338,7 +338,7 @@ int opal_info_get_value_enum (opal_info_t *info, const char *key, int *value,
338338
* Similar to opal_info_get(), but cast the result into a boolean
339339
* using some well-defined rules.
340340
*/
341-
int opal_info_get_bool(opal_info_t *info, char *key, bool *value, int *flag)
341+
int opal_info_get_bool(opal_info_t *info, const char *key, bool *value, int *flag)
342342
{
343343
char str[256];
344344

opal/util/info.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
* Copyright (c) 2012-2017 Los Alamos National Security, LLC. All rights
1616
* reserved.
1717
* Copyright (c) 2017-2018 IBM Corporation. All rights reserved.
18+
* Copyright (c) 2020 Intel, Inc. All rights reserved.
1819
* $COPYRIGHT$
1920
*
2021
* Additional copyrights may follow
@@ -203,7 +204,7 @@ int opal_info_free (opal_info_t **info);
203204
* result is false
204205
* - All other values are false
205206
*/
206-
OPAL_DECLSPEC int opal_info_get_bool (opal_info_t *info, char *key, bool *value,
207+
OPAL_DECLSPEC int opal_info_get_bool (opal_info_t *info, const char *key, bool *value,
207208
int *flag);
208209

209210
/**

0 commit comments

Comments
 (0)