Select Git revision
userdoc.org
-
Stéphane Del Pino authored
Fix few typos and slightly improve the text
Stéphane Del Pino authoredFix few typos and slightly improve the text
PugsUtils.cpp 8.39 KiB
#include <utils/PugsUtils.hpp>
#include <dev/ParallelChecker.hpp>
#include <utils/BacktraceManager.hpp>
#include <utils/BuildInfo.hpp>
#include <utils/CommunicatorManager.hpp>
#include <utils/ConsoleManager.hpp>
#include <utils/ExecutionStatManager.hpp>
#include <utils/FPEManager.hpp>
#include <utils/Messenger.hpp>
#include <utils/PETScWrapper.hpp>
#include <utils/ReproducibleSumManager.hpp>
#include <utils/RevisionInfo.hpp>
#include <utils/SLEPcWrapper.hpp>
#include <utils/SignalManager.hpp>
#include <utils/pugs_build_info.hpp>
#include <rang.hpp>
#include <Kokkos_Core.hpp>
#include <CLI/CLI.hpp>
#include <iostream>
#include <thread>
std::string
pugsVersion()
{
std::stringstream os;
os << "pugs version: " << rang::style::bold << RevisionInfo::version() << rang::style::reset << '\n';
os << "-------------------- " << rang::fg::green << "git info" << rang::fg::reset << " -------------------------"
<< '\n';
os << "tag: " << rang::style::bold << RevisionInfo::gitTag() << rang::style::reset << '\n';
os << "HEAD: " << rang::style::bold << RevisionInfo::gitHead() << rang::style::reset << '\n';
os << "hash: " << rang::style::bold << RevisionInfo::gitHash() << rang::style::reset << " (";
// LCOV_EXCL_START Cannot cover both situations at same time
if (RevisionInfo::gitIsClean()) {
os << rang::fgB::green << "clean" << rang::fg::reset;
} else {
os << rang::fgB::red << "dirty" << rang::fg::reset;
}
// LCOV_EXCL_STOP
os << ")\n";
os << "-------------------------------------------------------";
return os.str();
}
std::string
pugsBuildInfo()
{
std::ostringstream os;
os << "-------------------- " << rang::fg::green << "build info" << rang::fg::reset << " -----------------------"
<< '\n';
os << "type: " << rang::style::bold << BuildInfo::type() << rang::style::reset << '\n';
os << "compiler: " << rang::style::bold << BuildInfo::compiler() << rang::style::reset << '\n';
os << "kokkos: " << rang::style::bold << BuildInfo::kokkosDevices() << rang::style::reset << '\n';
os << "MPI: " << rang::style::bold << BuildInfo::mpiLibrary() << rang::style::reset << '\n';
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 << "-------------------------------------------------------";
return os.str();
}