Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/fclaw_options.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,9 @@ fclaw_register (fclaw_options_t* fclaw_opt, sc_options_t * opt)
sc_options_add_bool (opt, 0, "checkpoint", &fclaw_opt->checkpoint, 0,
"Enable checkpoint output [F]");

sc_options_add_int (opt, 0, "checkpoint-interval", &fclaw_opt->checkpoint_interval, 1,
"Output a checkpoint at every n output frames [1]");

/* ------------------------------- Restart options --------------------------------- */

sc_options_add_bool (opt, 0, "restart", &fclaw_opt->restart, 0,
Expand Down Expand Up @@ -442,6 +445,12 @@ fclaw_options_check (fclaw_options_t * fclaw_opt)
}
#endif

if (fclaw_opt->checkpoint_interval < 1)
{
fclaw_global_essentialf("Options : checkpoint-interval must be >= 1\n");
return FCLAW_EXIT_ERROR;
}

return FCLAW_NOEXIT;
}

Expand Down
1 change: 1 addition & 0 deletions src/fclaw_options.h
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ struct fclaw_options

int output;
int checkpoint;
int checkpoint_interval;

int restart;
const char * restart_file; /**< filename of restart file */
Expand Down
2 changes: 1 addition & 1 deletion src/fclaw_restart.c
Original file line number Diff line number Diff line change
Expand Up @@ -765,7 +765,7 @@ void fclaw_output_checkpoint(fclaw_global_t* glob, int iframe)
{
const fclaw_options_t *fclaw_opt = fclaw_get_options(glob);

if(fclaw_opt->checkpoint)
if(fclaw_opt->checkpoint && (iframe % fclaw_opt->checkpoint_interval == 0))
{
fclaw_timer_start (&glob->timers[FCLAW_TIMER_OUTPUT]);

Expand Down