Skip to content

Commit

Permalink
add back probing
Browse files Browse the repository at this point in the history
  • Loading branch information
vchuravy committed Feb 17, 2021
1 parent d8aae52 commit 6b52b0f
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions src/UCX.jl
Original file line number Diff line number Diff line change
Expand Up @@ -505,6 +505,35 @@ end

# UCX probe & probe msg receive

struct UCXMessage
handle::API.ucp_tag_message_h
info::API.ucp_tag_recv_info_t
end

function probe(worker::UCXWorker, tag, tag_mask=~zero(UCX.API.ucp_tag_t); remove=true)
info = Ref{API.ucp_tag_recv_info_t}()
msg = API.ucp_tag_probe_nb(worker, tag, tag_mask, remove, info)
if msg == C_NULL
return nothing
else
return UCXMessage(msg, info[])
end
end

# function recv(worker::UCXWorker, buffer, nbytes, msg::UCXMessage)
# dt = ucp_dt_make_contig(1) # since we are receiving nbytes
# request = UCXRequest(worker, buffer) # rooted through worker
# cb = @cfunction(recv_callback, Cvoid, (Ptr{Cvoid}, API.ucs_status_t, Ptr{API.ucp_tag_recv_info_t}, Ptr{Cvoid}))

# param = request_param(dt, request, cb)

# GC.@preserve buffer begin
# data = pointer(buffer)
# ptr = API.ucp_tag_msg_recv_nbx(worker, data, nbytes, tag, tag_mask, param)
# return handle_request(request, ptr)
# end
# end

##
# UCX stream interface
##
Expand Down

0 comments on commit 6b52b0f

Please sign in to comment.