Skip to content

Commit 18579b7

Browse files
authored
Merge pull request #9391 from tkordenbrock/portals4/master/fix-compiler-warnings
master: portals4: fix compiler warnings in all the Portals4 components
2 parents 52d1096 + 2fc4020 commit 18579b7

15 files changed

+125
-131
lines changed

ompi/mca/coll/portals4/coll_portals4_component.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -661,7 +661,11 @@ portals4_module_enable(mca_coll_base_module_t *module,
661661
return OMPI_SUCCESS;
662662
}
663663

664-
664+
#if OPAL_ENABLE_DEBUG
665+
/* These string maps are only used for debugging output.
666+
* They will be compiled-out when OPAL is configured
667+
* without --enable-debug.
668+
*/
665669
static char *failtype[] = {
666670
"PTL_NI_OK",
667671
"PTL_NI_PERM_VIOLATION",
@@ -695,6 +699,7 @@ static char *evname[] = {
695699
"PTL_EVENT_SEARCH",
696700
"PTL_EVENT_LINK"
697701
};
702+
#endif
698703

699704
/* Target EQ */
700705
static int

ompi/mca/coll/portals4/coll_portals4_gather.c

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ static ompi_coll_portals4_tree_t*
7676
ompi_coll_portals4_build_in_order_bmtree( struct ompi_communicator_t* comm,
7777
int root )
7878
{
79-
int childs = 0, rank, vrank, vparent, size, mask = 1, remote, i;
79+
int childs = 0, rank, vrank, vparent, size, mask = 1, remote;
8080
ompi_coll_portals4_tree_t *bmtree;
8181

8282
/*
@@ -97,7 +97,7 @@ ompi_coll_portals4_build_in_order_bmtree( struct ompi_communicator_t* comm,
9797
bmtree->tree_bmtree = 1;
9898
bmtree->tree_root = MPI_UNDEFINED;
9999
bmtree->tree_nextsize = MPI_UNDEFINED;
100-
for(i=0;i<MAXTREEFANOUT;i++) {
100+
for(int i = 0; i < MAXTREEFANOUT; i++) {
101101
bmtree->tree_next[i] = -1;
102102
}
103103

@@ -520,8 +520,6 @@ ompi_coll_portals4_gather_intra_binomial_top(const void *sbuf, int scount, struc
520520

521521
int vrank=-1;
522522

523-
int32_t i=0;
524-
525523
ompi_coll_portals4_tree_t* bmtree;
526524

527525
int32_t expected_ops =0;
@@ -606,7 +604,7 @@ ompi_coll_portals4_gather_intra_binomial_top(const void *sbuf, int scount, struc
606604
"%s:%d: packed_size=%lu, fragment_size=%lu",
607605
__FILE__, __LINE__, request->u.gather.packed_size, mca_coll_portals4_component.ni_limits.max_msg_size));
608606

609-
for (int i =0; i < bmtree->tree_nextsize; i++) {
607+
for (int i = 0; i < bmtree->tree_nextsize; i++) {
610608
int child_vrank = VRANK(bmtree->tree_next[i], request->u.gather.root_rank, request->u.gather.size);
611609
int sub_tree_size = get_tree_numdescendants_of(comm, child_vrank) + 1;
612610
ptl_size_t local_number_of_fragment = ((sub_tree_size * request->u.gather.packed_size) + mca_coll_portals4_component.ni_limits.max_msg_size -1) / mca_coll_portals4_component.ni_limits.max_msg_size;
@@ -688,7 +686,7 @@ ompi_coll_portals4_gather_intra_binomial_top(const void *sbuf, int scount, struc
688686
/************************************/
689687
/* put Recv-ACK to each child */
690688
/************************************/
691-
for (i=0;i<bmtree->tree_nextsize;i++) {
689+
for (int i = 0; i < bmtree->tree_nextsize; i++) {
692690
int32_t child=bmtree->tree_next[i];
693691
ret = PtlTriggeredPut(request->u.gather.sync_mdh,
694692
0,
@@ -730,7 +728,7 @@ ompi_coll_portals4_gather_intra_binomial_top(const void *sbuf, int scount, struc
730728
/**********************************/
731729
/* put RTR to each child */
732730
/**********************************/
733-
for (i=0;i<bmtree->tree_nextsize;i++) {
731+
for (int i = 0; i < bmtree->tree_nextsize; i++) {
734732
int32_t child=bmtree->tree_next[i];
735733
ret = PtlTriggeredPut(request->u.gather.sync_mdh,
736734
0,
@@ -750,7 +748,7 @@ ompi_coll_portals4_gather_intra_binomial_top(const void *sbuf, int scount, struc
750748
/**********************************/
751749
/* put RTR to each child */
752750
/**********************************/
753-
for (i=0;i<bmtree->tree_nextsize;i++) {
751+
for (int i = 0; i < bmtree->tree_nextsize; i++) {
754752
int32_t child=bmtree->tree_next[i];
755753
ret = PtlPut(request->u.gather.sync_mdh,
756754
0,
@@ -818,8 +816,6 @@ ompi_coll_portals4_gather_intra_linear_top(const void *sbuf, int scount, struct
818816

819817
int8_t i_am_root;
820818

821-
int32_t i=0;
822-
823819
int32_t expected_ops =0;
824820
int32_t expected_acks=0;
825821

@@ -975,7 +971,7 @@ ompi_coll_portals4_gather_intra_linear_top(const void *sbuf, int scount, struct
975971
/* root puts Recv-ACK to all other ranks */
976972
/*****************************************/
977973
if (i_am_root) {
978-
for (i=0;i<request->u.gather.size;i++) {
974+
for (int i = 0; i < request->u.gather.size; i++) {
979975
if (i == request->u.gather.root_rank) { continue; }
980976
ret = PtlTriggeredPut(request->u.gather.sync_mdh,
981977
0,
@@ -1019,7 +1015,7 @@ ompi_coll_portals4_gather_intra_linear_top(const void *sbuf, int scount, struct
10191015
/* root puts RTR to all other ranks */
10201016
/************************************/
10211017
if (i_am_root) {
1022-
for (i=0;i<request->u.gather.size;i++) {
1018+
for (int i = 0; i < request->u.gather.size; i++) {
10231019
if (i == request->u.gather.root_rank) { continue; }
10241020
ret = PtlTriggeredPut(request->u.gather.sync_mdh,
10251021
0,
@@ -1041,7 +1037,7 @@ ompi_coll_portals4_gather_intra_linear_top(const void *sbuf, int scount, struct
10411037
/* root puts RTR to all other ranks */
10421038
/************************************/
10431039
if (i_am_root) {
1044-
for (i=0;i<request->u.gather.size;i++) {
1040+
for (int i = 0; i < request->u.gather.size; i++) {
10451041
if (i == request->u.gather.root_rank) { continue; }
10461042
ret = PtlPut(request->u.gather.sync_mdh,
10471043
0,
@@ -1093,7 +1089,6 @@ ompi_coll_portals4_gather_intra_binomial_bottom(struct ompi_communicator_t *comm
10931089
ompi_coll_portals4_request_t *request)
10941090
{
10951091
int ret, line;
1096-
int i;
10971092

10981093
OPAL_OUTPUT_VERBOSE((10, ompi_coll_base_framework.framework_output,
10991094
"coll:portals4:gather_intra_binomial_bottom enter rank %d", request->u.gather.my_rank));
@@ -1109,7 +1104,7 @@ ompi_coll_portals4_gather_intra_binomial_bottom(struct ompi_communicator_t *comm
11091104
struct iovec iov;
11101105
size_t max_data;
11111106

1112-
for (i=0;i<request->u.gather.size;i++) {
1107+
for (int i = 0; i < request->u.gather.size; i++) {
11131108
uint64_t offset = request->u.gather.unpack_dst_extent * request->u.gather.unpack_dst_count * ((request->u.gather.my_rank + i) % request->u.gather.size);
11141109

11151110
opal_output_verbose(30, ompi_coll_base_framework.framework_output,
@@ -1161,7 +1156,6 @@ ompi_coll_portals4_gather_intra_linear_bottom(struct ompi_communicator_t *comm,
11611156
ompi_coll_portals4_request_t *request)
11621157
{
11631158
int ret, line;
1164-
int i;
11651159

11661160
OPAL_OUTPUT_VERBOSE((10, ompi_coll_base_framework.framework_output,
11671161
"coll:portals4:gather_intra_linear_bottom enter rank %d", request->u.gather.my_rank));
@@ -1177,7 +1171,7 @@ ompi_coll_portals4_gather_intra_linear_bottom(struct ompi_communicator_t *comm,
11771171
struct iovec iov;
11781172
size_t max_data;
11791173

1180-
for (i=0;i<request->u.gather.size;i++) {
1174+
for (int i = 0; i < request->u.gather.size; i++) {
11811175
ompi_coll_portals4_create_recv_converter (&request->u.gather.recv_converter,
11821176
request->u.gather.unpack_dst_buf + (request->u.gather.unpack_dst_extent*request->u.gather.unpack_dst_count*i),
11831177
ompi_comm_peer_lookup(comm, request->u.gather.my_rank),

ompi/mca/coll/portals4/coll_portals4_request.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ request_free(struct ompi_request_t **ompi_req)
2727
ompi_coll_portals4_request_t *request =
2828
(ompi_coll_portals4_request_t*) *ompi_req;
2929

30-
if (true != request->super.req_complete) {
30+
if (!REQUEST_COMPLETE(&request->super)) {
3131
return MPI_ERR_REQUEST;
3232
}
3333

ompi/mca/coll/portals4/coll_portals4_request.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,6 @@ OBJ_CLASS_DECLARATION(ompi_coll_portals4_request_t);
179179
req = (ompi_coll_portals4_request_t*) item; \
180180
OMPI_REQUEST_INIT(&req->super, false); \
181181
req->super.req_mpi_object.comm = comm; \
182-
req->super.req_complete = false; \
183182
req->super.req_state = OMPI_REQUEST_ACTIVE; \
184183
} while (0)
185184

ompi/mca/mtl/portals4/mtl_portals4_component.c

Lines changed: 25 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -229,36 +229,6 @@ ompi_mtl_portals4_component_open(void)
229229
sizeof(ompi_mtl_portals4_request_t) -
230230
sizeof(struct mca_mtl_request_t);
231231

232-
opal_output_verbose(1, ompi_mtl_base_framework.framework_output,
233-
"Flow control: "
234-
#if OMPI_MTL_PORTALS4_FLOW_CONTROL
235-
"yes"
236-
#else
237-
"no"
238-
#endif
239-
);
240-
opal_output_verbose(1, ompi_mtl_base_framework.framework_output,
241-
"Max message size: %lu", (unsigned long)
242-
ompi_mtl_portals4.max_msg_size_mtl);
243-
opal_output_verbose(1, ompi_mtl_base_framework.framework_output,
244-
"Short limit: %d", (int)
245-
ompi_mtl_portals4.short_limit);
246-
opal_output_verbose(1, ompi_mtl_base_framework.framework_output,
247-
"Eager limit: %d", (int)
248-
ompi_mtl_portals4.eager_limit);
249-
opal_output_verbose(1, ompi_mtl_base_framework.framework_output,
250-
"Short receive blocks: %d",
251-
ompi_mtl_portals4.recv_short_num);
252-
opal_output_verbose(1, ompi_mtl_base_framework.framework_output,
253-
"Send queue size: %d", ompi_mtl_portals4.send_queue_size);
254-
opal_output_verbose(1, ompi_mtl_base_framework.framework_output,
255-
"Recv queue size: %d", ompi_mtl_portals4.recv_queue_size);
256-
opal_output_verbose(1, ompi_mtl_base_framework.framework_output,
257-
"Long protocol: %s",
258-
(ompi_mtl_portals4.protocol == eager) ? "Eager" :
259-
(ompi_mtl_portals4.protocol == rndv) ? "Rendezvous" :
260-
"Other");
261-
262232
OBJ_CONSTRUCT(&ompi_mtl_portals4.fl_message, opal_free_list_t);
263233
opal_free_list_init(&ompi_mtl_portals4.fl_message,
264234
sizeof(ompi_mtl_portals4_message_t) +
@@ -291,6 +261,31 @@ ompi_mtl_portals4_component_open(void)
291261
ompi_mtl_portals4.use_flowctl=0;
292262
#endif
293263

264+
opal_output_verbose(1, ompi_mtl_base_framework.framework_output,
265+
"Flow control: %s",
266+
ompi_mtl_portals4.use_flowctl ? "yes" : "no");
267+
opal_output_verbose(1, ompi_mtl_base_framework.framework_output,
268+
"Max message size: %lu", (unsigned long)
269+
ompi_mtl_portals4.max_msg_size_mtl);
270+
opal_output_verbose(1, ompi_mtl_base_framework.framework_output,
271+
"Short limit: %d", (int)
272+
ompi_mtl_portals4.short_limit);
273+
opal_output_verbose(1, ompi_mtl_base_framework.framework_output,
274+
"Eager limit: %d", (int)
275+
ompi_mtl_portals4.eager_limit);
276+
opal_output_verbose(1, ompi_mtl_base_framework.framework_output,
277+
"Short receive blocks: %d",
278+
ompi_mtl_portals4.recv_short_num);
279+
opal_output_verbose(1, ompi_mtl_base_framework.framework_output,
280+
"Send queue size: %d", ompi_mtl_portals4.send_queue_size);
281+
opal_output_verbose(1, ompi_mtl_base_framework.framework_output,
282+
"Recv queue size: %d", ompi_mtl_portals4.recv_queue_size);
283+
opal_output_verbose(1, ompi_mtl_base_framework.framework_output,
284+
"Long protocol: %s",
285+
(ompi_mtl_portals4.protocol == eager) ? "Eager" :
286+
(ompi_mtl_portals4.protocol == rndv) ? "Rendezvous" :
287+
"Other");
288+
294289
return OMPI_SUCCESS;
295290
}
296291

ompi/mca/mtl/portals4/mtl_portals4_flowctl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ OBJ_CLASS_DECLARATION(ompi_mtl_portals4_pending_request_t);
3939

4040

4141
struct ompi_mtl_portals4_flowctl_t {
42-
int32_t flowctl_active;
42+
opal_atomic_int32_t flowctl_active;
4343

4444
opal_atomic_int32_t send_slots;
4545
int32_t max_send_slots;

ompi/mca/mtl/portals4/mtl_portals4_recv.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,7 @@ ompi_mtl_portals4_irecv(struct mca_mtl_base_module_t* mtl,
468468
ptl_request->super.type = portals4_req_recv;
469469
ptl_request->super.event_callback = ompi_mtl_portals4_recv_progress;
470470
#if OPAL_ENABLE_DEBUG
471-
ptl_request->opcount = OPAL_THREAD_ADD_FETCH64((int64_t*) &ompi_mtl_portals4.recv_opcount, 1);
471+
ptl_request->opcount = OPAL_THREAD_ADD_FETCH64((opal_atomic_int64_t*) &ompi_mtl_portals4.recv_opcount, 1);
472472
ptl_request->hdr_data = 0;
473473
#endif
474474
ptl_request->buffer_ptr = (free_after) ? start : NULL;
@@ -549,7 +549,7 @@ ompi_mtl_portals4_imrecv(struct mca_mtl_base_module_t* mtl,
549549
}
550550

551551
#if OPAL_ENABLE_DEBUG
552-
ptl_request->opcount = OPAL_THREAD_ADD_FETCH64((int64_t*) &ompi_mtl_portals4.recv_opcount, 1);
552+
ptl_request->opcount = OPAL_THREAD_ADD_FETCH64((opal_atomic_int64_t*) &ompi_mtl_portals4.recv_opcount, 1);
553553
ptl_request->hdr_data = 0;
554554
#endif
555555
ptl_request->super.type = portals4_req_recv;

ompi/mca/mtl/portals4/mtl_portals4_request.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ struct ompi_mtl_portals4_isend_request_t {
6262
#endif
6363
ptl_size_t length;
6464
opal_atomic_int32_t pending_get;
65-
opal_atomic_uint32_t event_count;
65+
opal_atomic_int32_t event_count;
6666
};
6767
typedef struct ompi_mtl_portals4_isend_request_t ompi_mtl_portals4_isend_request_t;
6868

ompi/mca/mtl/portals4/mtl_portals4_send.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ ompi_mtl_portals4_callback(ptl_event_t *ev,
4040
ompi_mtl_portals4_base_request_t* ptl_base_request,
4141
bool *complete)
4242
{
43-
int retval = OMPI_SUCCESS, ret, val, add = 1;
43+
int retval = OMPI_SUCCESS, ret = 0, val = 0, add = 1;
4444
ompi_mtl_portals4_isend_request_t* ptl_request =
4545
(ompi_mtl_portals4_isend_request_t*) ptl_base_request;
4646

@@ -161,7 +161,7 @@ ompi_mtl_portals4_callback(ptl_event_t *ev,
161161
ptl_request->me_h = PTL_INVALID_HANDLE;
162162
add++;
163163
}
164-
val = OPAL_THREAD_ADD_FETCH32((int32_t*)&ptl_request->event_count, add);
164+
val = OPAL_THREAD_ADD_FETCH32(&ptl_request->event_count, add);
165165
assert(val <= 3);
166166

167167
if (val == 3) {
@@ -492,7 +492,7 @@ ompi_mtl_portals4_send_start(struct mca_mtl_base_module_t* mtl,
492492
ret = ompi_mtl_datatype_pack(convertor, &start, &length, &free_after);
493493
if (OMPI_SUCCESS != ret) return ret;
494494

495-
ptl_request->opcount = OPAL_THREAD_ADD_FETCH64((int64_t*)&ompi_mtl_portals4.opcount, 1);
495+
ptl_request->opcount = OPAL_THREAD_ADD_FETCH64((opal_atomic_int64_t*)&ompi_mtl_portals4.opcount, 1);
496496
ptl_request->buffer_ptr = (free_after) ? start : NULL;
497497
ptl_request->length = length;
498498
ptl_request->event_count = 0;

0 commit comments

Comments
 (0)