13 using clock = std::chrono::system_clock;
14 const auto now = clock::now();
15 const auto now_c = clock::to_time_t( now );
17 out <<
"=========================================\n";
18 out <<
" TerraNeo - Run Info \n";
19 out <<
"=========================================\n";
21 out <<
"Wall time start : " << std::put_time( std::localtime( &now_c ),
"%Y-%m-%d %H:%M:%S" ) <<
"\n";
26 std::filesystem::path bin_path( argv[0] );
27 bin_path = std::filesystem::absolute( bin_path );
28 out <<
"Executable path : " << bin_path <<
"\n";
29 out <<
"Executable dir : " << bin_path.parent_path() <<
"\n";
30 out <<
"Working dir : " << std::filesystem::current_path() <<
"\n";
34 out <<
"Executable path : (unavailable)\n";
38 out <<
"Command line :";
39 for (
int i = 0; i < argc; ++i )
41 out <<
" " << argv[i];
46 const auto threads = Kokkos::num_threads();
47 const auto devices = Kokkos::num_devices();
51 out <<
"MPI processes : " << mpi_procs <<
"\n";
52 out <<
"MPI rank : " << mpi_rank <<
"\n";
53 out <<
"Kokkos threads : " << threads <<
"\n";
54 out <<
"Kokkos devices : " << devices <<
"\n";
56 using ExecSpace = Kokkos::DefaultExecutionSpace;
57 using MemSpace = ExecSpace::memory_space;
58 out <<
"ExecSpace : " << ExecSpace::name() <<
"\n";
59 out <<
"MemSpace : " << MemSpace::name() <<
"\n";
62#if defined( __linux__ )
64 if ( gethostname( hostname,
sizeof( hostname ) ) == 0 )
66 logall <<
"Rank " << mpi_rank <<
": device id = " << Kokkos::device_id() <<
", node = " << hostname << std::endl;
71 out <<
"=========================================\n" << std::endl;
detail::PrefixCout logall([]() { return detail::log_prefix();}, false)
std::ostream subclass that just logs on any process and adds a timestamp for each line.
void print_general_info(int argc, char **argv, std::ostream &out=logroot)
Prints some general information for this run to out.
Definition info.hpp:11