@@ -191,62 +191,71 @@ void orte_rmaps_base_map_job(int fd, short args, void *cbdata)
191191 * MCA param, then we use it - this can include a directive
192192 * to overload */
193193 jdata -> map -> binding = opal_hwloc_binding_policy ;
194+ } else if (1 < jdata -> map -> cpus_per_rank ) {
195+ /* bind to cpus */
196+ if (opal_hwloc_use_hwthreads_as_cpus ) {
197+ /* if we are using hwthread cpus, then bind to those */
198+ opal_output_verbose (5 , orte_rmaps_base_framework .framework_output ,
199+ "mca:rmaps[%d] binding not given - using byhwthread" , __LINE__ );
200+ OPAL_SET_DEFAULT_BINDING_POLICY (jdata -> map -> binding , OPAL_BIND_TO_HWTHREAD );
201+ } else {
202+ /* bind to core */
203+ opal_output_verbose (5 , orte_rmaps_base_framework .framework_output ,
204+ "mca:rmaps[%d] binding not given - using bycore" , __LINE__ );
205+ OPAL_SET_DEFAULT_BINDING_POLICY (jdata -> map -> binding , OPAL_BIND_TO_CORE );
206+ }
194207 } else {
195208 /* if the user explicitly mapped-by some object, then we default
196209 * to binding to that object */
197210 orte_mapping_policy_t mpol ;
198211 mpol = ORTE_GET_MAPPING_POLICY (jdata -> map -> mapping );
199212 if (ORTE_MAPPING_GIVEN & ORTE_GET_MAPPING_DIRECTIVE (jdata -> map -> mapping )) {
200213 if (ORTE_MAPPING_BYHWTHREAD == mpol ) {
214+ opal_output_verbose (5 , orte_rmaps_base_framework .framework_output ,
215+ "mca:rmaps[%d] binding not given - using byhwthread" , __LINE__ );
201216 OPAL_SET_DEFAULT_BINDING_POLICY (jdata -> map -> binding , OPAL_BIND_TO_HWTHREAD );
202217 } else if (ORTE_MAPPING_BYCORE == mpol ) {
218+ opal_output_verbose (5 , orte_rmaps_base_framework .framework_output ,
219+ "mca:rmaps[%d] binding not given - using bycore" , __LINE__ );
203220 OPAL_SET_DEFAULT_BINDING_POLICY (jdata -> map -> binding , OPAL_BIND_TO_CORE );
204221 } else if (ORTE_MAPPING_BYL1CACHE == mpol ) {
222+ opal_output_verbose (5 , orte_rmaps_base_framework .framework_output ,
223+ "mca:rmaps[%d] binding not given - using byL1" , __LINE__ );
205224 OPAL_SET_DEFAULT_BINDING_POLICY (jdata -> map -> binding , OPAL_BIND_TO_L1CACHE );
206225 } else if (ORTE_MAPPING_BYL2CACHE == mpol ) {
226+ opal_output_verbose (5 , orte_rmaps_base_framework .framework_output ,
227+ "mca:rmaps[%d] binding not given - using byL2" , __LINE__ );
207228 OPAL_SET_DEFAULT_BINDING_POLICY (jdata -> map -> binding , OPAL_BIND_TO_L2CACHE );
208229 } else if (ORTE_MAPPING_BYL3CACHE == mpol ) {
230+ opal_output_verbose (5 , orte_rmaps_base_framework .framework_output ,
231+ "mca:rmaps[%d] binding not given - using byL3" , __LINE__ );
209232 OPAL_SET_DEFAULT_BINDING_POLICY (jdata -> map -> binding , OPAL_BIND_TO_L3CACHE );
210233 } else if (ORTE_MAPPING_BYSOCKET == mpol ) {
234+ opal_output_verbose (5 , orte_rmaps_base_framework .framework_output ,
235+ "mca:rmaps[%d] binding not given - using bysocket" , __LINE__ );
211236 OPAL_SET_DEFAULT_BINDING_POLICY (jdata -> map -> binding , OPAL_BIND_TO_SOCKET );
212237 } else if (ORTE_MAPPING_BYNUMA == mpol ) {
213- OPAL_SET_DEFAULT_BINDING_POLICY (jdata -> map -> binding , OPAL_BIND_TO_NUMA );
214- }
215- } else if (nprocs <= 2 ) {
216- /* if nothing was specified, then we default to a policy
217- * based on number of procs and cpus_per_rank */
218- if (1 < orte_rmaps_base .cpus_per_rank ) {
219- /* assigning multiple cpus to a rank implies threading,
220- * so we only bind to the NUMA level */
221238 opal_output_verbose (5 , orte_rmaps_base_framework .framework_output ,
222- "mca:rmaps[%d] binding not given - using bynuma" , __LINE__ );
239+ "mca:rmaps[%d] binding not given - using bynuma" , __LINE__ );
223240 OPAL_SET_DEFAULT_BINDING_POLICY (jdata -> map -> binding , OPAL_BIND_TO_NUMA );
224- } else {
225- if (opal_hwloc_use_hwthreads_as_cpus ) {
226- /* if we are using hwthread cpus, then bind to those */
227- opal_output_verbose (5 , orte_rmaps_base_framework .framework_output ,
228- "mca:rmaps[%d] binding not given - using byhwthread" , __LINE__ );
229- OPAL_SET_DEFAULT_BINDING_POLICY (jdata -> map -> binding , OPAL_BIND_TO_HWTHREAD );
230- } else {
231- /* for performance, bind to core */
232- opal_output_verbose (5 , orte_rmaps_base_framework .framework_output ,
233- "mca:rmaps[%d] binding not given - using bycore" , __LINE__ );
234- OPAL_SET_DEFAULT_BINDING_POLICY (jdata -> map -> binding , OPAL_BIND_TO_CORE );
235- }
236241 }
237- } else {
238- if (1 < orte_rmaps_base .cpus_per_rank ) {
239- /* assigning multiple cpus to a rank implies threading,
240- * so we only bind to the NUMA level */
242+ } else if (nprocs <= 2 ) {
243+ if (opal_hwloc_use_hwthreads_as_cpus ) {
244+ /* if we are using hwthread cpus, then bind to those */
241245 opal_output_verbose (5 , orte_rmaps_base_framework .framework_output ,
242- "mca:rmaps[%d] binding not given - using bynuma " , __LINE__ );
243- OPAL_SET_DEFAULT_BINDING_POLICY (jdata -> map -> binding , OPAL_BIND_TO_NUMA );
246+ "mca:rmaps[%d] binding not given - using byhwthread " , __LINE__ );
247+ OPAL_SET_DEFAULT_BINDING_POLICY (jdata -> map -> binding , OPAL_BIND_TO_HWTHREAD );
244248 } else {
245- /* for performance, bind to socket */
249+ /* for performance, bind to core */
246250 opal_output_verbose (5 , orte_rmaps_base_framework .framework_output ,
247- "mca:rmaps[%d] binding not given - using bysocket " , __LINE__ );
248- OPAL_SET_DEFAULT_BINDING_POLICY (jdata -> map -> binding , OPAL_BIND_TO_SOCKET );
251+ "mca:rmaps[%d] binding not given - using bycore " , __LINE__ );
252+ OPAL_SET_DEFAULT_BINDING_POLICY (jdata -> map -> binding , OPAL_BIND_TO_CORE );
249253 }
254+ } else {
255+ /* for performance, bind to NUMA */
256+ opal_output_verbose (5 , orte_rmaps_base_framework .framework_output ,
257+ "mca:rmaps[%d] binding not given - using bynuma" , __LINE__ );
258+ OPAL_SET_DEFAULT_BINDING_POLICY (jdata -> map -> binding , OPAL_BIND_TO_NUMA );
250259 }
251260 if (OPAL_BIND_OVERLOAD_ALLOWED (opal_hwloc_binding_policy )) {
252261 jdata -> map -> binding |= OPAL_BIND_ALLOW_OVERLOAD ;
0 commit comments