Skip to content

Commit

Permalink
SSHMEM/UCX: fixed fallback warnings logic
Browse files Browse the repository at this point in the history
Signed-off-by: Roie Danino <[email protected]>
  • Loading branch information
roiedanino committed Aug 24, 2023
1 parent e37a850 commit 8e14b9e
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions oshmem/mca/sshmem/ucx/sshmem_ucx_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -180,28 +180,27 @@ segment_create(map_segment_t *ds_buf,
unsigned flags = UCP_MEM_MAP_ALLOCATE;
int status = OSHMEM_SUCCESS;

#if HAVE_DECL_UCS_MEMORY_TYPE_RDMA
if (hint & SHMEM_HINT_DEVICE_NIC_MEM) {
#if HAVE_DECL_UCS_MEMORY_TYPE_RDMA
status = segment_create_internal(ds_buf, NULL, size, flags,
UCS_MEMORY_TYPE_RDMA);
if (status == OSHMEM_SUCCESS) {
ds_buf->alloc_hints = hint;
ds_buf->allocator = &sshmem_ucx_allocator;
return OSHMEM_SUCCESS;
}
else if(hint) {
SSHMEM_WARN("Hint was not recognized therefore ignored, "
"fallback to host memory allocation");
} else {
SSHMEM_WARN("Failed to allocate DEVICE_NIC_MEM, "
"fallback to host memory");
}
/* Fallback - Try again using host memory*/
}
#else
SSHMEM_WARN("UCX version is too old and won't support "
"SHMEM_HINT_DEVICE_NIC_MEM hint, fallback to host memory");
SSHMEM_WARN("UCX version is too old and won't support "
"SHMEM_HINT_DEVICE_NIC_MEM hint, fallback to host memory");
#endif
}
if (hint & ~SHMEM_HINT_DEVICE_NIC_MEM) {
SSHMEM_WARN("Hint was not recognized therefore ignored, "
"fallback to host memory allocation");
}

flags |= UCP_MEM_MAP_FIXED;
if (spml->heap_reg_nb) {
Expand Down

0 comments on commit 8e14b9e

Please sign in to comment.