@@ -54,6 +54,7 @@ void orte_rmaps_base_map_job(int fd, short args, void *cbdata)
54
54
orte_job_t * parent ;
55
55
orte_vpid_t nprocs ;
56
56
orte_app_context_t * app ;
57
+ bool inherit = false;
57
58
58
59
ORTE_ACQUIRE_OBJECT (caddy );
59
60
jdata = caddy -> jdata ;
@@ -64,32 +65,36 @@ void orte_rmaps_base_map_job(int fd, short args, void *cbdata)
64
65
"mca:rmaps: mapping job %s" ,
65
66
ORTE_JOBID_PRINT (jdata -> jobid ));
66
67
67
- if (NULL == jdata -> map -> ppr && NULL != orte_rmaps_base .ppr ) {
68
- jdata -> map -> ppr = strdup (orte_rmaps_base .ppr );
68
+ /* if this is a dynamic job launch and they didn't explicitly
69
+ * request inheritance, then don't inherit the launch directives */
70
+ if (orte_get_attribute (& jdata -> attributes , ORTE_JOB_LAUNCH_PROXY , NULL , OPAL_NAME )) {
71
+ inherit = orte_rmaps_base .inherit ;
72
+ opal_output_verbose (5 , orte_rmaps_base_framework .framework_output ,
73
+ "mca:rmaps: dynamic job %s %s inherit launch directives" ,
74
+ ORTE_JOBID_PRINT (jdata -> jobid ),
75
+ inherit ? "will" : "will not" );
76
+ } else {
77
+ /* initial launch always takes on MCA params */
78
+ inherit = true;
79
+ }
80
+
81
+ if (inherit ) {
82
+ if (NULL == jdata -> map -> ppr && NULL != orte_rmaps_base .ppr ) {
83
+ jdata -> map -> ppr = strdup (orte_rmaps_base .ppr );
84
+ }
85
+ if (0 == jdata -> map -> cpus_per_rank ) {
86
+ jdata -> map -> cpus_per_rank = orte_rmaps_base .cpus_per_rank ;
87
+ }
69
88
}
70
89
if (NULL != jdata -> map -> ppr ) {
71
90
/* get the procs/object */
72
91
ppx = strtoul (jdata -> map -> ppr , NULL , 10 );
73
92
if (NULL != strstr (jdata -> map -> ppr , "node" )) {
74
93
pernode = true;
75
- } else {
76
- pernode = false;
77
- }
78
- } else {
79
- if (orte_rmaps_base_pernode ) {
80
- ppx = 1 ;
81
- pernode = true;
82
- } else if (0 < orte_rmaps_base_n_pernode ) {
83
- ppx = orte_rmaps_base_n_pernode ;
84
- pernode = true;
85
- } else if (0 < orte_rmaps_base_n_persocket ) {
86
- ppx = orte_rmaps_base_n_persocket ;
94
+ } else if (NULL != strstr (jdata -> map -> ppr , "socket" )) {
87
95
persocket = true;
88
96
}
89
97
}
90
- if (0 == jdata -> map -> cpus_per_rank ) {
91
- jdata -> map -> cpus_per_rank = orte_rmaps_base .cpus_per_rank ;
92
- }
93
98
94
99
/* compute the number of procs and check validity */
95
100
nprocs = 0 ;
@@ -151,12 +156,13 @@ void orte_rmaps_base_map_job(int fd, short args, void *cbdata)
151
156
"mca:rmaps: setting mapping policies for job %s nprocs %d" ,
152
157
ORTE_JOBID_PRINT (jdata -> jobid ), (int )nprocs );
153
158
154
- if (!jdata -> map -> display_map ) {
159
+ if (inherit && !jdata -> map -> display_map ) {
155
160
jdata -> map -> display_map = orte_rmaps_base .display_map ;
156
161
}
162
+
157
163
/* set the default mapping policy IFF it wasn't provided */
158
164
if (!ORTE_MAPPING_POLICY_IS_SET (jdata -> map -> mapping )) {
159
- if (ORTE_MAPPING_GIVEN & ORTE_GET_MAPPING_DIRECTIVE (orte_rmaps_base .mapping )) {
165
+ if (inherit && ( ORTE_MAPPING_GIVEN & ORTE_GET_MAPPING_DIRECTIVE (orte_rmaps_base .mapping ) )) {
160
166
opal_output_verbose (5 , orte_rmaps_base_framework .framework_output ,
161
167
"mca:rmaps mapping given by MCA param" );
162
168
jdata -> map -> mapping = orte_rmaps_base .mapping ;
@@ -216,12 +222,13 @@ void orte_rmaps_base_map_job(int fd, short args, void *cbdata)
216
222
217
223
/* check for no-use-local directive */
218
224
if (!(ORTE_MAPPING_LOCAL_GIVEN & ORTE_GET_MAPPING_DIRECTIVE (jdata -> map -> mapping ))) {
219
- if (ORTE_MAPPING_NO_USE_LOCAL & ORTE_GET_MAPPING_DIRECTIVE (orte_rmaps_base .mapping )) {
225
+ if (inherit && ( ORTE_MAPPING_NO_USE_LOCAL & ORTE_GET_MAPPING_DIRECTIVE (orte_rmaps_base .mapping ) )) {
220
226
ORTE_SET_MAPPING_DIRECTIVE (jdata -> map -> mapping , ORTE_MAPPING_NO_USE_LOCAL );
221
227
}
222
228
}
223
229
224
- /* ditto for rank policy */
230
+ /* we don't have logic to determine default rank policy, so
231
+ * just inherit it if they didn't give us one */
225
232
if (!ORTE_RANKING_POLICY_IS_SET (jdata -> map -> ranking )) {
226
233
jdata -> map -> ranking = orte_rmaps_base .ranking ;
227
234
}
@@ -230,7 +237,7 @@ void orte_rmaps_base_map_job(int fd, short args, void *cbdata)
230
237
* already (e.g., during the call to comm_spawn), then we don't
231
238
* override it */
232
239
if (!OPAL_BINDING_POLICY_IS_SET (jdata -> map -> binding )) {
233
- if (OPAL_BINDING_POLICY_IS_SET (opal_hwloc_binding_policy )) {
240
+ if (inherit && OPAL_BINDING_POLICY_IS_SET (opal_hwloc_binding_policy )) {
234
241
/* if the user specified a default binding policy via
235
242
* MCA param, then we use it - this can include a directive
236
243
* to overload */
0 commit comments