#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 |
◆ getInfo()
std::string SystemInfo::getInfo |
( |
| ) |
const |
Definition at line 26 of file SystemInfo.C.
28 std::stringstream oss;
29 oss << std::left <<
"\nFramework Information:\n"
30 << std::setw(25) <<
"MOOSE Version: " << MOOSE_REVISION <<
'\n'
31 << std::setw(25) <<
"LibMesh Version: " << LIBMESH_BUILD_VERSION <<
'\n';
32 #ifdef LIBMESH_DETECTED_PETSC_VERSION_MAJOR
33 oss << std::setw(25) <<
"PETSc Version: " << LIBMESH_DETECTED_PETSC_VERSION_MAJOR <<
'.'
34 << LIBMESH_DETECTED_PETSC_VERSION_MINOR <<
'.' << LIBMESH_DETECTED_PETSC_VERSION_SUBMINOR
37 #ifdef LIBMESH_DETECTED_SLEPC_VERSION_MAJOR
38 oss << std::setw(25) <<
"SLEPc Version: " << LIBMESH_DETECTED_SLEPC_VERSION_MAJOR <<
'.'
39 << LIBMESH_DETECTED_SLEPC_VERSION_MINOR <<
'.' << LIBMESH_DETECTED_SLEPC_VERSION_SUBMINOR
44 oss << std::setw(25) <<
"Current Time: " <<
getTimeStamp() <<
"\n";
47 std::string executable(
_argv[0]);
48 size_t last_slash = executable.find_last_of(
"/");
49 if (last_slash != std::string::npos)
50 executable = executable.substr(last_slash + 1);
53 if (!stat(executable_path.c_str(), &attrib))
54 oss << std::setw(25) <<
"Executable Timestamp: " <<
getTimeStamp(&(attrib.st_mtime)) <<
"\n";
Referenced by ConsoleUtils::outputFrameworkInformation(), and ExodusFormatter::printInputFile().
◆ getTimeStamp()
std::string SystemInfo::getTimeStamp |
( |
std::time_t * |
time_stamp = NULL | ) |
const |
Definition at line 62 of file SystemInfo.C.
64 struct tm * tm_struct;
65 std::time_t local_time;
67 #ifdef LIBMESH_HAVE_LOCALE
70 const std::time_put<char> & tp = std::use_facet<std::time_put<char>>(loc);
75 local_time = time(NULL);
76 time_stamp = &local_time;
78 tm_struct = std::localtime(time_stamp);
81 std::ostringstream date_stream;
100 return date_stream.str();
105 const unsigned int time_size = 40;
106 char time_buffer[time_size];
110 local_time = time(NULL);
111 time_stamp = &local_time;
113 tm_struct = std::localtime(time_stamp);
121 size_t len = strftime(time_buffer, time_size,
"%c", tm_struct);
124 return std::string(time_buffer);
127 libMesh::out <<
"Error formatting time buffer, returning empty string!" << std::endl;
128 return std::string(
"");
131 #endif // LIBMESH_HAVE_LOCALE
Referenced by getInfo().
◆ _argc
◆ _argv
The documentation for this class was generated from the following files: