We highly recommend using background jobs for tasks that require a long time to complete, like MD calculations. In this article, we'll explain how foreground execution works, what's so great about running jobs in the background, and some helpful tips.
Foreground job
Executing a cell in Jupyter Notebook with Shift+Enter or by clicking the "Run the Cell and advance" button will run the process in the foreground.
pros
When running in the foreground, interactive outputs are displayed as the process runs, allowing you to quickly check for errors during calculations.
Best for:
- Visualizing loaded structural data
- Graphing calculation results
- Test calculations for MD or other simulation that are set to finish quickly (for example, by adjusting the number of steps or termination conditions)
The status will show as "Busy" while the process is running.
cons
When executing in the foreground, if the connection to the kernel is lost (e.g., due to a timeout), the output will stop and the kernel status will become 'Unknown.'
Although the ongoing process will continue unless an error occurs, it becomes difficult to visually confirm whether the calculation is still running. (For tasks like MD calculations, you can check if the calculation is still in progress by monitoring the size of the output log file.)
Feature: Background job
You can run background jobs from the button included in Matlantis.
For basic operation and how to use it, please see here.
Pros
- You can view jobs that are currently running or have been completed on the screen.
- Clicking the file name on the screen will show you the file's location in the File Browser.
- You can also cancel a running background job.
- You can receive email notifications when a calculation is finished. (For more details on setting up the email address, please see here.)
- When a background job is launched, it automatically saves a copy of your open notebook under a new name. This provides a safe backup, even if you accidentally continue to modify the original file.
- For jobs that are waiting to run, you can change their queue order or modify their priority settings.
Background Job Tips
-
The number of background jobs that can run simultaneously is user-configurable. (Jobs that exceeded this limit will be placed in a queue. For details on how to change this setting, please see here.) Please ensure that the memory used by the job being executed does not exceed your notebook's specifications.
A warning mark will appear if the number exceeds 6 (recommended, default), but the setting will remain effective.
- The setting "Re-run Interrupted jobs at startup" was enabled by default (This has been invalidated since October 2025, but may still be effective if a previous setting remains). This ensures that if Matlantis is unexpectedly restarted due to an accident or similar issue while background jobs are running, the jobs are executed again. Since jobs that are stopped unintentionally will not resume from where they left off but will start the computation from the beginning, we recommend taking precautions to avoid overwriting results. For example, you can use the date and time in your output filenames. Alternatively, you may disable this feature if you don't need it.(For generating folder names using date and time, please refer to this article)