Skip to content

Commit 37bd4df

Browse files
committed
Beside the mpi-standard mandated keys, do not deprecate keys that
direcly correspond to an `mpiexec` parameter. Signed-off-by: Aurelien Bouteiller <bouteill@icl.utk.edu>
1 parent d03a99c commit 37bd4df

File tree

1 file changed

+63
-58
lines changed

1 file changed

+63
-58
lines changed

ompi/dpm/dpm.c

Lines changed: 63 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
44
* University Research and Technology
55
* Corporation. All rights reserved.
6-
* Copyright (c) 2004-2017 The University of Tennessee and The University
6+
* Copyright (c) 2004-2020 The University of Tennessee and The University
77
* of Tennessee Research Foundation. All rights
88
* reserved.
99
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
@@ -660,7 +660,8 @@ static int dpm_convert(opal_list_t *infos,
660660
char *infokey,
661661
char *option,
662662
char *directive,
663-
char *modifier)
663+
char *modifier,
664+
bool deprecated)
664665
{
665666
opal_info_item_t *iptr;
666667
char *ck, *ptr, *help_str;
@@ -758,9 +759,11 @@ static int dpm_convert(opal_list_t *infos,
758759
opal_list_append(infos, &iptr->super);
759760

760761
/* alert them */
761-
opal_asprintf(&help_str, "Key: %s Value: %s", option, ptr);
762-
opal_show_help("help-dpm.txt", "deprecated-converted", true,
763-
infokey, help_str);
762+
if(deprecated) {
763+
opal_asprintf(&help_str, "Key: %s Value: %s", option, ptr);
764+
opal_show_help("help-dpm.txt", "deprecated-converted", true,
765+
infokey, help_str);
766+
}
764767
free(help_str);
765768
free(ptr);
766769

@@ -803,8 +806,15 @@ int ompi_dpm_spawn(int count, const char *array_of_commands[],
803806
#endif
804807

805808
/* parse the info object */
806-
/* check potentially for:
809+
/* check potentially for
810+
Standard keys:
811+
- "arch": desired architecture
812+
- "wdir": directory, where executable can be found
813+
- "path": list of directories where to look for the executable
814+
- "file": filename, where additional information is provided.
815+
- "soft": see page 92 of MPI-2.
807816
- "host": desired host where to spawn the processes
817+
Non-standard keys:
808818
- "hostfile": hostfile containing hosts where procs are
809819
to be spawned
810820
- "add-host": add the specified hosts to the known list
@@ -818,11 +828,6 @@ int ompi_dpm_spawn(int count, const char *array_of_commands[],
818828
- "ompi_prefix": the path to the root of the directory tree where ompi
819829
executables and libraries can be found on all nodes
820830
used to spawn these procs
821-
- "arch": desired architecture
822-
- "wdir": directory, where executable can be found
823-
- "path": list of directories where to look for the executable
824-
- "file": filename, where additional information is provided.
825-
- "soft": see page 92 of MPI-2.
826831
- "mapper": indicate the mapper to be used for the job
827832
- "display_map": display the map of the spawned job
828833
- "npernode": number of procs/node to spawn
@@ -835,7 +840,6 @@ int ompi_dpm_spawn(int count, const char *array_of_commands[],
835840
- "ompi_preload_files": move specified files to nodes prior to execution
836841
- "ompi_non_mpi": spawned job will not call MPI_Init
837842
- "ompi_param": list of MCA params to be in the spawned job's environment
838-
- "env": newline (\n) delimited list of envar values to be passed to spawned procs
839843
*/
840844

841845
/* setup the job object */
@@ -907,12 +911,12 @@ int ompi_dpm_spawn(int count, const char *array_of_commands[],
907911
}
908912
#endif
909913

914+
/* check for standard form keys, do not deprecate they are part of
915+
* MPI standard ch. 10.3.4 */
916+
910917
/* check for 'host' */
911918
ompi_info_get (array_of_info[i], "host", sizeof(host) - 1, host, &flag);
912919
if ( flag ) {
913-
/* deprecate --> PMIX_PERSONALITY */
914-
opal_show_help("help-dpm.txt", "deprecated-converted", true,
915-
"host", "PMIX_HOST");
916920
info = OBJ_NEW(opal_info_item_t);
917921
PMIX_INFO_LOAD(&info->info, PMIX_HOST, host, PMIX_STRING);
918922
opal_list_append(&app_info, &info->super);
@@ -936,12 +940,46 @@ int ompi_dpm_spawn(int count, const char *array_of_commands[],
936940
}
937941
#endif
938942

943+
/* check for 'wdir' */
944+
ompi_info_get (array_of_info[i], "wdir", sizeof(cwd) - 1, cwd, &flag);
945+
if ( flag ) {
946+
info = OBJ_NEW(opal_info_item_t);
947+
PMIX_INFO_LOAD(&info->info, PMIX_WDIR, cwd, PMIX_STRING);
948+
opal_list_append(&app_info, &info->super);
949+
have_wdir = 1;
950+
}
951+
ompi_info_get (array_of_info[i], "PMIX_WDIR", sizeof(cwd) - 1, cwd, &flag);
952+
if ( flag ) {
953+
info = OBJ_NEW(opal_info_item_t);
954+
PMIX_INFO_LOAD(&info->info, PMIX_WDIR, cwd, PMIX_STRING);
955+
opal_list_append(&app_info, &info->super);
956+
have_wdir = 1;
957+
continue;
958+
}
959+
#if PMIX_NUMERIC_VERSION >= 0x00040000
960+
checkkey = PMIx_Get_attribute_string("PMIX_WDIR");
961+
ompi_info_get (array_of_info[i], checkkey, sizeof(cwd) - 1, cwd, &flag);
962+
if ( flag ) {
963+
info = OBJ_NEW(opal_info_item_t);
964+
PMIX_INFO_LOAD(&info->info, PMIX_WDIR, cwd, PMIX_STRING);
965+
opal_list_append(&app_info, &info->super);
966+
have_wdir = 1;
967+
continue;
968+
}
969+
#endif
970+
971+
/* 'path', 'arch', 'file', 'soft' -- to be implemented */
972+
973+
/* non-standard keys
974+
* Keys that correspond to prun/mpiexec parameters
975+
* do not deprecate PMIX unprefixed forms to remain identical
976+
* to the command line parameter;
977+
* Keys that are not corresponding to an mpiexec parameter are
978+
* deprecated in the non-prefixed form */
979+
939980
/* check for 'hostfile' */
940981
ompi_info_get (array_of_info[i], "hostfile", sizeof(host) - 1, host, &flag);
941982
if ( flag ) {
942-
/* deprecate --> PMIX_HOSTFILE */
943-
opal_show_help("help-dpm.txt", "deprecated-converted", true,
944-
"hostfile", "PMIX_HOSTFILE");
945983
info = OBJ_NEW(opal_info_item_t);
946984
PMIX_INFO_LOAD(&info->info, PMIX_HOSTFILE, host, PMIX_STRING);
947985
opal_list_append(&app_info, &info->super);
@@ -1058,8 +1096,6 @@ int ompi_dpm_spawn(int count, const char *array_of_commands[],
10581096
}
10591097
#endif
10601098

1061-
/* 'path', 'arch', 'file', 'soft' -- to be implemented */
1062-
10631099
/* check for 'ompi_prefix' (OMPI-specific -- to effect the same
10641100
* behavior as --prefix option to orterun)
10651101
*
@@ -1093,37 +1129,6 @@ int ompi_dpm_spawn(int count, const char *array_of_commands[],
10931129
}
10941130
#endif
10951131

1096-
/* check for 'wdir' */
1097-
ompi_info_get (array_of_info[i], "wdir", sizeof(cwd) - 1, cwd, &flag);
1098-
if ( flag ) {
1099-
/* deprecate --> PMIX_WDIR */
1100-
opal_show_help("help-dpm.txt", "deprecated-converted", true,
1101-
"wdir", "PMIX_WDIR");
1102-
info = OBJ_NEW(opal_info_item_t);
1103-
PMIX_INFO_LOAD(&info->info, PMIX_WDIR, cwd, PMIX_STRING);
1104-
opal_list_append(&app_info, &info->super);
1105-
have_wdir = 1;
1106-
}
1107-
ompi_info_get (array_of_info[i], "PMIX_WDIR", sizeof(cwd) - 1, cwd, &flag);
1108-
if ( flag ) {
1109-
info = OBJ_NEW(opal_info_item_t);
1110-
PMIX_INFO_LOAD(&info->info, PMIX_WDIR, cwd, PMIX_STRING);
1111-
opal_list_append(&app_info, &info->super);
1112-
have_wdir = 1;
1113-
continue;
1114-
}
1115-
#if PMIX_NUMERIC_VERSION >= 0x00040000
1116-
checkkey = PMIx_Get_attribute_string("PMIX_WDIR");
1117-
ompi_info_get (array_of_info[i], checkkey, sizeof(cwd) - 1, cwd, &flag);
1118-
if ( flag ) {
1119-
info = OBJ_NEW(opal_info_item_t);
1120-
PMIX_INFO_LOAD(&info->info, PMIX_WDIR, cwd, PMIX_STRING);
1121-
opal_list_append(&app_info, &info->super);
1122-
have_wdir = 1;
1123-
continue;
1124-
}
1125-
#endif
1126-
11271132
/* check for 'mapper' - a job-level key */
11281133
ompi_info_get(array_of_info[i], "mapper", sizeof(mapper) - 1, mapper, &flag);
11291134
if ( flag ) {
@@ -1156,7 +1161,7 @@ int ompi_dpm_spawn(int count, const char *array_of_commands[],
11561161
/* check for 'display_map' - a job-level key */
11571162
ompi_info_get_bool(array_of_info[i], "display_map", &local_spawn, &flag);
11581163
if ( flag ) {
1159-
rc = dpm_convert(&job_info, "display_map", PMIX_MAPBY, NULL, "DISPLAYMAP");
1164+
rc = dpm_convert(&job_info, "display_map", PMIX_MAPBY, NULL, "DISPLAYMAP", true);
11601165
if (OMPI_SUCCESS != rc) {
11611166
OPAL_LIST_DESTRUCT(&job_info);
11621167
OPAL_LIST_DESTRUCT(&app_info);
@@ -1171,7 +1176,7 @@ int ompi_dpm_spawn(int count, const char *array_of_commands[],
11711176
ompi_info_get (array_of_info[i], "npernode", sizeof(slot_list) - 1, slot_list, &flag);
11721177
if ( flag ) {
11731178
opal_asprintf(&tmp, "PPR:%s:NODE", slot_list);
1174-
rc = dpm_convert(&job_info, "npernode", PMIX_MAPBY, tmp, NULL);
1179+
rc = dpm_convert(&job_info, "npernode", PMIX_MAPBY, tmp, NULL, true);
11751180
free(tmp);
11761181
if (OMPI_SUCCESS != rc) {
11771182
OPAL_LIST_DESTRUCT(&job_info);
@@ -1184,7 +1189,7 @@ int ompi_dpm_spawn(int count, const char *array_of_commands[],
11841189
}
11851190
ompi_info_get (array_of_info[i], "pernode", sizeof(slot_list) - 1, slot_list, &flag);
11861191
if ( flag ) {
1187-
rc = dpm_convert(&job_info, "pernode", PMIX_MAPBY, "PPR:1:NODE", NULL);
1192+
rc = dpm_convert(&job_info, "pernode", PMIX_MAPBY, "PPR:1:NODE", NULL, true);
11881193
free(tmp);
11891194
if (OMPI_SUCCESS != rc) {
11901195
OPAL_LIST_DESTRUCT(&job_info);
@@ -1215,7 +1220,7 @@ int ompi_dpm_spawn(int count, const char *array_of_commands[],
12151220
opal_progress_event_users_decrement();
12161221
return MPI_ERR_SPAWN;
12171222
}
1218-
rc = dpm_convert(&job_info, "ppr", PMIX_MAPBY, slot_list, NULL);
1223+
rc = dpm_convert(&job_info, "ppr", PMIX_MAPBY, slot_list, NULL, true);
12191224
free(tmp);
12201225
if (OMPI_SUCCESS != rc) {
12211226
OPAL_LIST_DESTRUCT(&job_info);
@@ -1230,7 +1235,7 @@ int ompi_dpm_spawn(int count, const char *array_of_commands[],
12301235
/* check for 'map_by' - job-level key */
12311236
ompi_info_get(array_of_info[i], "map_by", sizeof(slot_list) - 1, slot_list, &flag);
12321237
if ( flag ) {
1233-
rc = dpm_convert(&job_info, "map_by", PMIX_MAPBY, slot_list, NULL);
1238+
rc = dpm_convert(&job_info, "map_by", PMIX_MAPBY, slot_list, NULL, false);
12341239
free(tmp);
12351240
if (OMPI_SUCCESS != rc) {
12361241
OPAL_LIST_DESTRUCT(&job_info);
@@ -1262,7 +1267,7 @@ int ompi_dpm_spawn(int count, const char *array_of_commands[],
12621267
/* check for 'rank_by' - job-level key */
12631268
ompi_info_get(array_of_info[i], "rank_by", sizeof(slot_list) - 1, slot_list, &flag);
12641269
if ( flag ) {
1265-
rc = dpm_convert(&job_info, "rank_by", PMIX_RANKBY, slot_list, NULL);
1270+
rc = dpm_convert(&job_info, "rank_by", PMIX_RANKBY, slot_list, NULL, false);
12661271
free(tmp);
12671272
if (OMPI_SUCCESS != rc) {
12681273
OPAL_LIST_DESTRUCT(&job_info);
@@ -1294,7 +1299,7 @@ int ompi_dpm_spawn(int count, const char *array_of_commands[],
12941299
/* check for 'bind_to' - job-level key */
12951300
ompi_info_get(array_of_info[i], "bind_to", sizeof(slot_list) - 1, slot_list, &flag);
12961301
if ( flag ) {
1297-
rc = dpm_convert(&job_info, "bind_to", PMIX_BINDTO, slot_list, NULL);
1302+
rc = dpm_convert(&job_info, "bind_to", PMIX_BINDTO, slot_list, NULL, false);
12981303
free(tmp);
12991304
if (OMPI_SUCCESS != rc) {
13001305
OPAL_LIST_DESTRUCT(&job_info);

0 commit comments

Comments
 (0)