Skip to content
Merged
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: 3 additions & 3 deletions src/include/mpir_gpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,15 +108,15 @@ MPL_STATIC_INLINE_PREFIX bool MPIR_GPU_query_pointer_is_dev(const void *ptr)
return false;
}

MPL_STATIC_INLINE_PREFIX bool MPIR_GPU_query_pointer_is_strict_dev(const void *ptr)
MPL_STATIC_INLINE_PREFIX bool MPIR_GPU_query_pointer_is_host(const void *ptr)
{
if (ENABLE_GPU && ptr != NULL) {
MPL_pointer_attr_t attr;
MPIR_GPU_query_pointer_attr(ptr, &attr);
return MPL_gpu_attr_is_strict_dev(&attr);
return MPL_gpu_attr_is_host(&attr);
}

return false;
return true;
}

/* gpu registration or pinning has huge latency (~500us), thus the following
Expand Down
4 changes: 2 additions & 2 deletions src/include/mpir_gpu_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ MPL_STATIC_INLINE_PREFIX void *MPIR_gpu_host_alloc(const void *buf,
MPL_pointer_attr_t attr;
MPIR_GPU_query_pointer_attr(buf, &attr);

/* FIXME: do we allocate buffer for non-strict dev buffer? */
if (!MPL_gpu_attr_is_strict_dev(&attr)) {
/* FIXME: do we allocate buffer for memory that is neither host nor device? */

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The question is whether non-strict dev buffer can operated like a host buf, e.g. memcpy, a+=b. Run a test to check

if (!MPL_gpu_attr_is_dev(&attr)) {
return NULL;
} else {
return MPIR_alloc_buffer(count, datatype);
Expand Down
2 changes: 1 addition & 1 deletion src/mpi/coll/algorithms/circ_graph/cga_request_queue.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ static int init_request_queue_common(MPII_cga_request_queue * queue,
MPIR_Datatype_is_contig(datatype, &dt_contig);

MPIR_GPU_query_pointer_attr(buf, &queue->attr);
queue->need_pack = (!dt_contig || MPL_gpu_attr_is_dev(&queue->attr));
queue->need_pack = (!dt_contig || !MPL_gpu_attr_is_host(&queue->attr));

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Depend on the same question as prev.


queue->comm = comm;
queue->coll_attr = coll_attr;
Expand Down
2 changes: 1 addition & 1 deletion src/mpi/datatype/typerep/src/typerep_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ yaksa_type_t MPII_Typerep_get_yaksa_op(MPI_Op op);
static inline yaksa_info_t MPII_yaksa_get_info(MPL_pointer_attr_t * inattr,
MPL_pointer_attr_t * outattr)
{
if (!MPL_gpu_attr_is_dev(inattr) && !MPL_gpu_attr_is_dev(outattr)) {
if (MPL_gpu_attr_is_host(inattr) && MPL_gpu_attr_is_host(outattr)) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same question

return MPII_yaksa_info_nogpu;
}

Expand Down
22 changes: 11 additions & 11 deletions src/mpi/misc/utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -167,9 +167,9 @@ static int do_localcopy(const void *sendbuf, MPI_Aint sendcount, MPI_Datatype se
MPIR_GPU_query_pointer_attr(sendbuf, &send_attr);
MPIR_GPU_query_pointer_attr(recvbuf, &recv_attr);

if (MPL_gpu_attr_is_strict_dev(&send_attr) && MPL_gpu_attr_is_strict_dev(&recv_attr)) {
if (MPL_gpu_attr_is_dev(&send_attr) && MPL_gpu_attr_is_dev(&recv_attr)) {
MPL_gpu_malloc((void **) &buf, COPY_BUFFER_SZ, recv_attr.device);
} else if (MPL_gpu_attr_is_strict_dev(&send_attr) || MPL_gpu_attr_is_strict_dev(&recv_attr)) {
} else if (MPL_gpu_attr_is_dev(&send_attr) || MPL_gpu_attr_is_dev(&recv_attr)) {
MPL_gpu_malloc_host((void **) &buf, COPY_BUFFER_SZ);
} else {
MPIR_CHKLMEM_MALLOC(buf, COPY_BUFFER_SZ);
Expand Down Expand Up @@ -212,9 +212,9 @@ static int do_localcopy(const void *sendbuf, MPI_Aint sendcount, MPI_Datatype se
}
}

if (MPL_gpu_attr_is_strict_dev(&send_attr) && MPL_gpu_attr_is_strict_dev(&recv_attr)) {
if (MPL_gpu_attr_is_dev(&send_attr) && MPL_gpu_attr_is_dev(&recv_attr)) {
MPL_gpu_free(buf);
} else if (MPL_gpu_attr_is_strict_dev(&send_attr) || MPL_gpu_attr_is_strict_dev(&recv_attr)) {
} else if (MPL_gpu_attr_is_dev(&send_attr) || MPL_gpu_attr_is_dev(&recv_attr)) {
MPL_gpu_free_host(buf);
}
}
Expand All @@ -225,9 +225,9 @@ static int do_localcopy(const void *sendbuf, MPI_Aint sendcount, MPI_Datatype se
return mpi_errno;
fn_fail:
if (buf) {
if (MPL_gpu_attr_is_strict_dev(&send_attr) && MPL_gpu_attr_is_strict_dev(&recv_attr)) {
if (MPL_gpu_attr_is_dev(&send_attr) && MPL_gpu_attr_is_dev(&recv_attr)) {
MPL_gpu_free(buf);
} else if (MPL_gpu_attr_is_strict_dev(&send_attr) || MPL_gpu_attr_is_strict_dev(&recv_attr)) {
} else if (MPL_gpu_attr_is_dev(&send_attr) || MPL_gpu_attr_is_dev(&recv_attr)) {
MPL_gpu_free_host(buf);
}
}
Expand Down Expand Up @@ -316,13 +316,13 @@ static int do_localcopy_gpu(const void *sendbuf, MPI_Aint sendcount, MPI_Datatyp
}

MPL_gpu_copy_direction_t dir;
if (send_attr->type == MPL_GPU_POINTER_DEV) {
if (recv_attr->type == MPL_GPU_POINTER_DEV) {
if (MPL_gpu_attr_is_dev(send_attr)) {
if (MPL_gpu_attr_is_dev(recv_attr)) {
dir = MPL_GPU_COPY_D2D_OUTGOING;
} else {
dir = MPL_GPU_COPY_D2H;
}
} else if (recv_attr->type == MPL_GPU_POINTER_DEV) {
} else if (MPL_gpu_attr_is_dev(recv_attr)) {
dir = MPL_GPU_COPY_H2D;
} else {
dir = MPL_GPU_COPY_DIRECTION_NONE;
Expand All @@ -348,12 +348,12 @@ static int do_localcopy_gpu(const void *sendbuf, MPI_Aint sendcount, MPI_Datatyp
gpu_req->type = MPIR_NULL_REQUEST;
}
} else {
if (MPL_gpu_attr_is_strict_dev(send_attr)) {
if (MPL_gpu_attr_is_dev(send_attr)) {
dev_id = MPL_gpu_get_dev_id_from_attr(send_attr);
}

if (dev_id == -1) {
if (MPL_gpu_attr_is_strict_dev(recv_attr)) {
if (MPL_gpu_attr_is_dev(recv_attr)) {
dev_id = MPL_gpu_get_dev_id_from_attr(recv_attr);
} else {
/* fallback to do_localcopy */
Expand Down
14 changes: 7 additions & 7 deletions src/mpi/stream/stream_enqueue.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ int MPIR_Send_enqueue_impl(const void *buf, MPI_Aint count, MPI_Datatype datatyp
p->comm_ptr = comm_ptr;
MPIR_Comm_add_ref(comm_ptr);

if (MPIR_GPU_query_pointer_is_dev(buf)) {
if (!MPIR_GPU_query_pointer_is_host(buf)) {
MPI_Aint dt_size;
MPIR_Datatype_get_size_macro(datatype, dt_size);
p->data_sz = dt_size * count;
Expand Down Expand Up @@ -169,7 +169,7 @@ int MPIR_Recv_enqueue_impl(void *buf, MPI_Aint count, MPI_Datatype datatype,
p->status = status;
MPIR_Comm_add_ref(comm_ptr);

if (MPIR_GPU_query_pointer_is_dev(buf)) {
if (!MPIR_GPU_query_pointer_is_host(buf)) {
MPI_Aint dt_size;
MPIR_Datatype_get_size_macro(datatype, dt_size);
p->data_sz = dt_size * count;
Expand Down Expand Up @@ -245,7 +245,7 @@ int MPIR_Isend_enqueue_impl(const void *buf, MPI_Aint count, MPI_Datatype dataty
p->comm_ptr = comm_ptr;
MPIR_Comm_add_ref(comm_ptr);

if (MPIR_GPU_query_pointer_is_dev(buf)) {
if (!MPIR_GPU_query_pointer_is_host(buf)) {
MPI_Aint dt_size;
MPIR_Datatype_get_size_macro(datatype, dt_size);
p->data_sz = dt_size * count;
Expand Down Expand Up @@ -319,7 +319,7 @@ int MPIR_Irecv_enqueue_impl(void *buf, MPI_Aint count, MPI_Datatype datatype,
p->datatype = datatype;
MPIR_Comm_add_ref(comm_ptr);

if (MPIR_GPU_query_pointer_is_dev(buf)) {
if (!MPIR_GPU_query_pointer_is_host(buf)) {
MPI_Aint dt_size;
MPIR_Datatype_get_size_macro(datatype, dt_size);
p->data_sz = dt_size * count;
Expand Down Expand Up @@ -685,18 +685,18 @@ int MPIR_Allreduce_enqueue_impl(const void *sendbuf, void *recvbuf,

/* Buffer swap. We need additional temp buffer size for noncontig datatype */
if (sendbuf == MPI_IN_PLACE) {
if (MPIR_GPU_query_pointer_is_dev(recvbuf)) {
if (!MPIR_GPU_query_pointer_is_host(recvbuf)) {
p->host_recvbuf = MPIR_alloc_buffer(count, datatype);
HOST_SWAP_STREAM(p->host_recvbuf, recvbuf, count, datatype, &gpu_stream,
is_contig, p->tmp_buf, p->data_sz);
}
} else {
void *use_recvbuf = recvbuf;
if (MPIR_GPU_query_pointer_is_dev(recvbuf)) {
if (!MPIR_GPU_query_pointer_is_host(recvbuf)) {
p->host_recvbuf = MPIR_alloc_buffer(count, datatype);
use_recvbuf = p->host_recvbuf;
}
if (MPIR_GPU_query_pointer_is_dev(sendbuf)) {
if (!MPIR_GPU_query_pointer_is_host(sendbuf)) {
/* copy the sendbuf to recvbuf and do IN_PLACE allreduce in callback */
p->sendbuf_is_dev = true;
HOST_SWAP_STREAM(use_recvbuf, sendbuf, count, datatype, &gpu_stream,
Expand Down
2 changes: 1 addition & 1 deletion src/mpid/ch4/netmod/ofi/mr_cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ int MPIDI_OFI_register_memory_and_bind(char *buf, size_t data_sz,
void *bounds_base;
uintptr_t bounds_len;
MPL_gpu_buffer_id_t buffer_id;
if (MPL_gpu_attr_is_dev(attr)) {
if (!MPL_gpu_attr_is_host(attr)) {
int mpl_err = MPL_gpu_get_buffer_bounds(buf, &bounds_base, &bounds_len);
MPIR_ERR_CHKANDJUMP(mpl_err != MPL_SUCCESS, mpi_errno, MPI_ERR_OTHER,
"**gpu_get_buffer_info");
Expand Down
12 changes: 6 additions & 6 deletions src/mpid/ch4/netmod/ofi/ofi_am_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -512,9 +512,9 @@ MPL_STATIC_INLINE_PREFIX int MPIDI_OFI_do_am_isend_eager(int rank, MPIR_Comm * c

MPL_pointer_attr_t attr;
MPIR_GPU_query_pointer_attr(buf, &attr);
if (MPL_gpu_attr_is_dev(&attr)) {
if (!MPL_gpu_attr_is_host(&attr)) {
MPIDI_OFI_register_am_bufs();
if (!MPIDI_OFI_ENABLE_HMEM || !MPL_gpu_attr_is_strict_dev(&attr)) {
if (!MPIDI_OFI_ENABLE_HMEM || !MPL_gpu_attr_is_dev(&attr)) {
/* Force packing of GPU buffer in host memory */
need_packing = true;
}
Expand Down Expand Up @@ -619,9 +619,9 @@ MPL_STATIC_INLINE_PREFIX int MPIDI_OFI_do_am_isend_pipeline(int rank, MPIR_Comm

MPL_pointer_attr_t attr;
MPIR_GPU_query_pointer_attr(buf, &attr);
if (MPL_gpu_attr_is_dev(&attr)) {
if (!MPL_gpu_attr_is_host(&attr)) {
MPIDI_OFI_register_am_bufs();
if (!MPIDI_OFI_ENABLE_HMEM || !MPL_gpu_attr_is_strict_dev(&attr)) {
if (!MPIDI_OFI_ENABLE_HMEM || !MPL_gpu_attr_is_dev(&attr)) {
/* Force packing of GPU buffer in host memory */
need_packing = true;
}
Expand Down Expand Up @@ -725,9 +725,9 @@ MPL_STATIC_INLINE_PREFIX int MPIDI_OFI_do_am_isend_rdma_read(int rank, MPIR_Comm

MPL_pointer_attr_t attr;
MPIR_GPU_query_pointer_attr(buf, &attr);
if (MPL_gpu_attr_is_dev(&attr)) {
if (!MPL_gpu_attr_is_host(&attr)) {
MPIDI_OFI_register_am_bufs();
if (!MPIDI_OFI_ENABLE_HMEM || !MPL_gpu_attr_is_strict_dev(&attr)) {
if (!MPIDI_OFI_ENABLE_HMEM || !MPL_gpu_attr_is_dev(&attr)) {
/* Force packing of GPU buffer in host memory */
need_packing = true;
}
Expand Down
6 changes: 3 additions & 3 deletions src/mpid/ch4/netmod/ofi/ofi_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,7 @@ MPL_STATIC_INLINE_PREFIX bool MPIDI_OFI_is_tag_rndv_pack(uint64_t match_bits)
MPL_STATIC_INLINE_PREFIX bool MPIDI_OFI_rndv_need_pack(int dt_contig, MPL_pointer_attr_t * attr)
{
/* assume noncontig data or device data can benefit from pipelined packing/unpacking */
return (!dt_contig || MPL_gpu_attr_is_dev(attr));
return (!dt_contig || !MPL_gpu_attr_is_host(attr));
}

MPL_STATIC_INLINE_PREFIX uint64_t MPIDI_OFI_init_sendtag(int contextid, int source, int tag)
Expand Down Expand Up @@ -790,7 +790,7 @@ MPL_STATIC_INLINE_PREFIX int MPIDI_OFI_register_memory(char *send_buf, size_t da
mr_attr.requested_key = rkey;
mr_attr.offset = 0;
mr_attr.context = NULL;
if (MPL_gpu_attr_is_strict_dev(attr)) {
if (MPL_gpu_attr_is_dev(attr)) {
#ifdef MPL_HAVE_CUDA
mr_attr.iface = FI_HMEM_CUDA;
mr_attr.device.cuda = MPL_gpu_get_dev_id_from_attr(attr);
Expand Down Expand Up @@ -855,7 +855,7 @@ MPL_STATIC_INLINE_PREFIX void MPIDI_OFI_gpu_rma_register(const void *buffer, siz
MPIR_GPU_query_pointer_attr(buffer, &attr_tmp);
attr = &attr_tmp;
}
if (MPIDI_OFI_ENABLE_HMEM && MPIDI_OFI_ENABLE_MR_HMEM && MPL_gpu_attr_is_strict_dev(attr)) {
if (MPIDI_OFI_ENABLE_HMEM && MPIDI_OFI_ENABLE_MR_HMEM && MPL_gpu_attr_is_dev(attr)) {
mpi_errno = MPIDI_OFI_register_memory_and_bind((char *) buffer, size, attr, ctx_idx, &mr);
MPIR_Assert(mpi_errno == MPI_SUCCESS);
if (mr != NULL) {
Expand Down
4 changes: 2 additions & 2 deletions src/mpid/ch4/netmod/ofi/ofi_recv.h
Original file line number Diff line number Diff line change
Expand Up @@ -183,12 +183,12 @@ MPL_STATIC_INLINE_PREFIX int MPIDI_OFI_do_irecv(void *buf,

if (MPIDI_OFI_ENABLE_HMEM && data_sz >= MPIR_CVAR_CH4_OFI_GPU_RDMA_THRESHOLD &&
MPIDI_OFI_ENABLE_MR_HMEM && dt_contig) {
if (MPL_gpu_attr_is_strict_dev(&attr)) {
if (MPL_gpu_attr_is_dev(&attr)) {
register_mem = true;
}
}

if (data_sz && MPL_gpu_attr_is_dev(&attr)) {
if (data_sz && !MPL_gpu_attr_is_host(&attr)) {
MPIDI_OFI_register_am_bufs();
if (!MPIDI_OFI_ENABLE_HMEM || !dt_contig || (MPIDI_OFI_ENABLE_MR_HMEM && !register_mem)) {
/* FIXME: at this point, GPU data takes host-buffer staging
Expand Down
10 changes: 5 additions & 5 deletions src/mpid/ch4/netmod/ofi/ofi_rma.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ MPL_STATIC_INLINE_PREFIX int MPIDI_OFI_gpu_rma_enabled(const void *ptr)
if (ENABLE_GPU) {
MPL_pointer_attr_t attr;
MPIR_GPU_query_pointer_attr(ptr, &attr);
if (MPL_gpu_attr_is_dev(&attr)) {
if (MPIDI_OFI_ENABLE_HMEM && MPL_gpu_attr_is_strict_dev(&attr)) {
if (!MPL_gpu_attr_is_host(&attr)) {
if (MPIDI_OFI_ENABLE_HMEM && MPL_gpu_attr_is_dev(&attr)) {
return 1;
} else
return 0;
Expand Down Expand Up @@ -249,7 +249,7 @@ MPL_STATIC_INLINE_PREFIX int MPIDI_OFI_do_put(const void *origin_addr,
/* skip fi_inject path for GPU messages because this path can be
* very slow */
if (!sigreq && origin_contig && target_contig &&
(origin_bytes <= MPIDI_OFI_global.max_buffered_write && !MPL_gpu_attr_is_dev(&attr))) {
(origin_bytes <= MPIDI_OFI_global.max_buffered_write && MPL_gpu_attr_is_host(&attr))) {
MPID_THREAD_CS_ENTER(VCI, MPIDI_VCI_LOCK(vci));
MPIDI_OFI_win_cntr_incr(win);
fi_addr_t dest = MPIDI_OFI_av_to_phys(addr, vci, 0, vci_target, nic_target);
Expand Down Expand Up @@ -297,7 +297,7 @@ MPL_STATIC_INLINE_PREFIX int MPIDI_OFI_do_put(const void *origin_addr,
iov.iov_len = target_bytes;

void *desc = NULL;
if (MPL_gpu_attr_is_strict_dev(&attr))
if (MPL_gpu_attr_is_dev(&attr))
MPIDI_OFI_gpu_rma_register(iov.iov_base, iov.iov_len, &attr, win, nic_target, &desc);

msg.desc = &desc;
Expand Down Expand Up @@ -480,7 +480,7 @@ MPL_STATIC_INLINE_PREFIX int MPIDI_OFI_do_get(void *origin_addr,
void *desc = NULL;
MPL_pointer_attr_t attr;
MPIR_GPU_query_pointer_attr(iov.iov_base, &attr);
if (MPL_gpu_attr_is_strict_dev(&attr))
if (MPL_gpu_attr_is_dev(&attr))
MPIDI_OFI_gpu_rma_register(iov.iov_base, iov.iov_len, NULL, win, nic_target, &desc);

msg.desc = &desc;
Expand Down
6 changes: 3 additions & 3 deletions src/mpid/ch4/netmod/ofi/ofi_send.h
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ MPL_STATIC_INLINE_PREFIX int MPIDI_OFI_send(const void *buf, MPI_Aint count, MPI
MPL_pointer_attr_t attr;
void *send_buf = MPIR_get_contig_ptr(buf, dt_true_lb);
MPIR_GPU_query_pointer_attr(send_buf, &attr);
if (data_sz && MPL_gpu_attr_is_dev(&attr)) {
if (data_sz && !MPL_gpu_attr_is_host(&attr)) {
is_gpu = true;
MPIDI_OFI_register_am_bufs();
}
Expand All @@ -336,8 +336,8 @@ MPL_STATIC_INLINE_PREFIX int MPIDI_OFI_send(const void *buf, MPI_Aint count, MPI
if (!MPIDI_OFI_ENABLE_HMEM) {
/* HMEM (any kind) not supported */
need_pack = true;
} else if (!MPL_gpu_attr_is_strict_dev(&attr)) {
/* non-strict gpu ptr (ZE shared host) */
} else if (!MPL_gpu_attr_is_dev(&attr)) {
/* neither host nor device memory (e.g. ZE host-registered or shared) */
need_pack = true;
} else {
if (MPIDI_OFI_ENABLE_MR_HMEM) {
Expand Down
6 changes: 3 additions & 3 deletions src/mpid/ch4/netmod/ofi/ofi_win.c
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,8 @@ static int win_allgather(MPIR_Win * win, void *base, int disp_unit)

MPL_pointer_attr_t attr;
MPIR_GPU_query_pointer_attr(base, &attr);
if (MPL_gpu_attr_is_dev(&attr)) {
if (MPIDI_OFI_ENABLE_HMEM && MPL_gpu_attr_is_strict_dev(&attr)) {
if (!MPL_gpu_attr_is_host(&attr)) {
if (MPIDI_OFI_ENABLE_HMEM && MPL_gpu_attr_is_dev(&attr)) {
mpi_errno =
MPIDI_OFI_register_memory(base, len, &attr, ctx_idx, MPIDI_OFI_WIN(win).mr_key,
&MPIDI_OFI_WIN(win).mr);
Expand Down Expand Up @@ -944,7 +944,7 @@ int MPIDI_OFI_mpi_win_attach_hook(MPIR_Win * win, void *base, MPI_Aint size)
int rc = 0, allrc = 0;
struct fid_mr *mr = NULL;
/* device buffers are not currently supported */
if (MPIR_GPU_query_pointer_is_dev(base))
if (!MPIR_GPU_query_pointer_is_host(base))
rc = -1;
else {
MPIDI_OFI_CALL_RETURN(fi_mr_reg(MPIDI_OFI_global.ctx[ctx_idx].domain, /* In: Domain Object */
Expand Down
2 changes: 1 addition & 1 deletion src/mpid/ch4/netmod/ucx/ucx_am.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ MPL_STATIC_INLINE_PREFIX int MPIDI_NM_am_isend(int rank,

MPL_pointer_attr_t attr;
MPIR_GPU_query_pointer_attr(data, &attr);
if (MPL_gpu_attr_is_dev(&attr)) {
if (!MPL_gpu_attr_is_host(&attr)) {
/* Force packing of GPU buffer in host memory */
dt_contig = 0;
}
Expand Down
8 changes: 4 additions & 4 deletions src/mpid/ch4/netmod/ucx/ucx_rma.h
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ MPL_STATIC_INLINE_PREFIX int MPIDI_NM_mpi_put(const void *origin_addr,
MPIR_FUNC_ENTER;

if (!MPIDI_UCX_is_reachable_target(target_rank, win, winattr) ||
MPIR_GPU_query_pointer_is_dev(origin_addr)) {
!MPIR_GPU_query_pointer_is_host(origin_addr)) {
mpi_errno = MPIDIG_mpi_put(origin_addr, origin_count, origin_datatype, target_rank,
target_disp, target_count, target_datatype, win);
} else {
Expand All @@ -354,7 +354,7 @@ MPL_STATIC_INLINE_PREFIX int MPIDI_NM_mpi_get(void *origin_addr,
MPIR_FUNC_ENTER;

if (!MPIDI_UCX_is_reachable_target(target_rank, win, winattr) ||
MPIR_GPU_query_pointer_is_dev(origin_addr)) {
!MPIR_GPU_query_pointer_is_host(origin_addr)) {
mpi_errno = MPIDIG_mpi_get(origin_addr, origin_count, origin_datatype, target_rank,
target_disp, target_count, target_datatype, win);
} else {
Expand Down Expand Up @@ -382,7 +382,7 @@ MPL_STATIC_INLINE_PREFIX int MPIDI_NM_mpi_rput(const void *origin_addr,
MPIR_FUNC_ENTER;

if (!MPIDI_UCX_is_reachable_target(target_rank, win, winattr) ||
MPIR_GPU_query_pointer_is_dev(origin_addr)) {
!MPIR_GPU_query_pointer_is_host(origin_addr)) {
mpi_errno = MPIDIG_mpi_rput(origin_addr, origin_count, origin_datatype, target_rank,
target_disp, target_count, target_datatype, win, request);
} else {
Expand Down Expand Up @@ -486,7 +486,7 @@ MPL_STATIC_INLINE_PREFIX int MPIDI_NM_mpi_rget(void *origin_addr,
MPIR_FUNC_ENTER;

if (!MPIDI_UCX_is_reachable_target(target_rank, win, winattr) ||
MPIR_GPU_query_pointer_is_dev(origin_addr)) {
!MPIR_GPU_query_pointer_is_host(origin_addr)) {
mpi_errno = MPIDIG_mpi_rget(origin_addr, origin_count, origin_datatype, target_rank,
target_disp, target_count, target_datatype, win, request);
} else {
Expand Down
2 changes: 1 addition & 1 deletion src/mpid/ch4/netmod/ucx/ucx_win.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ static int win_allgather(MPIR_Win * win, size_t length, uint32_t disp_unit, void

/* As of ucx-1.10, mapping with a CUDA device buffer may be successful but
* later RMA segfaults inside UCX. Thus, MPICH manually disables native RMA for device win buffer for now.*/
if (MPIR_GPU_query_pointer_is_dev(*base_ptr)) {
if (!MPIR_GPU_query_pointer_is_host(*base_ptr)) {
status = UCS_ERR_UNSUPPORTED;
} else {
status = ucp_mem_map(MPIDI_UCX_global.context, &mem_map_params, &mem_h);
Expand Down
Loading