1
1

Remove most (all) warnings from the new TreeMatch.

Signed-off-by: George Bosilca <bosilca@icl.utk.edu>
Этот коммит содержится в:
George Bosilca 2018-12-02 19:44:54 -05:00
родитель 27aa34e53f
Коммит 74f2365d6e
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 09C926752C9F09B1
10 изменённых файлов: 68 добавлений и 73 удалений

Просмотреть файл

@ -8,7 +8,7 @@ int compfunc(const FiboNode * const, const FiboNode * const);
int compFunc(const FiboNode * const node1, const FiboNode * const node2)
static int compFunc(const FiboNode * const node1, const FiboNode * const node2)
{
return
( ( ((QueueElement*)(node1))->key > ((QueueElement*)(node2))->key ) ? -1 : 1);

Просмотреть файл

@ -525,7 +525,7 @@ void partial_update_val (int nb_args, void **args, int thread_id){
if(nb_args != 5){
if(verbose_level >= ERROR)
fprintf(stderr,"(Thread: %d) Wrong number of args in %s: %d\n",thread_id, __FUNCTION__, nb_args);
fprintf(stderr,"(Thread: %d) Wrong number of args in %s: %d\n",thread_id, __func__, nb_args);
exit(-1);
}

Просмотреть файл

@ -6,9 +6,9 @@
#include <stdio.h>
#include "config.h"
#if HAVE_LIBSCOTCH
#if defined(HAVE_LIBSCOTCH)
#include <scotch.h>
#endif
#endif /* defined(HAVE_LIBSCOTCH) */
#define USE_KL_KPART 0
@ -49,7 +49,7 @@ int tm_get_greedy_flag(){
}
#if HAVE_LIBSCOTCH
#if defined(HAVE_LIBSCOTCH)
SCOTCH_Graph* com_mat_to_scotch_graph(com_mat_t *com_mat, int n){
double **mat = com_mat->comm;
@ -284,7 +284,7 @@ int *kpartition_scotch(int k, com_mat_t *com_mat, int n, int *constraints, int
return partition;
}
#endif /* HAVE_LIBSCOTCH */
#endif /* defined(HAVE_LIBSCOTCH) */
void allocate_vertex(int u, int *res, com_mat_t *com_mat, int n, int *size, int max_size)
@ -475,7 +475,7 @@ int *kpartition(int k, com_mat_t *com_mat, int n, int *constraints, int nb_const
/* else */
#if HAVE_LIBSCOTCH
#if defined(HAVE_LIBSCOTCH)
if(!greedy_flag){
if(verbose_level >= DEBUG)
printf("Using Scotch\n");
@ -485,11 +485,11 @@ int *kpartition(int k, com_mat_t *com_mat, int n, int *constraints, int nb_const
printf("Using greedy partitionning\n");
res = kpartition_greedy(k, com_mat, n, constraints, nb_constraints);
}
#else
#else /* defined(HAVE_LIBSCOTCH) */
if(verbose_level >= DEBUG)
printf("Using greedy partitionning\n");
res = kpartition_greedy(k, com_mat, n, constraints, nb_constraints);
#endif
#endif /* defined(HAVE_LIBSCOTCH) */
return res;
}
@ -684,8 +684,8 @@ void free_const_tab(constraint_t *const_tab, int k)
FREE(const_tab);
}
void check_com_mat(com_mat_t *com_mat){
#if 0
static void check_com_mat(com_mat_t *com_mat){
int i,j;
for( i = 0 ; i < com_mat->n ; i++ )
@ -694,16 +694,15 @@ void check_com_mat(com_mat_t *com_mat){
printf("com_mat->comm[%d][%d]= %f\n",i,j,com_mat->comm[i][j]);
exit(-1);
}
}
#endif
void print_tab(int n){
static void print_tab(int n){
for(;n;n--)
fprintf(stdout,"\t");
}
void display_partition(int *partition, int *local_vertices, int n, int depth, int k){
static void display_partition(int *partition, int *local_vertices, int n, int depth, int k){
int cur_part, j;
print_tab(depth);fprintf(stdout,"Partitions at depth=%d\n",depth);
for( cur_part = 0; cur_part < k ; cur_part ++){

Просмотреть файл

@ -36,7 +36,7 @@ static void init_extra_data(void);
char *my_strdup(char* string){
static char *my_strdup(char* string){
int size = 1+strlen(string);
char *res = (char*)malloc(size*sizeof(char));

Просмотреть файл

@ -22,9 +22,9 @@
#include <winbase.h>
#endif
#if HAVE_LIBSCOTCH
#if defined(HAVE_LIBSCOTCH)
#include <scotch.h>
#endif
#endif /* defined(HAVE_LIBSCOTCH) */
#include <sys/mman.h>
@ -58,7 +58,6 @@ int nb_leaves(tm_tree_t *comm_tree);
int nb_lines(char *filename);
void print_1D_tab(int *tab,int N);
tm_solution_t * tm_compute_mapping(tm_topology_t *topology,tm_tree_t *comm_tree);
void tm_finalize();
void tm_free_affinity_mat(tm_affinity_mat_t *aff_mat);
tm_affinity_mat_t *tm_load_aff_mat(char *filename);
void update_comm_speed(double **comm_speed,int old_size,int new_size);
@ -172,14 +171,14 @@ long int init_mat(char *filename,int N, double **mat, double *sum_row){
}
size_t get_filesize(char* filename) {
static size_t get_filesize(char* filename) {
struct stat st;
stat(filename, &st);
return st.st_size;
}
char *parse_line(int i, double **mat, double *sum_row, int N, char *data, char *filename, long int *nnz){
static char *parse_line(int i, double **mat, double *sum_row, int N, char *data, char *filename, long int *nnz){
/* now parse the buffer byte per byte for the current line i until we reach '\n'*/
unsigned int vl = tm_get_verbose_level();
long val;
@ -215,7 +214,7 @@ char *parse_line(int i, double **mat, double *sum_row, int N, char *data, char *
/* buffered read with mmap of teh file */
long int init_mat_mmap(char *filename,int N, double **mat, double *sum_row){
static long int init_mat_mmap(char *filename,int N, double **mat, double *sum_row){
int i;
unsigned int vl = tm_get_verbose_level();
size_t filesize = get_filesize(filename);
@ -251,7 +250,7 @@ long int init_mat_mmap(char *filename,int N, double **mat, double *sum_row){
long int init_mat_long(char *filename,int N, double **mat, double *sum_row){
static long int init_mat_long(char *filename,int N, double **mat, double *sum_row){
int i;
unsigned int vl = tm_get_verbose_level();
char line[LINE_SIZE];
@ -425,7 +424,7 @@ int nb_leaves(tm_tree_t *comm_tree)
}
/* find the first '-1 in the array of size n and put the value there*/
void set_val(int *tab, int val, int n){
static void set_val(int *tab, int val, int n){
int i = 0;
while (i < n ){

Просмотреть файл

@ -19,7 +19,6 @@ int nb_lines(char *filename);
int nb_processing_units(tm_topology_t *topology);
void print_1D_tab(int *tab,int N);
tm_solution_t * tm_compute_mapping(tm_topology_t *topology,tm_tree_t *comm_tree);
void tm_finalize();
void tm_free_affinity_mat(tm_affinity_mat_t *aff_mat);
tm_affinity_mat_t *tm_load_aff_mat(char *filename);
void update_comm_speed(double **comm_speed,int old_size,int new_size);

Просмотреть файл

@ -106,7 +106,7 @@ double display_sol_sum_com(tm_topology_t *topology, tm_affinity_mat_t *aff_mat,
a = cost[depth-distance(topology,sigma[i],sigma[j])];
if(tm_get_verbose_level() >= DEBUG)
printf("T_%d_%d %f*%f=%f\n",i,j,c,a,c*a);
sol += c*a;
sol += c*a;
}
for (i = 0; i < N; i++) {
@ -120,7 +120,7 @@ double display_sol_sum_com(tm_topology_t *topology, tm_affinity_mat_t *aff_mat,
}
double display_sol_max_com(tm_topology_t *topology, tm_affinity_mat_t *aff_mat, int *sigma)
static double display_sol_max_com(tm_topology_t *topology, tm_affinity_mat_t *aff_mat, int *sigma)
{
double a,c,sol;
int i,j;
@ -156,7 +156,7 @@ double display_sol_max_com(tm_topology_t *topology, tm_affinity_mat_t *aff_mat,
return sol;
}
double display_sol_hop_byte(tm_topology_t *topology, tm_affinity_mat_t *aff_mat, int *sigma)
static double display_sol_hop_byte(tm_topology_t *topology, tm_affinity_mat_t *aff_mat, int *sigma)
{
double c,sol;
int nb_hops;
@ -171,7 +171,7 @@ double display_sol_hop_byte(tm_topology_t *topology, tm_affinity_mat_t *aff_mat,
nb_hops = 2*distance(topology,sigma[i],sigma[j]);
if(tm_get_verbose_level() >= DEBUG)
printf("T_%d_%d %f*%d=%f\n",i,j,c,nb_hops,c*nb_hops);
sol += c*nb_hops;
sol += c*nb_hops;
}
for (i = 0; i < N; i++) {
@ -278,7 +278,7 @@ int in_tab(int *tab, int n, int val){
if(tab[i] == val)
return 1;
return 0;
return 0;
}
void map_Packed(tm_topology_t *topology, int N, int *sigma)

Просмотреть файл

@ -28,7 +28,6 @@ double ** topology_to_arch(hwloc_topology_t topology);
void build_synthetic_proc_id(tm_topology_t *topology);
tm_topology_t *tm_build_synthetic_topology(int *arity, double *cost, int nb_levels, int *core_numbering, int nb_core_per_nodes);
void tm_set_numbering(tm_numbering_t new_val); /* TM_NUMBERING_LOGICAL or TM_NUMBERING_PHYSICAL */
tm_numbering_t tm_get_numbering(); /* TM_NUMBERING_LOGICAL or TM_NUMBERING_PHYSICAL */
#define LINE_SIZE (1000000)
@ -135,8 +134,7 @@ int topo_nb_proc(hwloc_topology_t topology,int N)
}
double link_cost(int depth)
static double link_cost(int depth)
{
/*
Bertha values
@ -154,7 +152,6 @@ double link_cost(int depth)
*/
}
double ** topology_to_arch(hwloc_topology_t topology)
{
int nb_proc,i,j;
@ -198,7 +195,7 @@ int symetric(hwloc_topology_t topology)
return 1;
}
void build_process_tab_id(tm_topology_t *topology, hwloc_obj_t *objs, char* filename){
static void build_process_tab_id(tm_topology_t *topology, hwloc_obj_t *objs, char* filename){
unsigned int i,j;
unsigned int nb_nodes = topology->nb_proc_units;
int vl = tm_get_verbose_level();
@ -482,7 +479,7 @@ int int_cmp_inc(const void* x1,const void* x2)
}
int topo_check_constraints(tm_topology_t *topology){
static int topo_check_constraints(tm_topology_t *topology){
int n = topology->nb_constraints;
int i;
int depth = topology->nb_levels-1;
@ -502,7 +499,7 @@ int topo_check_constraints(tm_topology_t *topology){
/* cpy flag tells if we need to copy the array.
Set to 1 when called from the application level and 0 when called from inside the library*/
int tm_topology_set_binding_constraints_cpy(int *constraints, int nb_constraints, tm_topology_t *topology, int cpy_flag){
static int tm_topology_set_binding_constraints_cpy(int *constraints, int nb_constraints, tm_topology_t *topology, int cpy_flag){
topology -> nb_constraints = nb_constraints;
if(cpy_flag){

Просмотреть файл

@ -81,7 +81,7 @@ void free_non_constraint_tree(tm_tree_t *);
void free_constraint_tree(tm_tree_t *);
void free_tab_double(double**, int);
void free_tab_int(int**, int );
void partial_aggregate_aff_mat (int, void **, int);
static void partial_aggregate_aff_mat (int, void **, int);
void free_affinity_mat(tm_affinity_mat_t *aff_mat);
int int_cmp_inc(const void* x1, const void* x2);
@ -250,7 +250,7 @@ void partial_aggregate_aff_mat (int nb_args, void **args, int thread_id){
if(nb_args != 8){
if(verbose_level >= ERROR)
fprintf(stderr, "Thread %d: Wrong number of args in %s: %d\n", thread_id, __FUNCTION__, nb_args);
fprintf(stderr, "Thread %d: Wrong number of args in %s: %d\n", thread_id, __func__, nb_args);
exit(-1);
}
@ -277,7 +277,7 @@ void partial_aggregate_aff_mat (int nb_args, void **args, int thread_id){
}
tm_affinity_mat_t *aggregate_aff_mat(tm_tree_t *tab_node, tm_affinity_mat_t *aff_mat, int M)
static tm_affinity_mat_t *aggregate_aff_mat(tm_tree_t *tab_node, tm_affinity_mat_t *aff_mat, int M)
{
int i, j, i1, j1, id1, id2;
double **new_mat = NULL, **old_mat = aff_mat->mat;
@ -723,7 +723,7 @@ int select_independent_groups(group_list_t **tab_group, int n, int arity, int M
}
int8_t** init_independent_group_mat(int n, group_list_t **tab_group, int arity){
static int8_t** init_independent_group_mat(int n, group_list_t **tab_group, int arity){
int i, j, ii, jj;
int8_t **indep_mat = (int8_t **)MALLOC(sizeof(int8_t*) *n);
@ -751,7 +751,7 @@ int8_t** init_independent_group_mat(int n, group_list_t **tab_group, int arity){
return indep_mat;
}
int independent_groups_mat(group_list_t **selection, int selection_size, group_list_t *elem, int8_t **indep_mat)
static int independent_groups_mat(group_list_t **selection, int selection_size, group_list_t *elem, int8_t **indep_mat)
{
int i;
int id_elem = elem->id;
@ -774,7 +774,7 @@ int independent_groups_mat(group_list_t **selection, int selection_size, group_l
static long int y=0;
int thread_derecurs_exhaustive_search(group_list_t **tab_group, int i, int nb_groups, int arity, int depth, int solution_size,
static int thread_derecurs_exhaustive_search(group_list_t **tab_group, int i, int nb_groups, int arity, int depth, int solution_size,
double val, double *best_val, group_list_t **selection, group_list_t **best_selection,
int8_t **indep_mat, pthread_mutex_t *lock, int thread_id, int *tab_i, int start_depth){
@ -862,8 +862,8 @@ int thread_derecurs_exhaustive_search(group_list_t **tab_group, int i, int nb_gr
return 0;
}
group_list_t * group_dup(group_list_t *group, int nb_groups){
#if 0
static group_list_t * group_dup(group_list_t *group, int nb_groups){
group_list_t *elem = NULL;
/* tm_tree_t **tab = NULL; */
double *bound;
@ -887,8 +887,10 @@ group_list_t * group_dup(group_list_t *group, int nb_groups){
return elem;
}
#endif
group_list_t ** tab_group_dup(group_list_t **tab_group, int nb_groups){
#if 0
static group_list_t ** tab_group_dup(group_list_t **tab_group, int nb_groups){
group_list_t **res;
int i;
@ -902,8 +904,10 @@ group_list_t ** tab_group_dup(group_list_t **tab_group, int nb_groups){
return res;
}
#endif
int8_t **indep_mat_dup(int8_t** mat, int n){
#if 0
static int8_t **indep_mat_dup(int8_t** mat, int n){
int i;
int8_t ** res = (int8_t**)MALLOC(sizeof(int8_t*)*n);
int row_len;
@ -916,9 +920,9 @@ int8_t **indep_mat_dup(int8_t** mat, int n){
return res;
}
#endif
void partial_exhaustive_search(int nb_args, void **args, int thread_id){
static void partial_exhaustive_search(int nb_args, void **args, int thread_id){
int i, j;
group_list_t **selection = NULL;
double val;
@ -942,7 +946,7 @@ void partial_exhaustive_search(int nb_args, void **args, int thread_id){
if(nb_args!=9){
if(verbose_level>=ERROR){
fprintf(stderr, "Id: %d: bad number of argument for function %s: %d instead of 9\n", thread_id, __FUNCTION__, nb_args);
fprintf(stderr, "Id: %d: bad number of argument for function %s: %d instead of 9\n", thread_id, __func__, nb_args);
return;
}
}
@ -1026,18 +1030,14 @@ void partial_exhaustive_search(int nb_args, void **args, int thread_id){
int dbl_cmp_dec(const void* x1,const void* x2)
{
return *((double *)x1) > *((double *)x2) ? -1 : 1;
}
int dbl_cmp_inc(const void* x1,const void* x2)
static int dbl_cmp_inc(const void* x1,const void* x2)
{
return *((double *)x1) < *((double *)x2) ? -1 : 1;
}
double *build_bound_array(double *tab, int n){
static double *build_bound_array(double *tab, int n){
int i;
double *bound;
@ -1066,7 +1066,7 @@ double *build_bound_array(double *tab, int n){
return bound;
}
work_unit_t *create_work_unit(work_unit_t *cur, int *tab,int size){
static work_unit_t *create_work_unit(work_unit_t *cur, int *tab,int size){
work_unit_t *res = (work_unit_t *) CALLOC(1,sizeof(work_unit_t));
int *tab_group = MALLOC(size*sizeof(int));
memcpy(tab_group, tab, size*sizeof(int));
@ -1077,7 +1077,7 @@ work_unit_t *create_work_unit(work_unit_t *cur, int *tab,int size){
return res;
}
work_unit_t *generate_work_units(work_unit_t *cur, int i, int id, int *tab_group,int size, int id_max){
static work_unit_t *generate_work_units(work_unit_t *cur, int i, int id, int *tab_group,int size, int id_max){
tab_group[i] = id;
if(i==size-1){
@ -1097,7 +1097,7 @@ work_unit_t *generate_work_units(work_unit_t *cur, int i, int id, int *tab_grou
}
work_unit_t *create_tab_work(int n){
static work_unit_t *create_tab_work(int n){
int work_size = 4;
int i;
work_unit_t *cur,*res = (work_unit_t *) CALLOC(1,sizeof(work_unit_t));
@ -1121,7 +1121,7 @@ work_unit_t *create_tab_work(int n){
}
int thread_exhaustive_search(group_list_t **tab_group, int nb_groups, int arity, int solution_size, double *best_val,
static int thread_exhaustive_search(group_list_t **tab_group, int nb_groups, int arity, int solution_size, double *best_val,
group_list_t **best_selection){
pthread_mutex_t lock;
@ -1226,7 +1226,8 @@ int thread_exhaustive_search(group_list_t **tab_group, int nb_groups, int arity,
}
int old_recurs_exhaustive_search(group_list_t **tab, int i, int n, int arity, int d, int solution_size, double val, double *best_val, group_list_t **selection, group_list_t **best_selection, int8_t **indep_mat)
#if 0
static int old_recurs_exhaustive_search(group_list_t **tab, int i, int n, int arity, int d, int solution_size, double val, double *best_val, group_list_t **selection, group_list_t **best_selection, int8_t **indep_mat)
{
group_list_t *elem = NULL;
@ -1265,10 +1266,10 @@ int old_recurs_exhaustive_search(group_list_t **tab, int i, int n, int arity, in
return 0;
}
#endif
int recurs_exhaustive_search(group_list_t **tab, int i, int n, int arity, int d, int solution_size, double val, double *best_val, group_list_t **selection, group_list_t **best_selection, int8_t **indep_mat, int* tab_i)
#if 0
static int recurs_exhaustive_search(group_list_t **tab, int i, int n, int arity, int d, int solution_size, double val, double *best_val, group_list_t **selection, group_list_t **best_selection, int8_t **indep_mat, int* tab_i)
{
group_list_t *elem = NULL;
@ -1318,10 +1319,10 @@ int recurs_exhaustive_search(group_list_t **tab, int i, int n, int arity, int d,
return 0;
}
#endif
int exhaustive_search(group_list_t **tab_group, int n, int arity, int solution_size, double *best_val,
#if 0
static int exhaustive_search(group_list_t **tab_group, int n, int arity, int solution_size, double *best_val,
group_list_t **best_selection)
{
int i, j;
@ -1381,7 +1382,7 @@ int exhaustive_search(group_list_t **tab_group, int n, int arity, int solution_
return 0;
}
#endif
int select_independent_groups_by_largest_index(group_list_t **tab_group, int n, int arity, int solution_size, double *best_val, group_list_t **best_selection, int bound, double max_duration)
@ -1582,7 +1583,7 @@ double fast_grouping(tm_affinity_mat_t *aff_mat, tm_tree_t *tab_node, tm_tree_t
return val;
}
double k_partition_grouping(tm_affinity_mat_t *aff_mat, tm_tree_t *tab_node, tm_tree_t *new_tab_node, int arity, int solution_size) {
static double k_partition_grouping(tm_affinity_mat_t *aff_mat, tm_tree_t *tab_node, tm_tree_t *new_tab_node, int arity, int solution_size) {
int *partition = NULL;
int n = aff_mat->order;
com_mat_t com_mat;

Просмотреть файл

@ -179,7 +179,7 @@ void tm_free_affinity_mat(tm_affinity_mat_t *aff_mat);
void tm_set_verbose_level(unsigned int level);
unsigned int tm_get_verbose_level(void);
/* finalize treematch :check memory if necessary, and free internal variables (thread pool)*/
void tm_finalize();
void tm_finalize(void);
/*
Ask for exhaustive search: may be very long
@ -187,7 +187,7 @@ Ask for exhaustive search: may be very long
new_val != 0 : exhuative search
*/
void tm_set_exhaustive_search_flag(int new_val);
int tm_get_exhaustive_search_flag();
int tm_get_exhaustive_search_flag(void);
/*
Ask for greedy k-partitionning even if scotch is available
@ -195,7 +195,7 @@ Ask for greedy k-partitionning even if scotch is available
new_val != 0 : greedy k-partitionning
*/
void tm_set_greedy_flag(int new_val);
int tm_get_greedy_flag();
int tm_get_greedy_flag(void);
/* Setting the maximum number of threads you want to use in parallel parts of TreeMatch */
@ -203,7 +203,7 @@ void tm_set_max_nb_threads(unsigned int val);
/* managing the usage of physical vs. logical core numbering when using hwloc/xml files */
void tm_set_numbering(tm_numbering_t new_val); /* TM_NUMBERING_LOGICAL or TM_NUMBERING_PHYSICAL */
tm_numbering_t tm_get_numbering(); /* TM_NUMBERING_LOGICAL or TM_NUMBERING_PHYSICAL */
tm_numbering_t tm_get_numbering(void); /* TM_NUMBERING_LOGICAL or TM_NUMBERING_PHYSICAL */
#include "tm_malloc.h"