COMSOL Multiphysics installations on Tetralith & Sigma

COMSOL Multiphysics is a general-purpose software platform, based on advanced numerical methods, for modeling and simulating physics-based problems.

Official homepage: https://www.comsol.com

Licensing

Due to the terms of the COMSOL Multiphysics license, NSC is only allowed to make COMSOL Multiphysics available to those affiliated (student, researcher etc) with Linköping University.

If you have access to another COMSOL Multiphysics license, please contact and we will investigate if it is possible to arrange such that you can use that license instead.

If you are a LiU user and cannot access COMSOL Multiphysics, please contact and we will add you to the license group (“liu”), which will give you access.

Available versions and modules

Login to Tetralith or Sigma and check the module system to list installed versions:

[pemun@tetralith1 ~]$ module avail COMSOL

-------------------------------------- /software/sse/modules ---------------------------------------
   COMSOL/recommendation (D)    COMSOL/5.3.1.348-nsc1    COMSOL/5.4.0.388-nsc1
   COMSOL/5.2.1.262-nsc1        COMSOL/5.4.0.225-nsc1    COMSOL/5.5.0.306-nsc1

  Where:
   D:  Default Module

Use "module spider" to find all possible modules.
Use "module keyword key1 key2 ..." to search for all possible modules matching any of the "keys".

How to use COMSOL Multiphysics

COMSOL can be used either to perform interactive work or as batch jobs submitted to the batch queue system Slurm. Interactive work requiring limited resources, computationally and memory wise, can be performed on login nodes. More demanding interactive work should be performed within an interactive job on a compute node.

Interactive use of COMSOL

The recomended way to use COMSOL with its graphical user interface (GUI) for non demanding, computationally and memory wise, work is to login to Tetralith or Sigma with ThinLinc, load an appropriate COMSOL module and start COMSOL with vglrun for hardware accelerated OpenGL support. For more information on how to use ThinLinc, please see the page Running graphical applications.

[pemun@tetralith1 ~]$ module load COMSOL/5.5.0.306-nsc1
[pemun@tetralith1 ~]$ vglrun comsol

Please, only use this method for non demanding work as the login nodes are shared among users.

Use the "interactive" command to request a compute node for more demanding interactive usage. Unfortunatelly graphics will be less fast as there is no hardware accelerated OpenGL on compute nodes and the Help system within COMSOL do not work.

[pemun@tetralith1 ~]$ interactive -n1 -c32 -t 4:00:00
salloc: Granted job allocation 107651
srun: Step created for job 107651
[pemun@n192 ~]$ module load COMSOL/5.5.0.306-nsc1
[pemun@n192 ~]$ comsol

Example batch script

A batch script for running COMSOL at NSC may look like this:

#!/bin/bash
#SBATCH --job-name=myjobname           # Your name of the job
#SBATCH --time=00:30:00                # Requested walltime 
#SBATCH --ntasks=2                     # Number of tasks allocate
#SBATCH --cpus-per-task=32             # Number of cpus per task
#SBATCH --account=snicYYYY-XX-ZZ       # Account string for the project

module load COMSOL/5.5.0.306-nsc1

INFILE=infile.mph                      # The name of your COMSOL input file

F=$(echo ${INFILE}|sed 's/.mph$//')

if ! [ -f ${F}.mph ];then
  echo "${F} not found, exiting"
  exit 1
fi

# Run COMSOL
echo "Running COMSOL. Output file is ${F}-out.mph, Log file is ${F}.log"
echo "and Error file is ${f}.err."

time comsol -clustersimple batch -inputfile ${F}.mph \
            -outputfile ${F}-out.mph -batchlog ${F}.log \
            -error ${F}.err

#END OF SCRIPT

Note that you should at least edit the jobname, --job-name, and account, --account, before submitting but probably also the number of tasks (MPI ranks), --ntasks, requested walltime, --time, and possibly the number of cpus per task, --cpus-per-task.

Note that the optimal setting for "--ntasks", the number of MPI tasks, and "--cpus-per-task", the number of OpenMP threads per MPI task, is problem dependent. It depends on the solver used, size of the problem etc. Limited scaling tests of COMSOL on Tetralith and Sigma suggest that it is beneficial to choose a low number for "--ntasks" and a high number for "--cpus-per-task".


User Area

User support

Guides, documentation and FAQ.

Getting access

Applying for projects and login accounts.

System status

Everything OK!

No reported problems

Self-service

SUPR
NSC Express