Merge pull request #945 from hjelmn/osc_pt2pt_coverity
osc/pt2pt: fix coveity issues
Этот коммит содержится в:
Коммит
016badac2c
@ -63,7 +63,7 @@ static int ompi_osc_pt2pt_dt_send_complete (ompi_request_t *request)
|
|||||||
OBJ_RELEASE(datatype);
|
OBJ_RELEASE(datatype);
|
||||||
|
|
||||||
OPAL_THREAD_LOCK(&mca_osc_pt2pt_component.lock);
|
OPAL_THREAD_LOCK(&mca_osc_pt2pt_component.lock);
|
||||||
opal_hash_table_get_value_uint32(&mca_osc_pt2pt_component.modules,
|
(void) opal_hash_table_get_value_uint32(&mca_osc_pt2pt_component.modules,
|
||||||
ompi_comm_get_cid(request->req_mpi_object.comm),
|
ompi_comm_get_cid(request->req_mpi_object.comm),
|
||||||
(void **) &module);
|
(void **) &module);
|
||||||
OPAL_THREAD_UNLOCK(&mca_osc_pt2pt_component.lock);
|
OPAL_THREAD_UNLOCK(&mca_osc_pt2pt_component.lock);
|
||||||
@ -619,9 +619,6 @@ int ompi_osc_pt2pt_compare_and_swap (const void *origin_addr, const void *compar
|
|||||||
|
|
||||||
/* compare-and-swaps are always request based, so that we know where to land the data */
|
/* compare-and-swaps are always request based, so that we know where to land the data */
|
||||||
OMPI_OSC_PT2PT_REQUEST_ALLOC(win, request);
|
OMPI_OSC_PT2PT_REQUEST_ALLOC(win, request);
|
||||||
if (NULL == request) {
|
|
||||||
return OMPI_ERR_OUT_OF_RESOURCE;
|
|
||||||
}
|
|
||||||
|
|
||||||
request->type = OMPI_OSC_PT2PT_HDR_TYPE_CSWAP;
|
request->type = OMPI_OSC_PT2PT_HDR_TYPE_CSWAP;
|
||||||
request->origin_addr = origin_addr;
|
request->origin_addr = origin_addr;
|
||||||
@ -705,9 +702,6 @@ int ompi_osc_pt2pt_rput(const void *origin_addr, int origin_count,
|
|||||||
target_count, target_dt->name, win->w_name));
|
target_count, target_dt->name, win->w_name));
|
||||||
|
|
||||||
OMPI_OSC_PT2PT_REQUEST_ALLOC(win, pt2pt_request);
|
OMPI_OSC_PT2PT_REQUEST_ALLOC(win, pt2pt_request);
|
||||||
if (NULL == pt2pt_request) {
|
|
||||||
return OMPI_ERR_OUT_OF_RESOURCE;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* short-circuit case */
|
/* short-circuit case */
|
||||||
if (0 == origin_count || 0 == target_count) {
|
if (0 == origin_count || 0 == target_count) {
|
||||||
@ -764,9 +758,6 @@ static inline int ompi_osc_pt2pt_rget_internal (void *origin_addr, int origin_co
|
|||||||
|
|
||||||
/* gets are always request based, so that we know where to land the data */
|
/* gets are always request based, so that we know where to land the data */
|
||||||
OMPI_OSC_PT2PT_REQUEST_ALLOC(win, pt2pt_request);
|
OMPI_OSC_PT2PT_REQUEST_ALLOC(win, pt2pt_request);
|
||||||
if (NULL == pt2pt_request) {
|
|
||||||
return OMPI_ERR_OUT_OF_RESOURCE;
|
|
||||||
}
|
|
||||||
|
|
||||||
pt2pt_request->internal = release_req;
|
pt2pt_request->internal = release_req;
|
||||||
|
|
||||||
@ -914,9 +905,6 @@ int ompi_osc_pt2pt_raccumulate(const void *origin_addr, int origin_count,
|
|||||||
win->w_name));
|
win->w_name));
|
||||||
|
|
||||||
OMPI_OSC_PT2PT_REQUEST_ALLOC(win, pt2pt_request);
|
OMPI_OSC_PT2PT_REQUEST_ALLOC(win, pt2pt_request);
|
||||||
if (NULL == pt2pt_request) {
|
|
||||||
return OMPI_ERR_OUT_OF_RESOURCE;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* short-circuit case */
|
/* short-circuit case */
|
||||||
if (0 == origin_count || 0 == target_count) {
|
if (0 == origin_count || 0 == target_count) {
|
||||||
@ -979,9 +967,6 @@ int ompi_osc_pt2pt_rget_accumulate_internal (const void *origin_addr, int origin
|
|||||||
|
|
||||||
/* get_accumulates are always request based, so that we know where to land the data */
|
/* get_accumulates are always request based, so that we know where to land the data */
|
||||||
OMPI_OSC_PT2PT_REQUEST_ALLOC(win, pt2pt_request);
|
OMPI_OSC_PT2PT_REQUEST_ALLOC(win, pt2pt_request);
|
||||||
if (OPAL_UNLIKELY(NULL == pt2pt_request)) {
|
|
||||||
return OMPI_ERR_OUT_OF_RESOURCE;
|
|
||||||
}
|
|
||||||
|
|
||||||
pt2pt_request->internal = release_req;
|
pt2pt_request->internal = release_req;
|
||||||
|
|
||||||
|
@ -76,10 +76,6 @@ static void osc_pt2pt_accumulate_data_destructor (osc_pt2pt_accumulate_data_t *a
|
|||||||
if (acc_data->datatype) {
|
if (acc_data->datatype) {
|
||||||
OBJ_RELEASE(acc_data->datatype);
|
OBJ_RELEASE(acc_data->datatype);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (acc_data->op) {
|
|
||||||
OBJ_RELEASE(acc_data->op);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
OBJ_CLASS_DECLARATION(osc_pt2pt_accumulate_data_t);
|
OBJ_CLASS_DECLARATION(osc_pt2pt_accumulate_data_t);
|
||||||
@ -644,7 +640,6 @@ static int osc_pt2pt_accumulate_allocate (ompi_osc_pt2pt_module_t *module, int p
|
|||||||
acc_data->datatype = datatype;
|
acc_data->datatype = datatype;
|
||||||
OBJ_RETAIN(datatype);
|
OBJ_RETAIN(datatype);
|
||||||
acc_data->op = op;
|
acc_data->op = op;
|
||||||
OBJ_RETAIN(op);
|
|
||||||
acc_data->request_count = request_count;
|
acc_data->request_count = request_count;
|
||||||
|
|
||||||
*acc_data_out = acc_data;
|
*acc_data_out = acc_data;
|
||||||
@ -813,8 +808,6 @@ static int ompi_osc_pt2pt_acc_start (ompi_osc_pt2pt_module_t *module, int source
|
|||||||
ret = osc_pt2pt_accumulate_buffer (target, data, data_len, proc, acc_header->count,
|
ret = osc_pt2pt_accumulate_buffer (target, data, data_len, proc, acc_header->count,
|
||||||
datatype, op);
|
datatype, op);
|
||||||
|
|
||||||
OBJ_RELEASE(op);
|
|
||||||
|
|
||||||
ompi_osc_pt2pt_accumulate_unlock (module);
|
ompi_osc_pt2pt_accumulate_unlock (module);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
@ -890,8 +883,6 @@ static int ompi_osc_pt2pt_acc_long_start (ompi_osc_pt2pt_module_t *module, int s
|
|||||||
}
|
}
|
||||||
} while (0);
|
} while (0);
|
||||||
|
|
||||||
OBJ_RELEASE(op);
|
|
||||||
|
|
||||||
if (OPAL_UNLIKELY(OMPI_SUCCESS != ret)) {
|
if (OPAL_UNLIKELY(OMPI_SUCCESS != ret)) {
|
||||||
ompi_osc_pt2pt_accumulate_unlock (module);
|
ompi_osc_pt2pt_accumulate_unlock (module);
|
||||||
}
|
}
|
||||||
@ -941,8 +932,6 @@ static int ompi_osc_pt2pt_gacc_start (ompi_osc_pt2pt_module_t *module, int sourc
|
|||||||
}
|
}
|
||||||
} while (0);
|
} while (0);
|
||||||
|
|
||||||
OBJ_RELEASE(op);
|
|
||||||
|
|
||||||
if (OPAL_UNLIKELY(OMPI_SUCCESS != ret)) {
|
if (OPAL_UNLIKELY(OMPI_SUCCESS != ret)) {
|
||||||
ompi_osc_pt2pt_accumulate_unlock (module);
|
ompi_osc_pt2pt_accumulate_unlock (module);
|
||||||
}
|
}
|
||||||
@ -1022,8 +1011,6 @@ static int ompi_osc_gacc_long_start (ompi_osc_pt2pt_module_t *module, int source
|
|||||||
}
|
}
|
||||||
} while (0);
|
} while (0);
|
||||||
|
|
||||||
OBJ_RELEASE(op);
|
|
||||||
|
|
||||||
if (OPAL_UNLIKELY(OMPI_SUCCESS != ret)) {
|
if (OPAL_UNLIKELY(OMPI_SUCCESS != ret)) {
|
||||||
ompi_osc_pt2pt_accumulate_unlock (module);
|
ompi_osc_pt2pt_accumulate_unlock (module);
|
||||||
}
|
}
|
||||||
|
@ -332,8 +332,10 @@ static int ompi_osc_pt2pt_lock_internal (int lock_type, int target, int assert,
|
|||||||
ret = ompi_osc_pt2pt_lock_internal_execute (module, lock);
|
ret = ompi_osc_pt2pt_lock_internal_execute (module, lock);
|
||||||
if (OPAL_UNLIKELY(OMPI_SUCCESS != ret)) {
|
if (OPAL_UNLIKELY(OMPI_SUCCESS != ret)) {
|
||||||
OPAL_THREAD_SCOPED_LOCK(&module->lock, ompi_osc_pt2pt_module_lock_remove (module, lock));
|
OPAL_THREAD_SCOPED_LOCK(&module->lock, ompi_osc_pt2pt_module_lock_remove (module, lock));
|
||||||
|
if (&module->all_sync != lock) {
|
||||||
ompi_osc_pt2pt_sync_return (lock);
|
ompi_osc_pt2pt_sync_return (lock);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user