COMSOL

From SciNet Users Documentation
Revision as of 20:44, 13 August 2018 by Ejspence (talk | contribs)
Jump to navigation Jump to search

The COMSOL general-purpose engineering application is installed in both the Niagara and CC software stacks.

Getting a license

Licenses are provided by COMSOL. As commercial software you will require a license to use this package.

Running using the Niagara installation

COMSOL 5.3.1.275

In the Niagara software stack, commercial modules can only be accessed using the 'module use' command.

module use /scinet/niagara/software/commercial/modules
module load comsol/5.3.1.275

The same must be done to see these packages using module spider.

Setting up your .comsol directory

COMSOL will attempt to write to your $HOME/.comsol directory. This will work when you are testing your workflow on the login nodes, because they can write to $HOME. However, recall that the compute nodes cannot write to the /home filesystem. If you attempt to run COMSOL from a compute node using the default configuration, it will fail because COMSOL cannot write to $HOME/.comsol.

The solution is to create an alternative directory called $SCRATCH/.comsol, and create a soft link from $HOME/.comsol to $SCRATCH/.comsol:

mkdir $SCRATCH/.comsol
ln -s $SCRATCH/.comsol $HOME/.comsol

This will fool COMSOL into thinking it is writing to $HOME/.comsol, when in fact it is writing to $SCRATCH/.comsol. This command only needs to be run once.

Running comsol

Example submission script for a job running on 1 node, with max walltime of 11 hours:

#!/bin/bash
#SBATCH --nodes=1
#SBATCH --ntasks-per-node=1
#SBATCH --cpus-per-task=40
#SBATCH --time=11:00:00
#SBATCH --job-name test

module use /scinet/niagara/software/commercial/modules
module load comsol/5.3.1.275

# DIRECTORY TO RUN - $SLURM_SUBMIT_DIR is directory job was submitted from
cd $SLURM_SUBMIT_DIR

NCORE=$((SLURM_NTASKS * SLURM_CPUS_PER_TASK))
comsol batch -np $NCORE -inputfile micromixer_batch.mph -outputfile output.mph

Running using the CC installation

Ansys 19.0

To access the CC software stack you must unload the Niagara stack.

module load CCEnv
module load ansys/19.0

You can run the script given in the previous section by substituting the previous module commands with the above two.