HPC/Applications/comsol: Difference between revisions

From CNM Wiki
Jump to navigation Jump to search
Line 82: Line 82:
** If the client machine is directly in CNM networks, this should be the default.
** If the client machine is directly in CNM networks, this should be the default.
** If the client machine is connected over on VPN:
** If the client machine is connected over on VPN:
*** On a Mac, find the VPN configuration details under System Preferences, Network, Advanced.
::: On a Mac, find the VPN configuration details under System Preferences, Network, Advanced. You may need to unlock the Network panel first before you can make changes under "Advanced". It appears that the DNS setting appears to be persistent and will be active the next time that this VPN session gets started.
: [[Image:VNC_add_cnm_to_DNS_1.png|400px]] [[Image:VNC_add_cnm_to_DNS_2.png|400px]]
: [[Image:VNC_add_cnm_to_DNS_1.png|400px]] [[Image:VNC_add_cnm_to_DNS_2.png|400px]]
::: You may need to unlock the Network panel first before you can make changes under "Advanced". It appears that the DNS setting appears to be persistent and will be active the next time that this VPN session gets started.
::: On Windows or Linux machines, do the same, using the platform's configuration tools.
*** On Windows or Linux machines, do the same, using the platform's configuration tools.
 
** Verify that short host names can be resolved to IP addresses, i.e., either one of the following commands should produce sensible output:
==== Verifying basic connectivity to the license servers ====
<pre>
* Verify that short host names can be resolved to IP addresses, i.e., either one of the following commands should produce sensible output:
host cmgmt3
host cmgmt3
ping -c 3 cmgmt3
or:
</pre>
ping -c 3 cmgmt3
** Verify that the license hosts (under their short host names) ''and their ports'' can be reached from your client machine:
* Verify that the license hosts (using short names) and their ports can be reached from your client machine.
  telnet '''cmgmt3 1718'''
  telnet '''cmgmt3 1718'''
: or:
: or:
  telnet '''cmgmt3 1719'''
  telnet '''cmgmt3 1719'''
: A successful connection looks like:
: A successful connection looks like:
  Trying 146.139.2.46...
  Trying 146.139.x.y...
  Connected to cmgmt3.cnm.anl.gov.
  Connected to cmgmt3.cnm.anl.gov.
  Escape character is '^]'.
  Escape character is '^]'.
:: To close such a  connection, hit '''Ctrl-]''', then '''Ctrl-D'''.
:: To close such a  connection, hit '''Ctrl-]''', then '''Ctrl-D'''.
: A ''failed'' connection times out or gives this error:
: A ''failed'' connection times out or gives one of these errors:
Trying 146.139.2.46...
  telnet: connect to address 146.139.x.y: Connection refused
  telnet: connect to address 146.139.2.46: Connection refused
: or:
  telnet: Unable to connect to remote host
  telnet: connect to address 146.139.x.y: Operation timed out
* Start COMSOL.
* Start COMSOL.



Revision as of 18:41, May 18, 2017

Introduction

HPC Comsol licensed modules.png

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

Access

COMSOL Multiphysics

Our installation of the main COMSOL Multiphysics product (the full graphical user interface and its batch computing application) is generally available to Argonne employees only, in compliance with its license agreement.

  • To request access, send a request to [email protected].
  • Of the available features, we have licensed a subset, shown at right.
  • To have a native desktop version installed, please contact CNM support. Make sure to review Product Updates.

COMSOL Server Application

The complementary COMSOL Server product offers an alternative but more narrow means of access.

All users, including Non-Argonne persons may be able to run, over a web interface in their browser, frozen-code simulations that were made with the COMSOL Application Builder (Requires Windows). Please contact CNM support to discuss using server applications. We will review possible purchase paths for COMSOL Server, and the considerable effort likely required by users and the CNM to develop and deploy a COMSOL application.

Ways to run COMSOL

There are several ways of running COMSOL.

Running the desktop application

Model development and analysis is done using the COMSOL graphical user interface (GUI), which itself be run in several ways:

  1. Run on Carbon, display on your desktop using the X Window system (X11).
    • Requires an X11 Server application running on your client machine, and SSH X11 forwarding.
    • The X11 protocol can be slow over LAN.
  2. Run on Carbon within a virtual desktop environment (VNC).
    • Requires a VNC client on your machine.
    • It can be confusing where VNC and the app runs.
    • The virtual desktop presents a (deliberatly) sparse windowing environment – Copy&Paste can be difficult to use.
  3. Run on your own computer, remotely checking out Carbon's license.
    • Requires a full installation of COMSOL on your client machine.
    • Access to the license servers requires VPN (fairly easy) or SSH license tunneling (can be intimidating for first-time users).

Running a batch calculation

When the computational stage of models takes longer than a few minutes to complete, it will be beneficial to submit save the model file and run it in parallel on Carbon. See the section below.

Support

For questions on how to run or start COMSOL, contact CNM IT support - see HPC/FAQ.

For questions related to COMSOL data or scripts, you may contact COMSOL support directly.

Export control
If your support question might contain data that is subject to US Export Control, contact support@us.comsol.com instead.

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 native desktop version

To get the fastest response from the COMSOL GUI, run a native COMSOL version on your desktop machine.

For client machines inside the CNM, follow the next section. For a client machine outside of CNM networks, you will have to configure it to check out a license from the Comsol license server running on Carbon, using one of two ways. Choose one that you are more comfortable with.

Whichever situation you choose, you may need to edit the license file <COMSOLDIR>/license/license.dat, where <COMSOLDIR> is located by default at:

    • Windows: C:\Program files\COMSOL\COMSOL52a
    • Linux: /usr/local/comsol52a
    • Mac: /Applications/COMSOL52a

Outside CNM, using VPN

  • On your machine (known as the client), use the following data for the COMSOL license file, or enter the respective host names and ports into the COMSOL license configuration wizard:
SERVER cmgmt3 ANY 1718
SERVER cmgmt4 ANY 1718
SERVER csched1 ANY 1718
USE_SERVER
Note: You must use short host names as given here. If you get errors, see the section on VPN below.
  • Make sure "cnm.anl.gov" is one of the DNS Search Domains for your current network profile.
    • If the client machine is directly in CNM networks, this should be the default.
    • If the client machine is connected over on VPN:
On a Mac, find the VPN configuration details under System Preferences, Network, Advanced. You may need to unlock the Network panel first before you can make changes under "Advanced". It appears that the DNS setting appears to be persistent and will be active the next time that this VPN session gets started.
VNC add cnm to DNS 1.png VNC add cnm to DNS 2.png
On Windows or Linux machines, do the same, using the platform's configuration tools.

Verifying basic connectivity to the license servers

  • Verify that short host names can be resolved to IP addresses, i.e., either one of the following commands should produce sensible output:
host cmgmt3

or:

ping -c 3 cmgmt3
  • Verify that the license hosts (using short names) and their ports can be reached from your client machine.
telnet cmgmt3 1718
or:
telnet cmgmt3 1719
A successful connection looks like:
Trying 146.139.x.y...
Connected to cmgmt3.cnm.anl.gov.
Escape character is '^]'.
To close such a connection, hit Ctrl-], then Ctrl-D.
A failed connection times out or gives one of these errors:
telnet: connect to address 146.139.x.y: Connection refused
or:
telnet: connect to address 146.139.x.y: Operation timed out
  • Start COMSOL.

Outside CNM, using SSH Tunneling

If you're comfortable with ssh and tunneling, do the following on your (the client) machine:

  • Enter into the COMSOL license file:
SERVER 127.0.0.1 ANY 1718
USE_SERVER
Note: Do not use "localhost", as this will be directly (and incorrectly) interpreted by COMSOL to mean that the current machine actually is a license server.

Connect to mega or a Carbon login node with one of the following ssh commands:

  • First, set up a tunnel to the primary license server:
ssh  -L 1718:cmgmt3:1718  -L 1719:cmgmt3:1719  mega
  • Start COMSOL.
If you get an error that the number of licenses is exhausted, that is at least confirmation that you correctly reached the license server.

If the above attempt takes a long time or hangs entirely, it may be because the license service currently runs on the secondary server.

  • Connect to the alternate license server:
ssh  -L 1718:cmgmt4:1718  -L 1719:cmgmt4:1719  mega
  • Start COMSOL.
Note: With SSH tunneling, the selection of an active license server from a redundant set cannot be done automatically. Instead, the user must try one server first, then the other.

Inside CNM networks

  • Follow the directions and tests shown in the VPN section above.

License Troubleshooting

The following are typical error messages.

Could not obtain license for COMSOL Multiphysics GUI

  • Error details:
License error: -4.
Licensed number of users already reached.
Feature:       COMSOLGUI
License path:  /Users/stern/Applications/COMSOL52a/license/license.dat:
FlexNet Licensing error:-4,132
  • Reason: The connection to the license server succeeded, but the license token(s) you requested are in use.
  • Solution: Wait a bit, or identify who's using COMSOL and politely ask the user when they might be finished with their work.

License server machine is down or not responding

  • Error details:
 License error: -96.
 See the system administrator about starting the license server system, or
 make sure you're referring to the right host (see LM_LICENSE_FILE).
Feature:       SERIAL
Hostname:      csched1
License path:  /Users/stern/Applications/COMSOL52a/license/license.dat:
FlexNet Licensing error:-96,7
  • Reason: The license servers cannot be reached at all. The ping or host tests mentioned above fail.
  • Solution: Review the client license file and DNS lookup domains.

License file does not support this version

  • Error details:
 Feature: SERIAL
Application version > License version: 5.21 > 3.5
License path: /Users/stern/Applications/COMSOL52a/license/license.dat:
FlexNet Licensing error:-21,126
  • Reason: Only first of two steps for connecting to the license servers succeeds, which usually happens when the redundant license service runs on the alternate server instead of the one you're connected to.
  • Solution: When using SSH, try cmgmt4 instead of cmgmt3, or vice versa. Revisit your ~/.ssh/config file or use the alternate command line as shown in the SSH section above.

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