Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions cpp/src/request.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,7 @@ void Request::checkError()
utils::ucsErrorThrow(_status, _status == UCS_ERR_MESSAGE_TRUNCATED ? _status_msg : std::string());
}

bool Request::isCompleted()
{
std::lock_guard<std::recursive_mutex> lock(_mutex);
return _status != UCS_INPROGRESS;
}
bool Request::isCompleted() { return _status != UCS_INPROGRESS; }

void Request::callback(void* request, ucs_status_t status)
{
Expand Down
12 changes: 4 additions & 8 deletions python/ucxx/ucxx/_lib/libucxx.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -771,9 +771,6 @@ cdef class UCXWorker():
cdef Tag cpp_tag = <Tag><size_t>tag.value
cdef TagMask cpp_tag_mask = <TagMask><size_t>tag_mask.value

if not self._context_feature_flags & Feature.TAG.value:
raise ValueError("UCXContext must be created with `Feature.TAG`")

with nogil:
req = self._worker.get().tagRecv(
buf,
Expand All @@ -789,13 +786,16 @@ cdef class UCXWorker():
cdef class UCXRequest():
cdef:
shared_ptr[Request] _request
Request* _request_ptr
bint _enable_python_future
bint _completed

def __init__(self, uintptr_t shared_ptr_request, bint enable_python_future) -> None:
self._request = deref(<shared_ptr[Request] *> shared_ptr_request)
self._enable_python_future = enable_python_future
self._completed = False
with nogil:
self._request_ptr = self._request.get()

def __dealloc__(self) -> None:
with nogil:
Expand All @@ -810,7 +810,7 @@ cdef class UCXRequest():
return True

with nogil:
completed = self._request.get().isCompleted()
completed = self._request_ptr.isCompleted()

return completed

Expand Down Expand Up @@ -1407,8 +1407,6 @@ cdef class UCXEndpoint():
cdef shared_ptr[Request] req
cdef Tag cpp_tag = <Tag><size_t>tag.value

if not self._context_feature_flags & Feature.TAG.value:
raise ValueError("UCXContext must be created with `Feature.TAG`")
if arr.cuda and not self._cuda_support:
raise ValueError(
"UCX is not configured with CUDA support, please ensure that the "
Expand Down Expand Up @@ -1439,8 +1437,6 @@ cdef class UCXEndpoint():
cdef Tag cpp_tag = <Tag><size_t>tag.value
cdef TagMask cpp_tag_mask = <TagMask><size_t>tag_mask.value

if not self._context_feature_flags & Feature.TAG.value:
raise ValueError("UCXContext must be created with `Feature.TAG`")
if arr.cuda and not self._cuda_support:
raise ValueError(
"UCX is not configured with CUDA support, please ensure that the "
Expand Down