12 #include "MooseRevision.h" 14 #include "libmesh/libmesh_config.h" 19 #ifdef LIBMESH_HAVE_LOCALE 23 #ifdef LIBTORCH_ENABLED 24 #include <torch/version.h> 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 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";
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 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);
159 if (!stat(exe.c_str(), &attrib))
SystemInfo(int argc, char *argv[])
std::string getExecutable() const
std::string getExecutablePath()
This function returns the PATH of the running executable.
std::string getTimeStamp(std::time_t *time_stamp=NULL) const
std::string getExecutableTimeStamp() const
std::string getInfo() const
OStreamProxy out(std::cout)