From CAC Wiki
Revision as of 17:30, 29 August 2016 by Jstaff (Talk | contribs)

Jump to: navigation, search

Although COMSOL is installed on the SW cluster, users will need to provide their own license before they are able to use the software.

Any given COMSOL job requires 4 components to run, namely a license key (follows the format "CMC_#####.key"), a licensing script, a job script, and an input .mph file. The CMC license key and script should be obtained from CMC. If CMC asks for an IP address of the machine COMSOL will be run on, give them (this is the external IP address of the SW cluster).

Using your own license

The script requires editing before it can be used. These changes are designed to allow your job scripts to be run non-interactively. Please edit the line beginning with "ssh" and replace it with the following:

ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 443 -i $CMC_KEY -L 6601:lmserver-8:6601 -L 16601:lmserver-8:16601 -l $CMC_AG

As a test, verify that your license is active. To do this, run with the command "./ <yourUID>". This will open up a connection with CMC and fetch your license status. Your UID is the numeric portion of your COMSOL key. As an example, the UID of "CMC_12345.key" would be "12345".

An active license will show the following output (type "quit" to quit):

Warning: Permanently added '[]:443,[]:443' (RSA) to the list of known hosts.

IP access services                                            Status
 CMC_COMSOL_lmgrd  CMC COMSOL lmgrd (CMC Data center)           Active
 CMC_COMSOL_vendor  CMC COMSOL vendor                            Active

Enter a service name above, or 'help' for further instructions.


If you see dashes ("-") instead of "Active", you should get in touch with CMC and ensure your license gets activated. COMSOL jobs will fail with a licensing error until this is resolved.

Redirect temporary files

COMSOL will attempt to place a large number of temporary and configuration files in your home directory and /tmp (several GB per run). This is not recommended on our systems, as /tmp can fill up quickly (causing COMSOL runs to crash with a disk error), and the files it places in one's home directory may use up a significant amount of a user's disk quota under /home. To avoid this, we suggest redirecting all COMSOL tempfiles to your scratch directory. Follow these directions to setup temp file redirection (replace hpc1234 with your user name):

mkdir -p /scratch/hpc1234/comsol_scratch
mv ~/.comsol/* /scratch/hpc1234/comsol_scratch             # moves any existing COMSOL tempfiles to your new scratch directory
rmdir ~/.comsol                                            # if the .comsol directory exists, delete it
ln -s /scratch/hpc1234/comsol_scratch ~/.comsol

Running jobs

Assuming all required files are in the same directory, a typical COMSOL job might look like this (replace <Your_UID> with your UID number):

#$ -S /bin/bash
#$ -V
#$ -cwd
#$ -q abaqus.q
#$ -l qname=abaqus.q
#$ -o comsol_job.o$JOB_ID
#$ -j y

# Change the 12 to however many processors are needed
#$ -pe 12
# Change the 24 to however much memory is needed 
#$ -l mf=24G

use java8
use comsol
(while true; do sleep 60 ; done) | ./ <Your_UID> &
sleep 30
comsol -nn 1 -np $NSLOTS batch -tmpdir /scratch/hpc1234/comsol_scratch -inputfile inputFilename.mph -outputfile outputFilename

Once done creating this job script, submit the job with "qsub". If you've reached this point, congratulations! You can now run COMSOL jobs on the SW cluster.