From 202f64868cb7d13015c9fb2f7c8187aafbc03c29 Mon Sep 17 00:00:00 2001 From: Jeff Squyres Date: Sat, 25 Apr 2015 04:33:42 -0700 Subject: [PATCH] btl openib: only initialize CPCs if there are devices to use Defer initializing the CPCs until we know that we have devices/ports to use. This both prevents some useless work at startup when there are no devices/ports to use, and also prevents librdmacm complaining that there are no verbs-capable RDMA devices available (e.g., if a Cisco usNIC device is present, but does not present a verbs RDMA interface). --- opal/mca/btl/openib/btl_openib_component.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/opal/mca/btl/openib/btl_openib_component.c b/opal/mca/btl/openib/btl_openib_component.c index 1c5abaffcdf..eb75df3e812 100644 --- a/opal/mca/btl/openib/btl_openib_component.c +++ b/opal/mca/btl/openib/btl_openib_component.c @@ -2532,11 +2532,6 @@ btl_openib_component_init(int *num_btl_modules, goto no_btls; } - /* Init CPC components */ - if (OPAL_SUCCESS != (ret = opal_btl_openib_connect_base_init())) { - goto no_btls; - } - /* If we are using ptmalloc2 and there are no posix threads available, this will cause memory corruption. Refuse to run. Right now, ptmalloc2 is the only memory manager that we have on @@ -2792,6 +2787,12 @@ btl_openib_component_init(int *num_btl_modules, goto no_btls; } + /* Now that we know we have devices and ports that we want to use, + init CPC components */ + if (OPAL_SUCCESS != (ret = opal_btl_openib_connect_base_init())) { + goto no_btls; + } + /* Setup the BSRQ QP's based on the final value of mca_btl_openib_component.receive_queues. */ if (OPAL_SUCCESS != setup_qps()) {