[mpich-commits] [mpich] MPICH primary repository branch, master, updated. v3.2-6-g354cd1f

Service Account noreply at mpich.org
Wed Nov 18 17:10:20 CST 2015


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "MPICH primary repository".

The branch, master has been updated
       via  354cd1fda6b63e545e1286a9cfac4e6b88ba0070 (commit)
      from  1a6eb4d6026a2999403d9731ceb1c8b357fab476 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.mpich.org/mpich.git/commitdiff/354cd1fda6b63e545e1286a9cfac4e6b88ba0070

commit 354cd1fda6b63e545e1286a9cfac4e6b88ba0070
Author: Ken Raffenetti <raffenet at mcs.anl.gov>
Date:   Wed Nov 18 14:35:28 2015 -0600

    pm/hydra/topo: better debug string management
    
    The static debug string allocation was not sufficient for machines
    with many processing elements. Dynamically allocate a string to
    accomodate all cases. We also remove spaces in the binding output
    to make things easier on users' terminals.
    
    Reported-by: Jeff Hammond <jeff.science at gmail.com>
    Signed-off-by: Halim Amer <aamer at anl.gov>

diff --git a/src/pm/hydra/tools/topo/hwloc/topo_hwloc.c b/src/pm/hydra/tools/topo/hwloc/topo_hwloc.c
index 987e52a..c441841 100644
--- a/src/pm/hydra/tools/topo/hwloc/topo_hwloc.c
+++ b/src/pm/hydra/tools/topo/hwloc/topo_hwloc.c
@@ -10,7 +10,6 @@
 #include "topo_hwloc.h"
 
 #define MAP_LENGTH      (5)
-#define DBG_STR_LENGTH  (128)
 
 struct HYDT_topo_hwloc_info HYDT_topo_hwloc_info = { 0 };
 
@@ -457,17 +456,21 @@ HYD_status HYDT_topo_hwloc_bind(int idx)
 
         /* For debugging, print the binding bitmaps but don't actually bind. */
         if (HYDT_topo_info.debug) {
-            int i, cur;
-            char binding[DBG_STR_LENGTH];
+            int i;
+            char *binding;
 
-            cur = HYDU_snprintf(binding, DBG_STR_LENGTH, "process %d binding: ", idx);
+            HYDU_MALLOC(binding, char *, HYDT_topo_hwloc_info.total_num_pus + 1, status);
+            memset(binding, '\0', HYDT_topo_hwloc_info.total_num_pus + 1);
 
-            for (i = 0; i < HYDT_topo_hwloc_info.total_num_pus; i++)
-                cur += HYDU_snprintf(&binding[cur], DBG_STR_LENGTH - cur + 1, "%d ",
-                                     hwloc_bitmap_isset(HYDT_topo_hwloc_info.bitmap[id], i));
+            for (i = 0; i < HYDT_topo_hwloc_info.total_num_pus; i++) {
+                if (hwloc_bitmap_isset(HYDT_topo_hwloc_info.bitmap[id], i))
+                    *(binding + i) = '1';
+                else
+                    *(binding + i) = '0';
+            }
 
-            HYDU_snprintf(&binding[cur], DBG_STR_LENGTH - cur + 1, "\n");
-            HYDU_dump_noprefix(stdout, "%s", binding);
+            HYDU_dump_noprefix(stdout, "process %d binding: %s\n", idx, binding);
+            HYDU_FREE(binding);
         }
         else {
             hwloc_set_cpubind(topology, HYDT_topo_hwloc_info.bitmap[id], 0);
@@ -476,8 +479,12 @@ HYD_status HYDT_topo_hwloc_bind(int idx)
         }
     }
 
+ fn_exit:
     HYDU_FUNC_EXIT();
     return status;
+
+ fn_fail:
+    goto fn_exit;
 }
 
 HYD_status HYDT_topo_hwloc_finalize(void)

-----------------------------------------------------------------------

Summary of changes:
 src/pm/hydra/tools/topo/hwloc/topo_hwloc.c |   25 ++++++++++++++++---------
 1 files changed, 16 insertions(+), 9 deletions(-)


hooks/post-receive
-- 
MPICH primary repository


More information about the commits mailing list