HPC/Applications/comsol

From CNM Wiki
Jump to navigation Jump to search

Introduction

HPC Comsol licensed modules.png

The COMSOL Multiphysics product is available for Mac, Windows, and Linux.

Access to COMSOL is subject to a license agreement and is granted on request to individual users.

  • To request access, send a request to [email protected]. The license agreement restricts access to Argonne employees.
  • Of the available features we have licensed a subset, shown at right.
  • For the native desktop version, contact me (stern) for installation media. After installation, get Product Updates.

There are several ways of running COMSOL

  1. Run on Carbon, display on your desktop using X11.
  2. Run on Carbon within a virtual desktop environment (VNC).
  3. Run on your own computer, borrowing Carbon's license.
  4. Running a batch calculation on Carbon.

Use with X11

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

module load comsol

Then, from the command line on a Carbon login node, start the COMSOL GUI:

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.

Use with VNC

See general instructions on using VNC, and the COMSOL example therein.

Running a native desktop version

Direct license server connection - CNM/NST networks only

Configure COMSOL to use divisional license servers. Edit <COMSOLDIR>/license/license.dat and enter:

SERVER cmgmt3 ANY 1718
SERVER cmgmt4 ANY 1718
SERVER csched1 ANY 1718
USE_SERVER
Note
These servers are reachable only from within the CNM.

Use license forwarding - Other networks

To get the fastest response from the COMSOL GUI, run a native COMSOL version on your desktop and configure it to check out a license from the Comsol license server running on Carbon.

There are actually two license servers on Carbon, a primary and a secondary which can take over as needed. Unfortunately, the automatic server selection only works for nodes within Carbon, and fails when using a native desktop version. Use the following steps to set up license checkout.

Configure port forwarding

  • On your desktop machine, set up SSH tunneling. This step is only needed once.
    • Windows: Configure PuTTY
    • Linux/Mac/Cygwin: edit the file ~/.ssh/config and add to the Host clogin section:
Host clogin
	
	# COMSOL licensing
	# Initial ("negotiation") ports of FlexLM's lmgrd; may be forwarded to different local port numbers.
	LocalForward 33318 mgmt03:1718
	LocalForward 33418 mgmt04:1718
	# Secondary ("payload") ports of the COMSOL vendor daemon; local and remote port numbers must match.
	LocalForward  1719 mgmt03:1719
	LocalForward  1720 mgmt04:1720
Note …318 vs. …418 in the the first line pair.
  • Stop any previous connection that you might have to clogin.
  • Connect to clogin. This will start the port forwarding configured in the previous step.
    • On PuTTY, open the Clogin session.
    • On Linux/Mac/Cygwin, type:
ssh -v clogin

Configure COMSOL to use forwarded ports

  • Start the Comsol installer on your machine. When asked for licensing use the following type:
    • License type: networked server
  • For License hosts use one of the following entries. If the first failed, use the second.
    • localhost, port 33318
    • localhost, port 33418
  • Complete the installer.
  • Locate and start the COMSOL Multiphysics application.

Preparing to run COMSOL

  • Have an SSH connection to clogin active. It provides the forwarded ports to your machine.
  • Then start the COMSOL application normally.

Addendum: Point to an alternate license server

The COMSOL application determines the license server to contact by the file <COMSOLDIR>/license/license.dat. The file should look as follows:

SERVER localhost ANY 33318
SERVER localhost ANY 33418
USE_SERVER

Most of the time, the first license server is active and will respond locally on port 33318. If that port does not respond, COMSOL fails with an error. Ideally, COMSOL should contact the alternate server port as given by the second SERVER line, but in COMSOL43a that line is ignored.

To temporarily use the alternate server, comment out the first SERVER line from the license.dat file:

#SERVER localhost ANY 33318
SERVER localhost ANY 33319
USE_SERVER

Then restart COMSOL. You do not need to change the SSH configuration or re-open the connection to clogin.

Multiple CPU cores

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

comsol -np 8
export COMSOL_NUM_THREADS=8    # automatically provided on Carbon
comsol
  • COMSOL does not benefit from hyperthreading (oversubscribing the physical core count).

Batch jobs

Sample Job file

See:

$COMSOL_HOME/sample.job