Skip to content

Commit ea88d98

Browse files
authored
Merge pull request #9559 from tkordenbrock/portals4/backports/v4.0.x/fix-compiler-warnings
v4.0.x: backport: portals4: fix compiler warnings in all the Portals4 components
2 parents 9e2b235 + 3336566 commit ea88d98

File tree

12 files changed

+120
-128
lines changed

12 files changed

+120
-128
lines changed

ompi/mca/coll/portals4/coll_portals4_component.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -655,7 +655,11 @@ portals4_module_enable(mca_coll_base_module_t *module,
655655
return OMPI_SUCCESS;
656656
}
657657

658-
658+
#if OPAL_ENABLE_DEBUG
659+
/* These string maps are only used for debugging output.
660+
* They will be compiled-out when OPAL is configured
661+
* without --enable-debug.
662+
*/
659663
static char *failtype[] = {
660664
"PTL_NI_OK",
661665
"PTL_NI_PERM_VIOLATION",
@@ -689,6 +693,7 @@ static char *evname[] = {
689693
"PTL_EVENT_SEARCH",
690694
"PTL_EVENT_LINK"
691695
};
696+
#endif
692697

693698
/* Target EQ */
694699
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
@@ -176,7 +176,6 @@ OBJ_CLASS_DECLARATION(ompi_coll_portals4_request_t);
176176
req = (ompi_coll_portals4_request_t*) item; \
177177
OMPI_REQUEST_INIT(&req->super, false); \
178178
req->super.req_mpi_object.comm = comm; \
179-
req->super.req_complete = false; \
180179
req->super.req_state = OMPI_REQUEST_ACTIVE; \
181180
} while (0)
182181

ompi/mca/mtl/portals4/mtl_portals4_component.c

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

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

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

ompi/mca/mtl/portals4/mtl_portals4_request.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ struct ompi_mtl_portals4_isend_request_t {
5555
#endif
5656
ptl_size_t length;
5757
int32_t pending_get;
58-
uint32_t event_count;
58+
int32_t event_count;
5959
};
6060
typedef struct ompi_mtl_portals4_isend_request_t ompi_mtl_portals4_isend_request_t;
6161

ompi/mca/mtl/portals4/mtl_portals4_send.c

Lines changed: 1 addition & 1 deletion
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

0 commit comments

Comments
 (0)