COMSOL: Difference between revisions

From Alliance Doc
Jump to navigation Jump to search
No edit summary
No edit summary
Line 24: Line 24:
USE_SERVER
USE_SERVER
}}
}}
and put this file in the folder <tt>$HOME/.licenses/</tt>. Note that firewall changes will need to be done on both our side and your side.  To arrange this, send an email containing the service port and ip address of your floating comsol license server to [[Technical support]].  CMC license holders should use  
and put this file in the folder <tt>$HOME/.licenses/</tt>. Note that firewall changes will need to be done on both our side and your side.  To arrange this, send an email containing the service port and ip address of your floating comsol license server to [[Technical support]].  CMC license holders should use the following values in their comsol.lic file:
* on Béluga, "SERVER 132.219.136.89 ANY 6601"
* Béluga: SERVER 132.219.136.89 ANY 6601
* on Graham, "SERVER 199.241.162.97 ANY 6601"
* Graham: SERVER 199.241.162.97 ANY 6601
* on Cedar, "SERVER 172.16.121.25 ANY 6601"
* Cedar: SERVER 172.16.121.25 ANY 6601


= Running COMSOL on a single node = <!--T:6-->
= Running COMSOL on a single node = <!--T:6-->

Revision as of 22:11, 3 July 2020

Other languages:

Introduction

COMSOL is a general-purpose platform software for modeling engineering applications. Compute Canada would like to thank COMSOL, Inc. for allowing its software to be hosted on Compute Canada clusters via a special agreement.

Logo comsol blue 1571x143.png

We recommend that Compute Canada users who wish to run COMSOL consult the documentation included with the software under File > Help > Documentation prior to attempting to use it on one of the clusters. Some of the basic manuals are available here.

Licensing

Compute Canada is a hosting provider for COMSOL. This means that we have COMSOL software installed on our clusters, but we do not provide a generic license accessible to everyone. Many institutions, faculties, and departments already have licenses that can be used on our clusters. Alternatively researchers can purchase a license from CMC for use anywhere in Canada, or purchase a dedicated Floating Network License directly from the company for use on Compute Canada systems to run on a Sharcnet license server.

Once the legal aspects are worked out for licensing, there will be remaining technical aspects. The license server on your end will need to be reachable by our compute nodes. This will require our technical team to get in touch with the technical people managing your license software. In some cases such as CMC, this has already been done. You should then be able to load the COMSOL modules, and it should find its license automatically. If this is not the case, please contact our Technical support, so that we can arrange this for you.

Configuring your own license file

Our module for COMSOL is designed to look for license information in a few places. One of those places is your home folder. If you have your own license server, you can write the information to access it in the following format:

File : comsol.lic

SERVER <server> ANY <port>
USE_SERVER


and put this file in the folder $HOME/.licenses/. Note that firewall changes will need to be done on both our side and your side. To arrange this, send an email containing the service port and ip address of your floating comsol license server to Technical support. CMC license holders should use the following values in their comsol.lic file:

  • Béluga: SERVER 132.219.136.89 ANY 6601
  • Graham: SERVER 199.241.162.97 ANY 6601
  • Cedar: SERVER 172.16.121.25 ANY 6601

Running COMSOL on a single node

Below is a sample submission script for running COMSOL with eight cores on a single cluster compute node:

File : mysub1.sh

#!/bin/bash
#SBATCH --account=def-account     # Specify
#SBATCH --time=0-01:00            # d-hh:mm
#SBATCH --mem=3G                  # Change
#SBATCH --cpus-per-task=8         # Change
#SBATCH --nodes=1                 # Do not change
#SBATCH --ntasks-per-node=1       # Do not change
module load comsol/5.5
NCORE=$((SLURM_NTASKS * SLURM_CPUS_PER_TASK))

comsol batch -np $NCORE -inputfile FILENAME.mph -outputfile solved_out.mph


Note that depending on the complexity of the simulation, COMSOL may not be able to efficiently use very many cores. Therefore please test the scaling of your simulation by increasing the number of cores in #SBATCH --cpus-per-task=X from X=1 to the maximum number of cores on the compute node you are using. If you still get a good speed-up running on a full compute node then consider running the job over multiple full nodes by adjusting the following submission script.

Running COMSOL on multiple nodes

Below is a sample submission script for running COMSOL with eight cores distributed evenly over two cluster nodes:


File : mysub2.sh

#!/bin/bash
#SBATCH --account=def-account     # Specify
#SBATCH --time=00-06:00           # dd-hh:mm
#SBATCH --mem=3G                  # Change (set to 0 for full nodes)
#SBATCH --nodes=2                 # Change
#SBATCH --cpus-per-task=4         # Change (set to max cores for full nodes)
#SBATCH --ntasks-per-node=1       # Recommended to not change
module load comsol/5.5

comsol batch -inputfile FILENAME.mph -outputfile solved_out.mph \
 -nn $SLURM_NTASKS -nnhost $SLURM_NTASKS_PER_NODE -np $SLURM_CPUS_PER_TASK