Commit 3b3e5ec4 authored by David Deepwell's avatar David Deepwell
Browse files

Increase the needed dump write time to account for clock time step

Some simulations have a long clock time per step, but have a short
write to disk time. If only the short write to disk time is
accounted for in the check_and_dump command then insufficient
time may be allocated for the dump to disk. Both are now accounted
for.
parent 6c338dbc
......@@ -364,7 +364,7 @@ void BaseCase::init_grid_restart(const std::string & component,
/* Check and dump */
void BaseCase::check_and_dump(double clock_time, double real_start_time,
double compute_time, double sim_time, double avg_write_time, int plot_number,
double compute_time, double sim_time, double avg_write_time, int plot_number, int iter,
DTArray & u, DTArray & v, DTArray & w, vector<DTArray *> & tracer){
if (compute_time > 0) {
// default is to not dump variables
......@@ -373,7 +373,8 @@ void BaseCase::check_and_dump(double clock_time, double real_start_time,
// check if close to end of compute time
if (master()) {
double total_run_time = clock_time - real_start_time;
if (compute_time - total_run_time < 3*avg_write_time) {
double avg_clk_step = total_run_time/(iter+1); // +1 to accound for initial iter=0
if (compute_time - total_run_time < 5*(avg_write_time + avg_clk_step)) {
do_dump = 1; // true
}
}
......
......@@ -118,7 +118,7 @@ class BaseCase {
virtual void write_chain(const char *filename, DTArray & val, int Iout, int Jout, double time);
/* dumping functions */
virtual void check_and_dump(double clock_time, double real_start_time,
double compute_time, double sim_time, double avg_write_time, int plot_number,
double compute_time, double sim_time, double avg_write_time, int plot_number, int iter,
DTArray & u, DTArray & v, DTArray & w, vector<DTArray *> & tracer);
virtual void successful_dump(int plot_number, double final_time, double plot_interval);
......
......@@ -337,7 +337,7 @@ class userControl : public BaseCase {
// see if close to end of compute time and dump
check_and_dump(clock_time, real_start_time, compute_time, time, avg_write_time,
plot_number, u, v, w, tracers);
plot_number, iter, u, v, w, tracers);
// Change dump log file if successfully reached final time
successful_dump(plot_number, final_time, plot_interval);
// increase counter
......
......@@ -423,7 +423,7 @@ class userControl : public BaseCase {
// see if close to end of compute time and dump
check_and_dump(clock_time, real_start_time, compute_time, time, avg_write_time,
plot_number, u, v, w, tracers);
plot_number, iter, u, v, w, tracers);
// Change dump log file if successfully reached final time
successful_dump(plot_number, final_time, plot_interval);
// increase counter
......
......@@ -381,7 +381,7 @@ class userControl : public BaseCase {
// see if close to end of compute time and dump
check_and_dump(clock_time, real_start_time, compute_time, time, avg_write_time,
plot_number, u, v, w, tracers);
plot_number, iter, u, v, w, tracers);
// Change dump log file if successfully reached final time
successful_dump(plot_number, final_time, plot_interval);
// increase counter
......
......@@ -468,7 +468,7 @@ class userControl : public BaseCase {
// see if close to end of compute time and dump
check_and_dump(clock_time, real_start_time, compute_time, time, avg_write_time,
plot_number, u, v, w, tracers);
plot_number, iter, u, v, w, tracers);
// Change dump log file if successfully reached final time
successful_dump(plot_number, final_time, plot_interval);
// increase counter
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment