Skip to content

Commit 976aef1

Browse files
authored
Merge pull request #8882 from jsquyres/pr/fix-warnings
Fix a bunch of compiler warnings
2 parents aff9498 + d301e68 commit 976aef1

File tree

12 files changed

+54
-54
lines changed

12 files changed

+54
-54
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/include/mpi.h.in

Lines changed: 3 additions & 3 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-2020 Cisco Systems, Inc. All rights reserved
12+
* Copyright (c) 2007-2021 Cisco Systems, Inc. All rights reserved
1313
* Copyright (c) 2008-2009 Sun Microsystems, Inc. All rights reserved.
1414
* Copyright (c) 2009-2012 Oak Rigde National Laboratory. All rights reserved.
1515
* Copyright (c) 2011-2020 Sandia National Laboratories. All rights reserved.
@@ -1705,7 +1705,7 @@ OMPI_DECLSPEC int MPI_Pready(int partitions, MPI_Request request);
17051705
OMPI_DECLSPEC int MPI_Pready_range(int partition_low, int partition_high,
17061706
MPI_Request request);
17071707
OMPI_DECLSPEC int MPI_Pready_list(int length, int partition_list[], MPI_Request request);
1708-
OMPI_DECLSPEC int MPI_Precv_init(const void* buf, int partitions, MPI_Count count,
1708+
OMPI_DECLSPEC int MPI_Precv_init(void* buf, int partitions, MPI_Count count,
17091709
MPI_Datatype datatype, int source, int tag, MPI_Comm comm,
17101710
MPI_Request *request);
17111711
OMPI_DECLSPEC int MPI_Probe(int source, int tag, MPI_Comm comm, MPI_Status *status);
@@ -2321,7 +2321,7 @@ OMPI_DECLSPEC int PMPI_Isend(const void *buf, int count, MPI_Datatype datatype,
23212321
int tag, MPI_Comm comm, MPI_Request *request);
23222322
OMPI_DECLSPEC int PMPI_Issend(const void *buf, int count, MPI_Datatype datatype, int dest,
23232323
int tag, MPI_Comm comm, MPI_Request *request);
2324-
OMPI_DECLSPEC int PMPI_Precv_init(const void* buf, int partitions, MPI_Count count,
2324+
OMPI_DECLSPEC int PMPI_Precv_init(void* buf, int partitions, MPI_Count count,
23252325
MPI_Datatype datatype, int source, int tag, MPI_Comm comm,
23262326
MPI_Request *request);
23272327
OMPI_DECLSPEC int PMPI_Psend_init(const void* buf, int partitions, MPI_Count count,

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/part/persist/part_persist.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
* Copyright (c) 2019-2021 Sandia National Laboratories. All rights reserved.
1313
* Copyright (c) 2021 University of Alabama at Birmingham. All rights reserved.
1414
* Copyright (c) 2021 Tennessee Technological University. All rights reserved.
15+
* Copyright (c) 2021 Cisco Systems, Inc. All rights reserved
1516
* $COPYRIGHT$
1617
*
1718
* Additional copyrights may follow
@@ -313,8 +314,10 @@ mca_part_persist_progress(void)
313314
OPAL_THREAD_UNLOCK(&ompi_part_persist.lock);
314315
block_entry = opal_atomic_add_fetch_32(&(ompi_part_persist.block_entry), -1);
315316
if(to_delete) {
316-
int err = mca_part_persist_free_req(to_delete);
317-
if(OMPI_SUCCESS != err) return OMPI_ERROR;
317+
err = mca_part_persist_free_req(to_delete);
318+
if (OMPI_SUCCESS != err) {
319+
return OMPI_ERROR;
320+
}
318321
}
319322

320323
return OMPI_SUCCESS;

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; \

ompi/mpi/c/precv_init.c

Lines changed: 2 additions & 2 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) 2006 Cisco Systems, Inc. All rights reserved.
13+
* Copyright (c) 2006-2021 Cisco Systems, Inc. All rights reserved.
1414
* Copyright (c) 2013-2015 Los Alamos National Security, LLC. All rights
1515
* reserved.
1616
* Copyright (c) 2015 Research Organization for Information Science
@@ -43,7 +43,7 @@
4343
static const char FUNC_NAME[] = "MPI_Precv_init";
4444

4545

46-
int MPI_Precv_init(const void* buf, int partitions, MPI_Count count, MPI_Datatype datatype, int source, int tag, MPI_Comm comm, MPI_Request *request)
46+
int MPI_Precv_init(void* buf, int partitions, MPI_Count count, MPI_Datatype datatype, int source, int tag, MPI_Comm comm, MPI_Request *request)
4747
{
4848
int rc;
4949

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;

0 commit comments

Comments
 (0)