[mpich-commits] [mpich] MPICH primary repository branch, master, updated. v3.2-168-g78f4d6c

Service Account noreply at mpich.org
Fri Jan 29 13:10:02 CST 2016


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  78f4d6c6eb3db00281e524f22f8580e64abc97b7 (commit)
       via  5a3c8a6ed06b9afb6a2abda4cbe64ae43a02348c (commit)
      from  c40eb976d0458a1ae66ef8e2efa2ad86ff263ff4 (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/78f4d6c6eb3db00281e524f22f8580e64abc97b7

commit 78f4d6c6eb3db00281e524f22f8580e64abc97b7
Author: Pavan Balaji <balaji at anl.gov>
Date:   Fri Jan 29 00:04:44 2016 -0600

    valgrind: explicitly initialize bytes.
    
    Valgrind seems to be confused when a structure has padding and we only
    initialize the fields of the structure without touching the padding
    bytes.  https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=524488
    
    This patch checks if we are running in valgrind mode and explicitly
    initializes all bytes in such cases.  This adds extra overhead, but
    since this is done only in valgrind mode, the common-case should not
    be affected.
    
    Signed-off-by: Yanfei Guo <yguo at anl.gov>

diff --git a/src/mpid/ch3/channels/nemesis/netmod/tcp/socksm.c b/src/mpid/ch3/channels/nemesis/netmod/tcp/socksm.c
index 8300fe5..b06106b 100644
--- a/src/mpid/ch3/channels/nemesis/netmod/tcp/socksm.c
+++ b/src/mpid/ch3/channels/nemesis/netmod/tcp/socksm.c
@@ -475,6 +475,19 @@ static int send_id_info(const sockconn_t *const sc)
 /*     store ending NULL also */
 /*     FIXME better keep pg_id_len itself as part of MPIDI_Process.my_pg structure to */
 /*     avoid computing the length of string everytime this function is called. */
+
+#if defined(MPL_VG_AVAILABLE)
+    /* Valgrind has a bug
+     * (https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=524488) that
+     * causes it to report a warning when we initialize the compiler
+     * adds padding to structures.  Even when we initialize all the
+     * fields, the padding bytes are not initialized.  The idea here
+     * is to detect when we are in "valgrind mode" and in such cases
+     * initialize all bytes of the structure. */
+    if (MPL_VG_RUNNING_ON_VALGRIND()) {
+        memset(&hdr, 0, sizeof(hdr));
+    }
+#endif
     
     hdr.pkt_type = MPIDI_NEM_TCP_SOCKSM_PKT_ID_INFO;
     hdr.datalen = sizeof(MPIDI_nem_tcp_idinfo_t) + pg_id_len;    
@@ -711,6 +724,19 @@ static int send_cmd_pkt(int fd, MPIDI_nem_tcp_socksm_pkt_type_t pkt_type)
 		pkt_type == MPIDI_NEM_TCP_SOCKSM_PKT_TMPVC_NAK ||
                 pkt_type == MPIDI_NEM_TCP_SOCKSM_PKT_CLOSED);
 
+#if defined(MPL_VG_AVAILABLE)
+    /* Valgrind has a bug
+     * (https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=524488) that
+     * causes it to report a warning when we initialize the compiler
+     * adds padding to structures.  Even when we initialize all the
+     * fields, the padding bytes are not initialized.  The idea here
+     * is to detect when we are in "valgrind mode" and in such cases
+     * initialize all bytes of the structure. */
+    if (MPL_VG_RUNNING_ON_VALGRIND()) {
+        memset(&pkt, 0, sizeof(pkt));
+    }
+#endif
+
     pkt.pkt_type = pkt_type;
     pkt.datalen = 0;
 

http://git.mpich.org/mpich.git/commitdiff/5a3c8a6ed06b9afb6a2abda4cbe64ae43a02348c

commit 5a3c8a6ed06b9afb6a2abda4cbe64ae43a02348c
Author: Pavan Balaji <balaji at anl.gov>
Date:   Thu Jan 28 23:39:22 2016 -0600

    hydra: cleanup resources before exiting.
    
    Signed-off-by: Yanfei Guo <yguo at anl.gov>

diff --git a/src/pm/hydra/include/hydra.h b/src/pm/hydra/include/hydra.h
index e761f19..ecea5a1 100644
--- a/src/pm/hydra/include/hydra.h
+++ b/src/pm/hydra/include/hydra.h
@@ -598,6 +598,7 @@ HYD_status HYDU_sock_write(int fd, const void *buf, int maxlen, int *sent, int *
                            enum HYDU_sock_comm_flag flag);
 HYD_status HYDU_sock_set_nonblock(int fd);
 HYD_status HYDU_sock_forward_stdio(int in, int out, int *closed);
+void HYDU_sock_finalize(void);
 HYD_status HYDU_sock_get_iface_ip(char *iface, char **ip);
 HYD_status HYDU_sock_is_local(char *host, int *is_local);
 HYD_status
diff --git a/src/pm/hydra/ui/mpich/mpiexec.c b/src/pm/hydra/ui/mpich/mpiexec.c
index eb969ec..09ed094 100644
--- a/src/pm/hydra/ui/mpich/mpiexec.c
+++ b/src/pm/hydra/ui/mpich/mpiexec.c
@@ -384,6 +384,7 @@ int main(int argc, char **argv)
     /* Free the mpiexec params */
     HYD_uiu_free_params();
     HYDU_free_exec_list(HYD_uii_mpx_exec_list);
+    HYDU_sock_finalize();
 
   fn_exit:
     HYDU_dbg_finalize();
diff --git a/src/pm/hydra/utils/sock/sock.c b/src/pm/hydra/utils/sock/sock.c
index dc56c76..93c5e94 100644
--- a/src/pm/hydra/utils/sock/sock.c
+++ b/src/pm/hydra/utils/sock/sock.c
@@ -352,6 +352,8 @@ static HYD_status alloc_fwd_hash(struct fwd_hash **fwd_hash, int in, int out)
     goto fn_exit;
 }
 
+static struct fwd_hash *fwd_hash_list = NULL;
+
 /* This function does not provide any flow control. We just read from
  * the incoming socket as much as we can and push out to the outgoing
  * socket as much as we can. This can result in the process calling it
@@ -360,7 +362,6 @@ static HYD_status alloc_fwd_hash(struct fwd_hash **fwd_hash, int in, int out)
  * functionality for). */
 HYD_status HYDU_sock_forward_stdio(int in, int out, int *closed)
 {
-    static struct fwd_hash *fwd_hash_list = NULL;
     struct fwd_hash *fwd_hash, *tmp;
     int count;
     HYD_status status = HYD_SUCCESS;
@@ -439,6 +440,17 @@ HYD_status HYDU_sock_forward_stdio(int in, int out, int *closed)
     goto fn_exit;
 }
 
+void HYDU_sock_finalize(void)
+{
+    struct fwd_hash *tmp, *fwd_hash;
+
+    for (fwd_hash = fwd_hash_list; fwd_hash;) {
+        tmp = fwd_hash->next;
+        HYDU_FREE(fwd_hash);
+        fwd_hash = tmp;
+    }
+}
+
 HYD_status HYDU_sock_get_iface_ip(char *iface, char **ip)
 {
     HYD_status status = HYD_SUCCESS;

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

Summary of changes:
 src/mpid/ch3/channels/nemesis/netmod/tcp/socksm.c |   26 +++++++++++++++++++++
 src/pm/hydra/include/hydra.h                      |    1 +
 src/pm/hydra/ui/mpich/mpiexec.c                   |    1 +
 src/pm/hydra/utils/sock/sock.c                    |   14 ++++++++++-
 4 files changed, 41 insertions(+), 1 deletions(-)


hooks/post-receive
-- 
MPICH primary repository


More information about the commits mailing list