#include <SystemInfo.h>
Definition at line 15 of file SystemInfo.h.
◆ SystemInfo()
SystemInfo::SystemInfo |
( |
int |
argc, |
|
|
char * |
argv[] |
|
) |
| |
◆ argc()
int SystemInfo::argc |
( |
| ) |
const |
|
inline |
◆ argv()
char** SystemInfo::argv |
( |
| ) |
const |
|
inline |
◆ getExecutable()
std::string SystemInfo::getExecutable |
( |
| ) |
const |
Definition at line 138 of file SystemInfo.C.
Referenced by getExecutableTimeStamp(), getInfo(), and to_json().
140 std::string executable(
_argv[0]);
141 size_t last_slash = executable.find_last_of(
"/");
142 if (last_slash != std::string::npos)
143 executable = executable.substr(last_slash + 1);
std::string getExecutablePath()
This function returns the PATH of the running executable.
◆ getExecutableTimeStamp() [1/2]
std::string SystemInfo::getExecutableTimeStamp |
( |
| ) |
const |
◆ getExecutableTimeStamp() [2/2]
std::string SystemInfo::getExecutableTimeStamp |
( |
const std::string & |
exe | ) |
const |
Definition at line 156 of file SystemInfo.C.
159 if (!stat(exe.c_str(), &attrib))
std::string getTimeStamp(std::time_t *time_stamp=NULL) const
◆ getInfo()
std::string SystemInfo::getInfo |
( |
| ) |
const |
Definition at line 30 of file SystemInfo.C.
Referenced by ConsoleUtils::outputFrameworkInformation().
32 std::stringstream oss;
33 oss << std::left <<
"Framework Information:\n" 34 << std::setw(25) <<
"MOOSE Version: " << MOOSE_REVISION <<
'\n' 35 << std::setw(25) <<
"LibMesh Version: " << LIBMESH_BUILD_VERSION <<
'\n';
36 #ifdef LIBMESH_DETECTED_PETSC_VERSION_MAJOR 37 oss << std::setw(25) <<
"PETSc Version: " << LIBMESH_DETECTED_PETSC_VERSION_MAJOR <<
'.' 38 << LIBMESH_DETECTED_PETSC_VERSION_MINOR <<
'.' << LIBMESH_DETECTED_PETSC_VERSION_SUBMINOR
41 #ifdef LIBMESH_DETECTED_SLEPC_VERSION_MAJOR 42 oss << std::setw(25) <<
"SLEPc Version: " << LIBMESH_DETECTED_SLEPC_VERSION_MAJOR <<
'.' 43 << LIBMESH_DETECTED_SLEPC_VERSION_MINOR <<
'.' << LIBMESH_DETECTED_SLEPC_VERSION_SUBMINOR
46 #ifdef MOOSE_LIBTORCH_ENABLED 47 oss << std::setw(25) <<
"Libtorch Version: " << TORCH_VERSION <<
'\n';
51 oss << std::setw(25) <<
"Current Time: " <<
getTimeStamp() <<
"\n";
56 if (!executable_time.empty())
57 oss << std::setw(25) <<
"Executable Timestamp: " << executable_time <<
"\n";
std::string getExecutable() const
std::string getTimeStamp(std::time_t *time_stamp=NULL) const
std::string getExecutableTimeStamp() const
◆ getTimeStamp()
std::string SystemInfo::getTimeStamp |
( |
std::time_t * |
time_stamp = NULL | ) |
const |
Definition at line 65 of file SystemInfo.C.
Referenced by getExecutableTimeStamp(), getInfo(), and to_json().
67 struct tm * tm_struct;
68 std::time_t local_time;
70 #ifdef LIBMESH_HAVE_LOCALE 73 const std::time_put<char> & tp = std::use_facet<std::time_put<char>>(loc);
78 local_time = time(NULL);
79 time_stamp = &local_time;
81 tm_struct = std::localtime(time_stamp);
84 std::ostringstream date_stream;
103 return date_stream.str();
108 const unsigned int time_size = 40;
109 char time_buffer[time_size];
113 local_time = time(NULL);
114 time_stamp = &local_time;
116 tm_struct = std::localtime(time_stamp);
124 size_t len = strftime(time_buffer, time_size,
"%c", tm_struct);
127 return std::string(time_buffer);
130 libMesh::out <<
"Error formatting time buffer, returning empty string!" << std::endl;
131 return std::string(
"");
134 #endif // LIBMESH_HAVE_LOCALE OStreamProxy out(std::cout)
◆ _argc
◆ _argv
The documentation for this class was generated from the following files: