Skip to content

Commit eeae3f9

Browse files
authored
Merge pull request #5517 from bosilca/topic/treematch_warnings
Remove few warnings identified by @rhc in #5514.
2 parents 97da19f + 6d11a45 commit eeae3f9

File tree

5 files changed

+14
-8
lines changed

5 files changed

+14
-8
lines changed

ompi/mca/coll/libnbc/nbc.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -319,8 +319,6 @@ int NBC_Progress(NBC_Handle *handle) {
319319
bool flag;
320320
unsigned long size = 0;
321321
char *delim;
322-
int i;
323-
ompi_status_public_t status;
324322

325323
if (handle->nbc_complete) {
326324
return NBC_OK;

ompi/mca/topo/treematch/topo_treematch_dist_graph_create.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ int mca_topo_treematch_dist_graph_create(mca_topo_base_module_t* topo_module,
135135
int *lindex_to_grank = NULL;
136136
int *nodes_roots = NULL, *k = NULL;
137137
int *localrank_to_objnum = NULL;
138-
int depth, effective_depth = 0, obj_rank = -1;
138+
int depth = 0, effective_depth = 0, obj_rank = -1;
139139
int num_objs_in_node = 0, num_pus_in_node = 0;
140140
int numlevels = 0, num_nodes = 0, num_procs_in_node = 0;
141141
int rank, size, newrank = -1, hwloc_err, i, j, idx;

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,14 @@ double ** topology_to_arch(hwloc_topology_t topology)
141141
double **arch = NULL;
142142

143143
nb_proc = hwloc_get_nbobjs_by_type(topology, HWLOC_OBJ_PU);
144+
if( nb_proc <= 0 ) { /* if multiple levels with PUs */
145+
return NULL;
146+
}
144147
arch = (double**)MALLOC(sizeof(double*)*nb_proc);
148+
if( NULL == arch ) {
149+
return NULL;
150+
}
151+
145152
for( i = 0 ; i < nb_proc ; i++ ){
146153
obj_proc1 = hwloc_get_obj_by_type(topology,HWLOC_OBJ_PU,i);
147154
arch[obj_proc1->os_index] = (double*)MALLOC(sizeof(double)*nb_proc);

ompi/mca/topo/treematch/treematch/tm_tree.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -918,7 +918,7 @@ static void partial_exhaustive_search(int nb_args, void **args, int thread_id){
918918
work_unit_t *work = (work_unit_t *) args[7];
919919
pthread_mutex_t *lock = (pthread_mutex_t *) args[8];
920920
int *tab_i;
921-
int id, id1, id2;
921+
int id = 0, id1, id2;
922922
int total_work = work->nb_work;
923923
int cur_work = 0;
924924

@@ -1750,7 +1750,6 @@ void group_nodes(tm_affinity_mat_t *aff_mat, tm_tree_t *tab_node, tm_tree_t *new
17501750
int mat_order = aff_mat -> order;
17511751
tm_tree_t **cur_group = NULL;
17521752
int j, l;
1753-
unsigned long int list_size;
17541753
unsigned long int i;
17551754
group_list_t list, **best_selection = NULL, **tab_group = NULL;
17561755
double best_val, last_best;
@@ -1810,8 +1809,7 @@ void group_nodes(tm_affinity_mat_t *aff_mat, tm_tree_t *tab_node, tm_tree_t *new
18101809
best_selection = (group_list_t **)MALLOC(sizeof(group_list_t*)*solution_size);
18111810

18121811
list_all_possible_groups(cost_mat, tab_node, 0, arity, 0, cur_group, &list);
1813-
list_size = (int)list.val;
1814-
assert( list_size == nb_groups);
1812+
assert( nb_groups == (unsigned long int)list.val );
18151813
tab_group = (group_list_t**)MALLOC(sizeof(group_list_t*)*nb_groups);
18161814
list_to_tab(list.next, tab_group, nb_groups);
18171815
if(verbose_level>=INFO)

opal/mca/btl/vader/btl_vader_component.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,7 @@ static int mca_btl_base_vader_modex_send (void)
365365
return rc;
366366
}
367367

368+
#if OPAL_BTL_VADER_HAVE_XPMEM || OPAL_BTL_VADER_HAVE_CMA || OPAL_BTL_VADER_HAVE_KNEM
368369
static void mca_btl_vader_select_next_single_copy_mechanism (void)
369370
{
370371
for (int i = 0 ; single_copy_mechanisms[i].value != MCA_BTL_VADER_NONE ; ++i) {
@@ -374,10 +375,13 @@ static void mca_btl_vader_select_next_single_copy_mechanism (void)
374375
}
375376
}
376377
}
378+
#endif
377379

378380
static void mca_btl_vader_check_single_copy (void)
379381
{
382+
#if OPAL_BTL_VADER_HAVE_XPMEM || OPAL_BTL_VADER_HAVE_CMA || OPAL_BTL_VADER_HAVE_KNEM
380383
int initial_mechanism = mca_btl_vader_component.single_copy_mechanism;
384+
#endif
381385

382386
/* single-copy emulation is always used to support AMO's right now */
383387
mca_btl_vader_sc_emu_init ();
@@ -522,7 +526,6 @@ static mca_btl_base_module_t **mca_btl_vader_component_init (int *num_btls,
522526
mca_btl_vader_check_single_copy ();
523527

524528
if (MCA_BTL_VADER_XPMEM != mca_btl_vader_component.single_copy_mechanism) {
525-
const char *base_dir = opal_process_info.proc_session_dir;
526529
char *sm_file;
527530

528531
rc = asprintf(&sm_file, "%s" OPAL_PATH_SEP "vader_segment.%s.%x.%d", mca_btl_vader_component.backing_directory,

0 commit comments

Comments
 (0)