HPC/Applications/comsol: Difference between revisions

From CNM Wiki
Jump to navigation Jump to search
mNo edit summary
Line 9: Line 9:


Running comsol requires a license. Of the [http://www.comsol.com/products/multiphysics/ available features] we have licensed a subset, shown at right.
Running comsol requires a license. Of the [http://www.comsol.com/products/multiphysics/ available features] we have licensed a subset, shown at right.
== Requirements ==
For casual use, and with [[HPC/Network Access/SSH Tunnel Setup on Linux and MacOS | X11 tunneling to Carbon]] already set up, simply add to your <code>~/.bashrc</code> file:
module load comsol


== Basic usage with X11 ==
== Basic usage with X11 ==
 
Start the GUI on a clogin node:
For casual use, and with [[HPC/Network Access/SSH Tunnel Setup on Linux and MacOS | X11 tunneling to Carbon]] already set up, simply add to your ~/.bashrc file on Carbon:
module load comsol
Then start the GUI on a clogin node:
  comsol &
  comsol &
This will use one CPU core. To run calculations off the GUI multithreaded (using several cores on one node), use instead:
Comsol will use a number of cores to run calculations multithreaded by default. (On Carbon, COMSOL_NUM_THREADS is set.)
OMP_NUM_THREADS=4 comsol &


'''Quit the application''' as soon as you are done. Only one user can use Comsol at a time.
'''Quit the application''' as soon as you are done. Only one user can use Comsol at a time.
Line 49: Line 49:
== Multicore usage ==
== Multicore usage ==
Ways to start multi-core (from http://www.comsol.com/support/knowledgebase/1096/)
Ways to start multi-core (from http://www.comsol.com/support/knowledgebase/1096/)
  comsol -np 2
  comsol -np 2


  export COMSOL_NUM_THREADS=8    # automatically set on ''Carbon''
  export COMSOL_NUM_THREADS=8    # automatically provided on ''Carbon''
  comsol
  comsol
* COMSOL does not benefit from hyperthreading.
* COMSOL does not benefit from hyperthreading.
Line 65: Line 64:


See also http://www.comsol.com/support/knowledgebase/1001/ .
See also http://www.comsol.com/support/knowledgebase/1001/ .
=== Requirements ===
In your <code>~/.bashrc</code> file:
module load comsol


=== Sample Job file ===
=== Sample Job file ===

Revision as of 04:23, May 17, 2012

Introduction

HPC Comsol licensed modules.png

The COMSOL Multiphysics product is available for Mac, Windows, and Linux. You can run either the native version on your desktop or use the Linux version from Carbon, displaying on your desktop via X11.

Running comsol requires a license. Of the available features we have licensed a subset, shown at right.

Requirements

For casual use, and with X11 tunneling to Carbon already set up, simply add to your ~/.bashrc file:

module load comsol

Basic usage with X11

Start the GUI on a clogin node:

comsol &

Comsol will use a number of cores to run calculations multithreaded by default. (On Carbon, COMSOL_NUM_THREADS is set.)

Quit the application as soon as you are done. Only one user can use Comsol at a time.

Native desktop version, with license forwarding

Example for Comsol license tunneling using SSH under the popular PuTTY application. Adapt these settings for your SSH applications.

You can use a native Comsol version on your desktop but need a connection to the Comsol license server running on Carbon. Use these steps to set up the connection.

  • On your desktop machine, add to your SSH tunnel config file ~/.ssh/config in the Host clogin section:
Host clogin
       …
       # Comsol FlexLM
       LocalForward  1719 mgmt03:1719
       LocalForward 33317 mgmt03:1718
       LocalForward 33318 mgmt04:1718
       LocalForward 33319 sched1:1718

Adapt these settings for SSH applications other than OpenSSH.

  • Log in to clogin.
  • Start the Comsol installer on your machine. Use the following settings when asked for licensing:
    • License type: networked server
    • License hosts:
localhost, port 33317
localhost, port 33318
localhost, port 33319
  • Complete the installer.
  • Locate and start the COMSOL Multiphysics application.


Multicore usage

Ways to start multi-core (from http://www.comsol.com/support/knowledgebase/1096/)

comsol -np 2
export COMSOL_NUM_THREADS=8    # automatically provided on Carbon
comsol
  • COMSOL does not benefit from hyperthreading.

Cluster usage

comsol -clustersimple batch -inputfile input.mph -outputfile output.mph 
comsol –nn 8 mpd boot
comsol –nn 8 batch –inputfile in.mph
comsol mpd allexit
MPD is not supported on Carbon, and generally no longer necessary in Comsol-4.3.

See also http://www.comsol.com/support/knowledgebase/1001/ .

Sample Job file

#!/bin/bash
#PBS -l nodes=2:ppn=8
#PBS -l walltime=2:00:00
#PBS -N jobname
#PBS -o job.out
#PBS -e job.err
#PBS -m ae
#PBS -V

cd $PBS_O_WORKDIR
comsol  -clustersimple batch \
        -tmpdir $TMPDIR \
        -inputfile  inp.mph \
        -outputfile out.mph