COMSOL Batch
The COMSOL Multiphysics batch mode provides a way to run COMSOL Multiphysics without a graphical user interface. The COMSOL batch mode allows you to run both Model MPH files and compiled model files for Java (class files).
You can control the options for running the COMSOL software in batch mode from the Study node in the Model Builder. To enable the Batch feature, click the Show More Options button () and select Batch or Batch and Cluster (if your license includes cluster computing) in the Show More Options dialog. Then in the Model Builder, right-click a Study node and select Batch. Also see Design of Experiments (Job Configurations).
You can also run COMSOL batch using a command-line interface, as described in COMSOL Batch Commands (Windows), COMSOL Batch Commands (Linux), and COMSOL Batch Commands (macOS).
In batch mode, you can monitor the memory usage reported in the log as lines of the form
Memory: RAM/MAXRAM VIRT/MAXVIRT
where RAM is the current memory usage in MB, and VIRT is the current virtual memory usage in MB. The maximum measured usage is reported in MAXRAM and MAXVIRT, respectively. The log only reports changes to the memory usage. You can also monitor the current progress, which is reported as lines in the log of the form
Current Progress: 53%
where the percentage indicates the currently estimated progress.
For options for controlling the batch command, see the section The COMSOL Commands for your platform.
COMSOL Batch under a Floating Network License
If you have licensed a floating network license, you are allowed to run a simultaneous “batch job” along with your COMSOL Multiphysics Desktop. Such batch jobs have the capacity to run parametric sweeps on multiple computers, as long as the changes to your model include only changes to parameters. This batch license functionality is only available for Cluster Computing and Cluster Sweep nodes, and you must select the Use batch license checkbox in the Cluster Computing and Cluster Sweep nodes’ Settings windows. Each additional floating network license lets you run a separate independent batch job (with different models) on multiple computers.
Running COMSOL Batch with Models and Data Storage in Databases
If COMSOL Multiphysics is licensed with Model Manager functionality, it is possible to run COMSOL batch using a Model Manager database as storage for models and data, both from the command-line interface and from batch features under a Study node in the Model Builder. From the command-line interface, both the input and output models, and batch data, can be specified as database locations. See Running COMSOL Batch via the Command-line in the Model Manager Reference Manual for more details.
In the Model Builder, in the Settings window for the features Batch, Batch Sweep, Cluster Computing and Cluster Sweep, it is possible to configure storage modes for models and batch data in the Cluster computing settings section, under Batch Settings. From the Model storage and Data storage lists, respectively, choose: File system, Database or Same as current model. File system uses the traditional file system for storage, while Database uses a Model Manager database for storage. Same as current model uses the same storage as the current desktop model, which is either the file system or database. If selecting the database storage mode, it is required that the desktop model is saved in the database. These settings are also available as preferences under Preferences > Cluster Computing. The storage mode options are also available under the Batch job configuration node.
Note that it is possible to combine different storage modes for models and batch data, generating a hybrid storage where, for example, models are stored in a database while batch data is stored on the file system, or the other way around.
When both storage options are set to Database, temporary files may still be stored on the file system in the batch directory. The Directory and Specify server directory path settings may still be relevant to configure if you need to look at these files, for example when troubleshooting. If Output model to file or Save model to file after synchronization are enabled, the model is saved to the database instead of the file system. Additionally, it is not necessary to specify file transfer commands in a Cluster Computing node when running batch jobs on a remote computer, since models and batch data are automatically transferred from/to the database.
Currently, the following settings and actions are not supported when the Database storage mode is used:
Clear Data or Clear Status in the Settings window for the External Process node, or in the External Process window.
The Filename setting in the Settings window.
The Open action for the model in the Batch Data or External Process nodes, or in the External Process window.
See Running COMSOL Batch from the COMSOL Desktop in the Model Manager Reference Manual for more details.