72 if (amrex::ParallelDescriptor::IOProcessor())
76 std::chrono::time_point<std::chrono::system_clock> now_cr = std::chrono::system_clock::now();
77 std::time_t now = std::chrono::system_clock::to_time_t(now_cr);
89 std::string dumptable = ss.str();
90 hash = std::hash<std::string>{}(dumptable + std::ctime(&
starttime));
95 std::ofstream metadatafile;
96 metadatafile.open(plot_file+
"/metadata",std::ios_base::out);
97 metadatafile <<
"# COMPILATION DETAILS" << std::endl;
98 metadatafile <<
"# ===================" << std::endl;
99 metadatafile <<
"Git_commit_hash = " << METADATA_GITHASH << std::endl;
100 metadatafile <<
"AMReX_version = " << amrex::Version() << std::endl;
101 metadatafile <<
"Dimension = " << AMREX_SPACEDIM << std::endl;
102 metadatafile <<
"User = " << METADATA_USER << std::endl;
103 metadatafile <<
"Platform = " << METADATA_PLATFORM << std::endl;
104 metadatafile <<
"Compiler = " << METADATA_COMPILER << std::endl;
105 metadatafile <<
"Compilation_Date = " << METADATA_DATE << std::endl;
106 metadatafile <<
"Compilation_Time = " << METADATA_TIME << std::endl;
107 metadatafile << std::endl;
109 metadatafile <<
"# PARAMETERS" << std::endl;
110 metadatafile <<
"# ==========" << std::endl;
112 pp.dumpTable(metadatafile,
true);
114 metadatafile <<
"# RUN DETAILS" << std::endl;
115 metadatafile <<
"# ===========" << std::endl;
116 metadatafile <<
"HASH = " <<
hash << std::endl;
119 std::strftime(buffer,80,
"%Y-%m-%d %H:%M:%S",std::localtime(&
starttime));
120 std::string timefmt(buffer);
121 metadatafile <<
"Simulation_start_time = " << timefmt << std::endl;
123 metadatafile <<
"Number_of_processors = " << amrex::ParallelDescriptor::NProcs() << std::endl;
126 else if (status ==
Status::Abort) metadatafile <<
"Status = Abort";
131 metadatafile << std::endl;
136 std::strftime(buffer,80,
"%Y-%m-%d %H:%M:%S",std::localtime(&now));
137 std::string timefmt(buffer);
138 metadatafile <<
"Simulation_end_time = " << timefmt << std::endl;
141 auto milliseconds = std::chrono::duration_cast<std::chrono::milliseconds>(now_cr -
starttime_cr);
142 metadatafile <<
"Simulation_run_time = " << (float)milliseconds.count()/1000.0 <<
" " << std::endl;
144 WriteSlurmVariables(metadatafile);
146 #ifdef GIT_DIFF_OUTPUT
148 std::ifstream src(GIT_DIFF_OUTPUT,std::ios::binary);
149 std::ofstream dst(plot_file+
"/diff.html",std::ios::binary);
156 std::ifstream src(GIT_DIFF_PATCH_OUTPUT,std::ios::binary);
159 std::ofstream dst(plot_file+
"/diff.patch",std::ios::binary);
171 metadatafile.close();