If you’ve embarked on your fair share of CFD like I have, you know how critical it can be to set up auto-save for long-running CFD jobs. Learning that you lost four days of runtime because of a power outage will make you reevaluate your priorities. This blog covers exiting Ansys Fluent and manually saving your results when running in batch mode.
First let’s cover a bit of background and motivation. Transient simulations or even steady-state simulations with large meshes often use high-performance computing (HPC) resources, and these resources typically require submitting batch jobs to schedulers like Slurm, PBS etc. The downside to working in batch mode is that you cannot interactively pause or stop a job. As a reminder, it’s easy to auto-save in Ansys Fluent. This setting is found in the Solution Calculation Activities section as shown in Figure 1. The Autosave panel allows you to define the save frequency and filename. You can also limit retention to the most recent 1 or 2 files conserve disk space.
Figure 1: Auto-Save Settings in Ansys Fluent
Autosave ensures you have case and data files to post-process or resume from, whether your job is killed by a power outage or stopped intentionally.
What are your options if you neglected to enable auto-save? You certainly don’t want to kill the job because you will lose all progress to this point.
Ansys Fluent offers two options for this situation, both involving the creation of a blank file in the working directory.
- Option one is to place a blank file named “check-fluent” in your working directory. This will trigger Ansys Fluent to save case and data files at the current iteration or timestep and then continue solving. This serves two main purposes:
- Saves your work in case your HPC or model crashes
- Lets you inspect intermediate results and decide whether to continue or adjust settings
- Option two is to place a blank file named “exit-fluent” in your working directory. This will trigger Ansys Fluent to save your case and data files and then gracefully stop the job. Some examples of why you may want to manually interrupt a batch job are:
- The time allocated to your job on your HPC is about to elapse and you don’t want to lose progress to this point.
- The monitor files and residuals in the transcript file indicate the solution has stagnated and running it longer is unlikely to achieve better convergence. In this case you may as well interrupt the solve and free up the HPC.
- The model isn’t progressing as expected so you want to stop the model to investigate the flow field to determine how to adjust the settings.
- You originally planned to simulate the full duration of a transient event but determined that a partial simulation is sufficient.
An example workflow showing the usage of check-fluent and exit-fluent files is shown below on a Linux system.
Figure 2: Example Workflow to Save and Gracefully Stop Batch Ansys Fluent Jobs
Now you Know the Ins and Outs of Exiting Ansys Fluent and Saving your Results
To summarize, enabling auto-save is strongly recommended when working with batch jobs and doing so prevents losing hours/days/weeks of runtime. Saving a “check-fluent” or “exit-fluent” blank file in the working directory serves as a convenient backup plan for saving progress or gracefully exiting Ansys Fluent.
You must be logged in to post a comment.