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
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/18.104.22.1685
The same must be done to see these packages using
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.
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/22.214.171.1245 # 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 myinputfile.mph -outputfile myoutputfile.mph
Running using the CC installation
To access the CC software stack you must unload the Niagara stack.
module load CCEnv module load comsol/126.96.36.1995
You can run the script given in the previous section by substituting the previous module commands with the above two.