Skip to content

Commit e4db9e5

Browse files
committed
Fix all warnings.
Signed-off-by: George Bosilca <[email protected]>
1 parent c2927d7 commit e4db9e5

File tree

12 files changed

+56
-96
lines changed

12 files changed

+56
-96
lines changed

ompi/mca/topo/treematch/topo_treematch.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ int mca_topo_treematch_dist_graph_create(mca_topo_base_module_t* module,
7070
int n, const int nodes[],
7171
const int degrees[], const int targets[],
7272
const int weights[],
73-
struct ompi_info_t *info, int reorder,
73+
struct opal_info_t *info, int reorder,
7474
ompi_communicator_t **newcomm);
7575
/*
7676
* ******************************************************************

ompi/mca/topo/treematch/topo_treematch_dist_graph_create.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ int mca_topo_treematch_dist_graph_create(mca_topo_base_module_t* topo_module,
114114
int n, const int nodes[],
115115
const int degrees[], const int targets[],
116116
const int weights[],
117-
struct ompi_info_t *info, int reorder,
117+
struct opal_info_t *info, int reorder,
118118
ompi_communicator_t **newcomm)
119119
{
120120
int err;
@@ -613,7 +613,7 @@ int mca_topo_treematch_dist_graph_create(mca_topo_base_module_t* topo_module,
613613
if (obj_mapping[i] != -1)
614614
tm_topology->nb_constraints++;
615615
tm_topology->constraints = (int *)calloc(tm_topology->nb_constraints,sizeof(int));
616-
for(idx = 0,i = 0; i < tm_topology->nb_proc_units ; i++)
616+
for(idx = 0, i = 0; i < tm_topology->nb_proc_units ; i++)
617617
if (obj_mapping[i] != -1)
618618
tm_topology->constraints[idx++] = obj_mapping[i];
619619

ompi/mca/topo/treematch/treematch/PriorityQueue.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,7 @@
44
/*
55
This comparison function is used to sort elements in key descending order.
66
*/
7-
int compfunc(const FiboNode * const, const FiboNode * const);
8-
9-
10-
11-
int compFunc(const FiboNode * const node1, const FiboNode * const node2)
7+
static int compFunc(const FiboNode * const node1, const FiboNode * const node2)
128
{
139
return
1410
( ( ((QueueElement*)(node1))->key > ((QueueElement*)(node2))->key ) ? -1 : 1);

ompi/mca/topo/treematch/treematch/tm_bucket.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ static int ilog2(int val)
3131

3232
static int verbose_level = ERROR;
3333

34-
bucket_list_t global_bl;
34+
static bucket_list_t global_bl;
3535

3636
int tab_cmp(const void*,const void*);
3737
int old_bucket_id(int,int,bucket_list_t);
@@ -199,7 +199,7 @@ void add_to_bucket(int id,int i,int j,bucket_list_t bucket_list)
199199
/* display_bucket(bucket);*/
200200
if(verbose_level >= DEBUG){
201201
printf("Extending bucket %d (%p) from size %d to size %d!\n",
202-
id,bucket->bucket, bucket->nb_elem, bucket->nb_elem+size);
202+
id, (void*)bucket->bucket, bucket->nb_elem, bucket->nb_elem+size);
203203
}
204204

205205
bucket->bucket = (coord*)REALLOC(bucket->bucket,sizeof(coord)*(size + bucket->bucket_len));
@@ -525,7 +525,7 @@ void partial_update_val (int nb_args, void **args, int thread_id){
525525

526526
if(nb_args != 5){
527527
if(verbose_level >= ERROR)
528-
fprintf(stderr,"(Thread: %d) Wrong number of args in %s: %d\n",thread_id, __FUNCTION__, nb_args);
528+
fprintf(stderr,"(Thread: %d) Wrong number of args in %s: %d\n",thread_id, __func__, nb_args);
529529
exit(-1);
530530
}
531531

ompi/mca/topo/treematch/treematch/tm_kpartitioning.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ com_mat_t **split_com_mat(com_mat_t *com_mat, int n, int k, int *partition)
294294
printf("Partition: "); print_1D_tab(partition,n);
295295
display_tab(com_mat->comm,com_mat->n);
296296
printf("m=%d,n=%d,k=%d\n",m,n,k);
297-
printf("perm=%p\n",perm);
297+
printf("perm=%p\n", (void*)perm);
298298
}
299299

300300
perm = (int*)MALLOC(sizeof(int)*m);
@@ -425,8 +425,8 @@ void free_const_tab(constraint_t *const_tab, int k)
425425
FREE(const_tab);
426426
}
427427

428-
429-
void check_com_mat(com_mat_t *com_mat){
428+
#if 0
429+
static void check_com_mat(com_mat_t *com_mat){
430430
int i,j;
431431

432432
for( i = 0 ; i < com_mat->n ; i++ )
@@ -435,9 +435,8 @@ void check_com_mat(com_mat_t *com_mat){
435435
printf("com_mat->comm[%d][%d]= %f\n",i,j,com_mat->comm[i][j]);
436436
exit(-1);
437437
}
438-
439-
440438
}
439+
#endif
441440

442441
void kpartition_build_level_topology(tm_tree_t *cur_node, com_mat_t *com_mat, int N, int depth,
443442
tm_topology_t *topology, int *local_vertices,

ompi/mca/topo/treematch/treematch/tm_malloc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ static void init_extra_data(void);
3636

3737

3838

39-
char *my_strdup(char* string){
39+
static char *my_strdup(char* string){
4040
int size = 1+strlen(string);
4141
char *res = (char*)malloc(size*sizeof(char));
4242

ompi/mca/topo/treematch/treematch/tm_mapping.c

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -34,25 +34,6 @@ typedef struct {
3434
} hash2_t;
3535

3636

37-
tm_affinity_mat_t * new_affinity_mat(double **mat, double *sum_row, int order);
38-
int compute_nb_leaves_from_level(int depth,tm_topology_t *topology);
39-
void depth_first(tm_tree_t *comm_tree, int *proc_list,int *i);
40-
int fill_tab(int **new_tab,int *tab, int n, int start, int max_val, int shift);
41-
void init_mat(char *filename,int N, double **mat, double *sum_row);
42-
void map_topology(tm_topology_t *topology,tm_tree_t *comm_tree, int level,
43-
int *sigma, int nb_processes, int **k, int nb_compute_units);
44-
int nb_leaves(tm_tree_t *comm_tree);
45-
int nb_lines(char *filename);
46-
int nb_processing_units(tm_topology_t *topology);
47-
void print_1D_tab(int *tab,int N);
48-
tm_solution_t * tm_compute_mapping(tm_topology_t *topology,tm_tree_t *comm_tree);
49-
void tm_finalize();
50-
void tm_free_affinity_mat(tm_affinity_mat_t *aff_mat);
51-
tm_affinity_mat_t *tm_load_aff_mat(char *filename);
52-
void update_comm_speed(double **comm_speed,int old_size,int new_size);
53-
tm_affinity_mat_t * tm_build_affinity_mat(double **mat, int order);
54-
55-
5637
/* compute the number of leaves of any subtree starting froma node of depth depth*/
5738
int compute_nb_leaves_from_level(int depth,tm_topology_t *topology)
5839
{
@@ -280,7 +261,7 @@ int nb_leaves(tm_tree_t *comm_tree)
280261
}
281262

282263
/* find the first '-1 in the array of size n and put the value there*/
283-
void set_val(int *tab, int val, int n){
264+
static void set_val(int *tab, int val, int n){
284265
int i = 0;
285266

286267
while (i < n ){

ompi/mca/topo/treematch/treematch/tm_mapping.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ int nb_lines(char *filename);
1919
int nb_processing_units(tm_topology_t *topology);
2020
void print_1D_tab(int *tab,int N);
2121
tm_solution_t * tm_compute_mapping(tm_topology_t *topology,tm_tree_t *comm_tree);
22-
void tm_finalize();
2322
void tm_free_affinity_mat(tm_affinity_mat_t *aff_mat);
2423
tm_affinity_mat_t *tm_load_aff_mat(char *filename);
2524
void update_comm_speed(double **comm_speed,int old_size,int new_size);

ompi/mca/topo/treematch/treematch/tm_solution.c

Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -10,27 +10,6 @@ typedef struct {
1010
} hash_t;
1111

1212

13-
14-
void tm_free_solution(tm_solution_t *sol);
15-
int distance(tm_topology_t *topology,int i, int j);
16-
double display_sol_sum_com(tm_topology_t *topology, tm_affinity_mat_t *aff_mat, int *sigma);
17-
double display_sol(tm_topology_t *topology, tm_affinity_mat_t *aff_mat, int *sigma, tm_metric_t metric);
18-
double tm_display_solution(tm_topology_t *topology, tm_affinity_mat_t *aff_mat, tm_solution_t *sol,
19-
tm_metric_t metric);
20-
void tm_display_other_heuristics(tm_topology_t *topology, tm_affinity_mat_t *aff_mat, tm_metric_t metric);
21-
int in_tab(int *tab, int n, int val);
22-
void map_Packed(tm_topology_t *topology, int N, int *sigma);
23-
void map_RR(tm_topology_t * topology, int N, int *sigma);
24-
int hash_asc(const void* x1,const void* x2);
25-
int *generate_random_sol(tm_topology_t *topology,int N,int level,int seed);
26-
double eval_sol(int *sol,int N,double **comm, double **arch);
27-
void exchange(int *sol,int i,int j);
28-
double gain_exchange(int *sol,int l,int m,double eval1,int N,double **comm, double **arch);
29-
void select_max(int *l,int *m,double **gain,int N,int *state);
30-
void compute_gain(int *sol,int N,double **gain,double **comm, double **arch);
31-
void map_MPIPP(tm_topology_t *topology,int nb_seed,int N,int *sigma,double **comm, double **arch);
32-
33-
3413
void tm_free_solution(tm_solution_t *sol){
3514
int i,n;
3615

@@ -120,7 +99,7 @@ double display_sol_sum_com(tm_topology_t *topology, tm_affinity_mat_t *aff_mat,
12099
}
121100

122101

123-
double display_sol_max_com(tm_topology_t *topology, tm_affinity_mat_t *aff_mat, int *sigma)
102+
static double display_sol_max_com(tm_topology_t *topology, tm_affinity_mat_t *aff_mat, int *sigma)
124103
{
125104
double a,c,sol;
126105
int i,j;
@@ -156,7 +135,7 @@ double display_sol_max_com(tm_topology_t *topology, tm_affinity_mat_t *aff_mat,
156135
return sol;
157136
}
158137

159-
double display_sol_hop_byte(tm_topology_t *topology, tm_affinity_mat_t *aff_mat, int *sigma)
138+
static double display_sol_hop_byte(tm_topology_t *topology, tm_affinity_mat_t *aff_mat, int *sigma)
160139
{
161140
double c,sol;
162141
int nb_hops;

ompi/mca/topo/treematch/treematch/tm_topology.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ int topo_nb_proc(hwloc_topology_t topology,int N)
115115

116116

117117

118-
double link_cost(int depth)
118+
static double link_cost(int depth)
119119
{
120120
/*
121121
Bertha values
@@ -427,7 +427,7 @@ int int_cmp_inc(const void* x1,const void* x2)
427427
}
428428

429429

430-
int topo_check_constraints(tm_topology_t *topology){
430+
static int topo_check_constraints(tm_topology_t *topology){
431431
int n = topology->nb_constraints;
432432
int i;
433433
int depth = topology->nb_levels-1;
@@ -447,7 +447,7 @@ int topo_check_constraints(tm_topology_t *topology){
447447

448448
/* cpy flag tells if we need to copy the array.
449449
Set to 1 when called from the application level and 0 when called from inside the library*/
450-
int tm_topology_set_binding_constraints_cpy(int *constraints, int nb_constraints, tm_topology_t *topology, int cpy_flag){
450+
static int tm_topology_set_binding_constraints_cpy(int *constraints, int nb_constraints, tm_topology_t *topology, int cpy_flag){
451451

452452
topology -> nb_constraints = nb_constraints;
453453
if(cpy_flag){

0 commit comments

Comments
 (0)