Skip to content

Commit bcd34e7

Browse files
committed
ch3: Default to initialize packet headers
Only in --enable-fast mode will we skip initialization of packet headers. This will give most users a less surprising experience if running under tools like valgrind.
1 parent 76a537f commit bcd34e7

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

src/mpid/ch3/include/mpidimpl.h

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -456,16 +456,22 @@ void MPIDI_DBG_PrintVCState(MPIDI_VC_t *vc);
456456
/*--------------------
457457
BEGIN PACKET SECTION
458458
--------------------*/
459-
#if !defined(MPICH_DEBUG_MEMINIT)
459+
#ifdef MPICH_DEBUG_MEMINIT
460+
#define MPIDI_PKT_INIT_VAL (0xfc)
461+
#else
462+
#define MPIDI_PKT_INIT_VAL (0)
463+
#endif
464+
#ifdef NVALGRIND
460465
# define MPIDI_Pkt_init(pkt_, type_) \
461466
{ \
462467
(pkt_)->type = (type_); \
463468
}
464469
#else
465-
# define MPIDI_Pkt_init(pkt_, type_) \
466-
{ \
467-
memset((void *) (pkt_), 0xfc, sizeof(MPIDI_CH3_Pkt_t)); \
468-
(pkt_)->type = (type_); \
470+
# define MPIDI_Pkt_init(pkt_, type_) \
471+
{ \
472+
memset((void *) (pkt_), MPIDI_PKT_INIT_VAL, \
473+
sizeof(MPIDI_CH3_Pkt_t)); \
474+
(pkt_)->type = (type_); \
469475
}
470476
#endif
471477

0 commit comments

Comments
 (0)