Output to a restart file
When you want to split your application case into several simulations you can write your simulation state to a restart file and then continue the simulation by reading this file. There are two main ways of writing a restart file but Aspherix® can also write some restart files by itself when certain conditions are met. Those options will all be discussed in the following.
write_restart
To write a binary restart file simply add a line similar to the following to your input script:
write_restart restart_file_%.basx
The file ending does not really matter but it’s good practice to use basx for consistency. The % sign indicates that we want to write a parallel restart file. This will cause several restart files to be written and not just one, which improves performance. You will obtain a file for each processor plus a base file.
restart
The restart command is used to write restart files periodically either one for each file or two of them alternatingly. The first option requires a command similar to the following:
restart 1000 restart_repeated_*_%.basx
This command will write a restart file every 1000 time steps. As above, the % indicates parallel writing of the restart files and the * will be replaced by the current time step. So if you would have a simulation with 2 processors running for 3000 time steps, then the created files will be:
restart_repeated_1000_base.basx
restart_repeated_1000_0.basx
restart_repeated_1000_1.basx
restart_repeated_2000_base.basx
restart_repeated_2000_0.basx
restart_repeated_2000_1.basx
restart_repeated_3000_base.basx
restart_repeated_3000_0.basx
restart_repeated_3000_1.basx
Alternatively, if you add two file names to the command they will be written alternatingly, e.g.:
restart 1000 restart_a_%.basx restart_b_%.basx
This is especially useful when running on a cluster as running into the wall clock. The latest (and complete) restart file can then be used to continue the simulation if necessary.
Automated restart writing
Aspherix® writes restart files automatically when it encounters specific situations. One of them is manual abort by the user which can be triggered by pressing Ctrl+C. See the howto of signal handling for further details. Should the connection to the license server be interrupted a restart file will be written before the simulation ends. Regardless of how this is triggered, the restart files are always called aspherix_auto_restart_%.basx so in a two processor simulation the following files would be created:
aspherix_auto_restart_0.basx
aspherix_auto_restart_1.basx
aspherix_auto_restart_base.basx
These files can be used to restart the simulation using the read command just as any other set of restart files.