Skip to content

Commit 46d834d

Browse files
authored
Merge pull request #7781 from hkuno/john.l.byrne/mca_btl_ofi_rcache_init
mtl_btl_ofi_rcache_init() before creating domain
2 parents ffa50d8 + f1b21cb commit 46d834d

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

opal/mca/btl/ofi/btl_ofi_component.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -417,6 +417,12 @@ static int mca_btl_ofi_init_device(struct fi_info *info)
417417
ep_attr = ofi_info->ep_attr;
418418
domain_attr = ofi_info->domain_attr;
419419

420+
/* mtl_btl_ofi_rcache_init() initializes patcher which should only
421+
* take place things are single threaded. OFI providers may start
422+
* spawn threads, so initialize the rcache before creating OFI objects
423+
* to prevent races. */
424+
mca_btl_ofi_rcache_init(module);
425+
420426
linux_device_name = info->domain_attr->name;
421427
BTL_VERBOSE(("initializing dev:%s provider:%s",
422428
linux_device_name,
@@ -547,9 +553,6 @@ static int mca_btl_ofi_init_device(struct fi_info *info)
547553
module->use_virt_addr = true;
548554
}
549555

550-
/* initialize the rcache */
551-
mca_btl_ofi_rcache_init(module);
552-
553556
/* create endpoint list */
554557
OBJ_CONSTRUCT(&module->endpoints, opal_list_t);
555558
OBJ_CONSTRUCT(&module->module_lock, opal_mutex_t);

0 commit comments

Comments
 (0)