Skip to main content »

Trinity College Dublin


The COMSOL Multiphysics engineering simulation software environment facilitates all steps in the modeling process − defining your geometry, meshing, specifying your physics, solving, and then visualizing your results.

Running COMSOL on the TCHPC clusters is done in batch mode. The generation of models should be done locally on your own desktop. Save your model file (*.mph) and transfer it to the cluster for analysis.

COMSOL is a restricted access software due to limited available licences. Please contact the team ( if you require access.


File transfer to the cluster

After you have generated your model file (usually named *.mph) you will need to transfer it to the cluster. Details on the transfer of files to and from our cluster are available here :

You will typically have been assigned a storage area in association with your project id. This would be a good place to store model files and to run the analysis.

Generate a batch submission file

To run your COMSOL job you will need to generate another file know as a 'batch submission file'. This file will details the resources required for the job, will set up the required environment for the job and, finally, run the job. The batch file is submitted the the queue and run when the resources are available.

Below is a template batch file for Comsol 5. It would generally live in the same directory as your *.mph model file.


# Ask for a number of compute nodes 

# Submit to a partition (debug or compute)
#SBATCH -p compute

# Request a run time (max 4days on compute partition)
#SBATCH -t 24:00:00

# Set your email address to be notified of jobs updates
#SBATCH --mail-type=ALL
#SBATCH --mail-user=your@email.address

# Details of your input and output files

######## DO NOT EDIT BELOW THIS LINE ########
export PATH=$PATH:/home/support/apps/apps/comsol5/COMSOL5/bin/
# Create a machinefile for mpd
srun hostname | sort -n > $SLURM_SUBMIT_DIR/machine_file
/home/support/apps/apps/comsol5/COMSOL5/bin/comsol -nn $SLURM_NNODES mpd boot -f $SLURM_SUBMIT_DIR/machine_file
## Now, run COMSOL in batch mode with the input and output detailed above.
/home/support/apps/apps/comsol5/COMSOL5/bin/comsol -nn $SLURM_NNODES batch -inputfile $INPUTFILE -outputfile $OUTPUTFILE

Transfer this file (perhaps named .sbatch to the cluster. Typically is may live in the same location at the *.mph model file.

Submit the job to the queue

You will need to access the cluster via SSH to submit your job. Details on how to do this are available :

When you have logged in, do the following :

  • Navigate to the location of the batch file
    cd /projects/location/of/batchfile.sbatch
  • Submit the job to the queue
    sbatch batchfile.sbatch


  • COMSOL appears to the threaded for the parallel parts. You should request physical nodes, rather then individual cores. Minimise the number of MPI tasks and let threads sort themselves out per node.
  • The older version's 4.2a & 4.4 of COMSOL are still available at
    on the clusters.

Last updated 20 Jan 2017Contact Research IT.