From bed1930df817ba632f0ed365f634748ca4706a45 Mon Sep 17 00:00:00 2001 From: Jeff Squyres Date: Sat, 11 Nov 2017 04:58:08 -0800 Subject: [PATCH 1/5] mtl ofi: fix formatting of help message No code or logic changes. Signed-off-by: Jeff Squyres --- ompi/mca/mtl/ofi/help-mtl-ofi.txt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ompi/mca/mtl/ofi/help-mtl-ofi.txt b/ompi/mca/mtl/ofi/help-mtl-ofi.txt index 97c355123c1..8131766ae00 100644 --- a/ompi/mca/mtl/ofi/help-mtl-ofi.txt +++ b/ompi/mca/mtl/ofi/help-mtl-ofi.txt @@ -2,6 +2,7 @@ # # Copyright (c) 2013-2017 Intel, Inc. All rights reserved # +# Copyright (c) 2017 Cisco Systems, Inc. All rights reserved # $COPYRIGHT$ # # Additional copyrights may follow @@ -9,8 +10,9 @@ # $HEADER$ # [OFI call fail] -Open MPI failed an OFI Libfabric library call (%s).This is highly unusual; -your job may behave unpredictably (and/or abort) after this. +Open MPI failed an OFI Libfabric library call (%s). This is highly +unusual; your job may behave unpredictably (and/or abort) after this. + Local host: %s Location: %s:%d Error: %s (%zd) From e8c13ef286702a514e54681eaeee3e60c32c7800 Mon Sep 17 00:00:00 2001 From: Jeff Squyres Date: Sat, 11 Nov 2017 04:58:31 -0800 Subject: [PATCH 2/5] mtl ofi: fix trivial comment whitespace No code or logic changes. Signed-off-by: Jeff Squyres --- ompi/mca/mtl/ofi/mtl_ofi_component.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ompi/mca/mtl/ofi/mtl_ofi_component.c b/ompi/mca/mtl/ofi/mtl_ofi_component.c index 2dd0090ad18..e05a6127fab 100644 --- a/ompi/mca/mtl/ofi/mtl_ofi_component.c +++ b/ompi/mca/mtl/ofi/mtl_ofi_component.c @@ -2,7 +2,7 @@ /* * Copyright (c) 2013-2017 Intel, Inc. All rights reserved * - * Copyright (c) 2014-2015 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2014-2017 Cisco Systems, Inc. All rights reserved * Copyright (c) 2015-2016 Los Alamos National Security, LLC. All rights * reserved. * $COPYRIGHT$ @@ -362,7 +362,7 @@ ompi_mtl_ofi_component_init(bool enable_progress_threads, NULL, /* Optional name or fabric to resolve */ NULL, /* Optional service name or port to request */ 0ULL, /* Optional flag */ - hints, /* In: Hints to filter providers */ + hints, /* In: Hints to filter providers */ &providers); /* Out: List of matching providers */ if (0 != ret) { opal_show_help("help-mtl-ofi.txt", "OFI call fail", true, From f910f554f78cdc163eb2315832b805417885cf52 Mon Sep 17 00:00:00 2001 From: Jeff Squyres Date: Sat, 11 Nov 2017 04:58:59 -0800 Subject: [PATCH 3/5] mtl ofi: show the positive value of the error The value of ret is negative (e.g., -61), but it is displayed in the help message as `%zd`, which renders as unsigned (i.e., a giant positive value). So make sure to negate the negative value before rendering it (e.g., so we display "61", not "4294967235"). Signed-off-by: Jeff Squyres --- ompi/mca/mtl/ofi/mtl_ofi_component.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ompi/mca/mtl/ofi/mtl_ofi_component.c b/ompi/mca/mtl/ofi/mtl_ofi_component.c index e05a6127fab..3825e286bce 100644 --- a/ompi/mca/mtl/ofi/mtl_ofi_component.c +++ b/ompi/mca/mtl/ofi/mtl_ofi_component.c @@ -368,7 +368,7 @@ ompi_mtl_ofi_component_init(bool enable_progress_threads, opal_show_help("help-mtl-ofi.txt", "OFI call fail", true, "fi_getinfo", ompi_process_info.nodename, __FILE__, __LINE__, - fi_strerror(-ret), ret); + fi_strerror(-ret), -ret); goto error; } @@ -397,7 +397,7 @@ ompi_mtl_ofi_component_init(bool enable_progress_threads, opal_show_help("help-mtl-ofi.txt", "OFI call fail", true, "fi_fabric", ompi_process_info.nodename, __FILE__, __LINE__, - fi_strerror(-ret), ret); + fi_strerror(-ret), -ret); goto error; } @@ -414,7 +414,7 @@ ompi_mtl_ofi_component_init(bool enable_progress_threads, opal_show_help("help-mtl-ofi.txt", "OFI call fail", true, "fi_domain", ompi_process_info.nodename, __FILE__, __LINE__, - fi_strerror(-ret), ret); + fi_strerror(-ret), -ret); goto error; } @@ -433,7 +433,7 @@ ompi_mtl_ofi_component_init(bool enable_progress_threads, opal_show_help("help-mtl-ofi.txt", "OFI call fail", true, "fi_endpoint", ompi_process_info.nodename, __FILE__, __LINE__, - fi_strerror(-ret), ret); + fi_strerror(-ret), -ret); goto error; } @@ -617,7 +617,7 @@ ompi_mtl_ofi_finalize(struct mca_mtl_base_module_t *mtl) opal_show_help("help-mtl-ofi.txt", "OFI call fail", true, "fi_close", ompi_process_info.nodename, __FILE__, __LINE__, - fi_strerror(-ret), ret); + fi_strerror(-ret), -ret); return OMPI_ERROR; } From 5a6ddf42d6f94842c9b81bde1b077e5e73681de8 Mon Sep 17 00:00:00 2001 From: Jeff Squyres Date: Sat, 11 Nov 2017 05:01:15 -0800 Subject: [PATCH 4/5] mtl ofi: it is not an error to return no data from fi_getinfo() Before this commit, the presence of usNIC devices -- which will (currently) return no data when fi_getinfo() is queried for tagged matching providers -- would cause an error message to be displayed. Signed-off-by: Jeff Squyres --- ompi/mca/mtl/ofi/mtl_ofi_component.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ompi/mca/mtl/ofi/mtl_ofi_component.c b/ompi/mca/mtl/ofi/mtl_ofi_component.c index 3825e286bce..96f8f6abbff 100644 --- a/ompi/mca/mtl/ofi/mtl_ofi_component.c +++ b/ompi/mca/mtl/ofi/mtl_ofi_component.c @@ -364,7 +364,10 @@ ompi_mtl_ofi_component_init(bool enable_progress_threads, 0ULL, /* Optional flag */ hints, /* In: Hints to filter providers */ &providers); /* Out: List of matching providers */ - if (0 != ret) { + if (FI_ENODATA == -ret) { + // It is not an error if no information is returned. + goto error; + } else if (0 != ret) { opal_show_help("help-mtl-ofi.txt", "OFI call fail", true, "fi_getinfo", ompi_process_info.nodename, __FILE__, __LINE__, From a8686a681361177da28aac6e61963600fbd30d8a Mon Sep 17 00:00:00 2001 From: Jeff Squyres Date: Sat, 11 Nov 2017 05:04:23 -0800 Subject: [PATCH 5/5] mtl ofi: squelch compiler warnings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit gcc 5.2 complains: ``` mtl_ofi_component.c: In function ‘ompi_mtl_ofi_finalize’: mtl_ofi_component.c:613:5: warning: suggest parentheses around assignment used as truth value [-Wparentheses] if (ret = fi_close((fid_t)ompi_mtl_ofi.fabric)) { ^ ``` Signed-off-by: Jeff Squyres --- ompi/mca/mtl/ofi/mtl_ofi_component.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ompi/mca/mtl/ofi/mtl_ofi_component.c b/ompi/mca/mtl/ofi/mtl_ofi_component.c index 96f8f6abbff..89a71ed7b63 100644 --- a/ompi/mca/mtl/ofi/mtl_ofi_component.c +++ b/ompi/mca/mtl/ofi/mtl_ofi_component.c @@ -594,23 +594,23 @@ ompi_mtl_ofi_finalize(struct mca_mtl_base_module_t *mtl) opal_progress_unregister(ompi_mtl_ofi_progress_no_inline); /* Close all the OFI objects */ - if (ret = fi_close((fid_t)ompi_mtl_ofi.ep)) { + if ((ret = fi_close((fid_t)ompi_mtl_ofi.ep))) { goto finalize_err; } - if (ret = fi_close((fid_t)ompi_mtl_ofi.cq)) { + if ((ret = fi_close((fid_t)ompi_mtl_ofi.cq))) { goto finalize_err; } - if (ret = fi_close((fid_t)ompi_mtl_ofi.av)) { + if ((ret = fi_close((fid_t)ompi_mtl_ofi.av))) { goto finalize_err; } - if (ret = fi_close((fid_t)ompi_mtl_ofi.domain)) { + if ((ret = fi_close((fid_t)ompi_mtl_ofi.domain))) { goto finalize_err; } - if (ret = fi_close((fid_t)ompi_mtl_ofi.fabric)) { + if ((ret = fi_close((fid_t)ompi_mtl_ofi.fabric))) { goto finalize_err; }