HPC/Applications/comsol: Difference between revisions

From CNM Wiki
Jump to navigation Jump to search
 
(87 intermediate revisions by the same user not shown)
Line 1: Line 1:
== Introduction ==
== Introduction ==
<!-- thumb|Comsol features licensed at the CNM -->
The [http://www.comsol.com/products/multiphysics/ '''COMSOL Multiphysics'''] application suite
[[Image:HPC Comsol licensed modules.png|right|450px|thumb]]
is available for Mac, Windows, and Linux.
The [http://www.comsol.com/products/multiphysics/ COMSOL Multiphysics] product is available for Mac, Windows, and Linux.


== Access ==
== Access ==
[[Image:HPC Comsol licensed modules.png|right|450px|thumb|COMSOL features licensed at CNM as of 2024-10.]]
=== COMSOL Multiphysics ===
=== COMSOL Multiphysics ===
Our installation of the main [http://www.comsol.com/products/multiphysics/ '''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.
Access to '''COMSOL Multiphysics''', the main application with both a graphical user interface and batch computing capabilities, will be granted '''''upon request'''''&thinsp;.
* To request access, send a request to [mailto:[email protected]?Subject=Access%20to%20COMSOL [email protected]].
* Of the available features, we have licensed a subset, shown at right.
* To have a native desktop version installed, please contact [mailto:[email protected]?Subject=COMSOL%20license%20access%20request CNM support]. Make sure to review [http://www.comsol.com/support/updates/ Product Updates].


=== COMSOL Server Application ===
You must be:
The complementary [https://www.comsol.com/comsol-server '''COMSOL Server'''] product offers an alternative but more narrow means of access.
* An '''''Argonne employee'''''&thinsp; in one of the following roles:
** '''''NST staff member'''''&thinsp; (including PostDocs, joint appointments, and students at NST).
** '''''CNM Facility User'''''&thinsp; (including ''non-NST Argonne employees''), with an active proposal that has COMSOL in scope. Please see [[HPC/FAQ#Access_and_proposals]].


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).
The set of available COMSOL modules that we have licensed is shown at right.
Please contact [mailto:nst-it@anl.gov?Subject=COMSOL%20server%20use CNM support] to discuss using server applications.
 
* The native desktop version can be installed only on ''Argonne-owned'' computers (laptop or desktop). Please contact [mailto:[email protected]?Subject=COMSOL%20license%20access%20request CNM support]. Make sure to review [http://www.comsol.com/support/updates/ Product Updates].
* To run COMSOL on our HPC system ''Carbon'', as GUI or as batch computing jobs, your proposal must have ''Carbon'' access in scope.
 
=== COMSOL Server ===
''CNM Facility Users'' who are not Argonne employees are not eligible to access
the full '''COMSOL Multiphysics''' product, in compliance with its licensing terms and conditions.
However, the [https://www.comsol.com/comsol-server '''COMSOL Server'''] product offers an alternative
albeit more narrow means of access.
 
All users, including '''''non-Argonne users''''' may be able to run, over a web interface in their browser,
pre-parameterized "fixed-model" simulations that were made with the '''COMSOL Application Builder''' (requires Windows).
 
To inquire about using COMSOL server applications,
please contact us.
<!-- [mailto:cnm_useroffice@anl.gov?Subject=COMSOL%20server%20usage Support]. -->
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.
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 ==
== Support ==
* For questions on how to run or start COMSOL:
*: Submit an [[HPC/Support | '''IT support request''']]
* For questions related to most COMSOL data or scripts, contact COMSOL support at:
*: [mailto:[email protected] '''support'''@comsol.com]
* '''Exception:''' If your support question might contain data that is subject to '''US Export Control''' regulations, contact instead:
*: [mailto:[email protected] '''us-export-control'''@'''us'''.comsol.com]
 
== The modes to run COMSOL ==
There are several ways of running COMSOL.
There are several ways of running COMSOL.


=== Running the desktop application ===
=== Running the desktop application ===
Model development and analysis is done using the COMSOL graphical user interface (GUI), which itself be run in several ways:
To edit models and analyze results, use the COMSOL graphical user interface (GUI). You can run it in several ways, each explained in more detail in the following sections.


# Run on Carbon, display on your desktop using the [http://en.wikipedia.org/wiki/X_Window_System X Window system (X11)].
# Run on Carbon, display on your desktop using the [http://en.wikipedia.org/wiki/X_Window_System X Window system (X11)].
Line 32: Line 54:
#* The virtual desktop presents a (deliberatly) sparse windowing environment – Copy&Paste can be difficult to use.
#* The virtual desktop presents a (deliberatly) sparse windowing environment – Copy&Paste can be difficult to use.
# Run on your own computer, remotely checking out Carbon's license.
# Run on your own computer, remotely checking out Carbon's license.
#* Requires a full installation of COMSOL on your client machine.
#* Requires a full installation of COMSOL on your desktoo or laptop computer.
#* Access to the license servers requires VPN (fairly easy) or SSH license tunneling (can be intimidating for first-time users).
#* You will require access to the COMSOL license server running on Carbon, either through VPN (fairly easy) or SSH tunneling (can be intimidating for first-time users). See below for details.


=== Running a batch calculation ===
=== 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.
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 [[#Batch jobs|section below]].
See the [[#Batch jobs|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 [mailto:[email protected] COMSOL support] directly.
; Export control: If your support question might contain data that is subject to US Export Control, contact [mailto:[email protected] support@'''us.'''comsol.com] instead.


== Use with X11 ==
== Use with X11 ==
Line 52: Line 67:
Then, from the command line on a Carbon login node, start the COMSOL GUI:
Then, from the command line on a Carbon login node, start the COMSOL GUI:
  comsol &
  comsol &
License configuration is automatic on Carbon.
Comsol will use a number of cores to run calculations multithreaded by default. (On Carbon, COMSOL_NUM_THREADS is set.)
Comsol will use a number of cores to run calculations multithreaded by default. (On Carbon, COMSOL_NUM_THREADS is set.)


Line 59: Line 77:
See general  [[HPC/Network Access/Virtual Desktop | instructions on using VNC]], and the COMSOL example therein.
See general  [[HPC/Network Access/Virtual Desktop | instructions on using VNC]], and the COMSOL example therein.


== Running native desktop version ==
== Native desktop version ==
 
To get the fastest response from the COMSOL GUI, run a native COMSOL version on your desktop machine or laptop, called ''client machine'' below.
To get the fastest response from the COMSOL GUI, run a native COMSOL version on your desktop machine or laptop, called ''client machine'' below.


For client machines inside the CNM, follow the next section.
Enter license details either in the COMSOL Setup configuration dialog.
For a client machine outside of CNM networks, 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.
 
== Native desktop version — License configuration ==
A client's COMSOL license needs to be configured depending on how the client reaches CNM network resources. Follow the appropriate section:
* [[#License configuration when inside CNM or using VPN]]
* [[#License configuration when outside CNM and using SSH Tunneling]]
 
=== License configuration when inside CNM or using VPN ===
==== <span style="color:#A00;">Ensure correct DNS search domains</span> ====
 
* Inspect the client machine's network configuration.
* Ensure that '''two''' entries are listed as DNS Search Domains for the current network profile:
nst.anl.gov
cnm.anl.gov
: (The order of entries does not matter for the purposes considered here.)
* If the client machine is ''wired to CNM networks'', the domains are normally provided correctly by DHCP.
* If the client machine is ''connected over VPN'', you may need edit the respective network profile.
:* 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 those changes are being saved and will be activated automatically 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]]
:* On Windows or Linux machines, take ''analogous'' steps, using the platform's own configuration tools.


Enter license details either in the COMSOL Setup configuration dialog or later in COMSOL's license file at <code>&lt;COMSOLDIR&gt;/license/license.dat</code>, where <code>&lt;COMSOLDIR&gt;</code> is located by default at:
* Exclude license manager components from client desktop installation. (Those are all handled server-side.)
* '''Windows''': C:\Program files\COMSOL\COMSOL52a
* '''Linux''': /usr/local/comsol52a
* '''Mac''': /Applications/COMSOL52a


=== Inside CNM or over VPN from outside ===
==== License format ====
* On your client machine, use the following entries for the COMSOL license file, or enter the respective host names and ports into the COMSOL Setup license configuration dialog:
* Floating Network License (FNL), "Three-server redundancy"
 
==== License servers ====
* On client machines, while running the COMSOL installer or license configuration, specify license servers and ports as follows:
clicense1    1718
clicense2    1718
clicense3    1718
: '''Note:''' Use ''short host name'' form exactly as given here. (Technical Reason: The license must be usable both on Carbon's internal network as well as on divisional networks that are outside of Carbon).
 
'''Advanced:''' A client machine's COMSOL license file <code>&lt;COMSOLDIR&gt;/Multiphysics/license/license.dat</code> should look as follows:
<source lang="make">
<source lang="make">
SERVER cmgmt3 ANY 1718
SERVER clicense1 ANY 1718
SERVER cmgmt4 ANY 1718
SERVER clicense2 ANY 1718
SERVER csched1 ANY 1718
SERVER clicense3 ANY 1718
USE_SERVER
USE_SERVER
</source>
</source>
: '''Note:''' Use ''short host names'' as given here. (Technical Reason: The license must be usable in both Carbon's internal network as well as networks outside of Carbon). If you get errors, see [[#Network Troubleshooting]] below.
 
* Make sure "cnm.anl.gov" is one of the DNS Search Domains for your current network profile.
<code>&lt;COMSOLDIR&gt;</code> is located by default at:
** If the client machine is directly in CNM networks, this should be the default.
* '''Windows''': C:\Program files\COMSOL\COMSOL''nn''
** If the client machine is connected over VPN:
* '''Linux''': /usr/local/comsol''nn''
::: 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 this setting will be persistent and be activated automatically the next time that this VPN session gets started.
* '''Mac''': /Applications/COMSOL''nn''
:: [[Image:VNC_add_cnm_to_DNS_1.png|400px]] [[Image:VNC_add_cnm_to_DNS_2.png|400px]]
("''nn''" is the application's abbreviated version number.)
::: On Windows or Linux machines, take analogous steps, using the platform's own configuration tools.
* Start COMSOL.


==== Network Troubleshooting ====
==== Network Troubleshooting ====
When using the license access model descibed here (as opposed to SSH), ensure the following:
When using the license access model descibed here (as opposed to tunneled over SSH), ensure the following:
* Verify that short host names can be resolved to IP addresses. Either one of the following commands should produce sensible output:
* Verify that short host names can be resolved to IP addresses. Either one of the following commands should produce sensible output:
  host cmgmt3
  host clicense1
: or:
: or:
  ping -c 3 cmgmt3
  ping -c 3 clicense1
* Verify that ''both license ports on the same server'' can be reached from your client machine:
* Verify that ''both license ports on the same server'' can be reached from your client machine:
  telnet '''cmgmt3''' 1718
  telnet '''clicense1''' 1718
  telnet '''cmgmt3''' 1719
  telnet '''clicense1''' 1719
: or:
: or:
  telnet '''cmgmt4''' 1718
  telnet '''clicense2''' 1718
  telnet '''cmgmt4''' 1719
  telnet '''clicense2''' 1719
: A ''successful'' connection looks like:
: A ''successful'' connection looks like:
  Trying 146.139.x.y...
  Trying 146.139.x.y...
  Connected to cmgmt3.cnm.anl.gov.
  Connected to clicense1.cnm.anl.gov.
  Escape character is '^]'.
  Escape character is '^]'.
:: Do not enter any data. Instead,  close each connection by hitting <code>Ctrl</code><code>]</code> (closing square bracket), followed by <code>Ctrl</code><code>D</code>.
:: Do not enter any data. Instead,  close each connection by hitting <code>Ctrl</code><code>]</code> (closing square bracket), followed by <code>Ctrl</code><code>D</code>.
Line 110: Line 151:
:: In these cases, ask that your IP firewall configuration be reviewed and changed.
:: In these cases, ask that your IP firewall configuration be reviewed and changed.


=== Outside CNM, using SSH Tunneling ===
=== License access when outside CNM ===
If you're comfortable with ssh and tunneling, do the following on your (the client) machine:
If you're comfortable with ssh and tunneling, set up client licensing as follows:
* Enter into the COMSOL license file:
 
==== Configure COMSOL ====
The following needs to be done just once, typically during COMSOL installation:
 
In the COMSOL Installer, or in COMSOL Preferences, enter:
* '''License format:''' Floating Network License (FNL), "Port number and Hostname"
:: "Three-server redundancy" cannot be used because is cannot (easily) be accessed over SSH. Configure with just one server, and in rare tweak SSH to tunnel to the other server.
* '''Server:''' <code>127.0.0.1</code>
:: Do not use "localhost", as COMSOL interprets this incorrectly to mean that your machine ''is'' a license server.
 
* '''Port:''' <code>1718</code>
<!--
Or place a license file with this content:
<source lang="make">
<source lang="make">
SERVER 127.0.0.1 ANY 1718
SERVER 127.0.0.1 ANY 1718
USE_SERVER
USE_SERVER
</source>
</source>
: '''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:
==== Provide server connection ====
* First, set up a tunnel to the primary license server:
This step needs to be done prior to running COMSOL in your desktop session:
  ssh  -L 1718:'''cmgmt3''':1718  -L 1719:'''cmgmt3''':1719  mega
* Connect to <code>mega</code> with the following ssh command:
* Start COMSOL.
  ssh  -L 1718:'''clicense1''':1718  -L 1719:'''clicense1''':1719  mega.cnm.anl.gov
: If you get an error that the number of licenses is exhausted, that is at least confirmation that you correctly reached the license server.
* Leave the command running between invocations of COMSOL.


If the above attempt takes a long time or hangs entirely, it may be because the license service currently runs on the secondary server.
==== Run COMSOL ====
* Connect to the alternate license server:
* Ensure your connection to "mega" is still running. If not, restart it.
ssh  -L 1718:'''cmgmt4''':1718  -L 1719:'''cmgmt4''':1719  mega
* Start the COMSOL application.
* 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 ===
** If you get an error that the number of licenses is "exhausted", that is confirmation that you correctly reached the license server, though other users are using licenses.
* Follow the directions and tests shown in the [[#Outside CNM, using VPN|VPN]] section above.
** If the license access attempt takes a long time or hangs, the service might temporarily run on a secondary server. In this case, stop the mega session and restart it, connecting to the alternate license server:
ssh  -L 1718:clicense'''2''':1718  -L 1719:clicense'''2''':1719  mega.cnm.anl.gov


== License Troubleshooting ==
== License Troubleshooting ==
Line 152: Line 204:
   make sure you're referring to the right host (see LM_LICENSE_FILE).
   make sure you're referring to the right host (see LM_LICENSE_FILE).
  Feature:      SERIAL
  Feature:      SERIAL
  Hostname:      csched1
  Hostname:      clicense3
  License path:  /Users/stern/Applications/COMSOL52a/license/license.dat:
  License path:  /Users/stern/Applications/COMSOL52a/license/license.dat:
  FlexNet Licensing error:-96,7
  FlexNet Licensing error:-96,7
Line 164: Line 216:
  License path: /Users/stern/Applications/COMSOL52a/license/license.dat:
  License path: /Users/stern/Applications/COMSOL52a/license/license.dat:
  FlexNet Licensing error:-21,126
  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.
* Reason: Only the first of two steps for connecting to the license servers succeeds, which may happen when the redundant license service runs on the alternate server instead of the one you're connected to.
* Solution: When using SSH, try <code>cmgmt4</code> instead of  <code>cmgmt3</code>, or vice versa. Revisit your <code>~/.ssh/config</code> file or use the alternate command line as shown in the SSH section above.
* Solution: When using SSH, try <code>clicense2</code> instead of  <code>clicense1</code>, or vice versa. Revisit your <code>~/.ssh/config</code> file or use the alternate command line as shown in the SSH section above.


== Multiple CPU cores ==
== Multiple CPU cores ==
Line 190: Line 242:
See:
See:
  $COMSOL_HOME/sample.job
  $COMSOL_HOME/sample.job
== Important COMSOL Support Articles ==
* Toplevel suport page: https://www.comsol.com/support
=== KB Articles ===
* [https://www.comsol.com/support/knowledgebase/1001 Running COMSOL® in parallel on clusters]
* [https://www.comsol.com/support/knowledgebase/1250 Running parametric sweeps, batch sweeps, and cluster sweeps from the command line]
* [https://www.comsol.com/support/knowledgebase/1255 Reducing the amount of solution data stored in a model]
* [https://www.comsol.com/support/knowledgebase/830 Handling large models]
=== Blog-style articles ===
* [https://www.comsol.com/blogs/the-power-of-the-batch-sweep/ The Power of the Batch Sweep]
* [https://www.comsol.com/blogs/how-to-run-simulations-in-batch-mode-from-the-command-line/ How to Run Simulations in Batch Mode from the Command Line]

Latest revision as of 21:18, August 11, 2025

Introduction

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

Access

COMSOL features licensed at CNM as of 2024-10.

COMSOL Multiphysics

Access to COMSOL Multiphysics, the main application with both a graphical user interface and batch computing capabilities, will be granted upon request .

You must be:

  • An Argonne employee  in one of the following roles:
    • NST staff member  (including PostDocs, joint appointments, and students at NST).
    • CNM Facility User  (including non-NST Argonne employees), with an active proposal that has COMSOL in scope. Please see HPC/FAQ#Access_and_proposals.

The set of available COMSOL modules that we have licensed is shown at right.

  • The native desktop version can be installed only on Argonne-owned computers (laptop or desktop). Please contact CNM support. Make sure to review Product Updates.
  • To run COMSOL on our HPC system Carbon, as GUI or as batch computing jobs, your proposal must have Carbon access in scope.

COMSOL Server

CNM Facility Users who are not Argonne employees are not eligible to access the full COMSOL Multiphysics product, in compliance with its licensing terms and conditions. However, the COMSOL Server product offers an alternative albeit more narrow means of access.

All users, including non-Argonne users may be able to run, over a web interface in their browser, pre-parameterized "fixed-model" simulations that were made with the COMSOL Application Builder (requires Windows).

To inquire about using COMSOL server applications, please contact us. 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.

Support

The modes to run COMSOL

There are several ways of running COMSOL.

Running the desktop application

To edit models and analyze results, use the COMSOL graphical user interface (GUI). You can run it in several ways, each explained in more detail in the following sections.

  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 desktoo or laptop computer.
    • You will require access to the COMSOL license server running on Carbon, either through VPN (fairly easy) or SSH tunneling (can be intimidating for first-time users). See below for details.

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.

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 &

License configuration is automatic on Carbon.

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.

Native desktop version

To get the fastest response from the COMSOL GUI, run a native COMSOL version on your desktop machine or laptop, called client machine below.

Enter license details either in the COMSOL Setup configuration dialog.

Native desktop version — License configuration

A client's COMSOL license needs to be configured depending on how the client reaches CNM network resources. Follow the appropriate section:

License configuration when inside CNM or using VPN

Ensure correct DNS search domains

  • Inspect the client machine's network configuration.
  • Ensure that two entries are listed as DNS Search Domains for the current network profile:
nst.anl.gov
cnm.anl.gov
(The order of entries does not matter for the purposes considered here.)
  • If the client machine is wired to CNM networks, the domains are normally provided correctly by DHCP.
  • If the client machine is connected over VPN, you may need edit the respective network profile.
  • 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 those changes are being saved and will be activated automatically the next time that this VPN session gets started.
  • On Windows or Linux machines, take analogous steps, using the platform's own configuration tools.
  • Exclude license manager components from client desktop installation. (Those are all handled server-side.)

License format

  • Floating Network License (FNL), "Three-server redundancy"

License servers

  • On client machines, while running the COMSOL installer or license configuration, specify license servers and ports as follows:
clicense1    1718
clicense2    1718
clicense3    1718
Note: Use short host name form exactly as given here. (Technical Reason: The license must be usable both on Carbon's internal network as well as on divisional networks that are outside of Carbon).

Advanced: A client machine's COMSOL license file <COMSOLDIR>/Multiphysics/license/license.dat should look as follows:

SERVER clicense1 ANY 1718
SERVER clicense2 ANY 1718
SERVER clicense3 ANY 1718
USE_SERVER

<COMSOLDIR> is located by default at:

  • Windows: C:\Program files\COMSOL\COMSOLnn
  • Linux: /usr/local/comsolnn
  • Mac: /Applications/COMSOLnn

("nn" is the application's abbreviated version number.)

Network Troubleshooting

When using the license access model descibed here (as opposed to tunneled over SSH), ensure the following:

  • Verify that short host names can be resolved to IP addresses. Either one of the following commands should produce sensible output:
host clicense1
or:
ping -c 3 clicense1
  • Verify that both license ports on the same server can be reached from your client machine:
telnet clicense1 1718
telnet clicense1 1719
or:
telnet clicense2 1718
telnet clicense2 1719
A successful connection looks like:
Trying 146.139.x.y...
Connected to clicense1.cnm.anl.gov.
Escape character is '^]'.
Do not enter any data. Instead, close each connection by hitting Ctrl] (closing square bracket), followed by CtrlD.
A failed connection gives one of these errors:
telnet: connect to address 146.139.x.y: Operation timed out
or:
telnet: connect to address 146.139.x.y: Connection refused
In these cases, ask that your IP firewall configuration be reviewed and changed.

License access when outside CNM

If you're comfortable with ssh and tunneling, set up client licensing as follows:

Configure COMSOL

The following needs to be done just once, typically during COMSOL installation:

In the COMSOL Installer, or in COMSOL Preferences, enter:

  • License format: Floating Network License (FNL), "Port number and Hostname"
"Three-server redundancy" cannot be used because is cannot (easily) be accessed over SSH. Configure with just one server, and in rare tweak SSH to tunnel to the other server.
  • Server: 127.0.0.1
Do not use "localhost", as COMSOL interprets this incorrectly to mean that your machine is a license server.
  • Port: 1718

Provide server connection

This step needs to be done prior to running COMSOL in your desktop session:

  • Connect to mega with the following ssh command:
ssh  -L 1718:clicense1:1718  -L 1719:clicense1:1719  mega.cnm.anl.gov
  • Leave the command running between invocations of COMSOL.

Run COMSOL

  • Ensure your connection to "mega" is still running. If not, restart it.
  • Start the COMSOL application.
    • If you get an error that the number of licenses is "exhausted", that is confirmation that you correctly reached the license server, though other users are using licenses.
    • If the license access attempt takes a long time or hangs, the service might temporarily run on a secondary server. In this case, stop the mega session and restart it, connecting to the alternate license server:
ssh  -L 1718:clicense2:1718  -L 1719:clicense2:1719  mega.cnm.anl.gov

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:      clicense3
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 the first of two steps for connecting to the license servers succeeds, which may happen when the redundant license service runs on the alternate server instead of the one you're connected to.
  • Solution: When using SSH, try clicense2 instead of clicense1, 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

Important COMSOL Support Articles

KB Articles

Blog-style articles