MCA/UCX: added opal progress call to wait request routine
- added opal_progress call to wait function to avoid possible [dead]lock issues - wait call is declared as inline - minor fixes Signed-off-by: Sergey Oblomov <sergeyo@mellanox.com>
Этот коммит содержится в:
родитель
bbaffd3681
Коммит
0c3ed93ef0
@ -62,8 +62,33 @@ OBJ_CLASS_DECLARATION(mca_atomic_ucx_module_t);
|
||||
|
||||
|
||||
void mca_atomic_ucx_complete_cb(void *request, ucs_status_t status);
|
||||
ucs_status_t mca_atomic_ucx_wait_request(ucs_status_ptr_t request);
|
||||
|
||||
static inline
|
||||
ucs_status_t mca_atomic_ucx_wait_request(ucs_status_ptr_t request)
|
||||
{
|
||||
ucs_status_t status;
|
||||
int i;
|
||||
|
||||
/* check for request completed or failed */
|
||||
if (UCS_OK == request) {
|
||||
return UCS_OK;
|
||||
} else if (UCS_PTR_IS_ERR(request)) {
|
||||
return UCS_PTR_STATUS(request);
|
||||
}
|
||||
|
||||
while (1) {
|
||||
/* call UCX progress */
|
||||
for (i = 0; i < 100; i++) {
|
||||
if (UCS_INPROGRESS != (status = ucp_request_check_status(request))) {
|
||||
ucp_request_free(request);
|
||||
return status;
|
||||
}
|
||||
ucp_worker_progress(mca_spml_self->ucp_worker);
|
||||
}
|
||||
/* call OPAL progress on every 100 call to UCX progress */
|
||||
opal_progress();
|
||||
}
|
||||
}
|
||||
END_C_DECLS
|
||||
|
||||
#endif /* MCA_ATOMIC_MXM_H */
|
||||
#endif /* MCA_ATOMIC_UCX_H */
|
||||
|
@ -57,6 +57,7 @@ int mca_atomic_ucx_cswap(void *target,
|
||||
break;
|
||||
default:
|
||||
assert(0); /* should not be here */
|
||||
status = UCS_ERR_INVALID_PARAM;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -53,20 +53,3 @@ void mca_atomic_ucx_complete_cb(void *request, ucs_status_t status)
|
||||
{
|
||||
}
|
||||
|
||||
ucs_status_t mca_atomic_ucx_wait_request(ucs_status_ptr_t request)
|
||||
{
|
||||
ucs_status_t status;
|
||||
|
||||
/* check for request completed or failed */
|
||||
if (UCS_OK == request) {
|
||||
return UCS_OK;
|
||||
} else if (UCS_PTR_IS_ERR(request)) {
|
||||
return UCS_PTR_STATUS(request);
|
||||
}
|
||||
|
||||
while (UCS_INPROGRESS == (status = ucp_request_check_status(request))) {
|
||||
ucp_worker_progress(mca_spml_self->ucp_worker);
|
||||
}
|
||||
ucp_request_free(request);
|
||||
return status;
|
||||
}
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user