Skip to content

Commit fc25164

Browse files
ggouaillardetawlauria
authored andcommitted
osc/pt2pt: silence valgrind warnings
explicitly add and initialize padding to keep valgrind happy Signed-off-by: Gilles Gouaillardet <[email protected]>
1 parent ff74615 commit fc25164

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

ompi/mca/osc/pt2pt/osc_pt2pt_frag.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
* Copyright (c) 2012 Sandia National Laboratories. All rights reserved.
44
* Copyright (c) 2014-2017 Los Alamos National Security, LLC. All rights
55
* reserved.
6+
* Copyright (c) 2018 Research Organization for Information Science
7+
* and Technology (RIST). All rights reserved.
68
* $COPYRIGHT$
79
*
810
* Additional copyrights may follow
@@ -91,11 +93,18 @@ static inline ompi_osc_pt2pt_frag_t *ompi_osc_pt2pt_frag_alloc_non_buffered (omp
9193

9294
curr->header->base.type = OMPI_OSC_PT2PT_HDR_TYPE_FRAG;
9395
curr->header->base.flags = OMPI_OSC_PT2PT_HDR_FLAG_VALID;
96+
#if OPAL_ENABLE_DEBUG
97+
curr->header->padding[0] = 0;
98+
curr->header->padding[1] = 0;
99+
#endif
94100
if (module->passive_target_access_epoch) {
95101
curr->header->base.flags |= OMPI_OSC_PT2PT_HDR_FLAG_PASSIVE_TARGET;
96102
}
97103
curr->header->source = ompi_comm_rank(module->comm);
98104
curr->header->num_ops = 1;
105+
#if OPAL_ENABLE_DEBUG
106+
curr->header->pad = 0;
107+
#endif
99108

100109
return curr;
101110
}

ompi/mca/osc/pt2pt/osc_pt2pt_header.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* Copyright (c) 2010 Cisco Systems, Inc. All rights reserved.
1414
* Copyright (c) 2010 Oracle and/or its affiliates. All rights reserved.
1515
* Copyright (c) 2012-2013 Sandia National Laboratories. All rights reserved.
16-
* Copyright (c) 2015 Research Organization for Information Science
16+
* Copyright (c) 2015-2018 Research Organization for Information Science
1717
* and Technology (RIST). All rights reserved.
1818
* $COPYRIGHT$
1919
*
@@ -133,6 +133,9 @@ typedef struct ompi_osc_pt2pt_header_lock_t ompi_osc_pt2pt_header_lock_t;
133133

134134
struct ompi_osc_pt2pt_header_lock_ack_t {
135135
ompi_osc_pt2pt_header_base_t base;
136+
#if OPAL_ENABLE_HETEROGENEOUS_SUPPORT
137+
uint8_t padding[2];
138+
#endif
136139
uint32_t source;
137140
uint64_t lock_ptr;
138141
};
@@ -179,6 +182,9 @@ typedef struct ompi_osc_pt2pt_header_flush_ack_t ompi_osc_pt2pt_header_flush_ack
179182

180183
struct ompi_osc_pt2pt_frag_header_t {
181184
ompi_osc_pt2pt_header_base_t base;
185+
#if OPAL_ENABLE_HETEROGENEOUS_SUPPORT || OPAL_ENABLE_DEBUG
186+
uint8_t padding[2];
187+
#endif
182188
uint32_t source; /* rank in window of source process */
183189
opal_atomic_int32_t num_ops; /* number of operations in this buffer */
184190
uint32_t pad; /* ensure the fragment header is a multiple of 8 bytes */

0 commit comments

Comments
 (0)