Commits

Jeff Squyres committed ce7cef2 Draft

Fixes #3512: Move slot_list parse fix to v1.7

---svn-pre-commit-ignore-below---

r28054 [[BR]]
Correctly parse the rank file slot_list when given "S:C" - the first position holds the socket, so start looking for cores at posn=1

r28057 [[BR]]
Cleanup report-bindings so it always reports the actual binding instead of what was requested. Ensure we don't report twice if it is an MPI process being launched.

Comments (0)

Files changed (3)

opal/mca/hwloc/base/hwloc_base_util.c

         obj_type = HWLOC_OBJ_PU;
     }
 
-    for (i=0; NULL != socket_core[i]; i++) {
+    for (i=1; NULL != socket_core[i]; i++) {
         if ('C' == socket_core[i][0] ||
             'c' == socket_core[i][0]) {
             corestr = &socket_core[i][1];

orte/mca/ess/base/ess_base_fns.c

     opal_hwloc_base_get_local_cpuset();
     /* report bindings, if requested */
     if (opal_hwloc_report_bindings) {
-        char bindings[64];
-        hwloc_obj_t root;
-        hwloc_cpuset_t cpus;
-        /* get the root object for this node */
-        root = hwloc_get_root_obj(opal_hwloc_topology);
-        cpus = opal_hwloc_base_get_available_cpus(opal_hwloc_topology, root);
-        /* we are not bound if this equals our cpuset */
-        if (0 == hwloc_bitmap_compare(cpus, opal_hwloc_my_cpuset)) {
-            opal_output(0, "%s is not bound",
-                        ORTE_NAME_PRINT(ORTE_PROC_MY_NAME));
+        char tmp1[1024], tmp2[1024];
+        hwloc_cpuset_t mycpus;
+        /* get the cpus we are bound to */
+        mycpus = hwloc_bitmap_alloc();
+        if (hwloc_get_cpubind(opal_hwloc_topology, 
+                              mycpus, 
+                              HWLOC_CPUBIND_PROCESS) < 0) {
+            opal_output(0, "MCW rank %d is not bound",
+                        ORTE_PROC_MY_NAME->vpid);
         } else {
-            hwloc_bitmap_list_snprintf(bindings, 64, opal_hwloc_my_cpuset);
-            opal_output(0, "%s is bound to cpus %s",
-                        ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
-                        bindings);
+            opal_hwloc_base_cset2str(tmp1, sizeof(tmp1), mycpus);
+            opal_hwloc_base_cset2mapstr(tmp2, sizeof(tmp2), mycpus);
+            opal_output(0, "MCW rank %d bound to %s: %s",
+                        ORTE_PROC_MY_NAME->vpid, tmp1, tmp2);
         }
+        hwloc_bitmap_free(mycpus);
     }
 
     return ORTE_SUCCESS;

orte/mca/odls/default/odls_default_module.c

                 }
                 if (0 == rc && opal_hwloc_report_bindings) {
                     char tmp1[1024], tmp2[1024];
-                    opal_hwloc_base_cset2str(tmp1, sizeof(tmp1), cpuset);
-                    opal_hwloc_base_cset2mapstr(tmp2, sizeof(tmp2), cpuset);
-                    opal_output(0, "MCW rank %d bound to %s: %s",
-                                child->name.vpid, tmp1, tmp2);
+                    hwloc_cpuset_t mycpus;
+                    /* get the cpus we are bound to */
+                    mycpus = hwloc_bitmap_alloc();
+                    if (hwloc_get_cpubind(opal_hwloc_topology, 
+                                          mycpus, 
+                                          HWLOC_CPUBIND_PROCESS) < 0) {
+                        opal_output(0, "MCW rank %d is not bound",
+                                    child->name.vpid);
+                    } else {
+                        opal_hwloc_base_cset2str(tmp1, sizeof(tmp1), mycpus);
+                        opal_hwloc_base_cset2mapstr(tmp2, sizeof(tmp2), mycpus);
+                        opal_output(0, "MCW rank %d bound to %s: %s",
+                                    child->name.vpid, tmp1, tmp2);
+                    }
+                    hwloc_bitmap_free(mycpus);
+                    /* avoid reporting it twice */
+                    param = mca_base_param_env_var ("hwloc_base_report_bindings");
+                    opal_unsetenv(param, &environ_copy);
+                    free(param);
                 }
                 /* set memory affinity policy */
                 if (ORTE_SUCCESS != opal_hwloc_base_set_process_membind_policy()) {
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.