From 8e6eb30c487cf8a12b408edd4acf663b2bb90215 Mon Sep 17 00:00:00 2001 From: Trevor Steil Date: Fri, 4 Oct 2024 15:08:37 -0700 Subject: [PATCH 1/3] Adds MPI implementation details to ygm::comm::welcome() output --- include/ygm/detail/comm.ipp | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/include/ygm/detail/comm.ipp b/include/ygm/detail/comm.ipp index c9361cd5..86794559 100644 --- a/include/ygm/detail/comm.ipp +++ b/include/ygm/detail/comm.ipp @@ -75,9 +75,21 @@ inline void comm::welcome(std::ostream &os) { << " YY GG GG MM MM \n" << " YY GGGGGG MM MM \n" << "======================================\n" - << "COMM_SIZE = " << m_layout.size() << "\n" - << "RANKS_PER_NODE = " << m_layout.local_size() << "\n" - << "NUM_NODES = " << m_layout.node_size() << "\n"; + << "COMM_SIZE = " << m_layout.size() << "\n" + << "RANKS_PER_NODE = " << m_layout.local_size() << "\n" + << "NUM_NODES = " << m_layout.node_size() << "\n"; + + // Find MPI implementation details + char version[MPI_MAX_LIBRARY_VERSION_STRING]; + int version_len; + MPI_Get_library_version(version, &version_len); + + // Trim MPI details to implementation and version + std::string version_string(version, version_len); + std::string delimiters{',', '\n'}; + auto end = version_string.find_first_of(delimiters); + + sstr << "MPI_IMPLEMENTATION = " << version_string.substr(0, end) << "\n"; config.print(sstr); From 15af5ceae1eae5a1b8c373b41af65f438670115b Mon Sep 17 00:00:00 2001 From: Trevor Steil Date: Fri, 4 Oct 2024 15:33:00 -0700 Subject: [PATCH 2/3] Adds YGM version to ygm::comm:welcome() --- include/ygm/detail/comm.ipp | 2 ++ include/ygm/version.hpp | 10 ++++++++++ 2 files changed, 12 insertions(+) create mode 100644 include/ygm/version.hpp diff --git a/include/ygm/detail/comm.ipp b/include/ygm/detail/comm.ipp index 86794559..72536c36 100644 --- a/include/ygm/detail/comm.ipp +++ b/include/ygm/detail/comm.ipp @@ -7,6 +7,7 @@ #include #include #include +#include namespace ygm { @@ -90,6 +91,7 @@ inline void comm::welcome(std::ostream &os) { auto end = version_string.find_first_of(delimiters); sstr << "MPI_IMPLEMENTATION = " << version_string.substr(0, end) << "\n"; + sstr << "YGM_VERSION = " << ygm_version << "\n"; config.print(sstr); diff --git a/include/ygm/version.hpp b/include/ygm/version.hpp new file mode 100644 index 00000000..3e923149 --- /dev/null +++ b/include/ygm/version.hpp @@ -0,0 +1,10 @@ +// Copyright 2019-2021 Lawrence Livermore National Security, LLC and other YGM +// Project Developers. See the top-level COPYRIGHT file for details. +// +// SPDX-License-Identifier: MIT + +#include + +namespace ygm { +static const std::string ygm_version("v0.7-dev"); +} From 8ab1cac770b902b9064ad2cf69302ccb844c7a4e Mon Sep 17 00:00:00 2001 From: Trevor Steil Date: Thu, 10 Oct 2024 09:24:21 -0700 Subject: [PATCH 3/3] Changes MPI_IMPLEMENTATION to MPI_LIBRARY in comm::welcome() --- include/ygm/detail/comm.ipp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/include/ygm/detail/comm.ipp b/include/ygm/detail/comm.ipp index 72536c36..7c1a3b9b 100644 --- a/include/ygm/detail/comm.ipp +++ b/include/ygm/detail/comm.ipp @@ -76,9 +76,9 @@ inline void comm::welcome(std::ostream &os) { << " YY GG GG MM MM \n" << " YY GGGGGG MM MM \n" << "======================================\n" - << "COMM_SIZE = " << m_layout.size() << "\n" - << "RANKS_PER_NODE = " << m_layout.local_size() << "\n" - << "NUM_NODES = " << m_layout.node_size() << "\n"; + << "COMM_SIZE = " << m_layout.size() << "\n" + << "RANKS_PER_NODE = " << m_layout.local_size() << "\n" + << "NUM_NODES = " << m_layout.node_size() << "\n"; // Find MPI implementation details char version[MPI_MAX_LIBRARY_VERSION_STRING]; @@ -90,8 +90,8 @@ inline void comm::welcome(std::ostream &os) { std::string delimiters{',', '\n'}; auto end = version_string.find_first_of(delimiters); - sstr << "MPI_IMPLEMENTATION = " << version_string.substr(0, end) << "\n"; - sstr << "YGM_VERSION = " << ygm_version << "\n"; + sstr << "MPI_LIBRARY = " << version_string.substr(0, end) << "\n"; + sstr << "YGM_VERSION = " << ygm_version << "\n"; config.print(sstr);