Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Lior Paz committed Dec 29, 2020
1 parent 34b4253 commit af1d0bb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions src/team_lib/mhba/xccl_mhba_collective.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,17 +70,17 @@ static xccl_status_t xccl_mhba_reg_fanin_start(xccl_coll_task_t *task)

ucs_rcache_region_t* send_ptr;
ucs_rcache_region_t* recv_ptr;
if(UCS_OK != ucs_rcache_get(team->rcache,(void *)request->args.buffer_info.src_buffer,
if(UCS_OK != ucs_rcache_get(team->rcache, (void *)request->args.buffer_info.src_buffer,
request->args.buffer_info.len * team->size,
PROT_READ,&sr_mem_access_flags, &send_ptr)){
PROT_READ,&sr_mem_access_flags, &send_ptr)) {
xccl_mhba_error("Failed to register send_bf memory (errno=%d)", errno);
return XCCL_ERR_NO_RESOURCE;
}
request->send_rcache_region_p = xccl_rcache_ucs_get_reg_data(send_ptr);

if(UCS_OK != ucs_rcache_get(team->rcache,(void *)request->args.buffer_info.dst_buffer,
if(UCS_OK != ucs_rcache_get(team->rcache, (void *)request->args.buffer_info.dst_buffer,
request->args.buffer_info.len * team->size,
PROT_WRITE,&dr_mem_access_flags,&recv_ptr)){
PROT_WRITE,&dr_mem_access_flags,&recv_ptr)) {
xccl_mhba_error("Failed to register receive_bf memory");
ucs_rcache_region_put(team->rcache,request->send_rcache_region_p->region);
return XCCL_ERR_NO_RESOURCE;
Expand Down
12 changes: 6 additions & 6 deletions src/team_lib/mhba/xccl_mhba_team.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,28 +90,28 @@ static void build_rank_map(xccl_mhba_team_t *mhba_team)

static ucs_status_t rcache_reg_mr(void *context, ucs_rcache_t *rcache,void *arg, ucs_rcache_region_t *rregion,
uint16_t flags){
xccl_mhba_team_t *team = (xccl_mhba_team_t*)context;
void *addr = (void*)rregion->super.start;
size_t length = (size_t)(rregion->super.end - rregion->super.start);
xccl_mhba_team_t *team = (xccl_mhba_team_t*)context;
void *addr = (void*)rregion->super.start;
size_t length = (size_t)(rregion->super.end - rregion->super.start);
xccl_mhba_reg_t* mhba_reg = xccl_rcache_ucs_get_reg_data(rregion);
mhba_reg->region = rregion;
int* mem_flags = (int*) arg;
mhba_reg->mr = ibv_reg_mr(team->node.shared_pd, addr, length, *mem_flags);
if (!mhba_reg->mr){
if (!mhba_reg->mr) {
xccl_mhba_error("Failed to register memory");
return UCS_ERR_NO_MESSAGE;
}
return UCS_OK;
}

static void rcache_dereg_mr(void *context, ucs_rcache_t *rcache, ucs_rcache_region_t *rregion){
static void rcache_dereg_mr(void *context, ucs_rcache_t *rcache, ucs_rcache_region_t *rregion) {
xccl_mhba_reg_t* mhba_reg = xccl_rcache_ucs_get_reg_data(rregion);
assert(mhba_reg->region == rregion);
ibv_dereg_mr(mhba_reg->mr);
mhba_reg->mr = NULL;
}

static xccl_status_t create_rcache(xccl_mhba_team_t* mhba_team){
static xccl_status_t create_rcache(xccl_mhba_team_t* mhba_team) {
static ucs_rcache_ops_t rcache_ucs_ops = {
.mem_reg = rcache_reg_mr,
.mem_dereg = rcache_dereg_mr,
Expand Down

0 comments on commit af1d0bb

Please sign in to comment.