Skip to content

Commit 6a93897

Browse files
committed
symbol name pollution fix: making some things static
This is part of a symbol name pollution fix. In another commit I have a prefix being added to a lot of symbols. Since "static" was added by hand I have all the by-hand work done in this commit and the more automated changes where prefixes are added to other symbols is its own separate commit Signed-off-by: Mark Allen <[email protected]>
1 parent 47fb05f commit 6a93897

File tree

11 files changed

+224
-224
lines changed

11 files changed

+224
-224
lines changed

ompi/mca/fcoll/two_phase/fcoll_two_phase_file_write_all.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ static int is_aggregator(int rank,
120120
int *aggregator_list);
121121
#endif
122122

123-
void two_phase_heap_merge(mca_common_ompio_access_array_t *others_req,
123+
static void two_phase_heap_merge(mca_common_ompio_access_array_t *others_req,
124124
int *count,
125125
OMPI_MPI_OFFSET_TYPE *srt_off,
126126
int *srt_len,
@@ -1404,7 +1404,7 @@ static int two_phase_fill_send_buffer(ompio_file_t *fh,
14041404

14051405

14061406

1407-
void two_phase_heap_merge( mca_common_ompio_access_array_t *others_req,
1407+
static void two_phase_heap_merge( mca_common_ompio_access_array_t *others_req,
14081408
int *count,
14091409
OMPI_MPI_OFFSET_TYPE *srt_off,
14101410
int *srt_len,

ompi/mca/topo/treematch/treematch/k-partitioning.c

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,17 @@
44
#include "tm_mt.h"
55
#include "tm_verbose.h"
66

7-
void memory_allocation(PriorityQueue ** Q, PriorityQueue ** Qinst, double *** D, int n, int k);
8-
void initialization(int * const part, double ** const matrice, PriorityQueue * const Qpart, PriorityQueue * const Q, PriorityQueue * const Qinst, double ** const D, int n, int k, int * const deficit, int * const surplus);
9-
void algo(int * const part, double ** const matrice, PriorityQueue * const Qpart, PriorityQueue * const Q, PriorityQueue * const Qinst, double ** const D, int n, int * const deficit, int * const surplus);
10-
double nextGain(PriorityQueue * const Qpart, PriorityQueue * const Q, int * const deficit, int * const surplus);
11-
void balancing(int n, int deficit, int surplus, double ** const D, int * const part);
12-
void destruction(PriorityQueue * Qpart, PriorityQueue * Q, PriorityQueue * Qinst, double ** D, int n, int k);
13-
14-
void allocate_vertex2(int u, int *res, double **comm, int n, int *size, int max_size);
15-
double eval_cost2(int *,int,double **);
7+
static void memory_allocation(PriorityQueue ** Q, PriorityQueue ** Qinst, double *** D, int n, int k);
8+
static void initialization(int * const part, double ** const matrice, PriorityQueue * const Qpart, PriorityQueue * const Q, PriorityQueue * const Qinst, double ** const D, int n, int k, int * const deficit, int * const surplus);
9+
static void algo(int * const part, double ** const matrice, PriorityQueue * const Qpart, PriorityQueue * const Q, PriorityQueue * const Qinst, double ** const D, int n, int * const deficit, int * const surplus);
10+
static double nextGain(PriorityQueue * const Qpart, PriorityQueue * const Q, int * const deficit, int * const surplus);
11+
static void balancing(int n, int deficit, int surplus, double ** const D, int * const part);
12+
static void destruction(PriorityQueue * Qpart, PriorityQueue * Q, PriorityQueue * Qinst, double ** D, int n, int k);
13+
14+
static void allocate_vertex2(int u, int *res, double **comm, int n, int *size, int max_size);
15+
static double eval_cost2(int *,int,double **);
1616
int *kpartition_greedy2(int k, double **comm, int n, int nb_try_max, int *constraints, int nb_constraints);
17-
int* build_p_vector(double **comm, int n, int k, int greedy_trials, int * constraints, int nb_constraints);
17+
static int* build_p_vector(double **comm, int n, int k, int greedy_trials, int * constraints, int nb_constraints);
1818

1919
int* kPartitioning(double ** comm, int n, int k, int * constraints, int nb_constraints, int greedy_trials)
2020
{
@@ -48,7 +48,7 @@ int* kPartitioning(double ** comm, int n, int k, int * constraints, int nb_const
4848
return part;
4949
}
5050

51-
void memory_allocation(PriorityQueue ** Q, PriorityQueue ** Qinst, double *** D, int n, int k)
51+
static void memory_allocation(PriorityQueue ** Q, PriorityQueue ** Qinst, double *** D, int n, int k)
5252
{
5353
int i;
5454
*Q = calloc(k, sizeof(PriorityQueue)); /*one Q for each partition*/
@@ -58,7 +58,7 @@ void memory_allocation(PriorityQueue ** Q, PriorityQueue ** Qinst, double *** D,
5858
(*D)[i] = calloc(k, sizeof(double));
5959
}
6060

61-
void initialization(int * const part, double ** const matrice, PriorityQueue * const Qpart, PriorityQueue * const Q, PriorityQueue * const Qinst, double ** const D, int n, int k, int * const deficit, int * const surplus)
61+
static void initialization(int * const part, double ** const matrice, PriorityQueue * const Qpart, PriorityQueue * const Q, PriorityQueue * const Qinst, double ** const D, int n, int k, int * const deficit, int * const surplus)
6262
{
6363
int i,j;
6464

@@ -103,7 +103,7 @@ void initialization(int * const part, double ** const matrice, PriorityQueue * c
103103
*surplus = *deficit = 0;
104104
}
105105

106-
void algo(int * const part, double ** const matrice, PriorityQueue * const Qpart, PriorityQueue * const Q, PriorityQueue * const Qinst, double ** const D, int n, int * const deficit, int * const surplus)
106+
static void algo(int * const part, double ** const matrice, PriorityQueue * const Qpart, PriorityQueue * const Q, PriorityQueue * const Qinst, double ** const D, int n, int * const deficit, int * const surplus)
107107
{
108108
int p,u,v,j;
109109
double d;
@@ -149,7 +149,7 @@ void algo(int * const part, double ** const matrice, PriorityQueue * const Qpart
149149
PQ_adjustKey(Qpart, part[u], d); /*we update the new highest possible gain in u's subset*/
150150
}
151151

152-
double nextGain(PriorityQueue * const Qpart, PriorityQueue * const Q, int * const deficit, int * const surplus)
152+
static double nextGain(PriorityQueue * const Qpart, PriorityQueue * const Q, int * const deficit, int * const surplus)
153153
{
154154
double res;
155155
if(*deficit == *surplus) /*if the current partition is balanced*/
@@ -159,7 +159,7 @@ double nextGain(PriorityQueue * const Qpart, PriorityQueue * const Q, int * cons
159159
return res;
160160
}
161161

162-
void balancing(int n, int deficit, int surplus, double ** const D, int * const part)
162+
static void balancing(int n, int deficit, int surplus, double ** const D, int * const part)
163163
{
164164
if(surplus != deficit) /*if the current partition is not balanced*/
165165
{
@@ -176,7 +176,7 @@ void balancing(int n, int deficit, int surplus, double ** const D, int * const p
176176
}
177177
}
178178

179-
void destruction(PriorityQueue * Qpart, PriorityQueue * Q, PriorityQueue * Qinst, double ** D, int n, int k)
179+
static void destruction(PriorityQueue * Qpart, PriorityQueue * Q, PriorityQueue * Qinst, double ** D, int n, int k)
180180
{
181181
int i;
182182
PQ_exit(Qpart);
@@ -261,7 +261,7 @@ int *kpartition_greedy2(int k, double **comm, int n, int nb_try_max, int *const
261261
return best_res;
262262
}
263263

264-
void allocate_vertex2(int u, int *res, double **comm, int n, int *size, int max_size)
264+
static void allocate_vertex2(int u, int *res, double **comm, int n, int *size, int max_size)
265265
{
266266
int i,best_part = -1;
267267
double cost, best_cost = -1;
@@ -285,7 +285,7 @@ void allocate_vertex2(int u, int *res, double **comm, int n, int *size, int max_
285285
size[best_part]++;
286286
}
287287

288-
double eval_cost2(int *partition, int n, double **comm)
288+
static double eval_cost2(int *partition, int n, double **comm)
289289
{
290290
double cost = 0;
291291
int i,j;
@@ -298,7 +298,7 @@ double eval_cost2(int *partition, int n, double **comm)
298298
return cost;
299299
}
300300

301-
int* build_p_vector(double **comm, int n, int k, int greedy_trials, int * constraints, int nb_constraints)
301+
static int* build_p_vector(double **comm, int n, int k, int greedy_trials, int * constraints, int nb_constraints)
302302
{
303303
int * part = NULL;
304304
if(greedy_trials>0) /*if greedy_trials > 0 then we use kpartition_greedy with greedy_trials trials*/

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

Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -33,27 +33,27 @@ static int verbose_level = ERROR;
3333

3434
static bucket_list_t global_bl = {0};
3535

36-
int tab_cmp(const void*,const void*);
37-
int old_bucket_id(int,int,bucket_list_t);
38-
int bucket_id(int,int,bucket_list_t);
39-
void display_bucket(bucket_t *);
40-
void check_bucket(bucket_t *,double **,double, double);
41-
void display_pivots(bucket_list_t);
42-
void display_bucket_list(bucket_list_t);
43-
void add_to_bucket(int,int,int,bucket_list_t);
44-
void dfs(int,int,int,double *,double *,int,int);
45-
void built_pivot_tree(bucket_list_t);
46-
void fill_buckets(bucket_list_t);
47-
int is_power_of_2(int);
48-
void partial_sort(bucket_list_t *,double **,int);
49-
void next_bucket_elem(bucket_list_t,int *,int *);
50-
int add_edge_3(tm_tree_t *,tm_tree_t *,int,int,int *);
51-
void free_bucket(bucket_t *);
52-
void free_tab_bucket(bucket_t **,int);
53-
void free_bucket_list(bucket_list_t);
54-
void partial_update_val (int nb_args, void **args, int thread_id);
36+
static int tab_cmp(const void*,const void*);
37+
static int old_bucket_id(int,int,bucket_list_t);
38+
static int bucket_id(int,int,bucket_list_t);
39+
static void display_bucket(bucket_t *);
40+
static void check_bucket(bucket_t *,double **,double, double);
41+
static void display_pivots(bucket_list_t);
42+
static void display_bucket_list(bucket_list_t);
43+
static void add_to_bucket(int,int,int,bucket_list_t);
44+
static void dfs(int,int,int,double *,double *,int,int);
45+
static void built_pivot_tree(bucket_list_t);
46+
static void fill_buckets(bucket_list_t);
47+
static int is_power_of_2(int);
48+
static void partial_sort(bucket_list_t *,double **,int);
49+
static void next_bucket_elem(bucket_list_t,int *,int *);
50+
static int add_edge_3(tm_tree_t *,tm_tree_t *,int,int,int *);
51+
static void free_bucket(bucket_t *);
52+
static void free_tab_bucket(bucket_t **,int);
53+
static void free_bucket_list(bucket_list_t);
54+
static void partial_update_val (int nb_args, void **args, int thread_id);
5555
double bucket_grouping(tm_affinity_mat_t *,tm_tree_t *, tm_tree_t *, int ,int);
56-
int tab_cmp(const void* x1,const void* x2)
56+
static int tab_cmp(const void* x1,const void* x2)
5757
{
5858
int *e1 = NULL,*e2 = NULL,i1,i2,j1,j2;
5959
double **tab = NULL;
@@ -82,7 +82,7 @@ int tab_cmp(const void* x1,const void* x2)
8282
}
8383

8484

85-
int old_bucket_id(int i,int j,bucket_list_t bucket_list)
85+
static int old_bucket_id(int i,int j,bucket_list_t bucket_list)
8686
{
8787
double *pivot = NULL,val;
8888
int n,sup,inf,p;
@@ -111,7 +111,7 @@ int old_bucket_id(int i,int j,bucket_list_t bucket_list)
111111
return sup;
112112
}
113113

114-
int bucket_id(int i,int j,bucket_list_t bucket_list)
114+
static int bucket_id(int i,int j,bucket_list_t bucket_list)
115115
{
116116
double *pivot_tree = NULL,val;
117117
int p,k;
@@ -131,14 +131,14 @@ int bucket_id(int i,int j,bucket_list_t bucket_list)
131131
return (int)pivot_tree[p];
132132
}
133133

134-
void display_bucket(bucket_t *b)
134+
static void display_bucket(bucket_t *b)
135135
{
136136
printf("\tb.bucket=%p\n",(void *)b->bucket);
137137
printf("\tb.bucket_len=%d\n",(int)b->bucket_len);
138138
printf("\tb.nb_elem=%d\n",(int)b->nb_elem);
139139
}
140140

141-
void check_bucket(bucket_t *b,double **tab,double inf, double sup)
141+
static void check_bucket(bucket_t *b,double **tab,double inf, double sup)
142142
{
143143
int i,j,k;
144144
for( k = 0 ; k < b->nb_elem ; k++ ){
@@ -152,15 +152,15 @@ void check_bucket(bucket_t *b,double **tab,double inf, double sup)
152152
}
153153
}
154154

155-
void display_pivots(bucket_list_t bucket_list)
155+
static void display_pivots(bucket_list_t bucket_list)
156156
{
157157
int i;
158158
for( i = 0 ; i < bucket_list->nb_buckets-1 ; i++)
159159
printf("pivot[%d]=%f\n",i,bucket_list->pivot[i]);
160160
printf("\n");
161161
}
162162

163-
void display_bucket_list(bucket_list_t bucket_list)
163+
static void display_bucket_list(bucket_list_t bucket_list)
164164
{
165165
int i;
166166
double inf,sup;
@@ -184,7 +184,7 @@ void display_bucket_list(bucket_list_t bucket_list)
184184

185185
}
186186

187-
void add_to_bucket(int id,int i,int j,bucket_list_t bucket_list)
187+
static void add_to_bucket(int id,int i,int j,bucket_list_t bucket_list)
188188
{
189189
bucket_t *bucket = NULL;
190190
int N,n,size;
@@ -222,7 +222,7 @@ void add_to_bucket(int id,int i,int j,bucket_list_t bucket_list)
222222
/* exit(-1); */
223223
}
224224

225-
void dfs(int i,int inf,int sup,double *pivot,double *pivot_tree,int depth,int max_depth)
225+
static void dfs(int i,int inf,int sup,double *pivot,double *pivot_tree,int depth,int max_depth)
226226
{
227227
int p;
228228
if( depth == max_depth )
@@ -235,7 +235,7 @@ void dfs(int i,int inf,int sup,double *pivot,double *pivot_tree,int depth,int ma
235235
dfs(2*i+1,p+1,sup,pivot,pivot_tree,depth+1,max_depth);
236236
}
237237

238-
void built_pivot_tree(bucket_list_t bucket_list)
238+
static void built_pivot_tree(bucket_list_t bucket_list)
239239
{
240240
double *pivot_tree = NULL,*pivot = NULL;
241241
int n,i,k;
@@ -261,7 +261,7 @@ void built_pivot_tree(bucket_list_t bucket_list)
261261
}
262262
}
263263

264-
void fill_buckets(bucket_list_t bucket_list)
264+
static void fill_buckets(bucket_list_t bucket_list)
265265
{
266266
int N,i,j,id;
267267

@@ -274,7 +274,7 @@ void fill_buckets(bucket_list_t bucket_list)
274274
}
275275
}
276276

277-
int is_power_of_2(int val)
277+
static int is_power_of_2(int val)
278278
{
279279
int n = 1;
280280
do{
@@ -286,7 +286,7 @@ int is_power_of_2(int val)
286286
}
287287

288288

289-
void partial_sort(bucket_list_t *bl,double **tab,int N)
289+
static void partial_sort(bucket_list_t *bl,double **tab,int N)
290290
{
291291
double *pivot = NULL;
292292
int *sample = NULL;
@@ -386,7 +386,7 @@ void partial_sort(bucket_list_t *bl,double **tab,int N)
386386
*bl = bucket_list;
387387
}
388388

389-
void next_bucket_elem(bucket_list_t bucket_list,int *i,int *j)
389+
static void next_bucket_elem(bucket_list_t bucket_list,int *i,int *j)
390390
{
391391
bucket_t *bucket = bucket_list->bucket_tab[bucket_list->cur_bucket];
392392

@@ -415,7 +415,7 @@ void next_bucket_elem(bucket_list_t bucket_list,int *i,int *j)
415415
}
416416

417417

418-
int add_edge_3(tm_tree_t *tab_node, tm_tree_t *parent,int i,int j,int *nb_groups)
418+
static int add_edge_3(tm_tree_t *tab_node, tm_tree_t *parent,int i,int j,int *nb_groups)
419419
{
420420
/* printf("%d <-> %d ?\n",tab_node[i].id,tab_node[j].id); */
421421
if((!tab_node[i].parent) && (!tab_node[j].parent)){
@@ -492,21 +492,21 @@ int try_add_edge(tm_tree_t *tab_node, tm_tree_t *parent,int arity,int i,int j,in
492492
}
493493
}
494494

495-
void free_bucket(bucket_t *bucket)
495+
static void free_bucket(bucket_t *bucket)
496496
{
497497
FREE(bucket->bucket);
498498
FREE(bucket);
499499
}
500500

501-
void free_tab_bucket(bucket_t **bucket_tab,int N)
501+
static void free_tab_bucket(bucket_t **bucket_tab,int N)
502502
{
503503
int i;
504504
for( i = 0 ; i < N ; i++ )
505505
free_bucket(bucket_tab[i]);
506506
FREE(bucket_tab);
507507
}
508508

509-
void free_bucket_list(bucket_list_t bucket_list)
509+
static void free_bucket_list(bucket_list_t bucket_list)
510510
{
511511
/* Do not free the tab field it is used elsewhere */
512512
free_tab_bucket(bucket_list->bucket_tab,bucket_list->nb_buckets);
@@ -515,7 +515,7 @@ void free_bucket_list(bucket_list_t bucket_list)
515515
FREE(bucket_list);
516516
}
517517

518-
void partial_update_val (int nb_args, void **args, int thread_id){
518+
static void partial_update_val (int nb_args, void **args, int thread_id){
519519
int inf = *(int*)args[0];
520520
int sup = *(int*)args[1];
521521
tm_affinity_mat_t *aff_mat = (tm_affinity_mat_t*)args[2];

0 commit comments

Comments
 (0)