You don't need anything extra; just "sim submit <simulationname>".
TerminationTrigger::max_walltime = @WALLTIME_HOURS@
TerminationTrigger::on_remaining_walltime = 30 # minutes
TerminationTrigger::output_remtime_every_minutes = 30
This will cause Cactus to cleanly terminate 30 minutes before the end of the job's walltime (as a margin). If you additionally use
IO::checkpoint_on_terminate = yes
then you will get a checkpoint written. Without this, your job will be unceremoniously killed by the scheduler, leaving you with up to 3 hours of wasted computer time, possible corrupted output files, and duplicate data.
It is also convenient to use
TerminationTrigger::termination_from_file = yes
TerminationTrigger::termination_file = "terminate.txt"
TerminationTrigger::create_termination_file = yes
This will create a file called "terminate.txt" in the output directory. If you add a "1" to this file, Cactus will terminate immediately (and checkpoint, if you have set checkpoint_on_terminate as above). You can then resubmit the simulation if you like. This allows you to easily stop and start simulations without losing any runtime.