MCPcopy Create free account
hub / github.com/AMReX-Astro/Castro / writeJobInfo

Method writeJobInfo

Source/driver/Castro_io.cpp:537–847  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

535
536
537void
538Castro::writeJobInfo (const std::string& dir, const Real io_time)
539{
540
541 // job_info file with details about the run
542 std::ofstream jobInfoFile;
543 std::string FullPathJobInfoFile = dir;
544 FullPathJobInfoFile += "/job_info";
545 jobInfoFile.open(FullPathJobInfoFile.c_str(), std::ios::out);
546
547 std::string PrettyLine = std::string(78, '=') + "\n";
548 std::string OtherLine = std::string(78, '-') + "\n";
549 std::string SkipSpace = std::string(8, ' ');
550
551 // job information
552 jobInfoFile << PrettyLine;
553 jobInfoFile << " Castro Job Information\n";
554 jobInfoFile << PrettyLine;
555
556 jobInfoFile << "job name: " << job_name << "\n\n";
557 jobInfoFile << "inputs file: " << inputs_name << "\n\n";
558
559 jobInfoFile << "number of MPI processes: " << ParallelDescriptor::NProcs() << "\n";
560#ifdef AMREX_USE_OMP
561 jobInfoFile << "number of threads: " << omp_get_max_threads() << "\n";
562#endif
563 jobInfoFile << "\n";
564 jobInfoFile << "hydro tile size: " << hydro_tile_size << "\n";
565
566 jobInfoFile << "\n";
567#ifdef AMREX_USE_GPU
568 jobInfoFile << "GPU time used since start of simulation (GPU-hours): " <<
569 getCPUTime()/3600.0;
570#else
571 jobInfoFile << "CPU time used since start of simulation (CPU-hours): " <<
572 getCPUTime()/3600.0;
573#endif
574
575 jobInfoFile << "\n\n";
576
577 // plotfile information
578 jobInfoFile << PrettyLine;
579 jobInfoFile << " Plotfile Information\n";
580 jobInfoFile << PrettyLine;
581
582 const std::time_t now = time(nullptr);
583 jobInfoFile << "output date / time: "
584 << std::put_time(std::localtime(&now), "%c\n") << "\n";
585
586 jobInfoFile << "output dir: " << amrex::FileSystem::CurrentPath() << "\n";
587
588 jobInfoFile << "I/O time (s): " << io_time << "\n";
589
590 jobInfoFile << "\n\n";
591
592#ifdef AMREX_USE_GPU
593 // This output assumes for simplicity that every rank uses the
594 // same type of GPU.

Callers

nothing calls this directly

Calls 2

closeMethod · 0.80

Tested by

no test coverage detected