Use wall time for timestep logging

This commit is contained in:
2026-03-30 20:38:41 +08:00
parent 5f664716ab
commit 087d034ee3
3 changed files with 40 additions and 38 deletions

View File

@@ -1891,7 +1891,7 @@ void bssn_class::Read_Ansorg()
void bssn_class::Evolve(int Steps)
{
clock_t prev_clock, curr_clock;
double prev_clock = 0.0, curr_clock = 0.0;
double LastDump = 0.0, LastCheck = 0.0, Last2dDump = 0.0;
LastAnas = 0;
#if 0
@@ -2035,10 +2035,12 @@ void bssn_class::Evolve(int Steps)
GH->settrfls(trfls);
for (int ncount = 1; ncount < Steps + 1; ncount++)
{
cout << "Before Step: " << ncount << " My Rank: " << myrank
<< " takes " << MPI_Wtime() - beg_time << " seconds!" << endl;
for (int ncount = 1; ncount < Steps + 1; ncount++)
{
if (myrank == 0)
curr_clock = MPI_Wtime();
cout << "Before Step: " << ncount << " My Rank: " << myrank
<< " takes " << MPI_Wtime() - beg_time << " seconds!" << endl;
beg_time = MPI_Wtime();
#if (PSTR == 0)
RecursiveStep(0);
@@ -2095,10 +2097,10 @@ void bssn_class::Evolve(int Steps)
if (myrank == 0)
{
prev_clock = curr_clock;
curr_clock = clock();
cout << "Timestep # " << ncount << ": integrating to time: " << PhysTime << endl;
cout << "used " << (double)(curr_clock - prev_clock) / ((double)CLOCKS_PER_SEC) << " seconds!" << endl;
prev_clock = curr_clock;
curr_clock = MPI_Wtime();
cout << "Timestep # " << ncount << ": integrating to time: " << PhysTime << endl;
cout << "used " << (curr_clock - prev_clock) << " seconds!" << endl;
}
if (PhysTime >= TotalTime)