COMSOL

Overview

COMSOL Multiphysics engineering simulation software is a complete simulation environment allowing geometry specification, meshing, specifying physics, solving and visualisation. On the CSF we are concentrating on the solving stage where a simulation can be run in batch.

COMSOL can be run in parallel using two methods: Shared-memory (OpenMP) parallelism and distributed-memory (MPI) parallelism. The shared-memory method is for single compute-node multi-core jobs (similar to how you run COMSOL on a multi-core workstation). The distributed-memory method is for much larger jobs where multiple CSF compute nodes (and all of the cores in those nodes) are used by COMSOL to utilise many cores and much more memory. See below for how to run both types of jobs.

Version 6.1, 6.2, & 6.3 are installed.

Restrictions on use

The Faculty of Science and Engineering has negotiated a Batch Academic Term License (BATL) for COMSOL Multiphysics and a wide selection of add-on modules. These licenses are now available for use by researchers within the Faculty of Science and Engineering.

Access to the research COMSOL floating network license and add-ons is being managed via PPMS NOT Research IT.

Further instructions on obtaining a licence and other relevant information can be found by following this link.

https://wiki.cs.manchester.ac.uk/tech/index.php/COMSOL

Unfortunately Research IT cannot provide support for licence related queries

Once you have obtained a licence and have received confirmation that your University username has been added to the licence server, please contact Research IT via the Connect Portal HPC Help form, requesting to be added to the group that provides access to COMSOL. Once added to the group you should be able to access and run COMSOL in batch mode on the CSF.

Set up procedure

We now recommend loading modulefiles within your jobscript so that you have a full record of how the job was run. See the example jobscript below for how to do this. Alternatively, you may load modulefiles on the login node and let the job inherit these settings.

To add the COMSOL installation to your environment, run:

module load apps/binapps/comsol/6.3
module load apps/binapps/comsol/6.2
module load apps/binapps/comsol/6.1

Running the application

The batch product should be used to run COMSOL. We do not currently support the client/server mode. You will require an input .mph file.

Serial batch job submission

It is not expected that this software be run serially.

Parallel Single-node multi-core batch job submission

This method will run COMSOL on a single CSF compute node and use the specified number of cores in that node (up to 32).

Example: Create a text file (e.g., using gedit) named comsol-smp-job.sh containing the following:

#!/bin/bash --login

#SBATCH -p multicore
#SBATCH -n 16      # Number of cores - can be 2 -- 168
#SBATCH -t 4-0     # 4 day Wallclock time
                   # Max 7-days (7-0)

# Load the modulefile in the jobscript
module purge
module load apps/binapps/comsol/6.2

# $SLURM_NTASKS is automatically set to the number of cores requested above

comsol -np $SLURM_NTASKS batch -usebatchlic -inputfile myinfile.mph -outputfile myoutputfile.mph -batchlog comsol.$JOB_ID.log
#!/bin/bash --login
#$ -cwd
#$ -pe smp.pe 16            # Number of cores - can be 2 -- 168 (gives up to 6GB per core)

# Load the modulefile in the jobscript
module load apps/binapps/comsol/6.2

# $NSLOTS is automatically set to the number of cores requested above

comsol -np $NSLOTS batch -usebatchlic -inputfile myinfile.mph -outputfile myoutputfile.mph -batchlog comsol.$JOB_ID.log

To submit the job to the queue

sbatch comsol-smp-job.sh
qsub comsol-smp-job.sh

The following flags may also be useful on the comsol command line (add to jobscript above):

-tmpdir /scratch/$USER        # Use scratch for temp files

Further info

Product documentation (PDFs and HTML) is available on the CSF in

$COMSOL_HOME/doc/

The hybrid use of MPI and OpenMP parallelism allows for a variety of parallel process layouts. The COMSOL Blog article on the advantages of hybrid parallelism describes this in more detail.

See also http://www.uk.comsol.com/

Updates

Last modified on May 22, 2025 at 3:15 pm by Chris Grave