We are continuing the COMSOL focus days in our daily zoom garage in Autumn 2023: someone from COMSOL (the company) plans to join our zoom garage at 13:00 on the following Tuesdays: 2023-09-05, 2023-09-19, 2023-10-03, 2023-10-17, 2023-10-31, 2023-11-14, 2023-11-28, 2023-12-12.
Join the other COMSOL users in our Zulip Chat: Stream “#triton”, topic “Comsol user group”.
To check which versions of Comsol are available, run:
module spider comsol
Comsol in Triton is best run in Batch-mode, i.e. without the graphical userinterface. Prepare your models on your workstation and bring the ready-to-run models to triton. For detailed tutorials from COMSOL, see for example the Comsol Knowledge base articles Running COMSOL® in parallel on clusters and Running parametric sweeps, batch sweeps, and cluster sweeps from the command line. However, various settings must be edited in the graphical user interface.
Best practices of using COMSOL Graphical User Interface in Triton
Connect to triton
Use Open OnDemand for the best experience for interactive work on triton.
Connect to https://ood.triton.aalto.fi with your browser, log in. (It currently takes a while, please be patient.) Choose “My Interactive Sessions” from top bar, and then “Triton Desktop” from bottom. Launch your session, and once resources become available in triton, the session will be started on one of the interactive session nodes of triton. You can connect to a desktop in your browser with the “Launch Triton Desktop” button.
Once you have connected, you can open a terminal (in XFCE the black rectangle in the bottom of the screen).
You can alternatively open a linux session in https://vdi.aalto.fi.
Open a terminal, and connect with ssh to triton login nodessh -Y triton.aalto.fi
However, if you use this terminal to start COMSOL, it will be running on the login node, which is a shared resource, and you should be careful not to use too much memory or CPUs.
First make sure you have graphical connection (should print something like “:1.0”)
then load the comsol module (version of your choice)
module load comsol/6.1
and finally start comsol
Prerequsities of running COMSOL in Triton
There is a largish but limited pool of floating COMSOL licenses in Aalto University, so please be careful not launch large numbers of comsol processess that each consume a separate license.
Comsol uses a lot of temp file storage, which by default goes to
$HOME. Fix a bit like the following:
$ rm -rf ~/.comsol/ $ mkdir /scratch/work/$USER/comsol_recoveries/ $ ln -sT /scratch/work/$USER/comsol_recoveries/ ~/.comsol
You may need to enable access to the whole filesystem in File|Options –> Preferences –> Security: File system access: “All files”
Enable the “Study -> Batch and Cluster” as well as “Study -> Solver and Job Configurations” nodes in the “Show More Options dialog box you can open by right-clicking the study in the Model Builder Tree.
The cluster settings can be saved in comsol settings, not in the model file. The correct settings are entered in File|Options –> Preferences –> Multicore and Cluster Computing. It is enough to choose Scheduler type: “SLURM”
You can test by loading from the Application Libraries the “cluster_setup_validation” model. The model comes with a documentation -pdf file, which you can open in the Application Libraries dialogue after selecting the model.
COMSOL requires MPICH2 compatible MPI libraries:
$ module purge $ module load comsol/6.1 intel-parallel-studio/cluster.2020.0-intelmpi
A dictionary of COMSOL HPC lexicon
The knowledge base article Running COMSOL® in parallel on clusters explains the following meanings COMSOL uses:
SLURM & MPI
A process, software concept
A single computer
A single CPU-core
However, COMSOL does not seem to be using the terms in a 100% consistent way. E.g. sometimes in the SLURM context COMSOL may use node in the SLURM meaning.
An example run in a single node
Use the parameters
-launcher slurm. Here is a sample batch-job:
#!/bin/bash # Ask for e.g. 20 compute cores #SBATCH --time=10:00:00 #SBATCH --mem-per-cpu=2G #SBATCH --cpus-per-task=20 cd $WRKDIR/my_comsol_directory module load Java module load comsol/6.1 module load intel-parallel-studio/cluster.2020.0-intelmpi # Details of your input and output files INPUTFILE=input_model.mph OUTPUTFILE=output_model.mph comsol batch -clustersimple -launcher slurm -inputfile $INPUTFILE -outputfile $OUTPUTFILE -tmpdir $TMPDIR
If you have a parameter scan to perform, you can use the Cluster sweep node. The whole sweep only needs one license even if comsol launches multiple instances of itself.
First set up the cluster preferences, as described above.
Start by loading the correct modules in triton (COMSOL requires MPICH2 compatible MPI libraries). Then open the graphical user interface to comsol on the login node and open your model.
$ module purge $ module load comsol/6.1 intel-parallel-studio/cluster.2020.0-intelmpi $ comsol
Add a “Cluster Sweep” node to your study and a “Cluster Computing” node into your “Job Configurations” (You may need to first enable them in the “Show more options”. Check the various options. You can try solving a small test case from the graphical user interface. You should see COMSOL submitting jobs to the SLURM queue. You can download an
For a larger run, COMSOL can then submit the jobs with comsol but without the GUI:
$ comsol batch -inputfile your_ready_to_run_model.mph -outputfile output_file.mph -study std1 -mode desktop
See also how to run a parametric sweep from command line?
Cluster computing controlled from your windows workstation
The following example shows a working set of settings to use triton as a remote computation cluster for COMSOL.