Skip to content

Commit 08ad835

Browse files
committed
Fix local process accounting in openib when dynamic add_proc is on.
1 parent 3c2f6d5 commit 08ad835

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

opal/mca/btl/openib/btl_openib.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1061,8 +1061,10 @@ int mca_btl_openib_add_procs(
10611061

10621062
}
10631063

1064+
opal_mutex_lock(&openib_btl->ib_lock);
10641065
openib_btl->local_procs += local_procs;
10651066
openib_btl->device->mem_reg_max = openib_btl->device->mem_reg_max_total / openib_btl->local_procs;
1067+
opal_mutex_unlock(&openib_btl->ib_lock);
10661068

10671069
return OPAL_SUCCESS;
10681070
}
@@ -1124,8 +1126,17 @@ struct mca_btl_base_endpoint_t *mca_btl_openib_get_ep (struct mca_btl_base_modul
11241126

11251127
(void)init_ib_proc_nolock(openib_btl, ib_proc, &endpoint,
11261128
local_port_cnt, btl_rank);
1129+
11271130
exit:
11281131
opal_mutex_unlock(&ib_proc->proc_lock);
1132+
1133+
if (is_new && OPAL_PROC_ON_LOCAL_NODE(proc->proc_flags)) {
1134+
opal_mutex_lock(&openib_btl->ib_lock);
1135+
openib_btl->local_procs += 1;
1136+
openib_btl->device->mem_reg_max = openib_btl->device->mem_reg_max_total / openib_btl->local_procs;
1137+
opal_mutex_unlock(&openib_btl->ib_lock);
1138+
}
1139+
11291140
return endpoint;
11301141
}
11311142

0 commit comments

Comments
 (0)