Skip to content

Commit f6550b2

Browse files
authored
Merge pull request #12133 from jsquyres/pr/v5.0.x/fix-compiler-warnings
v5.0.x: Fix a bunch of compiler warnings
2 parents 2ba4104 + 5cadbd8 commit f6550b2

31 files changed

+94
-117
lines changed

ompi/communicator/ft/comm_ft.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
* reserved.
77
*
88
* Copyright (c) 2021 Nanook Consulting. All rights reserved.
9+
* Copyright (c) 2023 Jeffrey M. Squyres. All rights reserved.
910
* $COPYRIGHT$
1011
*
1112
* Additional copyrights may follow
@@ -441,10 +442,13 @@ bool ompi_comm_is_proc_active(ompi_communicator_t *comm, int peer_id, bool remot
441442

442443
int ompi_comm_set_rank_failed(ompi_communicator_t *comm, int peer_id, bool remote)
443444
{
444-
/* populate the proc in the comm's group array so that it is not a sentinel and can be read as failed */
445+
#if OPAL_ENABLE_DEBUG
446+
/* populate the proc in the comm's group array so that it is not a
447+
sentinel and can be read as failed */
445448
ompi_proc_t *ompi_proc = ompi_group_get_proc_ptr((remote ? comm->c_remote_group : comm->c_local_group),
446449
peer_id, true);
447450
assert(NULL != ompi_proc);
451+
#endif
448452

449453
/* Disable ANY_SOURCE */
450454
comm->any_source_enabled = false;

ompi/communicator/ft/comm_ft_detector.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
* Copyright (c) 2021 Triad National Security, LLC. All rights
77
* reserved.
88
*
9+
* Copyright (c) 2023 Jeffrey M. Squyres. All rights reserved.
910
* $COPYRIGHT$
1011
*
1112
* Additional copyrights may follow
@@ -579,7 +580,7 @@ static void fd_event_cb(int fd, short flags, void* pdetector)
579580
}
580581

581582
void* fd_progress(opal_object_t* obj) {
582-
int ret;
583+
int __opal_attribute_unused__ ret;
583584
MPI_Request req;
584585
if( OMPI_SUCCESS != ompi_comm_start_detector(&ompi_mpi_comm_world.comm)) {
585586
OPAL_THREAD_ADD_FETCH32(&fd_thread_active, -1);

ompi/mca/coll/adapt/coll_adapt_ireduce.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
* reserved.
55
* Copyright (c) 2020 Cisco Systems, Inc. All rights reserved.
66
* Copyright (c) 2022 IBM Corporation. All rights reserved
7+
* Copyright (c) 2023 Jeffrey M. Squyres. All rights reserved.
78
* $COPYRIGHT$
89
*
910
* Additional copyrights may follow
@@ -663,7 +664,6 @@ int ompi_coll_adapt_ireduce_generic(const void *sbuf, void *rbuf, int count,
663664
con->next_recv_segs[i] = min - 1;
664665
}
665666

666-
int num_recvs = 0;
667667
for (int32_t seg_index = 0; seg_index < min; seg_index++)
668668
{
669669
/* For each child */
@@ -711,8 +711,6 @@ int ompi_coll_adapt_ireduce_generic(const void *sbuf, void *rbuf, int count,
711711
}
712712
/* Set the recv callback */
713713
ompi_request_set_callback(recv_req, recv_cb, context);
714-
715-
++num_recvs;
716714
}
717715
}
718716
}

ompi/mca/coll/base/coll_base_reduce_scatter_block.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
* Copyright (c) 2018 Siberian State University of Telecommunications
1919
* and Information Sciences. All rights reserved.
2020
* Copyright (c) 2022 IBM Corporation. All rights reserved.
21+
* Copyright (c) 2023 Jeffrey M. Squyres. All rights reserved.
2122
* $COPYRIGHT$
2223
*
2324
* Additional copyrights may follow
@@ -245,7 +246,6 @@ ompi_coll_base_reduce_scatter_block_intra_recursivedoubling(
245246
int is_commutative = ompi_op_is_commute(op);
246247

247248
/* Recursive distance doubling */
248-
int rdoubling_step = 0;
249249
for (int mask = 1; mask < comm_size; mask <<= 1) {
250250
int remote = rank ^ mask;
251251
int cur_tree_root = ompi_rounddown(rank, mask);
@@ -350,7 +350,6 @@ ompi_coll_base_reduce_scatter_block_intra_recursivedoubling(
350350
if (MPI_SUCCESS != err) { goto cleanup_and_return; }
351351
}
352352
}
353-
rdoubling_step++;
354353
err = ompi_datatype_destroy(&dtypesend);
355354
if (MPI_SUCCESS != err) { goto cleanup_and_return; }
356355
err = ompi_datatype_destroy(&dtyperecv);

ompi/mca/coll/base/coll_base_util.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
* All rights reserved.
1212
* Copyright (c) 2014-2020 Research Organization for Information Science
1313
* and Technology (RIST). All rights reserved.
14+
* Copyright (c) 2023 Jeffrey M. Squyres. All rights reserved.
1415
* $COPYRIGHT$
1516
*
1617
* Additional copyrights may follow
@@ -398,7 +399,7 @@ int ompi_coll_base_file_getnext_long(FILE *fptr, int *fileline, long* val)
398399

399400
int ompi_coll_base_file_getnext_string(FILE *fptr, int *fileline, char** val)
400401
{
401-
char trash, token[32];
402+
char trash, token[33];
402403
int rc;
403404

404405
*val = NULL; /* security in case we fail */

ompi/mca/coll/inter/coll_inter_allreduce.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
* Copyright (c) 2013 Cisco Systems, Inc. All rights reserved.
1414
* Copyright (c) 2015-2017 Research Organization for Information Science
1515
* and Technology (RIST). All rights reserved.
16+
* Copyright (c) 2023 Jeffrey M. Squyres. All rights reserved.
1617
* $COPYRIGHT$
1718
*
1819
* Additional copyrights may follow
@@ -48,7 +49,8 @@ mca_coll_inter_allreduce_inter(const void *sbuf, void *rbuf, int count,
4849
mca_coll_base_module_t *module)
4950
{
5051
int err, rank, root = 0;
51-
char *tmpbuf = NULL, *pml_buffer = NULL, *source;
52+
char *tmpbuf = NULL, *pml_buffer = NULL;
53+
const char *source;
5254
ptrdiff_t gap, span;
5355

5456
rank = ompi_comm_rank(comm);

ompi/mca/coll/libnbc/libdict/dict.c

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -16,34 +16,6 @@
1616
dict_malloc_func ompi_coll_libnbc_dict_malloc = malloc;
1717
dict_free_func ompi_coll_libnbc_dict_free = free;
1818

19-
static inline dict_malloc_func
20-
dict_set_malloc(dict_malloc_func func)
21-
{
22-
dict_malloc_func old = ompi_coll_libnbc_dict_malloc;
23-
ompi_coll_libnbc_dict_malloc = func ? func : malloc;
24-
return old;
25-
}
26-
27-
static inline dict_free_func
28-
dict_set_free(dict_free_func func)
29-
{
30-
dict_free_func old = ompi_coll_libnbc_dict_free;
31-
ompi_coll_libnbc_dict_free = func ? func : free;
32-
return old;
33-
}
34-
35-
/*
36-
* In comparing, we cannot simply subtract because that might result in signed
37-
* overflow.
38-
*/
39-
static inline int
40-
dict_int_cmp(const void *k1, const void *k2)
41-
{
42-
const int *a = (int*)k1, *b = (int*)k2;
43-
44-
return (*a < *b) ? -1 : (*a > *b) ? +1 : 0;
45-
}
46-
4719
int
4820
ompi_coll_libnbc_dict_uint_cmp(const void *k1, const void *k2)
4921
{

ompi/mca/coll/libnbc/libdict/hb_tree.c

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -53,30 +53,6 @@ static hb_node *node_max __P((hb_node *node));
5353
static hb_node *node_next __P((hb_node *node));
5454
static hb_node *node_prev __P((hb_node *node));
5555

56-
static dict *hb_dict_new __P((dict_cmp_func key_cmp, dict_del_func key_del,
57-
dict_del_func dat_del));
58-
static dict_itor *hb_dict_itor_new __P((hb_tree *tree));
59-
static void hb_itor_invalidate __P((hb_itor *itor));
60-
static int hb_itor_first __P((hb_itor *itor));
61-
static void *hb_itor_data __P((hb_itor *itor));
62-
static const void *hb_itor_cdata __P((const hb_itor *itor));
63-
static int hb_itor_last __P((hb_itor *itor));
64-
static int hb_itor_nextn __P((hb_itor *itor, unsigned count));
65-
static int hb_itor_prev __P((hb_itor *itor));
66-
static int hb_itor_prevn __P((hb_itor *itor, unsigned count));
67-
static int hb_itor_search __P((hb_itor *itor, const void *key));
68-
static int hb_itor_set_data __P((hb_itor *itor, void *dat, int del));
69-
static unsigned hb_tree_count __P((const hb_tree *tree));
70-
static void hb_tree_destroy __P((hb_tree *tree, int del));
71-
static void hb_tree_empty __P((hb_tree *tree, int del));
72-
static unsigned hb_tree_height __P((const hb_tree *tree));
73-
static const void *hb_tree_max __P((const hb_tree *tree));
74-
static unsigned hb_tree_mheight __P((const hb_tree *tree));
75-
static const void *hb_tree_min __P((const hb_tree *tree));
76-
static unsigned hb_tree_pathlen __P((const hb_tree *tree));
77-
static int hb_tree_probe __P((hb_tree *tree, void *key, void **dat));
78-
static void hb_tree_walk __P((hb_tree *tree, dict_vis_func visit));
79-
8056
hb_tree *
8157
ompi_coll_libnbc_hb_tree_new(dict_cmp_func key_cmp, dict_del_func key_del,
8258
dict_del_func dat_del)

ompi/mca/coll/tuned/coll_tuned_dynamic_file.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
* All rights reserved.
1212
* Copyright (c) 2015 Research Organization for Information Science
1313
* and Technology (RIST). All rights reserved.
14+
* Copyright (c) 2023 Jeffrey M. Squyres. All rights reserved.
1415
* $COPYRIGHT$
1516
*
1617
* Additional copyrights may follow
@@ -69,8 +70,10 @@ int ompi_coll_tuned_read_rules_config_file (char *fname, ompi_coll_alg_rule_t**
6970

7071
/* stats info */
7172
int total_alg_count = 0;
73+
#if OPAL_ENABLE_DEBUG
7274
int total_com_count = 0;
7375
int total_msg_count = 0;
76+
#endif
7477

7578
if (!fname) {
7679
OPAL_OUTPUT((ompi_coll_tuned_stream,"Gave NULL as rule table configuration file for tuned collectives... ignoring!\n"));
@@ -203,11 +206,15 @@ int ompi_coll_tuned_read_rules_config_file (char *fname, ompi_coll_alg_rule_t**
203206
goto on_file_error;
204207
}
205208

209+
#if OPAL_ENABLE_DEBUG
206210
total_msg_count++;
211+
#endif
207212

208213
} /* msg size */
209214

215+
#if OPAL_ENABLE_DEBUG
210216
total_com_count++;
217+
#endif
211218

212219
} /* comm size */
213220

ompi/mca/common/ompio/common_ompio_aggregators.c

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
* Copyright (c) 2015-2018 Research Organization for Information Science
1717
* and Technology (RIST). All rights reserved.
1818
* Copyright (c) 2017 IBM Corporation. All rights reserved.
19+
* Copyright (c) 2023 Jeffrey M. Squyres. All rights reserved.
1920
* $COPYRIGHT$
2021
*
2122
* Additional copyrights may follow
@@ -195,16 +196,13 @@ int mca_common_ompio_forced_grouping ( ompio_file_t *fh,
195196
int rest = fh->f_size % num_groups;
196197
int flag = OMPI_COMM_IS_MAPBY_NODE (&ompi_mpi_comm_world.comm);
197198
int k=0, p=0, g=0;
198-
int total_procs = 0;
199199

200200
for ( k=0, p=0; p<num_groups; p++ ) {
201201
if ( p < rest ) {
202202
contg_groups[p].procs_per_contg_group = group_size+1;
203-
total_procs +=(group_size+1);
204203
}
205204
else {
206205
contg_groups[p].procs_per_contg_group = group_size;
207-
total_procs +=group_size;
208206
}
209207

210208
if ( flag ) {
@@ -1269,9 +1267,6 @@ int mca_common_ompio_prepare_to_group(ompio_file_t *fh,
12691267
int i = 0;
12701268
int j = 0;
12711269
int k = 0;
1272-
int merge_count = 0;
1273-
int split_count = 0; //not req?
1274-
int retain_as_is_count = 0; //not req?
12751270
int ret=OMPI_SUCCESS;
12761271

12771272
//Store start offset and length in an array //also add bytes per process
@@ -1367,16 +1362,13 @@ int mca_common_ompio_prepare_to_group(ompio_file_t *fh,
13671362
if((size_t)(aggr_bytes_per_group_tmp[i])>
13681363
(size_t)OMPIO_MCA_GET(fh, bytes_per_agg)){
13691364
decision_list_tmp[i] = OMPIO_SPLIT;
1370-
split_count++;
13711365
}
13721366
else if((size_t)(aggr_bytes_per_group_tmp[i])<
13731367
(size_t)OMPIO_MCA_GET(fh, bytes_per_agg)){
13741368
decision_list_tmp[i] = OMPIO_MERGE;
1375-
merge_count++;
13761369
}
13771370
else{
13781371
decision_list_tmp[i] = OMPIO_RETAIN;
1379-
retain_as_is_count++;
13801372
}
13811373
}
13821374

0 commit comments

Comments
 (0)