Skip to main content »

Trinity College Dublin

COMSOL

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 (ops@tchpc.tcd.ie) if you require access.

Requirments

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 : https://www.tchpc.tcd.ie/node/262

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. It would generally live in the same directory as your *.mph model file.

#!/bin/bash

# Ask for a number of compute nodes 
#SBATCH -N 

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

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

# Provide you project ID
#SBATCH -U 

# 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
INPUTFILE=/location/of/my/model.mph
OUTPUTFILE=/location/of/my/output_model.mph


######## DO NOT EDIT BELOW THIS LINE ########
export PATH=$PATH:/home/support/apps/apps/comsol44/COMSOL44/bin/
#SETUP THE COMSOL Environment
# Create a machinefile for mpd
srun hostname | sort -n > $SLURM_SUBMIT_DIR/machine_file
/home/support/apps/apps/comsol44/COMSOL44/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/comsol44/COMSOL44/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 : https://www.tchpc.tcd.ie/node/76

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
    

Notes

  • 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 4.2a of COMSOL is still available at /home/support/apps/apps/comsol42a/ on the clusters.

Last updated 13 Aug 2014Contact TCHPC: info | support.