Skip to content

Commit 4447738

Browse files
authored
Merge pull request #5414 from hppritcha/topic/iwarp_only_by_default
btl/openib: only look for iwarp/roce by default
2 parents bc8134d + 6818272 commit 4447738

File tree

4 files changed

+58
-3
lines changed

4 files changed

+58
-3
lines changed

opal/mca/btl/openib/btl_openib.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* All rights reserved.
1313
* Copyright (c) 2006-2011 Cisco Systems, Inc. All rights reserved.
1414
* Copyright (c) 2006-2009 Mellanox Technologies. All rights reserved.
15-
* Copyright (c) 2006-2016 Los Alamos National Security, LLC. All rights
15+
* Copyright (c) 2006-2018 Los Alamos National Security, LLC. All rights
1616
* reserved.
1717
* Copyright (c) 2006-2007 Voltaire All rights reserved.
1818
* Copyright (c) 2009-2010 Oracle and/or its affiliates. All rights reserved.
@@ -245,6 +245,7 @@ struct mca_btl_openib_component_t {
245245
guarantee about the size of an enum. this value will be registered as an
246246
integer with the MCA variable system */
247247
int device_type;
248+
bool allow_ib;
248249
char *if_include;
249250
char **if_include_list;
250251
char *if_exclude;

opal/mca/btl/openib/btl_openib_component.c

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* All rights reserved.
1313
* Copyright (c) 2006-2018 Cisco Systems, Inc. All rights reserved
1414
* Copyright (c) 2006-2015 Mellanox Technologies. All rights reserved.
15-
* Copyright (c) 2006-2015 Los Alamos National Security, LLC. All rights
15+
* Copyright (c) 2006-2018 Los Alamos National Security, LLC. All rights
1616
* reserved.
1717
* Copyright (c) 2006-2007 Voltaire All rights reserved.
1818
* Copyright (c) 2009-2012 Oracle and/or its affiliates. All rights reserved.
@@ -622,6 +622,30 @@ static int init_one_port(opal_list_t *btl_list, mca_btl_openib_device_t *device,
622622
union ibv_gid gid;
623623
uint64_t subnet_id;
624624

625+
/*
626+
* Starting with Open MPI 4.0 we don't support infiniband
627+
* unless the user specifically requested to override this
628+
* policy. For ancient OFED, only allow if user has set
629+
* the MCA parameter.
630+
*/
631+
#if HAVE_DECL_IBV_LINK_LAYER_ETHERNET
632+
if ((IBV_LINK_LAYER_INFINIBAND == ib_port_attr->link_layer) &&
633+
(false == mca_btl_openib_component.allow_ib)) {
634+
opal_show_help("help-mpi-btl-openib.txt", "ib port not selected",
635+
true, opal_process_info.nodename,
636+
ibv_get_device_name(device->ib_dev), port_num);
637+
return OPAL_ERR_NOT_FOUND;
638+
}
639+
#else
640+
if (false == mca_btl_openib_component.allow_ib) {
641+
opal_show_help("help-mpi-btl-openib.txt", "ib port not selected",
642+
true, opal_process_info.nodename,
643+
ibv_get_device_name(device->ib_dev), port_num);
644+
return OPAL_ERR_NOT_FOUND;
645+
}
646+
#endif
647+
648+
625649
/* Ensure that the requested GID index (via the
626650
btl_openib_gid_index MCA param) is within the GID table
627651
size. */

opal/mca/btl/openib/btl_openib_mca.c

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* All rights reserved.
1313
* Copyright (c) 2006-2015 Cisco Systems, Inc. All rights reserved.
1414
* Copyright (c) 2006-2009 Mellanox Technologies. All rights reserved.
15-
* Copyright (c) 2006-2015 Los Alamos National Security, LLC. All rights
15+
* Copyright (c) 2006-2018 Los Alamos National Security, LLC. All rights
1616
* reserved.
1717
* Copyright (c) 2006-2007 Voltaire All rights reserved.
1818
* Copyright (c) 2009-2010 Oracle and/or its affiliates. All rights reserved.
@@ -291,6 +291,19 @@ int btl_openib_register_mca_params(void)
291291
if (0 > tmp) ret = tmp;
292292
OBJ_RELEASE(new_enum);
293293

294+
/*
295+
* Provide way for using to override policy of ignoring IB HCAs
296+
*/
297+
298+
mca_btl_openib_component.allow_ib = false;
299+
tmp = mca_base_component_var_register(&mca_btl_openib_component.super.btl_version,
300+
"allow_ib",
301+
"Override policy since Open MPI 4.0 of ignoring IB HCAs for openib BTL",
302+
MCA_BASE_VAR_TYPE_BOOL, NULL,
303+
0, 0, OPAL_INFO_LVL_5,
304+
MCA_BASE_VAR_SCOPE_READONLY,
305+
&mca_btl_openib_component.allow_ib);
306+
294307
CHECK(reg_int("max_btls", NULL,
295308
"Maximum number of device ports to use "
296309
"(-1 = use all available, otherwise must be >= 1)",

opal/mca/btl/openib/help-mpi-btl-openib.txt

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
# Copyright (c) 2007-2009 Mellanox Technologies. All rights reserved.
1515
# Copyright (c) 2009 Sun Microsystems, Inc. All rights reserved.
1616
# Copyright (c) 2013-2014 NVIDIA Corporation. All rights reserved.
17+
# Copyright (c) 2018 Los Alamos National Security, LLC. All rights
18+
# reserved.
1719
# $COPYRIGHT$
1820
#
1921
# Additional copyrights may follow
@@ -250,6 +252,10 @@ this run.
250252

251253
If the "requested type" is "<any>", this usually means that *no*
252254
OpenFabrics devices were found within the requested bus distance.
255+
256+
Note starting with Open MPI 4.0, only iWarp and RoCE devices are considered
257+
for selection by default. Set the btl_openib_allow_ib MCA
258+
parameter to "true" to allow use of Infiniband devices.
253259
#
254260
[default subnet prefix]
255261
WARNING: There are more than one active ports on host '%s', but the
@@ -706,3 +712,14 @@ Open MPI has detected that you have attempted to set the btl_openib_cuda_max_sen
706712
value. This is not supported. Setting back to default value of 0.
707713

708714
Local host: %s
715+
[ib port not selected]
716+
By default, for Open MPI 4.0 and later, infiniband ports on a device
717+
are not used by default. The intent is to use UCX for these devices.
718+
You can override this policy by setting the btl_openib_allow_ib MCA parameter
719+
to true.
720+
721+
Local host: %s
722+
Local adapter: %s
723+
Local port: %d
724+
#
725+

0 commit comments

Comments
 (0)