From c67ee29a88ea752f78532b12bad94ba5479a38d9 Mon Sep 17 00:00:00 2001 From: chapman39 Date: Wed, 25 Sep 2024 18:01:58 -0700 Subject: [PATCH 1/2] Track serac version and compiler when benchmarking --- src/serac/infrastructure/about.cpp | 2 ++ src/serac/infrastructure/about.hpp | 7 +++++++ src/serac/infrastructure/profiling.cpp | 2 ++ src/serac/serac_config.hpp.in | 4 ++++ 4 files changed, 15 insertions(+) diff --git a/src/serac/infrastructure/about.cpp b/src/serac/infrastructure/about.cpp index 34b02559e3..d94646763a 100644 --- a/src/serac/infrastructure/about.cpp +++ b/src/serac/infrastructure/about.cpp @@ -221,4 +221,6 @@ std::string version(bool add_SHA) return version; } +std::string compiler() { return axom::fmt::format("{0} version {1}", SERAC_COMPILER_NAME, SERAC_COMPILER_VERSION); } + } // namespace serac diff --git a/src/serac/infrastructure/about.hpp b/src/serac/infrastructure/about.hpp index 82e016a805..e53060fc43 100644 --- a/src/serac/infrastructure/about.hpp +++ b/src/serac/infrastructure/about.hpp @@ -49,4 +49,11 @@ void printRunInfo(); */ std::string version(bool add_SHA = true); +/** + * @brief Returns a string for the current compiler name and version + * + * @return string value of the the current compiler name and version + */ +std::string compiler(); + } // namespace serac diff --git a/src/serac/infrastructure/profiling.cpp b/src/serac/infrastructure/profiling.cpp index 5a86079656..0d2decef58 100644 --- a/src/serac/infrastructure/profiling.cpp +++ b/src/serac/infrastructure/profiling.cpp @@ -34,6 +34,8 @@ void initialize([[maybe_unused]] MPI_Comm comm, [[maybe_unused]] std::string opt adiak::walltime(); adiak::cputime(); adiak::systime(); + SERAC_SET_METADATA("serac_version", serac::version(true)); + SERAC_SET_METADATA("serac_compiler", serac::compiler()); #endif #ifdef SERAC_USE_CALIPER diff --git a/src/serac/serac_config.hpp.in b/src/serac/serac_config.hpp.in index fa3be25255..1aa6865052 100644 --- a/src/serac/serac_config.hpp.in +++ b/src/serac/serac_config.hpp.in @@ -22,6 +22,10 @@ #define SERAC_REPO_DIR "@SERAC_REPO_DIR@" #define SERAC_BIN_DIR "@SERAC_BIN_DIR@" +// Compiler Information +#define SERAC_COMPILER_NAME "@CMAKE_CXX_COMPILER_ID@" +#define SERAC_COMPILER_VERSION "@CMAKE_CXX_COMPILER_VERSION@" + // General defines #cmakedefine SERAC_DEBUG From 11297f5a42ee59933bb89b8e410b712bdffa94ac Mon Sep 17 00:00:00 2001 From: Alex Tyler Chapman Date: Thu, 26 Sep 2024 13:36:59 -0700 Subject: [PATCH 2/2] fix missing include --- src/serac/infrastructure/profiling.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/serac/infrastructure/profiling.cpp b/src/serac/infrastructure/profiling.cpp index 0d2decef58..95a41e7b34 100644 --- a/src/serac/infrastructure/profiling.cpp +++ b/src/serac/infrastructure/profiling.cpp @@ -4,8 +4,8 @@ // // SPDX-License-Identifier: (BSD-3-Clause) +#include "serac/infrastructure/about.hpp" #include "serac/infrastructure/profiling.hpp" - #include "serac/infrastructure/logger.hpp" #ifdef SERAC_USE_CALIPER