Fix set of coverity issues
List of CIDs (scan.coverity.com): oshmem: 1269787, 1269907, 1270161, 1270162, 1270977, 1270978 ompi: 1270170, 1270172, 1270173 Signed-off-by: Igor Ivanov <Igor.Ivanov@itseez.com>
Этот коммит содержится в:
родитель
426d1ce146
Коммит
010dce307a
@ -107,8 +107,10 @@ static int __fca_comm_new(mca_coll_fca_module_t *fca_module)
|
||||
ompi_communicator_t *comm = fca_module->comm;
|
||||
fca_comm_new_spec_t spec = {0,};
|
||||
int info_size, all_info_size;
|
||||
void *all_info, *my_info;
|
||||
int *rcounts, *displs;
|
||||
void *all_info = NULL;
|
||||
void *my_info = NULL;
|
||||
int *rcounts = NULL;
|
||||
int *displs = NULL;
|
||||
int i, rc, ret, comm_size = ompi_comm_size(fca_module->comm);
|
||||
|
||||
/* call fca_get_rank_info() on node managers only*/
|
||||
@ -361,7 +363,7 @@ static int __create_fca_comm(mca_coll_fca_module_t *fca_module)
|
||||
c_item = (mca_coll_fca_c_cache_item_t *)opal_list_get_next((opal_list_item_t *) c_item)){
|
||||
act_deep++;
|
||||
/* first check the size */
|
||||
if( comm_size == c_item->size){
|
||||
if( c_item && (comm_size == c_item->size)) {
|
||||
/* then we have a potential cache hit */
|
||||
ompi_comm_compare(comm, c_item->comm, &result);
|
||||
if( MPI_CONGRUENT == result) {
|
||||
@ -604,7 +606,7 @@ mca_coll_fca_comm_query(struct ompi_communicator_t *comm, int *priority)
|
||||
{
|
||||
mca_coll_base_module_t *module;
|
||||
int size = ompi_comm_size(comm);
|
||||
int local_peers;
|
||||
int local_peers = 0;
|
||||
mca_coll_fca_module_t *fca_module;
|
||||
|
||||
*priority = 0;
|
||||
|
@ -267,6 +267,9 @@ static int ompi_mtl_mxm_recv_ep_address(ompi_proc_t *source_proc, void **address
|
||||
bail:
|
||||
free(modex_component_name);
|
||||
free(modex_name);
|
||||
if (*address_p) {
|
||||
free(*address_p);
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
|
||||
@ -307,12 +310,14 @@ int ompi_mtl_mxm_module_init(void)
|
||||
MXM_VERBOSE(1, "MXM support will be disabled because of total number "
|
||||
"of processes (%lu) is less than the minimum set by the "
|
||||
"mtl_mxm_np MCA parameter (%u)", totps, ompi_mtl_mxm.mxm_np);
|
||||
free(procs);
|
||||
return OMPI_ERR_NOT_SUPPORTED;
|
||||
}
|
||||
MXM_VERBOSE(1, "MXM support enabled");
|
||||
|
||||
if (ORTE_NODE_RANK_INVALID == (lr = ompi_process_info.my_node_rank)) {
|
||||
MXM_ERROR("Unable to obtain local node rank");
|
||||
free(procs);
|
||||
return OMPI_ERROR;
|
||||
}
|
||||
nlps = ompi_process_info.num_local_peers + 1;
|
||||
@ -322,6 +327,7 @@ int ompi_mtl_mxm_module_init(void)
|
||||
mxlr = max(mxlr, procs[proc]->super.proc_name.vpid);
|
||||
}
|
||||
}
|
||||
free(procs);
|
||||
|
||||
/* Setup the endpoint options and local addresses to bind to. */
|
||||
#if MXM_API < MXM_VERSION(2,0)
|
||||
@ -406,7 +412,7 @@ int ompi_mtl_mxm_add_procs(struct mca_mtl_base_module_t *mtl, size_t nprocs,
|
||||
mxm_conn_req_t *conn_reqs;
|
||||
size_t ep_index = 0;
|
||||
#endif
|
||||
void *ep_address;
|
||||
void *ep_address = NULL;
|
||||
size_t ep_address_len;
|
||||
mxm_error_t err;
|
||||
size_t i;
|
||||
@ -502,13 +508,16 @@ bail:
|
||||
free(conn_reqs);
|
||||
free(ep_info);
|
||||
#endif
|
||||
if (ep_address) {
|
||||
free(ep_address);
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
|
||||
int ompi_mtl_add_single_proc(struct mca_mtl_base_module_t *mtl,
|
||||
struct ompi_proc_t* procs)
|
||||
{
|
||||
void *ep_address;
|
||||
void *ep_address = NULL;
|
||||
size_t ep_address_len;
|
||||
mxm_error_t err;
|
||||
int rc;
|
||||
@ -548,6 +557,7 @@ int ompi_mtl_add_single_proc(struct mca_mtl_base_module_t *mtl,
|
||||
"unknown" : procs->proc_hostname,
|
||||
mxm_error_string(conn_reqs.error));
|
||||
}
|
||||
free(ep_address);
|
||||
return OMPI_ERROR;
|
||||
}
|
||||
|
||||
@ -562,6 +572,7 @@ int ompi_mtl_add_single_proc(struct mca_mtl_base_module_t *mtl,
|
||||
err = mxm_ep_connect(ompi_mtl_mxm.ep, ep_address, &endpoint->mxm_conn);
|
||||
if (err != MXM_OK) {
|
||||
MXM_ERROR("MXM returned connect error: %s\n", mxm_error_string(err));
|
||||
free(ep_address);
|
||||
return OMPI_ERROR;
|
||||
}
|
||||
procs->proc_endpoints[OMPI_PROC_ENDPOINT_TAG_MTL] = endpoint;
|
||||
|
@ -121,7 +121,7 @@ int mca_memheap_base_select()
|
||||
opal_list_remove_item(&oshmem_memheap_base_framework.framework_components, &cli->super);
|
||||
mca_base_component_close((mca_base_component_t *) component,
|
||||
oshmem_memheap_base_framework.framework_output);
|
||||
|
||||
} else {
|
||||
/* Calculate memheap size in case it was not set during component initialization */
|
||||
module->memheap_size = context->user_size;
|
||||
}
|
||||
|
@ -413,7 +413,7 @@ static int _algorithm_recursive_doubling(struct oshmem_group_t *group,
|
||||
SCOLL_VERBOSE(12,
|
||||
"[#%d] Restore special synchronization array",
|
||||
group->my_pe);
|
||||
for (i = 0; pSync && (i < _SHMEM_BARRIER_SYNC_SIZE); i++) {
|
||||
for (i = 0; i < _SHMEM_BARRIER_SYNC_SIZE; i++) {
|
||||
pSync[i] = _SHMEM_SYNC_VALUE;
|
||||
}
|
||||
|
||||
|
@ -427,11 +427,13 @@ int mca_spml_ikrit_add_procs(oshmem_proc_t** procs, size_t nprocs)
|
||||
#if MXM_API < MXM_VERSION(2,0)
|
||||
if (OSHMEM_SUCCESS
|
||||
!= spml_ikrit_get_ep_address(&my_ep_info, MXM_PTL_SELF)) {
|
||||
return OSHMEM_ERROR;
|
||||
rc = OSHMEM_ERROR;
|
||||
goto bail;
|
||||
}
|
||||
if (OSHMEM_SUCCESS
|
||||
!= spml_ikrit_get_ep_address(&my_ep_info, MXM_PTL_RDMA)) {
|
||||
return OSHMEM_ERROR;
|
||||
rc = OSHMEM_ERROR;
|
||||
goto bail;
|
||||
}
|
||||
#else
|
||||
if (mca_spml_ikrit.hw_rdma_channel) {
|
||||
@ -439,7 +441,8 @@ int mca_spml_ikrit_add_procs(oshmem_proc_t** procs, size_t nprocs)
|
||||
if (MXM_OK != err) {
|
||||
orte_show_help("help-oshmem-spml-ikrit.txt", "unable to get endpoint address", true,
|
||||
mxm_error_string(err));
|
||||
return OSHMEM_ERROR;
|
||||
rc = OSHMEM_ERROR;
|
||||
goto bail;
|
||||
}
|
||||
oshmem_shmem_allgather(&my_ep_info, ep_hw_rdma_info,
|
||||
sizeof(spml_ikrit_mxm_ep_conn_info_t));
|
||||
@ -448,7 +451,8 @@ int mca_spml_ikrit_add_procs(oshmem_proc_t** procs, size_t nprocs)
|
||||
if (MXM_OK != err) {
|
||||
orte_show_help("help-oshmem-spml-ikrit.txt", "unable to get endpoint address", true,
|
||||
mxm_error_string(err));
|
||||
return OSHMEM_ERROR;
|
||||
rc = OSHMEM_ERROR;
|
||||
goto bail;
|
||||
}
|
||||
#endif
|
||||
oshmem_shmem_allgather(&my_ep_info, ep_info,
|
||||
|
@ -562,7 +562,6 @@ static int create_btl_idx(int dst_pe)
|
||||
/*Chose SHMEM capable btl from eager array. Not filter now: take the first
|
||||
(but could appear on demand).*/
|
||||
shmem_index = 0;
|
||||
bml_btl = mca_bml_base_btl_array_get_index(btl_array, shmem_index);
|
||||
size = 1;
|
||||
}
|
||||
else {
|
||||
@ -673,7 +672,7 @@ int mca_spml_yoda_del_procs(oshmem_proc_t** procs, size_t nprocs)
|
||||
static inline mca_bml_base_btl_t *get_next_btl(int dst, int *btl_id)
|
||||
{
|
||||
mca_bml_base_endpoint_t* endpoint;
|
||||
mca_bml_base_btl_t* bml_btl;
|
||||
mca_bml_base_btl_t* bml_btl = NULL;
|
||||
oshmem_proc_t *proc;
|
||||
mca_bml_base_btl_array_t *btl_array = 0;
|
||||
int shmem_index = -1;
|
||||
@ -704,17 +703,12 @@ static inline mca_bml_base_btl_t *get_next_btl(int dst, int *btl_id)
|
||||
*/
|
||||
size = mca_bml_base_btl_array_get_size(btl_array =
|
||||
&endpoint->btl_eager);
|
||||
if (0 < size) {
|
||||
/*Chose SHMEM capable btl from eager array. Not filter now: take the first
|
||||
(but could appear on demand).*/
|
||||
shmem_index = 0;
|
||||
bml_btl = mca_bml_base_btl_array_get_index(btl_array, shmem_index);
|
||||
size = 1;
|
||||
}
|
||||
}
|
||||
if (0 < size) {
|
||||
shmem_index = 0;
|
||||
bml_btl = mca_bml_base_btl_array_get_index(btl_array, shmem_index);
|
||||
}
|
||||
|
||||
shmem_index = 0;
|
||||
bml_btl = mca_bml_base_btl_array_get_index(btl_array, shmem_index);
|
||||
*btl_id = proc->transport_ids[0];
|
||||
|
||||
#if SPML_YODA_DEBUG == 1
|
||||
|
@ -25,7 +25,7 @@ oshmem_group_t* find_group_in_cache(int PE_start, int logPE_stride, int PE_size)
|
||||
for (item = opal_list_get_first(&oshmem_group_cache_list);
|
||||
item != opal_list_get_end(&oshmem_group_cache_list);
|
||||
item = opal_list_get_next(item)) {
|
||||
if (!memcmp(((oshmem_group_cache_t *) item)->cache_id,
|
||||
if (item && !memcmp(((oshmem_group_cache_t *) item)->cache_id,
|
||||
cache_look_up_id,
|
||||
3 * sizeof(int))) {
|
||||
return ((oshmem_group_cache_t *) item)->group;
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user