Skip to content
Snippets Groups Projects
Commit e97c4e7b authored by Jeff Squyres's avatar Jeff Squyres
Browse files

treematch: fix several compiler warnings


Fix compiler warnings about having "shadow" variable declarations.

Signed-off-by: default avatarJeff Squyres <jsquyres@cisco.com>
parent 02b20108
Branches
No related tags found
No related merge requests found
......@@ -101,13 +101,13 @@ typedef struct FiboTree_ {
the algorithms have been de-recursived
and written as macros. */
#define fiboTreeLinkAfter(o,n) do { \
FiboNode * nextptr; \
nextptr = (o)->linkdat.nextptr; \
(n)->linkdat.nextptr = nextptr; \
(n)->linkdat.prevptr = (o); \
nextptr->linkdat.prevptr = (n); \
(o)->linkdat.nextptr = (n); \
#define fiboTreeLinkAfter(o,n) do { \
FiboNode * nextptr_loc; \
nextptr_loc = (o)->linkdat.nextptr; \
(n)->linkdat.nextptr = nextptr_loc; \
(n)->linkdat.prevptr = (o); \
nextptr_loc->linkdat.prevptr = (n); \
(o)->linkdat.nextptr = (n); \
} while (0)
#define fiboTreeUnlink(n) do { \
......
......@@ -575,7 +575,7 @@ int tm_topology_add_binding_constraints(char *constraints_filename, tm_topology
}
void topology_numbering_cpy(tm_topology_t *topology,int **numbering,int *nb_nodes)
void topology_numbering_cpy(tm_topology_t *topology,int **numbering_loc,int *nb_nodes)
{
int nb_levels;
unsigned int vl = tm_get_verbose_level();
......@@ -584,8 +584,8 @@ void topology_numbering_cpy(tm_topology_t *topology,int **numbering,int *nb_node
*nb_nodes = topology->nb_nodes[nb_levels-1];
if(vl >= INFO)
printf("nb_nodes=%d\n",*nb_nodes);
*numbering = (int*)MALLOC(sizeof(int)*(*nb_nodes));
memcpy(*numbering,topology->node_id,sizeof(int)*(*nb_nodes));
*numbering_loc = (int*)MALLOC(sizeof(int)*(*nb_nodes));
memcpy(*numbering_loc,topology->node_id,sizeof(int)*(*nb_nodes));
}
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)
void tm_optimize_topology(tm_topology_t **topology){
int *arity = NULL,nb_levels;
int *numbering = NULL,nb_nodes;
int *numbering_loc = NULL,nb_nodes;
tm_topology_t *new_topo;
double *cost;
unsigned int vl = tm_get_verbose_level();
......@@ -710,13 +710,13 @@ void tm_optimize_topology(tm_topology_t **topology){
tm_display_arity(*topology);
topology_arity_cpy(*topology,&arity,&nb_levels);
topology_numbering_cpy(*topology,&numbering,&nb_nodes);
topology_numbering_cpy(*topology,&numbering_loc,&nb_nodes);
topology_constraints_cpy(*topology,&constraints,&nb_constraints);
topology_cost_cpy(*topology,&cost);
optimize_arity(&arity,&cost,&nb_levels,nb_levels-2);
new_topo = tm_build_synthetic_topology(arity, NULL, nb_levels,numbering,nb_nodes);
new_topo = tm_build_synthetic_topology(arity, NULL, nb_levels,numbering_loc,nb_nodes);
new_topo->cost = cost;
new_topo->constraints = constraints;
new_topo->nb_constraints = nb_constraints;
......@@ -736,7 +736,7 @@ void tm_optimize_topology(tm_topology_t **topology){
tm_display_arity(new_topo);
}
FREE(arity);
FREE(numbering);
FREE(numbering_loc);
tm_free_topology(*topology);
*topology = new_topo;
......
......@@ -1793,7 +1793,7 @@ void group_nodes(tm_affinity_mat_t *aff_mat, tm_tree_t *tab_node, tm_tree_t *new
/* if(nb_groups>30000||depth>5){*/
if( nbg > 30000 ){
double duration;
double duration_loc;
TIC;
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
val = k_partition_grouping(cost_mat, tab_node, new_tab_node, arity, solution_size);
}
duration = TOC;
duration_loc = TOC;
if(verbose_level >= INFO)
printf("Fast grouping duration=%f\n", duration);
printf("Fast grouping duration=%f\n", duration_loc);
if(verbose_level >= INFO)
display_grouping(new_tab_node, solution_size, arity, val);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment