5 #include <athena/mesh/mesh.hpp>
6 #include <athena/outputs/io_wrapper.hpp>
7 #include <athena/parameter_input.hpp>
10 #include <application/globals.hpp>
13 #include <configure.hpp>
26 void mesh_destroy(ParameterInput *&pinput, Mesh *&pmesh,
int mbcnt) {
27 clock_t tstop = clock();
29 if (Globals::my_rank == 0) {
30 pmesh->OutputCycleDiagnostics();
31 if (pmesh->ncycle == pmesh->nlim) {
32 std::cout << std::endl <<
"Terminating on cycle limit" << std::endl;
35 std::cout <<
"time=" << pmesh->time <<
" cycle=" << pmesh->ncycle
37 std::cout <<
"tlim=" << pmesh->tlim <<
" nlim=" << pmesh->nlim << std::endl;
39 if (pmesh->adaptive) {
40 std::cout << std::endl
41 <<
"Number of MeshBlocks = " << pmesh->nbtotal <<
"; "
42 << pmesh->nbnew <<
" created, " << pmesh->nbdel
43 <<
" destroyed during this simulation." << std::endl;
47 #ifdef OPENMP_PARALLEL
48 double omp_time = omp_get_wtime() - omp_start_time;
50 clock_t tstop = clock();
52 (tstop > Globals::tstart ?
static_cast<double>(tstop - Globals::tstart)
54 static_cast<double>(CLOCKS_PER_SEC);
55 std::uint64_t zonecycles =
56 mbcnt *
static_cast<std::uint64_t
>(
57 pmesh->my_blocks(0)->GetNumberOfMeshBlockCells());
58 double zc_cpus =
static_cast<double>(zonecycles) / cpu_time;
60 std::cout << std::endl <<
"zone-cycles = " << zonecycles << std::endl;
61 std::cout <<
"zone-cycles/cpu_second = " << zc_cpus << std::endl;
62 #ifdef OPENMP_PARALLEL
63 double zc_omps =
static_cast<double>(zonecycles) / omp_time;
64 std::cout << std::endl <<
"omp wtime used = " << omp_time << std::endl;
65 std::cout <<
"zone-cycles/omp_wsecond = " << zc_omps << std::endl;
static void Destroy()
Destroy the one and only instance of Thermodynamics.
void mesh_destroy(ParameterInput *&pinput, Mesh *&pmesh, int mbcnt)
void free_mpi_particle_data()