Skip to content

Commit

Permalink
Merge pull request #1240 from LLNL/feature/chapman39/adiak-track-commit
Browse files Browse the repository at this point in the history
Track serac version and compiler when benchmarking
  • Loading branch information
chapman39 authored Sep 30, 2024
2 parents a830718 + 584def4 commit 2a36b8b
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/serac/infrastructure/about.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
7 changes: 7 additions & 0 deletions src/serac/infrastructure/about.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 3 additions & 1 deletion src/serac/infrastructure/profiling.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions src/serac/serac_config.hpp.in
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 2a36b8b

Please sign in to comment.