Skip to content

Commit 609bea8

Browse files
authored
Merge pull request #8894 from jsquyres/pr/v5.0.x/fix-a-bunch-of-warnings
v5.0.x: fix a bunch of warnings
2 parents 2d5bea3 + 19a7148 commit 609bea8

File tree

9 files changed

+44
-47
lines changed

9 files changed

+44
-47
lines changed

3rd-party/treematch/fibo.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -101,13 +101,13 @@ typedef struct FiboTree_ {
101101
the algorithms have been de-recursived
102102
and written as macros. */
103103

104-
#define fiboTreeLinkAfter(o,n) do { \
105-
FiboNode * nextptr; \
106-
nextptr = (o)->linkdat.nextptr; \
107-
(n)->linkdat.nextptr = nextptr; \
108-
(n)->linkdat.prevptr = (o); \
109-
nextptr->linkdat.prevptr = (n); \
110-
(o)->linkdat.nextptr = (n); \
104+
#define fiboTreeLinkAfter(o,n) do { \
105+
FiboNode * nextptr_loc; \
106+
nextptr_loc = (o)->linkdat.nextptr; \
107+
(n)->linkdat.nextptr = nextptr_loc; \
108+
(n)->linkdat.prevptr = (o); \
109+
nextptr_loc->linkdat.prevptr = (n); \
110+
(o)->linkdat.nextptr = (n); \
111111
} while (0)
112112

113113
#define fiboTreeUnlink(n) do { \

3rd-party/treematch/tm_topology.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -575,7 +575,7 @@ int tm_topology_add_binding_constraints(char *constraints_filename, tm_topology
575575
}
576576

577577

578-
void topology_numbering_cpy(tm_topology_t *topology,int **numbering,int *nb_nodes)
578+
void topology_numbering_cpy(tm_topology_t *topology,int **numbering_loc,int *nb_nodes)
579579
{
580580
int nb_levels;
581581
unsigned int vl = tm_get_verbose_level();
@@ -584,8 +584,8 @@ void topology_numbering_cpy(tm_topology_t *topology,int **numbering,int *nb_node
584584
*nb_nodes = topology->nb_nodes[nb_levels-1];
585585
if(vl >= INFO)
586586
printf("nb_nodes=%d\n",*nb_nodes);
587-
*numbering = (int*)MALLOC(sizeof(int)*(*nb_nodes));
588-
memcpy(*numbering,topology->node_id,sizeof(int)*(*nb_nodes));
587+
*numbering_loc = (int*)MALLOC(sizeof(int)*(*nb_nodes));
588+
memcpy(*numbering_loc,topology->node_id,sizeof(int)*(*nb_nodes));
589589
}
590590

591591
void topology_arity_cpy(tm_topology_t *topology,int **arity,int *nb_levels)
@@ -699,7 +699,7 @@ void optimize_arity(int **arity, double **cost, int *nb_levels,int n)
699699

700700
void tm_optimize_topology(tm_topology_t **topology){
701701
int *arity = NULL,nb_levels;
702-
int *numbering = NULL,nb_nodes;
702+
int *numbering_loc = NULL,nb_nodes;
703703
tm_topology_t *new_topo;
704704
double *cost;
705705
unsigned int vl = tm_get_verbose_level();
@@ -710,13 +710,13 @@ void tm_optimize_topology(tm_topology_t **topology){
710710
tm_display_arity(*topology);
711711

712712
topology_arity_cpy(*topology,&arity,&nb_levels);
713-
topology_numbering_cpy(*topology,&numbering,&nb_nodes);
713+
topology_numbering_cpy(*topology,&numbering_loc,&nb_nodes);
714714
topology_constraints_cpy(*topology,&constraints,&nb_constraints);
715715
topology_cost_cpy(*topology,&cost);
716716

717717

718718
optimize_arity(&arity,&cost,&nb_levels,nb_levels-2);
719-
new_topo = tm_build_synthetic_topology(arity, NULL, nb_levels,numbering,nb_nodes);
719+
new_topo = tm_build_synthetic_topology(arity, NULL, nb_levels,numbering_loc,nb_nodes);
720720
new_topo->cost = cost;
721721
new_topo->constraints = constraints;
722722
new_topo->nb_constraints = nb_constraints;
@@ -736,7 +736,7 @@ void tm_optimize_topology(tm_topology_t **topology){
736736
tm_display_arity(new_topo);
737737
}
738738
FREE(arity);
739-
FREE(numbering);
739+
FREE(numbering_loc);
740740
tm_free_topology(*topology);
741741

742742
*topology = new_topo;

3rd-party/treematch/tm_tree.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1793,7 +1793,7 @@ void group_nodes(tm_affinity_mat_t *aff_mat, tm_tree_t *tab_node, tm_tree_t *new
17931793
/* if(nb_groups>30000||depth>5){*/
17941794
if( nbg > 30000 ){
17951795

1796-
double duration;
1796+
double duration_loc;
17971797

17981798
TIC;
17991799
if( arity <= 2 ){
@@ -1811,9 +1811,9 @@ void group_nodes(tm_affinity_mat_t *aff_mat, tm_tree_t *tab_node, tm_tree_t *new
18111811
val = k_partition_grouping(cost_mat, tab_node, new_tab_node, arity, solution_size);
18121812
}
18131813

1814-
duration = TOC;
1814+
duration_loc = TOC;
18151815
if(verbose_level >= INFO)
1816-
printf("Fast grouping duration=%f\n", duration);
1816+
printf("Fast grouping duration=%f\n", duration_loc);
18171817

18181818
if(verbose_level >= INFO)
18191819
display_grouping(new_tab_node, solution_size, arity, val);

ompi/mca/coll/ftagree/coll_ftagree_earlyreturning.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3332,6 +3332,11 @@ int mca_coll_ftagree_iera_intra(void *contrib,
33323332
return OMPI_SUCCESS;
33333333
}
33343334

3335+
#if 0
3336+
// Per @bosilca and @jsquyres discussion 29 Apr 2021: there is
3337+
// probably a memory leak in MPI_FINALIZE right now, because this
3338+
// function does not appear to be being called from anywhere.
3339+
// @bosilca's team is looking into it.
33353340
int mca_coll_ftagree_era_free_comm(ompi_communicator_t* comm,
33363341
mca_coll_base_module_t *module)
33373342
{
@@ -3369,3 +3374,4 @@ int mca_coll_ftagree_era_free_comm(ompi_communicator_t* comm,
33693374

33703375
return OMPI_SUCCESS;
33713376
}
3377+
#endif

ompi/mca/coll/han/coll_han_module.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* of Tennessee Research Foundation. All rights
44
* reserved.
55
* Copyright (c) 2020 Bull S.A.S. All rights reserved.
6+
* Copyright (c) 2021 Cisco Systems, Inc. All rights reserved
67
* $COPYRIGHT$
78
*
89
* Additional copyrights may follow
@@ -222,8 +223,6 @@ mca_coll_han_comm_query(struct ompi_communicator_t * comm, int *priority)
222223
han_module->topologic_level = GLOBAL_COMMUNICATOR;
223224

224225
if (NULL != comm->super.s_info) {
225-
char info_val[OPAL_MAX_INFO_VAL+1];
226-
227226
/* Get the info value disaqualifying coll components */
228227
opal_cstring_t *info_str;
229228
opal_info_get(comm->super.s_info, "ompi_comm_coll_han_topo_level",

ompi/mca/vprotocol/pessimist/vprotocol_pessimist_wait.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/*
22
* Copyright (c) 2004-2007 The Trustees of the University of Tennessee.
33
* All rights reserved.
4+
* Copyright (c) 2021 Cisco Systems, Inc. All rights reserved
45
* $COPYRIGHT$
56
*
67
* Additional copyrights may follow
@@ -19,7 +20,7 @@ static int vprotocol_pessimist_request_no_free(ompi_request_t **req) {
1920
}
2021

2122
#define PREPARE_REQUESTS_WITH_NO_FREE(count, requests) do { \
22-
for(int i = 0; i < count; i++) \
23+
for (typeof(count) i = 0; i < count; i++) \
2324
{ \
2425
if(requests[i] == MPI_REQUEST_NULL) continue; \
2526
requests[i]->req_free = vprotocol_pessimist_request_no_free; \

opal/mca/base/mca_base_var.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* University of Stuttgart. All rights reserved.
1111
* Copyright (c) 2004-2005 The Regents of the University of California.
1212
* All rights reserved.
13-
* Copyright (c) 2008-2018 Cisco Systems, Inc. All rights reserved
13+
* Copyright (c) 2008-2021 Cisco Systems, Inc. All rights reserved
1414
* Copyright (c) 2012-2018 Los Alamos National Security, LLC. All rights
1515
* reserved.
1616
* Copyright (c) 2014-2020 Intel, Inc. All rights reserved.
@@ -1543,12 +1543,12 @@ int mca_base_var_register(const char *project_name, const char *framework_name,
15431543
}
15441544

15451545
OPAL_LIST_FOREACH_DECL(alias_item, &alias->component_aliases, mca_base_alias_item_t) {
1546-
mca_base_var_syn_flag_t flags_tmp = 0;
1546+
mca_base_var_syn_flag_t flags_derived = flags;
15471547
if (alias_item->alias_flags & MCA_BASE_ALIAS_FLAG_DEPRECATED) {
1548-
flags_tmp = MCA_BASE_VAR_SYN_FLAG_DEPRECATED;
1548+
flags_derived = MCA_BASE_VAR_SYN_FLAG_DEPRECATED;
15491549
}
15501550
(void) mca_base_var_register_synonym(ret, project_name, framework_name,
1551-
alias_item->component_alias, variable_name, flags);
1551+
alias_item->component_alias, variable_name, flags_derived);
15521552
}
15531553

15541554
return ret;

opal/mca/btl/base/btl_base_am_rdma.c

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* Copyright (c) 2011-2018 Los Alamos National Security, LLC. All rights
44
* reserved.
55
* Copyright (c) 2020-2021 Google, LLC. All rights reserved.
6+
* Copyright (c) 2021 Cisco Systems, Inc. All rights reserved
67
* $COPYRIGHT$
78
*
89
* Additional copyrights may follow
@@ -480,7 +481,7 @@ mca_btl_base_rdma_start(mca_btl_base_module_t *btl, struct mca_btl_base_endpoint
480481

481482
BTL_VERBOSE(("Initiating RDMA operation. context=%p, size=%" PRIsize_t
482483
", packet_size=%" PRIsize_t,
483-
context, size, packet_size));
484+
(void*) context, size, packet_size));
484485

485486
descriptor = btl->btl_alloc(btl, endpoint, order, packet_size,
486487
MCA_BTL_DES_SEND_ALWAYS_CALLBACK | MCA_BTL_DES_FLAGS_SIGNAL);
@@ -609,7 +610,7 @@ static int mca_btl_base_am_rdma_respond(mca_btl_base_module_t *btl,
609610
}
610611
}
611612

612-
BTL_VERBOSE(("sending descriptor %p", send_descriptor));
613+
BTL_VERBOSE(("sending descriptor %p", (void*) send_descriptor));
613614

614615
send_descriptor->des_cbfunc = NULL;
615616

@@ -638,7 +639,7 @@ mca_btl_base_am_rmda_rdma_complete(mca_btl_base_module_t *btl,
638639
if (OPAL_UNLIKELY(OPAL_SUCCESS != ret)) {
639640
BTL_VERBOSE(
640641
("could not send a response. queueing the response for later. endpoint=%p, ret=%d",
641-
endpoint, ret));
642+
(void*) endpoint, ret));
642643
mca_btl_base_rdma_queue_operation(btl, NULL, NULL, 0, NULL, operation);
643644
}
644645

@@ -873,7 +874,7 @@ static void mca_btl_base_am_rdma_response(mca_btl_base_module_t *btl,
873874
mca_btl_base_rdma_context_t *context = (mca_btl_base_rdma_context_t *) (uintptr_t)
874875
resp_hdr->context;
875876

876-
BTL_VERBOSE(("received response for RDMA operation. context=%p, size=%" PRIu64, context,
877+
BTL_VERBOSE(("received response for RDMA operation. context=%p, size=%" PRIu64, (void*) context,
877878
resp_hdr->response_size));
878879

879880
if (MCA_BTL_BASE_AM_PUT != context->type) {
@@ -890,7 +891,7 @@ static void mca_btl_base_am_rdma_response(mca_btl_base_module_t *btl,
890891
}
891892

892893
if (context->total_size
893-
== opal_atomic_add_fetch_64(&context->acknowledged, resp_hdr->response_size)) {
894+
== (uint64_t) opal_atomic_add_fetch_64(&context->acknowledged, resp_hdr->response_size)) {
894895
context->cbfunc(btl, desc->endpoint, context->local_address, context->local_handle,
895896
context->cbcontext, context->cbdata, OPAL_SUCCESS);
896897
OBJ_RELEASE(context);
@@ -1001,7 +1002,7 @@ static void mca_btl_base_am_process_atomic(mca_btl_base_module_t *btl,
10011002
}
10021003
}
10031004

1004-
void mca_btl_sm_sc_emu_init(void)
1005+
static void mca_btl_sm_sc_emu_init(void)
10051006
{
10061007
mca_btl_base_active_message_trigger[MCA_BTL_BASE_TAG_RDMA].cbfunc
10071008
= mca_btl_base_am_process_rdma;
@@ -1093,19 +1094,19 @@ int mca_btl_base_am_rdma_init(mca_btl_base_module_t *btl)
10931094
btl->btl_put_limit = max_operation_size - sizeof(mca_btl_base_rdma_hdr_t);
10941095
btl->btl_put_alignment = operation_alignment;
10951096
btl->btl_put = mca_btl_base_am_rdma_put;
1096-
BTL_VERBOSE(("Enabling AM-based RDMA put for BTL %p. max put = %zu", btl, btl->btl_put_limit));
1097+
BTL_VERBOSE(("Enabling AM-based RDMA put for BTL %p. max put = %zu", (void*) btl, btl->btl_put_limit));
10971098
}
10981099

10991100
if (!(btl->btl_flags & MCA_BTL_FLAGS_GET)) {
11001101
btl->btl_flags |= MCA_BTL_FLAGS_GET_AM;
11011102
btl->btl_get_limit = max_operation_size - sizeof(mca_btl_base_rdma_response_hdr_t);
11021103
btl->btl_get_alignment = operation_alignment;
11031104
btl->btl_get = mca_btl_base_am_rdma_get;
1104-
BTL_VERBOSE(("Enabling AM-based RDMA get for BTL %p. max get = %zu", btl, btl->btl_get_limit));
1105+
BTL_VERBOSE(("Enabling AM-based RDMA get for BTL %p. max get = %zu", (void*) btl, btl->btl_get_limit));
11051106
}
11061107

11071108
if (!(btl->btl_flags & MCA_BTL_FLAGS_ATOMIC_FOPS)) {
1108-
BTL_VERBOSE(("Enabling AM-based FOPs get for BTL %p", btl));
1109+
BTL_VERBOSE(("Enabling AM-based FOPs get for BTL %p", (void*) btl));
11091110
btl->btl_flags |= MCA_BTL_FLAGS_ATOMIC_AM_FOP;
11101111

11111112
btl->btl_atomic_fop = mca_btl_base_am_fop;

opal/tools/wrappers/opal_wrapper.c

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* University of Stuttgart. All rights reserved.
1010
* Copyright (c) 2004-2005 The Regents of the University of California.
1111
* All rights reserved.
12-
* Copyright (c) 2007-2015 Cisco Systems, Inc. All rights reserved.
12+
* Copyright (c) 2007-2021 Cisco Systems, Inc. All rights reserved
1313
* Copyright (c) 2007-2013 Los Alamos National Security, LLC. All rights
1414
* reserved.
1515
* Copyright (c) 2010 Oracle and/or its affiliates. All rights reserved.
@@ -940,14 +940,9 @@ int main(int argc, char *argv[])
940940
if (flags & COMP_DRY_RUN) {
941941
exec_command = opal_argv_join(exec_argv, ' ');
942942
printf("%s\n", exec_command);
943+
free(exec_command);
943944
} else {
944945
char *tmp;
945-
946-
#if 0
947-
exec_command = opal_argv_join(exec_argv, ' ');
948-
printf("command: %s\n", exec_command);
949-
#endif
950-
951946
tmp = opal_path_findv(exec_argv[0], 0, environ, NULL);
952947
if (NULL == tmp) {
953948
opal_show_help("help-opal-wrapper.txt", "no-compiler-found", true, exec_argv[0], NULL);
@@ -964,17 +959,12 @@ int main(int argc, char *argv[])
964959
? WTERMSIG(status)
965960
: (WIFSTOPPED(status) ? WSTOPSIG(status) : 255));
966961
if ((OPAL_SUCCESS != ret) || ((0 != exit_status) && (flags & COMP_SHOW_ERROR))) {
967-
char* exec_cmd = opal_argv_join(exec_argv, ' ');
968962
if (OPAL_SUCCESS != ret) {
963+
exec_command = opal_argv_join(exec_argv, ' ');
969964
opal_show_help("help-opal-wrapper.txt", "spawn-failed", true, exec_argv[0],
970965
strerror(status), exec_command, NULL);
971-
} else {
972-
#if 0
973-
opal_show_help("help-opal-wrapper.txt", "compiler-failed", true,
974-
exec_argv[0], exit_status, exec_cmd, NULL);
975-
#endif
966+
free(exec_command);
976967
}
977-
free(exec_cmd);
978968
}
979969
}
980970
}

0 commit comments

Comments
 (0)