Difference between revisions of "COMSOL"
From Montana Tech High Performance Computing
(→COMSOL Examples for cluster computing) |
|||
Line 1: | Line 1: | ||
==COMSOL General Documentation== | ==COMSOL General Documentation== | ||
COMSOL[http://www.comsol.com] documentation is available in both html and pdf on hpc.mtech.edu/comsol[http://hpc.mtech.edu/comsol]. Navigate the file directory structure to locate the desired document. Here is direct link to the Introduction to COMSOL | COMSOL[http://www.comsol.com] documentation is available in both html and pdf on hpc.mtech.edu/comsol[http://hpc.mtech.edu/comsol]. Navigate the file directory structure to locate the desired document. Here is direct link to the Introduction to COMSOL | ||
− | [http://hpc.mtech.edu/comsol/pdf/COMSOL_Multiphysics/IntroductionToCOMSOLMultiphysics.pdf]. There is also documentation available through the COMSOL desktop. The remaining documentation in the Wiki below describes how to run COMSOL on the cluster. | + | [http://hpc.mtech.edu/comsol/pdf/COMSOL_Multiphysics/IntroductionToCOMSOLMultiphysics.pdf]. There is also documentation available through the COMSOL desktop. The remaining documentation in the Wiki below describes how to run COMSOL on the cluster. |
+ | |||
+ | ==Available COMSOL Modules== | ||
+ | Our COMSOL license comes with several modules including HEATTRANSFER, OPTIMIZATION, STRUCTURALMECHANICS, NONLINEARSTRUCTMATERIALS, etc. (For a complete list of modules refer to the command at the end of this page) | ||
+ | Our COMSOL license allows 3 concurrent instances of COMSOL (this also includes COMSOL running on office computers) and the modules allows 1~3 concurrent use. As a result, please remember to exit COMSOL when you are done with your calculations, so that it'll not affect other users. | ||
==Running desktop gui from Management Node== | ==Running desktop gui from Management Node== |
Revision as of 21:33, 7 February 2019
Contents
COMSOL General Documentation
COMSOL[1] documentation is available in both html and pdf on hpc.mtech.edu/comsol[2]. Navigate the file directory structure to locate the desired document. Here is direct link to the Introduction to COMSOL [3]. There is also documentation available through the COMSOL desktop. The remaining documentation in the Wiki below describes how to run COMSOL on the cluster.
Available COMSOL Modules
Our COMSOL license comes with several modules including HEATTRANSFER, OPTIMIZATION, STRUCTURALMECHANICS, NONLINEARSTRUCTMATERIALS, etc. (For a complete list of modules refer to the command at the end of this page) Our COMSOL license allows 3 concurrent instances of COMSOL (this also includes COMSOL running on office computers) and the modules allows 1~3 concurrent use. As a result, please remember to exit COMSOL when you are done with your calculations, so that it'll not affect other users.
Running desktop gui from Management Node
The COMSOL desktop gui can be run on the management node, but long simulations should be executed on the compute nodes (see below). There are two ways to start COMSOL from a Windows PC. If you have an x-server installed (Cygwin[4] works well), you can login with an ssh client(e.g. putty [5], make sure to enable X11 forwarding). Alternatively, you can run NX (start through your web browser at hpc.mtech.edu/nx[6]). [this method currently is not working] Once logged in, type comsol.
Submitting batch jobs through Moab
To avoid overloading the management node, COMSOL should be used in batch mode and jobs should be submitted to the compute nodes through torque.
Single Node
- Create a job script for using 4 processors (cores) - put the following in a file called comsoljob
-
#!/bin/sh
PBS -l nodes=1:ppn=4
#PBS -j oe
#PBS -N ComsolJob
#PBS -d /home/mtech/YOURNAME/COMSOL_PROJECT_DIR
#PBS -S /bin/bash
#PBS -m be
#PBS -M YOURNAME@mtech.edu
#PBS -l walltime=00:20:00
comsol batch -inputfile in.mph -outputfile out.mph -np 4 - -->be sure to update with you input/output file names and your usernames
-
- Submit to Moab
-
msub comsoljob
-
- Check status with showq or qstat or Ganglia.
Multiple Nodes with Intel MPI
COMSOL is installed with Intel's MPI and can be used on multiple nodes. In order to run on 2 or more node, modify your job script to include -clustersimple -f $PBS_NODEFILE.
For example:
-
#!/bin/sh
#PBS -l nodes=2:ppn=32
#PBS -N Comsol-2-node-32-core
#PBS -d /home/mtech/username/comsol
#PBS -l walltime=00:30:00
hostname
comsol batch -clustersimple -f $PBS_NODEFILE -inputfile mycomsol_file.mph -outputfile mycomsol_out.mph
- (edit username/path, mycomsol_file and mycomsol_out for your model)
LiveLink for MATLAB
To use COMSOL with the LiveLink for MATLAB:
comsol server matlab
This will start up the MATLAB Desktop.
To run a COMSOL batch job through Moab using a .m file (e.g., myprog.m), put the following in a job script:
-
#!/bin/sh
#PBS -l nodes=1:ppn=32
#PBS -j oe
#PBS -N ComsolJob
#PBS -d /home/mtech/YOURNAME/COMSOL_PROJECT_DIR
#PBS -S /bin/bash
#PBS -m be
#PBS -M YOURNAME@mtech.edu
#PBS -l walltime=02:00:00
comsol server < /dev/null > comsolserver.log &
matlab -nodesktop -nosplash -r "addpath /opt/COMSOL43b/mli, mphstart, myprog, exit"
COMSOL will automatically use the 32 available processors in the node. This job would run for 2 hours and then be cancelled, if you expect a longer run, then make sure to update the walltime.
Performance
COMSOL's performance generally improves as more processors (i.e., cores) are used until a certain point. This varies with the type of simulation and model being used. The "sweet spot" might be just 4 or 8 processors. For example one test gave
np | 1 | 2 | 4 | 8 | 16 | 24 | 32 |
time(s) | 51 | 33 | 24 | 18 | 12 | 19 | 15 |
While hyperthreading is currently enabled, don't expect performance to improve for np > 16 as there are 16 cores per node (32 threads run simultaneously with hyperthreading and COMSOL does not take advantage of hyperthreading).
Checking for license availability
Montana Tech has a floating network license, so COMSOL could be in use on another system. To check which licenses are available:
/opt/comsol53/license/glnxa64/lmstat -a -c /opt/comsol53/license/license.dat