13 #include "MooseRevision.h" 15 #include "libmesh/libmesh_config.h" 20 #ifdef LIBMESH_HAVE_LOCALE 24 #ifdef MOOSE_LIBTORCH_ENABLED 25 #include <torch/version.h> 31 std::stringstream oss;
32 oss << std::left <<
"Framework Information:\n" 33 << std::setw(25) <<
"MOOSE Version: " << MOOSE_REVISION <<
'\n' 34 << std::setw(25) <<
"LibMesh Version: " << LIBMESH_BUILD_VERSION <<
'\n';
35 #ifdef LIBMESH_DETECTED_PETSC_VERSION_MAJOR 36 oss << std::setw(25) <<
"PETSc Version: " << LIBMESH_DETECTED_PETSC_VERSION_MAJOR <<
'.' 37 << LIBMESH_DETECTED_PETSC_VERSION_MINOR <<
'.' << LIBMESH_DETECTED_PETSC_VERSION_SUBMINOR
40 #ifdef LIBMESH_DETECTED_SLEPC_VERSION_MAJOR 41 oss << std::setw(25) <<
"SLEPc Version: " << LIBMESH_DETECTED_SLEPC_VERSION_MAJOR <<
'.' 42 << LIBMESH_DETECTED_SLEPC_VERSION_MINOR <<
'.' << LIBMESH_DETECTED_SLEPC_VERSION_SUBMINOR
45 #ifdef MOOSE_LIBTORCH_ENABLED 46 oss << std::setw(25) <<
"Libtorch Version: " << TORCH_VERSION <<
'\n';
50 oss << std::setw(25) <<
"Current Time: " <<
getTimeStamp() <<
"\n";
54 if (!executable_time.empty())
55 oss << std::setw(25) <<
"Executable Timestamp: " << executable_time <<
"\n";
65 struct tm * tm_struct;
66 std::time_t local_time;
68 #ifdef LIBMESH_HAVE_LOCALE 71 const std::time_put<char> & tp = std::use_facet<std::time_put<char>>(loc);
76 local_time = time(NULL);
77 time_stamp = &local_time;
79 tm_struct = std::localtime(time_stamp);
82 std::ostringstream date_stream;
101 return date_stream.str();
106 const unsigned int time_size = 40;
107 char time_buffer[time_size];
111 local_time = time(NULL);
112 time_stamp = &local_time;
114 tm_struct = std::localtime(time_stamp);
122 size_t len = strftime(time_buffer, time_size,
"%c", tm_struct);
125 return std::string(time_buffer);
128 libMesh::out <<
"Error formatting time buffer, returning empty string!" << std::endl;
129 return std::string(
"");
132 #endif // LIBMESH_HAVE_LOCALE 152 if (!stat(exe.c_str(), &attrib))
std::string getExecutable() const
std::string getTimeStamp(std::time_t *time_stamp=NULL) const
std::string getExec()
Gets the full path to the running executable on Mac OS X and linux.
std::string getExecutableTimeStamp() const
std::string getInfo() const
OStreamProxy out(std::cout)