Skip to content

Commit 046b3d7

Browse files
Mamzi Bayatpour  mbayatpour@nvidia.com ()janjust
andcommitted
OSC/UCX: Enhancing an assertion in worker pool mem map
Signed-off-by: Mamzi Bayatpour <mbayatpour@nvidia.com> Co-authored-by: Tomislav Janjusic <tomislavj@nvidia.com>
1 parent a0193bd commit 046b3d7

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

opal/mca/common/ucx/common_ucx_wpool.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#include "opal/mca/pmix/pmix-internal.h"
99
#include "opal/memoryhooks/memory.h"
1010
#include "opal/util/proc.h"
11+
#include "opal/util/sys_limits.h"
1112

1213
#include <ucm/api/ucm.h>
1314

@@ -508,7 +509,10 @@ static int _comm_ucx_wpmem_map(opal_common_ucx_wpool_t *wpool, void **base, size
508509

509510
assert(mem_attrs.length >= size);
510511
if (mem_type != OPAL_COMMON_UCX_MEM_ALLOCATE_MAP) {
511-
assert(mem_attrs.address == (*base));
512+
/* Returned mapped address is aligned to ucs rcache->params.alignment.
513+
* Alignment is less than page size */
514+
assert(((mem_attrs.address <= (*base)) && ((*base) - opal_getpagesize()
515+
< mem_attrs.address)) || (size == 0 && mem_attrs.address == NULL));
512516
} else {
513517
(*base) = mem_attrs.address;
514518
}

0 commit comments

Comments
 (0)