Merge pull request #1477 from hjelmn/ompi_coverity
Fix some issues in OMPI identified by Coverity
Этот коммит содержится в:
Коммит
81085dd89d
@ -2,7 +2,7 @@
|
||||
/*
|
||||
* Copyright (c) 2009-2012 Oak Ridge National Laboratory. All rights reserved.
|
||||
* Copyright (c) 2009-2012 Mellanox Technologies. All rights reserved.
|
||||
* Copyright (c) 2014-2015 Los Alamos National Security, LLC. All rights
|
||||
* Copyright (c) 2014-2016 Los Alamos National Security, LLC. All rights
|
||||
* reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
@ -271,12 +271,7 @@ static int basesmuma_close(void)
|
||||
mca_bcol_basesmuma_component_t *cs = &mca_bcol_basesmuma_component;
|
||||
|
||||
/* gvm Leak FIX */
|
||||
while(!opal_list_is_empty(&(cs->ctl_structures))) {
|
||||
opal_list_item_t *item;
|
||||
item = opal_list_remove_first(&(cs->ctl_structures));
|
||||
OBJ_DESTRUCT(item);
|
||||
}
|
||||
OBJ_DESTRUCT(&(cs->ctl_structures));
|
||||
OPAL_LIST_DESTRUCT (&cs->ctl_structures);
|
||||
|
||||
/* deregister the progress function */
|
||||
ret=opal_progress_unregister(bcol_basesmuma_progress);
|
||||
@ -331,7 +326,7 @@ int mca_bcol_basesmuma_init_query(bool enable_progress_threads,
|
||||
int mca_bcol_basesmuma_allocate_sm_ctl_memory(mca_bcol_basesmuma_component_t *cs)
|
||||
{
|
||||
/* local variables */
|
||||
int name_length, ret;
|
||||
int name_length, ret = OMPI_SUCCESS;
|
||||
size_t ctl_length;
|
||||
char *name;
|
||||
size_t page_size = getpagesize ();
|
||||
@ -347,6 +342,7 @@ int mca_bcol_basesmuma_allocate_sm_ctl_memory(mca_bcol_basesmuma_component_t *cs
|
||||
}
|
||||
/* make sure name is not too long */
|
||||
if ( OPAL_PATH_MAX < (name_length-1) ) {
|
||||
free (name);
|
||||
return OMPI_ERROR;
|
||||
}
|
||||
|
||||
@ -371,21 +367,14 @@ int mca_bcol_basesmuma_allocate_sm_ctl_memory(mca_bcol_basesmuma_component_t *cs
|
||||
if( !cs->sm_ctl_structs) {
|
||||
opal_output (ompi_bcol_base_framework.framework_output,
|
||||
"In mca_bcol_basesmuma_allocate_sm_ctl_memory failed to allocathe backing file %s\n", name);
|
||||
ret=OMPI_ERR_OUT_OF_RESOURCE;
|
||||
goto Error;
|
||||
ret = OMPI_ERR_OUT_OF_RESOURCE;
|
||||
}
|
||||
|
||||
/* free the memory allocated by asprintf for the file name -
|
||||
* in mca_base_smcm_mem_reg this name is copied into a new
|
||||
* memory location */
|
||||
free(name);
|
||||
free (name);
|
||||
|
||||
/* successful return */
|
||||
return OMPI_SUCCESS;
|
||||
|
||||
Error:
|
||||
if(name) {
|
||||
free(name);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
@ -1,6 +1,9 @@
|
||||
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
|
||||
/*
|
||||
* Copyright (c) 2009-2012 Oak Ridge National Laboratory. All rights reserved.
|
||||
* Copyright (c) 2009-2012 Mellanox Technologies. All rights reserved.
|
||||
* Copyright (c) 2016 Los Alamos National Security, LLC. All rights
|
||||
* reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
@ -72,7 +75,7 @@ int bcol_basesmuma_k_nomial_barrier_init(bcol_function_args_t *input_args,
|
||||
int pow_k, tree_order;
|
||||
int max_requests = 0; /* important to initialize this */
|
||||
|
||||
int matched = 0;
|
||||
bool matched;
|
||||
int64_t sequence_number=input_args->sequence_num;
|
||||
int my_rank = bcol_module->super.sbgp_partner_module->my_index;
|
||||
|
||||
@ -128,10 +131,8 @@ int bcol_basesmuma_k_nomial_barrier_init(bcol_function_args_t *input_args,
|
||||
src = exchange_node->rank_extra_sources_array[0];
|
||||
peer_ctl_pointer = data_buffs[src].ctl_struct;
|
||||
|
||||
for( i = 0; i < cm->num_to_probe && (0 == matched); i++ ) {
|
||||
for( i = 0; i < cm->num_to_probe ; i++ ) {
|
||||
if(IS_PEER_READY(peer_ctl_pointer, ready_flag, sequence_number, BARRIER_RKING_FLAG, bcol_id)){
|
||||
matched = 1;
|
||||
|
||||
goto FINISHED;
|
||||
}
|
||||
|
||||
@ -148,20 +149,21 @@ int bcol_basesmuma_k_nomial_barrier_init(bcol_function_args_t *input_args,
|
||||
peer_ctl_pointer = data_buffs[src].ctl_struct;
|
||||
|
||||
/* probe for extra rank's arrival */
|
||||
for( i = 0; i < cm->num_to_probe && ( 0 == matched); i++) {
|
||||
for( i = 0, matched = false ; i < cm->num_to_probe && !matched ; i++) {
|
||||
if(IS_PEER_READY(peer_ctl_pointer,ready_flag, sequence_number, BARRIER_RKING_FLAG, bcol_id)){
|
||||
matched = 1;
|
||||
/* copy it in */
|
||||
goto MAIN_PHASE;
|
||||
matched = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!matched) {
|
||||
*status = ready_flag;
|
||||
*iteration = -1;
|
||||
return BCOL_FN_STARTED;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
MAIN_PHASE:
|
||||
/* bump the ready flag */
|
||||
ready_flag++;
|
||||
|
||||
@ -189,12 +191,11 @@ MAIN_PHASE:
|
||||
* better temporal locality, this comes at a cost to asynchronicity
|
||||
* but should get better cache performance
|
||||
*/
|
||||
matched = 0;
|
||||
for( probe = 0; probe < cm->num_to_probe && (0 == matched); probe++){
|
||||
for( probe = 0; probe < cm->num_to_probe ; probe++){
|
||||
if(IS_PEER_READY(peer_ctl_pointer,ready_flag, sequence_number, BARRIER_RKING_FLAG, bcol_id)){
|
||||
matched = 1;
|
||||
/* set this request's bit */
|
||||
*active_requests ^= (1<<j);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -261,7 +262,7 @@ int bcol_basesmuma_k_nomial_barrier_progress(bcol_function_args_t *input_args,
|
||||
int pow_k, tree_order;
|
||||
int bcol_id = (int) bcol_module->super.bcol_id;
|
||||
|
||||
int matched = 0;
|
||||
bool matched;
|
||||
int64_t sequence_number=input_args->sequence_num;
|
||||
int my_rank = bcol_module->super.sbgp_partner_module->my_index;
|
||||
|
||||
@ -311,10 +312,8 @@ int bcol_basesmuma_k_nomial_barrier_progress(bcol_function_args_t *input_args,
|
||||
src = exchange_node->rank_extra_sources_array[0];
|
||||
peer_ctl_pointer = data_buffs[src].ctl_struct;
|
||||
|
||||
for( i = 0; i < cm->num_to_probe && (0 == matched); i++ ) {
|
||||
for( i = 0; i < cm->num_to_probe ; i++ ) {
|
||||
if(IS_PEER_READY(peer_ctl_pointer, ready_flag, sequence_number, BARRIER_RKING_FLAG, bcol_id)){
|
||||
matched = 1;
|
||||
|
||||
goto FINISHED;
|
||||
}
|
||||
|
||||
@ -330,20 +329,20 @@ int bcol_basesmuma_k_nomial_barrier_progress(bcol_function_args_t *input_args,
|
||||
peer_ctl_pointer = data_buffs[src].ctl_struct;
|
||||
|
||||
/* probe for extra rank's arrival */
|
||||
for( i = 0; i < cm->num_to_probe && ( 0 == matched); i++) {
|
||||
for( i = 0, matched = false ; i < cm->num_to_probe && !matched ; i++) {
|
||||
if(IS_PEER_READY(peer_ctl_pointer,ready_flag, sequence_number, BARRIER_RKING_FLAG, bcol_id)){
|
||||
matched = 1;
|
||||
matched = true;
|
||||
/* bump the flag */
|
||||
ready_flag++;
|
||||
*iteration = 0;
|
||||
goto MAIN_PHASE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!matched) {
|
||||
return BCOL_FN_STARTED;
|
||||
|
||||
}
|
||||
|
||||
MAIN_PHASE:
|
||||
}
|
||||
|
||||
/* start the recursive k - ing phase */
|
||||
for( *iter=*iteration; *iter < pow_k; (*iter)++) {
|
||||
@ -369,12 +368,11 @@ MAIN_PHASE:
|
||||
/* I am putting the probe loop as the inner most loop to achieve
|
||||
* better temporal locality
|
||||
*/
|
||||
matched = 0;
|
||||
for( probe = 0; probe < cm->num_to_probe && (0 == matched); probe++){
|
||||
for( probe = 0; probe < cm->num_to_probe ; probe++){
|
||||
if(IS_PEER_READY(peer_ctl_pointer,ready_flag, sequence_number, BARRIER_RKING_FLAG, bcol_id)){
|
||||
matched = 1;
|
||||
/* flip the request's bit */
|
||||
*active_requests ^= (1<<j);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -3,7 +3,7 @@
|
||||
*
|
||||
* Copyright (c) 2009-2012 Oak Ridge National Laboratory. All rights reserved.
|
||||
* Copyright (c) 2009-2012 Mellanox Technologies. All rights reserved.
|
||||
* Copyright (c) 2012-2014 Los Alamos National Security, LLC. All rights
|
||||
* Copyright (c) 2012-2016 Los Alamos National Security, LLC. All rights
|
||||
* reserved.
|
||||
* Copyright (c) 2014 Intel, Inc. All rights reserved.
|
||||
* Copyright (c) 2014-2015 Research Organization for Information Science
|
||||
@ -371,7 +371,10 @@ bcol_basesmuma_smcm_mmap_t *bcol_basesmuma_smcm_mem_reg(void *in_ptr,
|
||||
if (fd < 0) {
|
||||
opal_output (ompi_bcol_base_framework.framework_output, "basesmuma shared memory allocation open failed with errno: %d",
|
||||
errno);
|
||||
} else if (0 != ftruncate(fd,length)) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (0 != ftruncate(fd,length)) {
|
||||
opal_output (ompi_bcol_base_framework.framework_output, "basesmuma shared memory allocation ftruncate failed with errno: %d",
|
||||
errno);
|
||||
} else {
|
||||
|
@ -1,6 +1,9 @@
|
||||
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
|
||||
/*
|
||||
* Copyright (c) 2009-2012 Oak Ridge National Laboratory. All rights reserved.
|
||||
* Copyright (c) 2009-2012 Mellanox Technologies. All rights reserved.
|
||||
* Copyright (c) 2016 Los Alamos National Security, LLC. All rights
|
||||
* reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
|
@ -1,6 +1,9 @@
|
||||
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
|
||||
/*
|
||||
* Copyright (c) 2009-2012 Oak Ridge National Laboratory. All rights reserved.
|
||||
* Copyright (c) 2009-2012 Mellanox Technologies. All rights reserved.
|
||||
* Copyright (c) 2016 Los Alamos National Security, LLC. All rights
|
||||
* reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
@ -66,7 +69,7 @@ do {
|
||||
int dst_boundary_rank; \
|
||||
int radix_mask = radix_mask_pow >= 0 ? 1 << radix_mask_pow : 0; \
|
||||
\
|
||||
while(radix_mask > 0) { \
|
||||
while(radix_mask_pow >= 0) { \
|
||||
/* For each level of tree, do sends */ \
|
||||
dst = my_group_index ^ radix_mask; \
|
||||
comm_dst = group_list[dst]; \
|
||||
|
@ -12,7 +12,7 @@
|
||||
* All rights reserved.
|
||||
* Copyright (c) 2008 Sun Microsystems, Inc. All rights reserved.
|
||||
* Copyright (c) 2008 Cisco Systems, Inc. All rights reserved.
|
||||
* Copyright (c) 2013 Los Alamos National Security, LLC. All rights
|
||||
* Copyright (c) 2013-2016 Los Alamos National Security, LLC. All rights
|
||||
* reserved.
|
||||
* Copyright (c) 2015 Research Organization for Information Science
|
||||
* and Technology (RIST). All rights reserved.
|
||||
@ -352,8 +352,11 @@ OMPI_DECLSPEC OBJ_CLASS_DECLARATION(mca_coll_base_comm_t);
|
||||
*/
|
||||
static inline void ompi_coll_base_free_reqs(ompi_request_t **reqs, int count)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < count; ++i) {
|
||||
if (OPAL_UNLIKELY(NULL == reqs)) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (int i = 0; i < count; ++i) {
|
||||
if( MPI_REQUEST_NULL != reqs[i] ) {
|
||||
ompi_request_free(&reqs[i]);
|
||||
}
|
||||
|
@ -2,7 +2,7 @@
|
||||
/*
|
||||
* Copyright (c) 2009-2012 Oak Ridge National Laboratory. All rights reserved.
|
||||
* Copyright (c) 2009-2012 Mellanox Technologies. All rights reserved.
|
||||
* Copyright (c) 2013-2014 Los Alamos National Security, LLC. All rights
|
||||
* Copyright (c) 2013-2016 Los Alamos National Security, LLC. All rights
|
||||
* reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
@ -440,6 +440,9 @@ static int parse_line(section_config_t *section)
|
||||
if (COLL_ML_CONFIG_PARSE_SINGLE_WORD == val ||
|
||||
COLL_ML_CONFIG_PARSE_VALUE == val) {
|
||||
value = strdup(coll_ml_config_yytext);
|
||||
if (NULL == value) {
|
||||
return OMPI_ERR_OUT_OF_RESOURCE;
|
||||
}
|
||||
|
||||
/* Now we need to see the newline */
|
||||
val = coll_ml_config_yylex();
|
||||
@ -458,37 +461,21 @@ static int parse_line(section_config_t *section)
|
||||
COLL_ML_CONFIG_PARSE_NEWLINE != val) {
|
||||
ML_ERROR(("Line %d, expected new line or end of line",
|
||||
coll_ml_config_yynewlines));
|
||||
ret = OMPI_ERROR;
|
||||
goto Error;
|
||||
return OMPI_ERROR;
|
||||
} else {
|
||||
ML_ERROR(("Line %d malformed", coll_ml_config_yynewlines));
|
||||
return OMPI_ERROR;
|
||||
}
|
||||
|
||||
/* Line parsing is done, read the values */
|
||||
if (!strcasecmp(key_buffer, "algorithm")) {
|
||||
ret = parse_algorithm_key(section, value);
|
||||
if (OMPI_SUCCESS != ret) {
|
||||
goto Error;
|
||||
}
|
||||
}
|
||||
|
||||
else if (!strcasecmp(key_buffer, "threshold")) {
|
||||
} else if (!strcasecmp(key_buffer, "threshold")) {
|
||||
ret = parse_threshold_key(section, value);
|
||||
if (OMPI_SUCCESS != ret) {
|
||||
goto Error;
|
||||
}
|
||||
}
|
||||
|
||||
else if (!strcasecmp(key_buffer, "hierarchy")) {
|
||||
} else if (!strcasecmp(key_buffer, "hierarchy")) {
|
||||
ret = parse_hierarchy_key(section, value);
|
||||
if (OMPI_SUCCESS != ret) {
|
||||
goto Error;
|
||||
}
|
||||
}
|
||||
|
||||
else if (!strcasecmp(key_buffer, "fragmentation")) {
|
||||
} else if (!strcasecmp(key_buffer, "fragmentation")) {
|
||||
ret = parse_fragmentation_key(section, value);
|
||||
if (OMPI_SUCCESS != ret) {
|
||||
goto Error;
|
||||
}
|
||||
/* Failed to parse the key */
|
||||
} else {
|
||||
ML_ERROR(("Line %d, unknown key %s",
|
||||
@ -496,10 +483,7 @@ static int parse_line(section_config_t *section)
|
||||
}
|
||||
|
||||
/* All done */
|
||||
Error:
|
||||
if (NULL != value) {
|
||||
free(value);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
@ -2,7 +2,7 @@
|
||||
/*
|
||||
* Copyright (c) 2009-2012 Oak Ridge National Laboratory. All rights reserved.
|
||||
* Copyright (c) 2009-2012 Mellanox Technologies. All rights reserved.
|
||||
* Copyright (c) 2014 Los Alamos National Security, LLC. All rights
|
||||
* Copyright (c) 2014-2016 Los Alamos National Security, LLC. All rights
|
||||
* reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
@ -253,32 +253,19 @@ int ml_coll_up_and_down_hier_setup(mca_coll_ml_module_t *ml_module,
|
||||
topo_info->hierarchical_algorithms[collective]->n_buffers = 1;
|
||||
|
||||
/* Release temporary memories */
|
||||
if (NULL != scratch_indx) {
|
||||
free(scratch_indx);
|
||||
}
|
||||
|
||||
if (NULL != scratch_num) {
|
||||
free(scratch_num);
|
||||
}
|
||||
|
||||
return OMPI_SUCCESS;
|
||||
|
||||
Error:
|
||||
if (NULL != collective_alg->functions) {
|
||||
if (NULL != collective_alg) {
|
||||
free(collective_alg->functions);
|
||||
}
|
||||
|
||||
if (NULL != collective_alg) {
|
||||
free(collective_alg);
|
||||
}
|
||||
|
||||
if (NULL != scratch_indx) {
|
||||
free(scratch_indx);
|
||||
}
|
||||
|
||||
if (NULL != scratch_num) {
|
||||
free(scratch_num);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
@ -527,13 +514,8 @@ int ml_coll_barrier_constant_group_data_setup(
|
||||
return OMPI_SUCCESS;
|
||||
|
||||
Const_Data_Setup_Error:
|
||||
if (NULL != scratch_indx) {
|
||||
free(scratch_indx);
|
||||
}
|
||||
|
||||
if (NULL != scratch_num) {
|
||||
free(scratch_num);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
@ -2,7 +2,7 @@
|
||||
/*
|
||||
* Copyright (c) 2009-2013 Oak Ridge National Laboratory. All rights reserved.
|
||||
* Copyright (c) 2009-2012 Mellanox Technologies. All rights reserved.
|
||||
* Copyright (c) 2012-2015 Los Alamos National Security, LLC. All rights
|
||||
* Copyright (c) 2012-2016 Los Alamos National Security, LLC. All rights
|
||||
* reserved.
|
||||
* Copyright (c) 2013-2014 Cisco Systems, Inc. All rights reserved.
|
||||
* Copyright (c) 2014 Research Organization for Information Science
|
||||
@ -476,14 +476,13 @@ static int calculate_buffer_header_size(mca_coll_ml_module_t *ml_module)
|
||||
MPI_INT, ompi_comm_rank(ml_module->comm),
|
||||
MPI_MAX, comm_size,
|
||||
ranks_in_comm, ml_module->comm);
|
||||
|
||||
free(ranks_in_comm);
|
||||
if (OPAL_UNLIKELY(OMPI_SUCCESS != rc)) {
|
||||
ML_ERROR(("comm_allreduce_pml failed."));
|
||||
return OMPI_ERROR;
|
||||
}
|
||||
|
||||
ml_module->data_offset = (uint32_t) data_offset;
|
||||
free(ranks_in_comm);
|
||||
|
||||
ML_VERBOSE(10, ("The offset is %d", ml_module->data_offset));
|
||||
|
||||
@ -1105,6 +1104,10 @@ static int get_new_subgroup_data (int32_t *all_selected, int size_of_all_selecte
|
||||
|
||||
(*sub_group_meta_data)[sg_id].index_of_first_element=offset;
|
||||
|
||||
if ((*sub_group_meta_data)[sg_id].n_ranks && NULL == temp) {
|
||||
return OMPI_ERROR;
|
||||
}
|
||||
|
||||
for( array_id=0 ; array_id < (*sub_group_meta_data)[sg_id].n_ranks ;
|
||||
array_id++ ) {
|
||||
(*list_of_ranks_in_all_subgroups)[offset+array_id]=
|
||||
@ -1317,14 +1320,12 @@ static int ml_module_set_small_msg_thresholds(mca_coll_ml_module_t *ml_module)
|
||||
BCOL_NUM_OF_FUNCTIONS, MPI_INT,
|
||||
ompi_comm_rank(ml_module->comm), MPI_MIN,
|
||||
comm_size, ranks_in_comm, ml_module->comm);
|
||||
|
||||
free(ranks_in_comm);
|
||||
if (OPAL_UNLIKELY(OMPI_SUCCESS != rc)) {
|
||||
ML_ERROR(("comm_allreduce_pml failed."));
|
||||
return OMPI_ERROR;
|
||||
}
|
||||
|
||||
free(ranks_in_comm);
|
||||
|
||||
return OMPI_SUCCESS;
|
||||
}
|
||||
|
||||
@ -2319,9 +2320,6 @@ static int mca_coll_ml_fill_in_route_tab(mca_coll_ml_topology_t *topo, ompi_comm
|
||||
|
||||
int32_t **route_table = NULL;
|
||||
int32_t *all_reachable_ranks = NULL;
|
||||
|
||||
struct ompi_proc_t **sbgp_procs = NULL;
|
||||
|
||||
mca_sbgp_base_module_t *sbgp_group = NULL;
|
||||
comm_size = ompi_comm_size(comm);
|
||||
|
||||
@ -2500,13 +2498,7 @@ static int mca_coll_ml_fill_in_route_tab(mca_coll_ml_topology_t *topo, ompi_comm
|
||||
free(route_table);
|
||||
}
|
||||
|
||||
if (NULL != sbgp_procs) {
|
||||
free(sbgp_procs);
|
||||
}
|
||||
|
||||
if (NULL != all_reachable_ranks) {
|
||||
free(all_reachable_ranks);
|
||||
}
|
||||
|
||||
return rc;
|
||||
}
|
||||
@ -2668,6 +2660,7 @@ static int check_for_max_supported_ml_modules(struct ompi_communicator_t *comm)
|
||||
1 , MPI_INT, ompi_comm_rank(comm),
|
||||
MPI_MIN, ompi_comm_size(comm), comm_ranks,
|
||||
comm);
|
||||
free(comm_ranks);
|
||||
if (OMPI_SUCCESS != ret) {
|
||||
ML_ERROR(("comm_allreduce - failed to collect max_comm data"));
|
||||
return ret;
|
||||
@ -2680,8 +2673,6 @@ static int check_for_max_supported_ml_modules(struct ompi_communicator_t *comm)
|
||||
--cs->max_comm;
|
||||
}
|
||||
|
||||
free(comm_ranks);
|
||||
|
||||
return OMPI_SUCCESS;
|
||||
}
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
/*
|
||||
* Copyright (c) 2009-2013 Oak Ridge National Laboratory. All rights reserved.
|
||||
* Copyright (c) 2009-2012 Mellanox Technologies. All rights reserved.
|
||||
* Copyright (c) 2012-2014 Los Alamos National Security, LLC. All rights
|
||||
* Copyright (c) 2012-2016 Los Alamos National Security, LLC. All rights
|
||||
* reserved.
|
||||
* Copyright (c) 2013-2014 Cisco Systems, Inc. All rights reserved.
|
||||
* Copyright (c) 2014 Research Organization for Information Science
|
||||
@ -127,8 +127,7 @@ static int add_to_invoke_table(mca_bcol_base_module_t *bcol_module,
|
||||
struct mca_bcol_base_coll_fn_invoke_attributes_t *inv_attribs = NULL;
|
||||
int bcoll_type, data_src_type, waiting_semantic;
|
||||
int range_min,range_max;
|
||||
int i=0,j=0,k=0,mask=1;
|
||||
|
||||
int i=0,j=0,k=0;
|
||||
|
||||
|
||||
if((NULL == fn_filtered->inv_attr)||(NULL == fn_filtered->comm_attr)) {
|
||||
@ -148,7 +147,7 @@ static int add_to_invoke_table(mca_bcol_base_module_t *bcol_module,
|
||||
for (j=0; j<OMPI_OP_NUM_OF_TYPES; j++) {
|
||||
for (k=0; k<OMPI_DATATYPE_MAX_PREDEFINED; k++) {
|
||||
|
||||
if ((inv_attribs->datatype_bitmap & (mask << k)) && (inv_attribs->op_types_bitmap & (mask << j))){
|
||||
if ((inv_attribs->datatype_bitmap & (1ul << k)) && (inv_attribs->op_types_bitmap & (1ul << j))){
|
||||
|
||||
for (i=range_min; i<=range_max; i++) {
|
||||
bcol_module->filtered_fns_table[data_src_type][waiting_semantic][bcoll_type][i][j][k]
|
||||
|
@ -320,7 +320,9 @@ static int ompi_osc_pt2pt_lock_internal (int lock_type, int target, int assert,
|
||||
|
||||
/* check for conflicting lock */
|
||||
if (ompi_osc_pt2pt_module_lock_find (module, target, NULL)) {
|
||||
if (&module->all_sync != lock) {
|
||||
ompi_osc_pt2pt_sync_return (lock);
|
||||
}
|
||||
OPAL_THREAD_UNLOCK(&module->lock);
|
||||
return OMPI_ERR_RMA_CONFLICT;
|
||||
}
|
||||
|
@ -8,7 +8,7 @@
|
||||
* University of Stuttgart. All rights reserved.
|
||||
* Copyright (c) 2004-2005 The Regents of the University of California.
|
||||
* All rights reserved.
|
||||
* Copyright (c) 2007-2015 Los Alamos National Security, LLC. All rights
|
||||
* Copyright (c) 2007-2016 Los Alamos National Security, LLC. All rights
|
||||
* reserved.
|
||||
* Copyright (c) 2012-2013 Sandia National Laboratories. All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
@ -103,18 +103,12 @@ int ompi_osc_rdma_free(ompi_win_t *win)
|
||||
}
|
||||
|
||||
OBJ_DESTRUCT(&module->peer_hash);
|
||||
} else {
|
||||
} else if (NULL != module->comm) {
|
||||
for (int i = 0 ; i < ompi_comm_rank (module->comm) ; ++i) {
|
||||
if (NULL != module->peer_array[i]) {
|
||||
OBJ_RELEASE(module->peer_array[i]);
|
||||
}
|
||||
}
|
||||
|
||||
free (module->peer_array);
|
||||
}
|
||||
|
||||
if (NULL != module->outstanding_lock_array) {
|
||||
free (module->outstanding_lock_array);
|
||||
}
|
||||
|
||||
if (module->local_leaders && MPI_COMM_NULL != module->local_leaders) {
|
||||
@ -129,15 +123,14 @@ int ompi_osc_rdma_free(ompi_win_t *win)
|
||||
ompi_comm_free (&module->comm);
|
||||
}
|
||||
|
||||
if (NULL != module->free_after) {
|
||||
free(module->free_after);
|
||||
}
|
||||
|
||||
if (module->segment_base) {
|
||||
opal_shmem_segment_detach (&module->seg_ds);
|
||||
module->segment_base = NULL;
|
||||
}
|
||||
|
||||
free (module->peer_array);
|
||||
free (module->outstanding_lock_array);
|
||||
free (module->free_after);
|
||||
free (module);
|
||||
|
||||
return OMPI_SUCCESS;
|
||||
|
@ -1,3 +1,4 @@
|
||||
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
|
||||
/*
|
||||
* Copyright (c) 2011-2015 The University of Tennessee and The University
|
||||
* of Tennessee Research Foundation. All rights
|
||||
@ -7,6 +8,8 @@
|
||||
* Copyright (c) 2015 Intel, Inc. All rights reserved
|
||||
* Copyright (c) 2015 Research Organization for Information Science
|
||||
* and Technology (RIST). All rights reserved.
|
||||
* Copyright (c) 2016 Los Alamos National Security, LLC. All rights
|
||||
* reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
@ -31,7 +34,12 @@
|
||||
#include "opal/mca/pmix/pmix.h"
|
||||
|
||||
#define ERR_EXIT(ERR) \
|
||||
do { free(local_pattern); \
|
||||
do { \
|
||||
free (nodes_roots); \
|
||||
free (local_procs); \
|
||||
free (tracker); \
|
||||
free (colors); \
|
||||
free(local_pattern); \
|
||||
return (ERR); } \
|
||||
while(0);
|
||||
|
||||
@ -70,12 +78,20 @@ static int check_oversubscribing(int rank,
|
||||
oversub[0] = local_oversub;
|
||||
for(i = 1; i < num_nodes; i++)
|
||||
if (OMPI_SUCCESS != ( err = MCA_PML_CALL(irecv(&oversub[i], 1, MPI_INT,
|
||||
nodes_roots[i], 111, comm_old, &reqs[i-1]))))
|
||||
nodes_roots[i], 111, comm_old, &reqs[i-1])))) {
|
||||
/* NTH: more needs to be done to correctly clean up here */
|
||||
free (reqs);
|
||||
free (oversub);
|
||||
return err;
|
||||
}
|
||||
|
||||
if (OMPI_SUCCESS != ( err = ompi_request_wait_all(num_nodes-1,
|
||||
reqs, MPI_STATUSES_IGNORE)))
|
||||
reqs, MPI_STATUSES_IGNORE))) {
|
||||
/* NTH: more needs to be done to correctly clean up here */
|
||||
free (reqs);
|
||||
free (oversub);
|
||||
return err;
|
||||
}
|
||||
|
||||
for(i = 0; i < num_nodes; i++)
|
||||
oversubscribed += oversub[i];
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user