Page tree
Skip to end of metadata
Go to start of metadata

COMSOL Multiphysics is a powerful interactive environment for modeling and solving all kinds of scientific and engineering problems based on partial differential equations (PDEs). With this product you can easily extend conventional models for one type of physics into multiphysics models that solve coupled physics phenomena and do so simultaneously. Accessing this power does not require an in-depth knowledge of mathematics or numerical analysis. Thanks to the built-in physics modes it is possible to build models by defining the relevant physical quantities such as material properties, loads, constraints, sources, and fluxes rather than by defining the underlying equations. COMSOL Multiphysics then internally compiles a set of PDEs representing the entire model. You access the power of COMSOL Multiphysics as a standalone product through a flexible graphical user interface, or by script programming in the MATLAB language.


To use COMSOL on Raijin, please send out the request to join COMSOL software group first by following this link [https://my.nci.org.au/mancini/project/comsol/join] and, if Matlab is needed, please also join corresponding Matlab software group through [my.nci.org.au] according to your institution.

Usage

Before running COMSOL version 5.1 you should do the following:

mkdir -p /short/$PROJECT/$USER/.comsol/v51
mkdir $HOME/.comsol
cd $HOME/.comsol
ln -s /short/$PROJECT/$USER/.comsol/v51 v51

This ensures that your home quota is not exceeded by COMSOL temporary files being stored in $HOME/.comsol/v51.
 

To use COMSOL on raijin do

module load comsol/5.1


An example submission script for running a batch job within one compute node, using shared memory, is shown below.

#!/bin/bash
#PBS -q normal
#PBS -l walltime=01:00:00
#PBS -l ncpus=8
#PBS -l mem=14GB
#PBS -l jobfs=200GB
#PBS -l software=comsol
#PBS -l wd

module load comsol/5.1

comsol -np $PBS_NCPUS batch -tmpdir $PBS_JOBFS -inputfile input_file.mph 

For up to 16 processors (28 cores for jobs submitted to broadwell queues), you can use the script shown above. Please make sure to compare timings on 1, 2, 4 etc processors to see if there is a speed-up by using more processors as problem with very small size 


To run cluster COMSOL on more than 16(28) cpus follow the instructions for using Intel MPI in the documentation. An example batch script follows:

#!/bin/bash
#PBS -q normal
#PBS -l walltime=00:15:00
#PBS -l ncpus=256
#PBS -l mem=1024GB
#PBS -l jobfs=6400GB
#PBS -l software=comsol
#PBS -l wd

module rm openmpi
module load intel-mpi/4.1.1.036
module load comsol/5.1

export I_MPI_FABRICS=shm:tcp
cat $PBS_NODEFILE | uniq > comsol_nodefile
 
export NUM_PROCESS_PER_TASK=2
export NUM_TASK=$(expr $PBS_NCPUS / $NUM_PROCESS_PER_TASK)

comsol -np $NUM_PROCESS_PER_TASK -nn $NUM_TASK -nnhost 4 batch -f comsol_nodefile -tmpdir $PBS_JOBFS -inputfile input.mph -outputfile output.mph -batchlog job.log 

Please note, pass the number of cores optimised for your sub-problem to the option -np which determines number of processes per task and pass the number of tasks to the option -nn. Please double check -nn * -np = $PBS_NCPUS before submitting a modified script.


If you wish to run a matlab comsol script (and are an ANU staff or student) as a batch job you need to stop the java windows from opening, see further discussion here, and load the matlab module as well. An example batch script which runs Comsol with Matlab is shown below. Please note, each matlab worker connects to only one comsol mphserver and most institutions do not provide their matlab licenses with Matlab Distributed Computing Server, therefore, it is highly recommended to use Matlab liveLink only to generate the mph file which can be used in the batch/cluster parallel computing modes described above.   

#!/bin/bash
#PBS -q express
#PBS -l walltime=00:10:00
#PBS -l mem=10GB
#PBS -l software=comsol:matlab_anu
#PBS -l wd
#PBS -l ncpus=1

module load matlab/R2014b
module load comsol/5.1

matlab -nodisplay -r "system('comsol server -np $PBS_NCPUS /null > /dev/null &'),pause(10),addpath /apps/comsol/5.1/mli/, mphstart, your_m_file, exit"

License requirements

There are only 2 licenses for COMSOL so only 2 jobs can be run concurrently.