From 8fbf34b1967e2af79ea398801ee43013ff4c320f Mon Sep 17 00:00:00 2001 From: Jeff Squyres Date: Fri, 24 Apr 2015 14:19:06 -0700 Subject: [PATCH] oob ud: put call to ibv_fork_init() before *all* ibv calls Move the call to opal_common_verbs_fork_test() to up before the call to ibv_get_device_list() (just curious -- why not use opal_ibv_get_device_list()?). This ensures that the call to ibv_fork_init() is before *all* other ibv_* calls. --- orte/mca/oob/ud/oob_ud_component.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/orte/mca/oob/ud/oob_ud_component.c b/orte/mca/oob/ud/oob_ud_component.c index 89ad6863200..f60cc44f903 100644 --- a/orte/mca/oob/ud/oob_ud_component.c +++ b/orte/mca/oob/ud/oob_ud_component.c @@ -6,6 +6,7 @@ * and Technology (RIST). All rights reserved. * 2014 Mellanox Technologies, Inc. * All rights reserved. + * Copyright (c) 2015 Cisco Systems, Inc. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -216,15 +217,6 @@ static inline int mca_oob_ud_device_setup (mca_oob_ud_device_t *device, ORTE_NAME_PRINT(ORTE_PROC_MY_NAME), (void *) ib_device); - /* If fork support is requested, try to enable it */ - rc = opal_common_verbs_fork_test(); - if (OPAL_SUCCESS != rc) { - opal_output_verbose(5, orte_oob_base_framework.framework_output, - "%s oob:ud:device_setup failed in ibv_fork_init. errno = %d", - ORTE_NAME_PRINT(ORTE_PROC_MY_NAME), errno); - return ORTE_ERROR; - } - device->ib_context = ibv_open_device (ib_device); if (NULL == device->ib_context) { opal_output_verbose(5, orte_oob_base_framework.framework_output, @@ -296,6 +288,15 @@ static int mca_oob_ud_component_startup(void) opal_list_item_t *item, *item2; bool found_one = false; + /* If fork support is requested, try to enable it */ + rc = opal_common_verbs_fork_test(); + if (OPAL_SUCCESS != rc) { + opal_output_verbose(5, orte_oob_base_framework.framework_output, + "%s oob:ud:device_setup failed in ibv_fork_init. errno = %d", + ORTE_NAME_PRINT(ORTE_PROC_MY_NAME), errno); + return ORTE_ERROR; + } + devices = ibv_get_device_list (&num_devices); if (NULL == devices || 0 == num_devices) { opal_output_verbose(5, orte_oob_base_framework.framework_output,