19 if (amrex::ParallelDescriptor::IOProcessor())
23 std::chrono::time_point<std::chrono::system_clock> now_cr = std::chrono::system_clock::now();
24 std::time_t now = std::chrono::system_clock::to_time_t(now_cr);
36 std::string dumptable = ss.str();
37 hash = std::hash<std::string>{}(dumptable + std::ctime(&
starttime));
42 std::ofstream metadatafile;
43 metadatafile.open(plot_file+
"/metadata",std::ios_base::out);
44 metadatafile <<
"# COMPILATION DETAILS" << std::endl;
45 metadatafile <<
"# ===================" << std::endl;
46 metadatafile <<
"Git_commit_hash = " << METADATA_GITHASH << std::endl;
47 metadatafile <<
"AMReX_version = " << amrex::Version() << std::endl;
48 metadatafile <<
"Dimension = " << AMREX_SPACEDIM << std::endl;
49 metadatafile <<
"User = " << METADATA_USER << std::endl;
50 metadatafile <<
"Platform = " << METADATA_PLATFORM << std::endl;
51 metadatafile <<
"Compiler = " << METADATA_COMPILER << std::endl;
52 metadatafile <<
"Compilation_Date = " << METADATA_DATE << std::endl;
53 metadatafile <<
"Compilation_Time = " << METADATA_TIME << std::endl;
54 metadatafile << std::endl;
56 metadatafile <<
"# PARAMETERS" << std::endl;
57 metadatafile <<
"# ==========" << std::endl;
59 pp.dumpTable(metadatafile,
true);
61 metadatafile <<
"# RUN DETAILS" << std::endl;
62 metadatafile <<
"# ===========" << std::endl;
63 metadatafile <<
"HASH = " <<
hash << std::endl;
66 std::strftime(buffer,80,
"%Y-%m-%d %H:%M:%S",std::localtime(&
starttime));
67 std::string timefmt(buffer);
68 metadatafile <<
"Simulation_start_time = " << timefmt << std::endl;
70 metadatafile <<
"Number_of_processors = " << amrex::ParallelDescriptor::NProcs() << std::endl;
73 else if (status ==
Status::Abort) metadatafile <<
"Status = Abort";
78 metadatafile << std::endl;
83 std::strftime(buffer,80,
"%Y-%m-%d %H:%M:%S",std::localtime(&now));
84 std::string timefmt(buffer);
85 metadatafile <<
"Simulation_end_time = " << timefmt << std::endl;
88 auto milliseconds = std::chrono::duration_cast<std::chrono::milliseconds>(now_cr -
starttime_cr);
89 metadatafile <<
"Simulation_run_time = " << (float)milliseconds.count()/1000.0 <<
" " << std::endl;
91 #ifdef GIT_DIFF_OUTPUT
93 std::ifstream src(GIT_DIFF_OUTPUT,std::ios::binary);
94 std::ofstream dst(plot_file+
"/diff.html",std::ios::binary);
101 std::ifstream src(GIT_DIFF_PATCH_OUTPUT,std::ios::binary);
104 std::ofstream dst(plot_file+
"/diff.patch",std::ios::binary);
116 metadatafile.close();