Skip to content
Snippets Groups Projects
Commit 38fe1ef1 authored by Stéphane Del Pino's avatar Stéphane Del Pino
Browse files

Update build info showing slurm library info

parent 8f11894f
Branches
No related tags found
1 merge request!199Integrate checkpointing
......@@ -21,6 +21,10 @@
#include <highfive/highfive.hpp>
#endif // PUGS_HAS_HDF5
#ifdef PUGS_HAS_SLURM
#include <slurm/slurm.h>
#endif // PUGS_HAS_SLURM
std::string
BuildInfo::type()
{
......@@ -51,7 +55,7 @@ BuildInfo::mpiLibrary()
MPI_Get_library_version(mpi_version, &length);
return std::string(mpi_version);
}();
#else
#else // PUGS_HAS_MPI
return "none";
#endif // PUGS_HAS_MPI
}
......@@ -62,7 +66,7 @@ BuildInfo::petscLibrary()
#ifdef PUGS_HAS_PETSC
return stringify(PETSC_VERSION_MAJOR) + "." + stringify(PETSC_VERSION_MINOR) + "." +
stringify(PETSC_VERSION_SUBMINOR);
#else
#else // PUGS_HAS_PETSC
return "none";
#endif // PUGS_HAS_PETSC
}
......@@ -73,7 +77,7 @@ BuildInfo::slepcLibrary()
#ifdef PUGS_HAS_SLEPC
return stringify(SLEPC_VERSION_MAJOR) + "." + stringify(SLEPC_VERSION_MINOR) + "." +
stringify(SLEPC_VERSION_SUBMINOR);
#else
#else // PUGS_HAS_SLEPC
return "none";
#endif // PUGS_HAS_SLEPC
}
......@@ -89,7 +93,21 @@ BuildInfo::hdf5Library()
return stringify(H5_VERSION) + " [sequential]";
#endif // H5_HAVE_PARALLEL
#else
#else // PUGS_HAS_HDF5
return "none";
#endif // PUGS_HAS_HDF5
}
std::string
BuildInfo::slurmLibrary()
{
#ifdef PUGS_HAS_SLURM
return stringify(SLURM_VERSION_MAJOR(SLURM_VERSION_NUMBER)) + "." +
stringify(SLURM_VERSION_MINOR(SLURM_VERSION_NUMBER)) + "." +
stringify(SLURM_VERSION_MICRO(SLURM_VERSION_NUMBER));
#else // PUGS_HAS_SLURM
return "none";
#endif // PUGS_HAS_SLURM
}
......@@ -12,6 +12,7 @@ struct BuildInfo
static std::string petscLibrary();
static std::string slepcLibrary();
static std::string hdf5Library();
static std::string slurmLibrary();
};
#endif // BUILD_INFO_HPP
......@@ -65,6 +65,7 @@ pugsBuildInfo()
os << "PETSc: " << rang::style::bold << BuildInfo::petscLibrary() << rang::style::reset << '\n';
os << "SLEPc: " << rang::style::bold << BuildInfo::slepcLibrary() << rang::style::reset << '\n';
os << "HDF5: " << rang::style::bold << BuildInfo::hdf5Library() << rang::style::reset << '\n';
os << "SLURM: " << rang::style::bold << BuildInfo::slurmLibrary() << rang::style::reset << '\n';
os << "-------------------------------------------------------";
return os.str();
......
......@@ -16,6 +16,10 @@
#include <petsc.h>
#endif // PUGS_HAS_PETSC
#ifdef PUGS_HAS_SLURM
#include <slurm/slurm.h>
#endif // PUGS_HAS_SLURM
// clazy:excludeall=non-pod-global-static
TEST_CASE("BuildInfo", "[utils]")
......@@ -64,4 +68,17 @@ TEST_CASE("BuildInfo", "[utils]")
REQUIRE(BuildInfo::petscLibrary() == "none");
#endif // PUGS_HAS_PETSC
}
SECTION("slurm")
{
#ifdef PUGS_HAS_SLURM
const std::string slurm_library = stringify(SLURM_VERSION_MAJOR(SLURM_VERSION_NUMBER)) + "." +
stringify(SLURM_VERSION_MINOR(SLURM_VERSION_NUMBER)) + "." +
stringify(SLURM_VERSION_MICRO(SLURM_VERSION_NUMBER));
REQUIRE(BuildInfo::slurmLibrary() == slurm_library);
#else
REQUIRE(BuildInfo::slurmLibrary() == "none");
#endif // PUGS_HAS_SLURM
}
}
......@@ -52,6 +52,7 @@ TEST_CASE("PugsUtils", "[utils]")
os << "PETSc: " << rang::style::bold << BuildInfo::petscLibrary() << rang::style::reset << '\n';
os << "SLEPc: " << rang::style::bold << BuildInfo::slepcLibrary() << rang::style::reset << '\n';
os << "HDF5: " << rang::style::bold << BuildInfo::hdf5Library() << rang::style::reset << '\n';
os << "SLURM: " << rang::style::bold << BuildInfo::slurmLibrary() << rang::style::reset << '\n';
os << "-------------------------------------------------------";
return os.str();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment