Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/mpi version #265

Merged
merged 3 commits into from
Oct 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions include/ygm/detail/comm.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include <ygm/detail/lambda_compliance.hpp>
#include <ygm/detail/meta/functional.hpp>
#include <ygm/detail/ygm_cereal_archive.hpp>
#include <ygm/version.hpp>

namespace ygm {

Expand Down Expand Up @@ -79,6 +80,19 @@ inline void comm::welcome(std::ostream &os) {
<< "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_LIBRARY = " << version_string.substr(0, end) << "\n";
sstr << "YGM_VERSION = " << ygm_version << "\n";

config.print(sstr);

if (rank() == 0) {
Expand Down
10 changes: 10 additions & 0 deletions include/ygm/version.hpp
Original file line number Diff line number Diff line change
@@ -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 <string>

namespace ygm {
static const std::string ygm_version("v0.7-dev");
}