<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.anl.gov/wiki_cnm/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Stern</id>
	<title>CNM Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.anl.gov/wiki_cnm/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Stern"/>
	<link rel="alternate" type="text/html" href="https://wiki.anl.gov/cnm/Special:Contributions/Stern"/>
	<updated>2026-08-04T23:12:48Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.9</generator>
	<entry>
		<id>https://wiki.anl.gov/wiki_cnm/index.php?title=HPC/Applications/vasp&amp;diff=7511</id>
		<title>HPC/Applications/vasp</title>
		<link rel="alternate" type="text/html" href="https://wiki.anl.gov/wiki_cnm/index.php?title=HPC/Applications/vasp&amp;diff=7511"/>
		<updated>2026-07-28T20:06:28Z</updated>

		<summary type="html">&lt;p&gt;Stern: /* Requesting Access */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Requesting Access ==&lt;br /&gt;
VASP versions 4, 5, and 6 are is available on Carbon, subject to confirmation for your group having a license for VASP major versions 4, 5, or 6.&lt;br /&gt;
&lt;br /&gt;
Each VASP user needs to be registered, at VASP.at by name and email address, under the VASP license of a research group, or on a commercial license through MDI.&lt;br /&gt;
&lt;br /&gt;
To use VASP binaries on Carbon, send me (M. Sternberg), the following for you, and possibly other users of your VASP license group:&lt;br /&gt;
&lt;br /&gt;
* Full name&lt;br /&gt;
* Email address that the person registered with at vasp.at or MDI.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
Please kindly ask the vaspmaster to confirm to me that you hold or are covered by a license.  You may wish to use the following template.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;To:&#039;&#039;&#039; [mailto:licensing@vasp.at?subject=License%20confirmation&amp;amp;CC=sternberg@anl.gov licensing@vasp.at]&lt;br /&gt;
 &#039;&#039;&#039;CC:&#039;&#039;&#039; sternberg@anl.gov&lt;br /&gt;
 &#039;&#039;&#039;Subject:&#039;&#039;&#039; License confirmation&lt;br /&gt;
 &lt;br /&gt;
 We are users of the Center for Nanoscale Materials at Argonne National Laboratory.&lt;br /&gt;
 We would like to use the VASP installation at this site.&lt;br /&gt;
 &lt;br /&gt;
 Please confirm to Michael Sternberg &amp;lt;sternberg@anl.gov&amp;gt; that the following people in my research group are eligible to use VASP:&lt;br /&gt;
 &lt;br /&gt;
 - ...&lt;br /&gt;
 - ... &lt;br /&gt;
 &lt;br /&gt;
 With best regards,&lt;br /&gt;
 ...&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Module considerations ==&lt;br /&gt;
* Review the available modules for each major version:&lt;br /&gt;
** [[HPC/Software/Modules#vasp | vasp]], for VASP 4.x&lt;br /&gt;
** [[HPC/Software/Modules#vasp5 | vasp5]], for VASP 5.x&lt;br /&gt;
** [[HPC/Software/Modules#vasp5 | vasp6]], for VASP 6.x&lt;br /&gt;
* Choose and [[HPC/Software/Module Setup#Shell Customizations|add &#039;&#039;&#039;one&#039;&#039;&#039; of the following lines to your ~/.bashrc]] file:&lt;br /&gt;
 module load --auto vasp                # sets &#039;&#039;&#039;$VASP_HOME&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;!-- &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;&amp;lt;strike&amp;gt;module load vasp-vtst           # sets &#039;&#039;&#039;$VASP_VTST_HOME&#039;&#039;&#039;&amp;lt;/strike&amp;gt;  Obsolete; now included in vasp and vasp5&amp;lt;/font&amp;gt; --&amp;gt;&lt;br /&gt;
 module load --auto vasp5               # sets &#039;&#039;&#039;$VASP5_HOME&#039;&#039;&#039;&lt;br /&gt;
 module load --auto vasp6               # sets &#039;&#039;&#039;$VASP6_HOME&#039;&#039;&#039;&lt;br /&gt;
: Each module points to an installation directory using an [[HPC/Software/Module Setup#Package home directories|environment variable corresponding to the module name]]. Do not hardcode the directory anywhere, as that location is determined by the module and may change in subsequent versions. There should not be a reason to do so, since &amp;lt;code&amp;gt;$PATH&amp;lt;/code&amp;gt; will be managed appropriately.&lt;br /&gt;
&lt;br /&gt;
* Each module provides several binaries (see [[#Binaries|next section]]).&lt;br /&gt;
* You do not need to specify a path for vasp for the mpirun statement in the PBS job script.&lt;br /&gt;
* The modules are mutually exclusive.&lt;br /&gt;
* Potentials are available in &amp;lt;code&amp;gt;/opt/soft/vasp-pot&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
To access Graeme Henkelman&#039;s script suite, load the [[HPC/Software/Modules#vasp-vtstscripts|vasp-vtstscripts module]]. It works with both the vasp and vasp5 modules above. In either case, choose one of the VTST-patched binaries from the table below. The unpatched vasp binaries will not interoperate with the script suite.&lt;br /&gt;
&lt;br /&gt;
 module load vasp-vtstscripts&lt;br /&gt;
&lt;br /&gt;
== Binaries ==&lt;br /&gt;
Some options for VASP cannot be configured at runtime (by input data) but must be chosen when compiling.&lt;br /&gt;
Since no single set of compile-time choices is appropriate for all uses, a number of binaries are provided, distinguished by their name.&lt;br /&gt;
&lt;br /&gt;
The modules from versions vasp/4.6.35-mkl-13 and vasp5/5.2.12a-mkl-4 onwards, respectively,&lt;br /&gt;
contain several binaries built using different sets of preprocessor flags in the Makefile.&lt;br /&gt;
Earlier modules only contain two binaries, &amp;lt;code&amp;gt;vasp&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;vasp-gamma&amp;lt;/code&amp;gt;.&lt;br /&gt;
Additional binaries are provided for useful preprocessor flag combinations&lt;br /&gt;
after applying patches from the group of Graeme Henkelman (UT Austin) to the source code:&lt;br /&gt;
* [http://theory.cm.utexas.edu/vtsttools/ Transition state tools for VASP], and&lt;br /&gt;
* [http://theory.cm.utexas.edu/vtsttools/bader/ DOS Projection in Bader Volumes].&lt;br /&gt;
&lt;br /&gt;
To verify the binaries available for a module, run the appropriate command, once the module has been loaded:&lt;br /&gt;
 ls $VASP_HOME/bin   # for VASP-4 (previous major version)&lt;br /&gt;
 ls $VASP5_HOME/bin&lt;br /&gt;
&lt;br /&gt;
Choose a binary appropriate for your task and pass its name to &amp;lt;code&amp;gt;mpirun&amp;lt;/code&amp;gt; in the job script.&lt;br /&gt;
There is no need for full path names.&lt;br /&gt;
Copy a sample job script from:&lt;br /&gt;
 $VASP_HOME/vasp.job   # for VASP-4 (previous major version)&lt;br /&gt;
 $VASP5_HOME/vasp.job&lt;br /&gt;
&lt;br /&gt;
=== Available binaries and their compile-time flags used ===&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
sed -n &#039;/DMPI_BLOCK/s/.*&amp;quot;//p&#039; embody-5.2.12a-mkl-4/build.log  | uniq&lt;br /&gt;
sed -n &#039;/DMPI_BLOCK/s/.*8000//p&#039; embody-5.2.12a-mkl-4/build.log  | uniq&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
This table lists the names of the binaries compiled from&lt;br /&gt;
* combinations of preprocessor flags, and&lt;br /&gt;
* variants of the source code, primarily enhancing capabilities of ionic updates.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; cellpadding=&amp;quot;5&amp;quot; style=&amp;quot;text-align:left; font-family: monospace;&amp;quot;&lt;br /&gt;
&amp;lt;!---------- HEADER ----------&amp;gt;&lt;br /&gt;
|- style=&amp;quot;background:#e4e4e4; text-align:center; font-weight: bold; font-family: sans-serif;&amp;quot;&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | Versions and capabilities&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | Flags used&lt;br /&gt;
| colspan=&amp;quot;4&amp;quot; align=&amp;quot;center&amp;quot; | Binary names&lt;br /&gt;
|- style=&amp;quot;background:#e4e4e4; text-align:center; vertical-align:top; font-weight: bold; font-family: sans-serif;&amp;quot;&lt;br /&gt;
| Official&lt;br /&gt;
| Constrained Cell relaxation&amp;lt;sup&amp;gt;1&amp;lt;/sup&amp;gt;&lt;br /&gt;
| Patched for VTST&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;&lt;br /&gt;
| Patched for Bader-projected DOS&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! colspan=&amp;quot;6&amp;quot; style=&amp;quot;background:#e4e4e4; text-align:center; font-family: sans-serif;&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
&amp;lt;!---------- 4.x AND EARLY 5.x ----------&amp;gt;&lt;br /&gt;
! rowspan=&amp;quot;4&amp;quot; style=&amp;quot;background:#e4e4e4; text-align:center; font-family: sans-serif;&amp;quot; | Conventional,&amp;lt;br&amp;gt;Versions 4.x–5.3&lt;br /&gt;
| style=&amp;quot;background:#e4e4e4;&amp;quot; | (none)&lt;br /&gt;
| style=&amp;quot;background:none;&amp;quot; | &#039;&#039;&#039;vasp&#039;&#039;&#039;&lt;br /&gt;
| style=&amp;quot;background:#eed;&amp;quot; | &#039;&#039;&#039;vasp-cellz&#039;&#039;&#039;&lt;br /&gt;
| style=&amp;quot;background:#ded;&amp;quot; | &#039;&#039;&#039;vasp-vtst&#039;&#039;&#039;&lt;br /&gt;
| style=&amp;quot;background:#fee;&amp;quot; | &#039;&#039;&#039;vasp-baderdos&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background:#e4e4e4;&amp;quot; | -DNGZhalf&lt;br /&gt;
| style=&amp;quot;background:none;&amp;quot; | &#039;&#039;&#039;vasp-chargehalf&#039;&#039;&#039;&lt;br /&gt;
| style=&amp;quot;background:#eed;&amp;quot; | &#039;&#039;&#039;vasp-cellz-chargehalf&#039;&#039;&#039;&lt;br /&gt;
| style=&amp;quot;background:#ded;&amp;quot; | &#039;&#039;&#039;vasp-vtst-chargehalf&#039;&#039;&#039;&lt;br /&gt;
| style=&amp;quot;background:#fee;&amp;quot; | &#039;&#039;&#039;vasp-baderdos-chargehalf&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background:#e4e4e4;&amp;quot; | -DwNGZhalf&lt;br /&gt;
| style=&amp;quot;background:none;&amp;quot; | &#039;&#039;&#039;vasp-gamma&#039;&#039;&#039;&lt;br /&gt;
| style=&amp;quot;background:#eed;&amp;quot; | &#039;&#039;&#039;vasp-cellz-gamma&#039;&#039;&#039;&lt;br /&gt;
| style=&amp;quot;background:#ded;&amp;quot; | &#039;&#039;&#039;vasp-vtst-gamma&#039;&#039;&#039;&lt;br /&gt;
| style=&amp;quot;background:#fee;&amp;quot; | &#039;&#039;&#039;vasp-baderdos-gamma&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background:#e4e4e4;&amp;quot; | -DwNGZhalf -DNGZhalf&lt;br /&gt;
| style=&amp;quot;background:none;&amp;quot; | &#039;&#039;&#039;vasp-gamma-chargehalf&#039;&#039;&#039;&lt;br /&gt;
| style=&amp;quot;background:#eed;&amp;quot; | &#039;&#039;&#039;vasp-cellz-gamma-chargehalf&#039;&#039;&#039;&lt;br /&gt;
| style=&amp;quot;background:#ded;&amp;quot; | &#039;&#039;&#039;vasp-vtst-gamma-chargehalf&#039;&#039;&#039;&lt;br /&gt;
| style=&amp;quot;background:#fee;&amp;quot; | &#039;&#039;&#039;vasp-baderdos-gamma-chargehalf&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! rowspan=&amp;quot;4&amp;quot; style=&amp;quot;background:#e4e4e4; text-align:center; font-family: sans-serif;&amp;quot; | Advanced&amp;lt;br&amp;gt;MD techniques,&amp;lt;sup&amp;gt;4&amp;lt;/sup&amp;gt;&amp;lt;br&amp;gt;Versions 5.2 and 5.3&lt;br /&gt;
| style=&amp;quot;background:#e4e4e4;&amp;quot; | -Dtbdyn&lt;br /&gt;
| style=&amp;quot;background:#ddf;&amp;quot; | &#039;&#039;&#039;vasp-tbdyn&#039;&#039;&#039;&lt;br /&gt;
| rowspan=&amp;quot;4&amp;quot; style=&amp;quot;background:#f0f0f0; text-align:center; font-style:oblique; font-family: sans-serif;&amp;quot; | –&lt;br /&gt;
| rowspan=&amp;quot;4&amp;quot; style=&amp;quot;background:#f0f0f0; text-align:center; font-style:oblique; font-family: sans-serif;&amp;quot; | –&lt;br /&gt;
| rowspan=&amp;quot;4&amp;quot; style=&amp;quot;background:#f0f0f0; text-align:center; font-style:oblique; font-family: sans-serif;&amp;quot; | not useful&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background:#e4e4e4;&amp;quot; | -Dtbdyn -DNGZhalf&lt;br /&gt;
| style=&amp;quot;background:#ddf;&amp;quot; | &#039;&#039;&#039;vasp-tbdyn-chargehalf&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background:#e4e4e4;&amp;quot; | -Dtbdyn -DwNGZhalf&lt;br /&gt;
| style=&amp;quot;background:#ddf;&amp;quot; | &#039;&#039;&#039;vasp-tbdyn-gamma&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background:#e4e4e4;&amp;quot; | -Dtbdyn -DwNGZhalf -DNGZhalf&lt;br /&gt;
| style=&amp;quot;background:#ddf;&amp;quot; | &#039;&#039;&#039;vasp-tbdyn-gamma-chargehalf&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;!---------- VERSION 5.4 ----------&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! colspan=&amp;quot;6&amp;quot; style=&amp;quot;background:#e4e4e4; text-align:center; font-family: sans-serif;&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
! rowspan=&amp;quot;5&amp;quot; style=&amp;quot;background:#e4e4e4; text-align:center; font-family: sans-serif;&amp;quot; | Version 5.4&amp;lt;sup&amp;gt;4,5&amp;lt;/sup&amp;gt;&lt;br /&gt;
| style=&amp;quot;background:#e4e4e4;&amp;quot; | -Dtbdyn&lt;br /&gt;
| style=&amp;quot;background:#f0f0f0;&amp;quot; | &#039;&#039;&#039;vasp_ncl&#039;&#039;&#039;&lt;br /&gt;
| rowspan=&amp;quot;5&amp;quot; style=&amp;quot;background:#eed; text-align:center; font-family: sans-serif; &amp;quot; | (–o–)&amp;lt;sup&amp;gt;5&amp;lt;/sup&amp;gt;&lt;br /&gt;
| style=&amp;quot;background:#ded;&amp;quot; | &#039;&#039;&#039;vasp_vtst_ncl&#039;&#039;&#039;&lt;br /&gt;
| rowspan=&amp;quot;5&amp;quot; style=&amp;quot;background:#f0f0f0; text-align:center; font-style:oblique; font-family: sans-serif;&amp;quot; | TBD&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background:#e4e4e4;&amp;quot; | -Dtbdyn -DNGZhalf&lt;br /&gt;
| style=&amp;quot;background:none;&amp;quot; | &#039;&#039;&#039;vasp_std&#039;&#039;&#039;&lt;br /&gt;
| style=&amp;quot;background:#ded;&amp;quot; | &#039;&#039;&#039;vasp_vtst_std&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background:#e4e4e4;&amp;quot; | -Dtbdyn -DwNGZhalf -DNGZhalf&lt;br /&gt;
| style=&amp;quot;background:none;&amp;quot; | &#039;&#039;&#039;vasp_gam&#039;&#039;&#039;&lt;br /&gt;
| style=&amp;quot;background:#ded;&amp;quot; | &#039;&#039;&#039;vasp_vtst_gam&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background:#e4e4e4;&amp;quot; | (GPU&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;)&lt;br /&gt;
| style=&amp;quot;background:none;&amp;quot; | &#039;&#039;&#039;vasp_&amp;lt;font color=&amp;quot;purple&amp;quot;&amp;gt;gpu&amp;lt;/font&amp;gt;_ncl&#039;&#039;&#039;&lt;br /&gt;
| style=&amp;quot;background:#ded;&amp;quot; | &#039;&#039;&#039;vasp_vtst_&amp;lt;font color=&amp;quot;purple&amp;quot;&amp;gt;gpu&amp;lt;/font&amp;gt;_ncl&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background:#e4e4e4;&amp;quot; | (GPU&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;) -DNGZhalf&lt;br /&gt;
| style=&amp;quot;background:none;&amp;quot; | &#039;&#039;&#039;vasp_&amp;lt;font color=&amp;quot;purple&amp;quot;&amp;gt;gpu&amp;lt;/font&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
| style=&amp;quot;background:#ded;&amp;quot; | &#039;&#039;&#039;vasp_vtst_&amp;lt;font color=&amp;quot;purple&amp;quot;&amp;gt;gpu&amp;lt;/font&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;!---------- VERSION 6 ----------&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! colspan=&amp;quot;6&amp;quot; style=&amp;quot;background:#e4e4e4; text-align:center; font-family: sans-serif;&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
! rowspan=&amp;quot;4&amp;quot; style=&amp;quot;background:#e4e4e4; text-align:center; font-family: sans-serif;&amp;quot; | Version 6 (prelim.)&lt;br /&gt;
| style=&amp;quot;background:#e4e4e4;&amp;quot; |&lt;br /&gt;
| style=&amp;quot;background:#f0f0f0;&amp;quot; | &#039;&#039;&#039;vasp_ncl&#039;&#039;&#039;&lt;br /&gt;
| rowspan=&amp;quot;3&amp;quot; style=&amp;quot;background:#eed; text-align:center; font-family: sans-serif; &amp;quot; | (–o–)&amp;lt;sup&amp;gt;5&amp;lt;/sup&amp;gt;&lt;br /&gt;
| style=&amp;quot;background:#ded;&amp;quot; | &#039;&#039;&#039;vasp_vtst_ncl&#039;&#039;&#039;&lt;br /&gt;
| rowspan=&amp;quot;4&amp;quot; style=&amp;quot;background:#f0f0f0; text-align:center; font-style:oblique; font-family: sans-serif;&amp;quot; | TBD&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background:#e4e4e4;&amp;quot; |&lt;br /&gt;
| style=&amp;quot;background:none;&amp;quot; | &#039;&#039;&#039;vasp_std&#039;&#039;&#039;&lt;br /&gt;
| style=&amp;quot;background:#ded;&amp;quot; | &#039;&#039;&#039;vasp_vtst_std&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background:#e4e4e4;&amp;quot; |&lt;br /&gt;
| style=&amp;quot;background:none;&amp;quot; | &#039;&#039;&#039;vasp_gam&#039;&#039;&#039;&lt;br /&gt;
| style=&amp;quot;background:#ded;&amp;quot; | &#039;&#039;&#039;vasp_vtst_gam&#039;&#039;&#039;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;sup&amp;gt;1&amp;lt;/sup&amp;gt;) Stress tensor selectively zeroed in subroutine &amp;lt;code&amp;gt;CONSTR_CELL_RELAX&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;) http://theory.cm.utexas.edu/vtsttools/ . The dimer method was broken for vasp5/5.3.3 prior to 5.3.3p3-mkl-2.&amp;lt;!-- The [http://theory.cm.utexas.edu/forum/viewtopic.php?f=2&amp;amp;t=1285 &#039;&#039;dimer method is broken&#039;&#039; in vasp5/5.3.3p1-mkl-1.] To run the dimer method at the moment, load the module version vasp5/5.3.2.--&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;) http://theory.cm.utexas.edu/vtsttools/dos/ (now defunct)&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;sup&amp;gt;4&amp;lt;/sup&amp;gt;) http://cms.mpi.univie.ac.at/vasp/vasp/Advanced_MD_techniques.html &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;sup&amp;gt;5&amp;lt;/sup&amp;gt;) [[#Constrained Cell Relaxation|Axis-selective constrained cell relaxation]], controlled via an optional input file &amp;lt;code&amp;gt;CELL_RELAX&amp;lt;/code&amp;gt;, is compiled into &#039;&#039;all&#039;&#039; binaries.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;) http://cms.mpi.univie.ac.at/wiki/index.php/GPU_port_of_VASP&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Explanation of flags ===&lt;br /&gt;
* File &amp;lt;code&amp;gt;vasp.5.2/makefile.linux_pg&amp;lt;/code&amp;gt; in the souce code explains:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#-----------------------------------------------------------------------&lt;br /&gt;
# possible options for CPP:&lt;br /&gt;
# NGXhalf             charge density   reduced in X direction&lt;br /&gt;
# wNGXhalf            gamma point only reduced in X direction&lt;br /&gt;
# avoidalloc          avoid ALLOCATE if possible&lt;br /&gt;
# IFC                 work around some IFC bugs&lt;br /&gt;
# CACHE_SIZE          1000 for PII,PIII, 5000 for Athlon, 8000 P4&lt;br /&gt;
# RPROMU_DGEMV        use DGEMV instead of DGEMM in RPRO (usually  faster)&lt;br /&gt;
# RACCMU_DGEMV        use DGEMV instead of DGEMM in RACC (faster on P4)&lt;br /&gt;
#  **** definitely use -DRACCMU_DGEMV if you use the mkl library&lt;br /&gt;
#-----------------------------------------------------------------------&lt;br /&gt;
…&lt;br /&gt;
#-----------------------------------------------------------------------&lt;br /&gt;
# additional options for CPP in parallel version (see also above):&lt;br /&gt;
# NGZhalf               charge density   reduced in Z direction&lt;br /&gt;
# wNGZhalf              gamma point only reduced in Z direction&lt;br /&gt;
# scaLAPACK             use scaLAPACK (usually slower on 100 Mbit Net)&lt;br /&gt;
#-----------------------------------------------------------------------&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* In the new build system (since version 5.4) the direct use of the &amp;lt;code&amp;gt;-D*NG*half&amp;lt;/code&amp;gt; options has been replaced by predefined make(1) arguments &amp;lt;code&amp;gt;VERSION={std,gam,ncl}&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Common flags ===&lt;br /&gt;
 -DIFC -DRPROMU_DGEMV  -DRACCMU_DGEMV -DCACHE_SIZE=16000  -DMPI -DMPI_BLOCK=8000&lt;br /&gt;
&lt;br /&gt;
== General patches ==&lt;br /&gt;
&lt;br /&gt;
The following modifications have been applied and are active in &#039;&#039;all binaries&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
=== vdW-DF functional ===&lt;br /&gt;
The [http://cms.mpi.univie.ac.at/vasp/vasp/vdW_DF_functional_Langreth_Lundqvist_et_al.html vdW-DF functional of Langreth and Lundqvist et al.]&lt;br /&gt;
is implemented in all the &amp;lt;code&amp;gt;*-chargehalf&amp;lt;/code&amp;gt; binaries of the vasp5 module, and all versions above 5.4.&lt;br /&gt;
&lt;br /&gt;
No specific preparations are needed other than setting the INCAR flags as documented. The binaries will find the required precalculated kernel  file &amp;lt;code&amp;gt;vdw_kernel.bindat&amp;lt;/code&amp;gt; by means of the environment variable &amp;lt;code&amp;gt;$VASP5_HOME&amp;lt;/code&amp;gt; which is set by the module.&lt;br /&gt;
&lt;br /&gt;
This is a Carbon-specific extension.&lt;br /&gt;
&lt;br /&gt;
=== Solvation Model ===&lt;br /&gt;
All binaries above build 5.4.1.3-8-* contain the [http://vaspsol.mse.ufl.edu VASPsol] solvation model of the Hennig group at Univ. of Florida..&lt;br /&gt;
&lt;br /&gt;
=== Constrained Cell Relaxation ===&lt;br /&gt;
Likewise, in all binaries above build 5.4.1.3-8-* the relaxation of the unit cell may be constrained&lt;br /&gt;
along one or more axes by creating a supplementary input file &amp;lt;code&amp;gt;CELL_RELAX&amp;lt;/code&amp;gt;.&lt;br /&gt;
The subroutine &amp;lt;code&amp;gt;CONSTR_CELL_RELAX&amp;lt;/code&amp;gt;,&lt;br /&gt;
having been a placeholder in the original source files,&lt;br /&gt;
was extended to read (and re-read) this file in each call and apply the containts&lt;br /&gt;
to the force components of each basis vector.&lt;br /&gt;
The performance impact from the multiple reads is expected to be minimal.&lt;br /&gt;
&lt;br /&gt;
This is a Carbon-specific extension.&lt;br /&gt;
&lt;br /&gt;
; File format:&lt;br /&gt;
   cell relaxation     - fixed string, for validation only, leading spaces ignored.&lt;br /&gt;
   ix iy iz            - 3 integer flags, indicating which cartesian components of the&lt;br /&gt;
                         basis vectors are allowed to be changed; 0 means no (fixed),&lt;br /&gt;
                         non-zero means yes (can change).&lt;br /&gt;
; Examples:&lt;br /&gt;
* To relax the entire cell (identical to default behavior):&lt;br /&gt;
   cell relaxation&lt;br /&gt;
   1 1 1&lt;br /&gt;
* To relax along z only:&lt;br /&gt;
   cell relaxation&lt;br /&gt;
   0 0 1&lt;br /&gt;
; Output indicator:&lt;br /&gt;
To indicate if your chosen VASP binary (a) looked for and (b) did or did not find the &amp;lt;code&amp;gt;CELL_RELAX&amp;lt;/code&amp;gt; file, the subroutine &amp;lt;code&amp;gt;CONSTR_CELL_RELAX&amp;lt;/code&amp;gt; will output one of the following each time it has been called:&lt;br /&gt;
 CELL_RELAX not present: performing unconstrained unit cell relaxation&lt;br /&gt;
: or:&lt;br /&gt;
 CELL_RELAX: performing constrained unit cell relaxation in cartesian directions  1  0  1&lt;br /&gt;
 Unit cell forces:&lt;br /&gt;
       1.1111111111111112       0.0000000000000000       2.2222222222222223&lt;br /&gt;
       0.0000000000000000       0.0000000000000000       0.0000000000000000&lt;br /&gt;
       2.2222222222222223       0.0000000000000000       3.3333333333333330&lt;br /&gt;
: (The force values shown here are contrived.)&lt;br /&gt;
; Author: Michael Sternberg.&lt;br /&gt;
&lt;br /&gt;
== Usage under ASE ==&lt;br /&gt;
VASP calculations can be set up, run, and analyzed using the [https://wiki.fysik.dtu.dk/ase/ase/calculators/vasp.html calculator interface] of the [https://wiki.fysik.dtu.dk/ase/overview.html ASE] package, available on Carbon under both the [[../#ase3 | ase3]] and [[../#atk | atk]] modules.&lt;br /&gt;
ASE is told how to use VASP by means of environment variables which the modules define for you with sensible defaults:&lt;br /&gt;
 VASP_PP_PATH&lt;br /&gt;
 VASP_COMMAND&lt;br /&gt;
* The calculator will create and possibly overwrite VASP input files in the current directory, and then run VASP therein. To minimize clutter, consider setting up and changing into a run-specific directory before initializing the calculator.&lt;br /&gt;
* &amp;lt;code&amp;gt;VASP_COMMAND&amp;lt;/code&amp;gt; normally uses the &amp;lt;code&amp;gt;vasp&amp;lt;/code&amp;gt; binary ([[#Binaries|see above]]), and will run in parallel when called under a PBS job. That decision is based on the &amp;lt;code&amp;gt;PBS_NODEFILE&amp;lt;/code&amp;gt; environment variable being present.&lt;br /&gt;
* You can supply another executable name or path in the variable &amp;lt;code&amp;gt;VASP_BINARY&amp;lt;/code&amp;gt;. &amp;lt;!-- If you have experience with shell variables; after loading the ase3 or atk module or just prior to deploying the calculator in an ASE script. --&amp;gt;&lt;br /&gt;
* The ASE calculator supports an alternative calling interface, a python script named in &amp;lt;code&amp;gt;VASP_SCRIPT&amp;lt;/code&amp;gt;. This variable is not set by default on Carbon. If you wish to define a personal &amp;lt;code&amp;gt;VASP_SCRIPT&amp;lt;/code&amp;gt;, unset &amp;lt;code&amp;gt;VASP_COMMAND&amp;lt;/code&amp;gt; in tandem.&lt;br /&gt;
** &amp;lt;code&amp;gt;VASP_COMMAND&amp;lt;/code&amp;gt; takes precendence over &amp;lt;code&amp;gt;VASP_SCRIPT&amp;lt;/code&amp;gt;.&lt;br /&gt;
** The stdout stream is redirected to a file under &amp;lt;code&amp;gt;VASP_COMMAND&amp;lt;/code&amp;gt;, but will appear on ASE&#039;s stdout under &amp;lt;code&amp;gt;VASP_SCRIPT&amp;lt;/code&amp;gt;.&lt;br /&gt;
** Inspect the [https://trac.fysik.dtu.dk/projects/ase/browser/trunk/ase/calculators/vasp.py#L519 calculator source code] for details; see function &amp;lt;code&amp;gt;run(self)&amp;lt;/code&amp;gt;.&lt;br /&gt;
* The directory for pseudopotentials is preconfigured to be the same as &amp;lt;code&amp;gt;$VASP_PP_PATH&amp;lt;/code&amp;gt; for the ASE calculator.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
== Usage with ATK/VNL ==&lt;br /&gt;
The [http://quantumwise.com/documents/manuals/latest/ReferenceManual ATK] package ([[../#atk|module atk]]) supports two different ways to interface with VASP.&lt;br /&gt;
# The [http://quantumwise.com/documents/manuals/latest/ReferenceManual/index.html/chap.python.html#sect1.appendix.nlpackages ase calculator interface] – see [[#Usage under ASE|previous section]].&lt;br /&gt;
# The [http://quantumwise.com/documents/tutorials/latest/VASPScripter VASPScripter] AddOn.&lt;br /&gt;
#* The scripter &amp;quot;merely&amp;quot; helps you to set up the VASP input files in VNL, the ATK GUI. It does not start or analyze a VASP run.&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Node resources for VASP ==&lt;br /&gt;
Consider the follwing to specify PBS node resources (in job files and on the qsub command line).&lt;br /&gt;
&lt;br /&gt;
=== Single-node jobs ===&lt;br /&gt;
* When memory-constrained, set &amp;lt;code&amp;gt;ppn&amp;lt;/code&amp;gt; to less than the number of cores, and disallow node sharing:&lt;br /&gt;
 #PBS -l nodes=1:ppn=16:gen6&lt;br /&gt;
 #PBS -l naccesspolicy=SINGLEJOB -n&lt;br /&gt;
&lt;br /&gt;
=== Multi-node jobs ===&lt;br /&gt;
Run on gen8, by using the following options for qsub or #PBS:&lt;br /&gt;
 #PBS -l nodes=__:ppn=__:gen8&lt;br /&gt;
&lt;br /&gt;
=== See also ===&lt;br /&gt;
* [[HPC/Submitting and Managing Jobs/Advanced node selection|Advanced node selection]]&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
* [[HPC/Benchmarks/Generation 1 vs 2|Benchmarks – Generation 1 vs 2]]&lt;br /&gt;
--&amp;gt;&lt;/div&gt;</summary>
		<author><name>Stern</name></author>
	</entry>
	<entry>
		<id>https://wiki.anl.gov/wiki_cnm/index.php?title=HPC/Applications/vasp&amp;diff=7510</id>
		<title>HPC/Applications/vasp</title>
		<link rel="alternate" type="text/html" href="https://wiki.anl.gov/wiki_cnm/index.php?title=HPC/Applications/vasp&amp;diff=7510"/>
		<updated>2026-07-28T20:03:49Z</updated>

		<summary type="html">&lt;p&gt;Stern: /* Requesting Access */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Requesting Access ==&lt;br /&gt;
VASP versions 4, 5, and 6 are is available on Carbon, subject to confirmation for your group having a license for VASP major versions 4, 5, or 6.&lt;br /&gt;
&lt;br /&gt;
To use VASP binaries on Carbon, send me (M. Sternberg), the following for the persons on your VASP license group who will be using VASP on Carbon:&lt;br /&gt;
&lt;br /&gt;
* For each person:&lt;br /&gt;
** Full name&lt;br /&gt;
** Email address that the person registered with at vasp.at or MDI.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
Please kindly ask the vaspmaster to confirm to me that you hold or are covered by a license.  You may wish to use the following template.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;To:&#039;&#039;&#039; [mailto:licensing@vasp.at?subject=License%20confirmation&amp;amp;CC=sternberg@anl.gov licensing@vasp.at]&lt;br /&gt;
 &#039;&#039;&#039;CC:&#039;&#039;&#039; sternberg@anl.gov&lt;br /&gt;
 &#039;&#039;&#039;Subject:&#039;&#039;&#039; License confirmation&lt;br /&gt;
 &lt;br /&gt;
 We are users of the Center for Nanoscale Materials at Argonne National Laboratory.&lt;br /&gt;
 We would like to use the VASP installation at this site.&lt;br /&gt;
 &lt;br /&gt;
 Please confirm to Michael Sternberg &amp;lt;sternberg@anl.gov&amp;gt; that the following people in my research group are eligible to use VASP:&lt;br /&gt;
 &lt;br /&gt;
 - ...&lt;br /&gt;
 - ... &lt;br /&gt;
 &lt;br /&gt;
 With best regards,&lt;br /&gt;
 ...&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Module considerations ==&lt;br /&gt;
* Review the available modules for each major version:&lt;br /&gt;
** [[HPC/Software/Modules#vasp | vasp]], for VASP 4.x&lt;br /&gt;
** [[HPC/Software/Modules#vasp5 | vasp5]], for VASP 5.x&lt;br /&gt;
** [[HPC/Software/Modules#vasp5 | vasp6]], for VASP 6.x&lt;br /&gt;
* Choose and [[HPC/Software/Module Setup#Shell Customizations|add &#039;&#039;&#039;one&#039;&#039;&#039; of the following lines to your ~/.bashrc]] file:&lt;br /&gt;
 module load --auto vasp                # sets &#039;&#039;&#039;$VASP_HOME&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;!-- &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;&amp;lt;strike&amp;gt;module load vasp-vtst           # sets &#039;&#039;&#039;$VASP_VTST_HOME&#039;&#039;&#039;&amp;lt;/strike&amp;gt;  Obsolete; now included in vasp and vasp5&amp;lt;/font&amp;gt; --&amp;gt;&lt;br /&gt;
 module load --auto vasp5               # sets &#039;&#039;&#039;$VASP5_HOME&#039;&#039;&#039;&lt;br /&gt;
 module load --auto vasp6               # sets &#039;&#039;&#039;$VASP6_HOME&#039;&#039;&#039;&lt;br /&gt;
: Each module points to an installation directory using an [[HPC/Software/Module Setup#Package home directories|environment variable corresponding to the module name]]. Do not hardcode the directory anywhere, as that location is determined by the module and may change in subsequent versions. There should not be a reason to do so, since &amp;lt;code&amp;gt;$PATH&amp;lt;/code&amp;gt; will be managed appropriately.&lt;br /&gt;
&lt;br /&gt;
* Each module provides several binaries (see [[#Binaries|next section]]).&lt;br /&gt;
* You do not need to specify a path for vasp for the mpirun statement in the PBS job script.&lt;br /&gt;
* The modules are mutually exclusive.&lt;br /&gt;
* Potentials are available in &amp;lt;code&amp;gt;/opt/soft/vasp-pot&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
To access Graeme Henkelman&#039;s script suite, load the [[HPC/Software/Modules#vasp-vtstscripts|vasp-vtstscripts module]]. It works with both the vasp and vasp5 modules above. In either case, choose one of the VTST-patched binaries from the table below. The unpatched vasp binaries will not interoperate with the script suite.&lt;br /&gt;
&lt;br /&gt;
 module load vasp-vtstscripts&lt;br /&gt;
&lt;br /&gt;
== Binaries ==&lt;br /&gt;
Some options for VASP cannot be configured at runtime (by input data) but must be chosen when compiling.&lt;br /&gt;
Since no single set of compile-time choices is appropriate for all uses, a number of binaries are provided, distinguished by their name.&lt;br /&gt;
&lt;br /&gt;
The modules from versions vasp/4.6.35-mkl-13 and vasp5/5.2.12a-mkl-4 onwards, respectively,&lt;br /&gt;
contain several binaries built using different sets of preprocessor flags in the Makefile.&lt;br /&gt;
Earlier modules only contain two binaries, &amp;lt;code&amp;gt;vasp&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;vasp-gamma&amp;lt;/code&amp;gt;.&lt;br /&gt;
Additional binaries are provided for useful preprocessor flag combinations&lt;br /&gt;
after applying patches from the group of Graeme Henkelman (UT Austin) to the source code:&lt;br /&gt;
* [http://theory.cm.utexas.edu/vtsttools/ Transition state tools for VASP], and&lt;br /&gt;
* [http://theory.cm.utexas.edu/vtsttools/bader/ DOS Projection in Bader Volumes].&lt;br /&gt;
&lt;br /&gt;
To verify the binaries available for a module, run the appropriate command, once the module has been loaded:&lt;br /&gt;
 ls $VASP_HOME/bin   # for VASP-4 (previous major version)&lt;br /&gt;
 ls $VASP5_HOME/bin&lt;br /&gt;
&lt;br /&gt;
Choose a binary appropriate for your task and pass its name to &amp;lt;code&amp;gt;mpirun&amp;lt;/code&amp;gt; in the job script.&lt;br /&gt;
There is no need for full path names.&lt;br /&gt;
Copy a sample job script from:&lt;br /&gt;
 $VASP_HOME/vasp.job   # for VASP-4 (previous major version)&lt;br /&gt;
 $VASP5_HOME/vasp.job&lt;br /&gt;
&lt;br /&gt;
=== Available binaries and their compile-time flags used ===&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
sed -n &#039;/DMPI_BLOCK/s/.*&amp;quot;//p&#039; embody-5.2.12a-mkl-4/build.log  | uniq&lt;br /&gt;
sed -n &#039;/DMPI_BLOCK/s/.*8000//p&#039; embody-5.2.12a-mkl-4/build.log  | uniq&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
This table lists the names of the binaries compiled from&lt;br /&gt;
* combinations of preprocessor flags, and&lt;br /&gt;
* variants of the source code, primarily enhancing capabilities of ionic updates.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; cellpadding=&amp;quot;5&amp;quot; style=&amp;quot;text-align:left; font-family: monospace;&amp;quot;&lt;br /&gt;
&amp;lt;!---------- HEADER ----------&amp;gt;&lt;br /&gt;
|- style=&amp;quot;background:#e4e4e4; text-align:center; font-weight: bold; font-family: sans-serif;&amp;quot;&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | Versions and capabilities&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | Flags used&lt;br /&gt;
| colspan=&amp;quot;4&amp;quot; align=&amp;quot;center&amp;quot; | Binary names&lt;br /&gt;
|- style=&amp;quot;background:#e4e4e4; text-align:center; vertical-align:top; font-weight: bold; font-family: sans-serif;&amp;quot;&lt;br /&gt;
| Official&lt;br /&gt;
| Constrained Cell relaxation&amp;lt;sup&amp;gt;1&amp;lt;/sup&amp;gt;&lt;br /&gt;
| Patched for VTST&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;&lt;br /&gt;
| Patched for Bader-projected DOS&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! colspan=&amp;quot;6&amp;quot; style=&amp;quot;background:#e4e4e4; text-align:center; font-family: sans-serif;&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
&amp;lt;!---------- 4.x AND EARLY 5.x ----------&amp;gt;&lt;br /&gt;
! rowspan=&amp;quot;4&amp;quot; style=&amp;quot;background:#e4e4e4; text-align:center; font-family: sans-serif;&amp;quot; | Conventional,&amp;lt;br&amp;gt;Versions 4.x–5.3&lt;br /&gt;
| style=&amp;quot;background:#e4e4e4;&amp;quot; | (none)&lt;br /&gt;
| style=&amp;quot;background:none;&amp;quot; | &#039;&#039;&#039;vasp&#039;&#039;&#039;&lt;br /&gt;
| style=&amp;quot;background:#eed;&amp;quot; | &#039;&#039;&#039;vasp-cellz&#039;&#039;&#039;&lt;br /&gt;
| style=&amp;quot;background:#ded;&amp;quot; | &#039;&#039;&#039;vasp-vtst&#039;&#039;&#039;&lt;br /&gt;
| style=&amp;quot;background:#fee;&amp;quot; | &#039;&#039;&#039;vasp-baderdos&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background:#e4e4e4;&amp;quot; | -DNGZhalf&lt;br /&gt;
| style=&amp;quot;background:none;&amp;quot; | &#039;&#039;&#039;vasp-chargehalf&#039;&#039;&#039;&lt;br /&gt;
| style=&amp;quot;background:#eed;&amp;quot; | &#039;&#039;&#039;vasp-cellz-chargehalf&#039;&#039;&#039;&lt;br /&gt;
| style=&amp;quot;background:#ded;&amp;quot; | &#039;&#039;&#039;vasp-vtst-chargehalf&#039;&#039;&#039;&lt;br /&gt;
| style=&amp;quot;background:#fee;&amp;quot; | &#039;&#039;&#039;vasp-baderdos-chargehalf&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background:#e4e4e4;&amp;quot; | -DwNGZhalf&lt;br /&gt;
| style=&amp;quot;background:none;&amp;quot; | &#039;&#039;&#039;vasp-gamma&#039;&#039;&#039;&lt;br /&gt;
| style=&amp;quot;background:#eed;&amp;quot; | &#039;&#039;&#039;vasp-cellz-gamma&#039;&#039;&#039;&lt;br /&gt;
| style=&amp;quot;background:#ded;&amp;quot; | &#039;&#039;&#039;vasp-vtst-gamma&#039;&#039;&#039;&lt;br /&gt;
| style=&amp;quot;background:#fee;&amp;quot; | &#039;&#039;&#039;vasp-baderdos-gamma&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background:#e4e4e4;&amp;quot; | -DwNGZhalf -DNGZhalf&lt;br /&gt;
| style=&amp;quot;background:none;&amp;quot; | &#039;&#039;&#039;vasp-gamma-chargehalf&#039;&#039;&#039;&lt;br /&gt;
| style=&amp;quot;background:#eed;&amp;quot; | &#039;&#039;&#039;vasp-cellz-gamma-chargehalf&#039;&#039;&#039;&lt;br /&gt;
| style=&amp;quot;background:#ded;&amp;quot; | &#039;&#039;&#039;vasp-vtst-gamma-chargehalf&#039;&#039;&#039;&lt;br /&gt;
| style=&amp;quot;background:#fee;&amp;quot; | &#039;&#039;&#039;vasp-baderdos-gamma-chargehalf&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! rowspan=&amp;quot;4&amp;quot; style=&amp;quot;background:#e4e4e4; text-align:center; font-family: sans-serif;&amp;quot; | Advanced&amp;lt;br&amp;gt;MD techniques,&amp;lt;sup&amp;gt;4&amp;lt;/sup&amp;gt;&amp;lt;br&amp;gt;Versions 5.2 and 5.3&lt;br /&gt;
| style=&amp;quot;background:#e4e4e4;&amp;quot; | -Dtbdyn&lt;br /&gt;
| style=&amp;quot;background:#ddf;&amp;quot; | &#039;&#039;&#039;vasp-tbdyn&#039;&#039;&#039;&lt;br /&gt;
| rowspan=&amp;quot;4&amp;quot; style=&amp;quot;background:#f0f0f0; text-align:center; font-style:oblique; font-family: sans-serif;&amp;quot; | –&lt;br /&gt;
| rowspan=&amp;quot;4&amp;quot; style=&amp;quot;background:#f0f0f0; text-align:center; font-style:oblique; font-family: sans-serif;&amp;quot; | –&lt;br /&gt;
| rowspan=&amp;quot;4&amp;quot; style=&amp;quot;background:#f0f0f0; text-align:center; font-style:oblique; font-family: sans-serif;&amp;quot; | not useful&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background:#e4e4e4;&amp;quot; | -Dtbdyn -DNGZhalf&lt;br /&gt;
| style=&amp;quot;background:#ddf;&amp;quot; | &#039;&#039;&#039;vasp-tbdyn-chargehalf&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background:#e4e4e4;&amp;quot; | -Dtbdyn -DwNGZhalf&lt;br /&gt;
| style=&amp;quot;background:#ddf;&amp;quot; | &#039;&#039;&#039;vasp-tbdyn-gamma&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background:#e4e4e4;&amp;quot; | -Dtbdyn -DwNGZhalf -DNGZhalf&lt;br /&gt;
| style=&amp;quot;background:#ddf;&amp;quot; | &#039;&#039;&#039;vasp-tbdyn-gamma-chargehalf&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;!---------- VERSION 5.4 ----------&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! colspan=&amp;quot;6&amp;quot; style=&amp;quot;background:#e4e4e4; text-align:center; font-family: sans-serif;&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
! rowspan=&amp;quot;5&amp;quot; style=&amp;quot;background:#e4e4e4; text-align:center; font-family: sans-serif;&amp;quot; | Version 5.4&amp;lt;sup&amp;gt;4,5&amp;lt;/sup&amp;gt;&lt;br /&gt;
| style=&amp;quot;background:#e4e4e4;&amp;quot; | -Dtbdyn&lt;br /&gt;
| style=&amp;quot;background:#f0f0f0;&amp;quot; | &#039;&#039;&#039;vasp_ncl&#039;&#039;&#039;&lt;br /&gt;
| rowspan=&amp;quot;5&amp;quot; style=&amp;quot;background:#eed; text-align:center; font-family: sans-serif; &amp;quot; | (–o–)&amp;lt;sup&amp;gt;5&amp;lt;/sup&amp;gt;&lt;br /&gt;
| style=&amp;quot;background:#ded;&amp;quot; | &#039;&#039;&#039;vasp_vtst_ncl&#039;&#039;&#039;&lt;br /&gt;
| rowspan=&amp;quot;5&amp;quot; style=&amp;quot;background:#f0f0f0; text-align:center; font-style:oblique; font-family: sans-serif;&amp;quot; | TBD&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background:#e4e4e4;&amp;quot; | -Dtbdyn -DNGZhalf&lt;br /&gt;
| style=&amp;quot;background:none;&amp;quot; | &#039;&#039;&#039;vasp_std&#039;&#039;&#039;&lt;br /&gt;
| style=&amp;quot;background:#ded;&amp;quot; | &#039;&#039;&#039;vasp_vtst_std&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background:#e4e4e4;&amp;quot; | -Dtbdyn -DwNGZhalf -DNGZhalf&lt;br /&gt;
| style=&amp;quot;background:none;&amp;quot; | &#039;&#039;&#039;vasp_gam&#039;&#039;&#039;&lt;br /&gt;
| style=&amp;quot;background:#ded;&amp;quot; | &#039;&#039;&#039;vasp_vtst_gam&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background:#e4e4e4;&amp;quot; | (GPU&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;)&lt;br /&gt;
| style=&amp;quot;background:none;&amp;quot; | &#039;&#039;&#039;vasp_&amp;lt;font color=&amp;quot;purple&amp;quot;&amp;gt;gpu&amp;lt;/font&amp;gt;_ncl&#039;&#039;&#039;&lt;br /&gt;
| style=&amp;quot;background:#ded;&amp;quot; | &#039;&#039;&#039;vasp_vtst_&amp;lt;font color=&amp;quot;purple&amp;quot;&amp;gt;gpu&amp;lt;/font&amp;gt;_ncl&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background:#e4e4e4;&amp;quot; | (GPU&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;) -DNGZhalf&lt;br /&gt;
| style=&amp;quot;background:none;&amp;quot; | &#039;&#039;&#039;vasp_&amp;lt;font color=&amp;quot;purple&amp;quot;&amp;gt;gpu&amp;lt;/font&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
| style=&amp;quot;background:#ded;&amp;quot; | &#039;&#039;&#039;vasp_vtst_&amp;lt;font color=&amp;quot;purple&amp;quot;&amp;gt;gpu&amp;lt;/font&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;!---------- VERSION 6 ----------&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! colspan=&amp;quot;6&amp;quot; style=&amp;quot;background:#e4e4e4; text-align:center; font-family: sans-serif;&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
! rowspan=&amp;quot;4&amp;quot; style=&amp;quot;background:#e4e4e4; text-align:center; font-family: sans-serif;&amp;quot; | Version 6 (prelim.)&lt;br /&gt;
| style=&amp;quot;background:#e4e4e4;&amp;quot; |&lt;br /&gt;
| style=&amp;quot;background:#f0f0f0;&amp;quot; | &#039;&#039;&#039;vasp_ncl&#039;&#039;&#039;&lt;br /&gt;
| rowspan=&amp;quot;3&amp;quot; style=&amp;quot;background:#eed; text-align:center; font-family: sans-serif; &amp;quot; | (–o–)&amp;lt;sup&amp;gt;5&amp;lt;/sup&amp;gt;&lt;br /&gt;
| style=&amp;quot;background:#ded;&amp;quot; | &#039;&#039;&#039;vasp_vtst_ncl&#039;&#039;&#039;&lt;br /&gt;
| rowspan=&amp;quot;4&amp;quot; style=&amp;quot;background:#f0f0f0; text-align:center; font-style:oblique; font-family: sans-serif;&amp;quot; | TBD&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background:#e4e4e4;&amp;quot; |&lt;br /&gt;
| style=&amp;quot;background:none;&amp;quot; | &#039;&#039;&#039;vasp_std&#039;&#039;&#039;&lt;br /&gt;
| style=&amp;quot;background:#ded;&amp;quot; | &#039;&#039;&#039;vasp_vtst_std&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background:#e4e4e4;&amp;quot; |&lt;br /&gt;
| style=&amp;quot;background:none;&amp;quot; | &#039;&#039;&#039;vasp_gam&#039;&#039;&#039;&lt;br /&gt;
| style=&amp;quot;background:#ded;&amp;quot; | &#039;&#039;&#039;vasp_vtst_gam&#039;&#039;&#039;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;sup&amp;gt;1&amp;lt;/sup&amp;gt;) Stress tensor selectively zeroed in subroutine &amp;lt;code&amp;gt;CONSTR_CELL_RELAX&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;) http://theory.cm.utexas.edu/vtsttools/ . The dimer method was broken for vasp5/5.3.3 prior to 5.3.3p3-mkl-2.&amp;lt;!-- The [http://theory.cm.utexas.edu/forum/viewtopic.php?f=2&amp;amp;t=1285 &#039;&#039;dimer method is broken&#039;&#039; in vasp5/5.3.3p1-mkl-1.] To run the dimer method at the moment, load the module version vasp5/5.3.2.--&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;) http://theory.cm.utexas.edu/vtsttools/dos/ (now defunct)&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;sup&amp;gt;4&amp;lt;/sup&amp;gt;) http://cms.mpi.univie.ac.at/vasp/vasp/Advanced_MD_techniques.html &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;sup&amp;gt;5&amp;lt;/sup&amp;gt;) [[#Constrained Cell Relaxation|Axis-selective constrained cell relaxation]], controlled via an optional input file &amp;lt;code&amp;gt;CELL_RELAX&amp;lt;/code&amp;gt;, is compiled into &#039;&#039;all&#039;&#039; binaries.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;) http://cms.mpi.univie.ac.at/wiki/index.php/GPU_port_of_VASP&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Explanation of flags ===&lt;br /&gt;
* File &amp;lt;code&amp;gt;vasp.5.2/makefile.linux_pg&amp;lt;/code&amp;gt; in the souce code explains:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#-----------------------------------------------------------------------&lt;br /&gt;
# possible options for CPP:&lt;br /&gt;
# NGXhalf             charge density   reduced in X direction&lt;br /&gt;
# wNGXhalf            gamma point only reduced in X direction&lt;br /&gt;
# avoidalloc          avoid ALLOCATE if possible&lt;br /&gt;
# IFC                 work around some IFC bugs&lt;br /&gt;
# CACHE_SIZE          1000 for PII,PIII, 5000 for Athlon, 8000 P4&lt;br /&gt;
# RPROMU_DGEMV        use DGEMV instead of DGEMM in RPRO (usually  faster)&lt;br /&gt;
# RACCMU_DGEMV        use DGEMV instead of DGEMM in RACC (faster on P4)&lt;br /&gt;
#  **** definitely use -DRACCMU_DGEMV if you use the mkl library&lt;br /&gt;
#-----------------------------------------------------------------------&lt;br /&gt;
…&lt;br /&gt;
#-----------------------------------------------------------------------&lt;br /&gt;
# additional options for CPP in parallel version (see also above):&lt;br /&gt;
# NGZhalf               charge density   reduced in Z direction&lt;br /&gt;
# wNGZhalf              gamma point only reduced in Z direction&lt;br /&gt;
# scaLAPACK             use scaLAPACK (usually slower on 100 Mbit Net)&lt;br /&gt;
#-----------------------------------------------------------------------&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* In the new build system (since version 5.4) the direct use of the &amp;lt;code&amp;gt;-D*NG*half&amp;lt;/code&amp;gt; options has been replaced by predefined make(1) arguments &amp;lt;code&amp;gt;VERSION={std,gam,ncl}&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Common flags ===&lt;br /&gt;
 -DIFC -DRPROMU_DGEMV  -DRACCMU_DGEMV -DCACHE_SIZE=16000  -DMPI -DMPI_BLOCK=8000&lt;br /&gt;
&lt;br /&gt;
== General patches ==&lt;br /&gt;
&lt;br /&gt;
The following modifications have been applied and are active in &#039;&#039;all binaries&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
=== vdW-DF functional ===&lt;br /&gt;
The [http://cms.mpi.univie.ac.at/vasp/vasp/vdW_DF_functional_Langreth_Lundqvist_et_al.html vdW-DF functional of Langreth and Lundqvist et al.]&lt;br /&gt;
is implemented in all the &amp;lt;code&amp;gt;*-chargehalf&amp;lt;/code&amp;gt; binaries of the vasp5 module, and all versions above 5.4.&lt;br /&gt;
&lt;br /&gt;
No specific preparations are needed other than setting the INCAR flags as documented. The binaries will find the required precalculated kernel  file &amp;lt;code&amp;gt;vdw_kernel.bindat&amp;lt;/code&amp;gt; by means of the environment variable &amp;lt;code&amp;gt;$VASP5_HOME&amp;lt;/code&amp;gt; which is set by the module.&lt;br /&gt;
&lt;br /&gt;
This is a Carbon-specific extension.&lt;br /&gt;
&lt;br /&gt;
=== Solvation Model ===&lt;br /&gt;
All binaries above build 5.4.1.3-8-* contain the [http://vaspsol.mse.ufl.edu VASPsol] solvation model of the Hennig group at Univ. of Florida..&lt;br /&gt;
&lt;br /&gt;
=== Constrained Cell Relaxation ===&lt;br /&gt;
Likewise, in all binaries above build 5.4.1.3-8-* the relaxation of the unit cell may be constrained&lt;br /&gt;
along one or more axes by creating a supplementary input file &amp;lt;code&amp;gt;CELL_RELAX&amp;lt;/code&amp;gt;.&lt;br /&gt;
The subroutine &amp;lt;code&amp;gt;CONSTR_CELL_RELAX&amp;lt;/code&amp;gt;,&lt;br /&gt;
having been a placeholder in the original source files,&lt;br /&gt;
was extended to read (and re-read) this file in each call and apply the containts&lt;br /&gt;
to the force components of each basis vector.&lt;br /&gt;
The performance impact from the multiple reads is expected to be minimal.&lt;br /&gt;
&lt;br /&gt;
This is a Carbon-specific extension.&lt;br /&gt;
&lt;br /&gt;
; File format:&lt;br /&gt;
   cell relaxation     - fixed string, for validation only, leading spaces ignored.&lt;br /&gt;
   ix iy iz            - 3 integer flags, indicating which cartesian components of the&lt;br /&gt;
                         basis vectors are allowed to be changed; 0 means no (fixed),&lt;br /&gt;
                         non-zero means yes (can change).&lt;br /&gt;
; Examples:&lt;br /&gt;
* To relax the entire cell (identical to default behavior):&lt;br /&gt;
   cell relaxation&lt;br /&gt;
   1 1 1&lt;br /&gt;
* To relax along z only:&lt;br /&gt;
   cell relaxation&lt;br /&gt;
   0 0 1&lt;br /&gt;
; Output indicator:&lt;br /&gt;
To indicate if your chosen VASP binary (a) looked for and (b) did or did not find the &amp;lt;code&amp;gt;CELL_RELAX&amp;lt;/code&amp;gt; file, the subroutine &amp;lt;code&amp;gt;CONSTR_CELL_RELAX&amp;lt;/code&amp;gt; will output one of the following each time it has been called:&lt;br /&gt;
 CELL_RELAX not present: performing unconstrained unit cell relaxation&lt;br /&gt;
: or:&lt;br /&gt;
 CELL_RELAX: performing constrained unit cell relaxation in cartesian directions  1  0  1&lt;br /&gt;
 Unit cell forces:&lt;br /&gt;
       1.1111111111111112       0.0000000000000000       2.2222222222222223&lt;br /&gt;
       0.0000000000000000       0.0000000000000000       0.0000000000000000&lt;br /&gt;
       2.2222222222222223       0.0000000000000000       3.3333333333333330&lt;br /&gt;
: (The force values shown here are contrived.)&lt;br /&gt;
; Author: Michael Sternberg.&lt;br /&gt;
&lt;br /&gt;
== Usage under ASE ==&lt;br /&gt;
VASP calculations can be set up, run, and analyzed using the [https://wiki.fysik.dtu.dk/ase/ase/calculators/vasp.html calculator interface] of the [https://wiki.fysik.dtu.dk/ase/overview.html ASE] package, available on Carbon under both the [[../#ase3 | ase3]] and [[../#atk | atk]] modules.&lt;br /&gt;
ASE is told how to use VASP by means of environment variables which the modules define for you with sensible defaults:&lt;br /&gt;
 VASP_PP_PATH&lt;br /&gt;
 VASP_COMMAND&lt;br /&gt;
* The calculator will create and possibly overwrite VASP input files in the current directory, and then run VASP therein. To minimize clutter, consider setting up and changing into a run-specific directory before initializing the calculator.&lt;br /&gt;
* &amp;lt;code&amp;gt;VASP_COMMAND&amp;lt;/code&amp;gt; normally uses the &amp;lt;code&amp;gt;vasp&amp;lt;/code&amp;gt; binary ([[#Binaries|see above]]), and will run in parallel when called under a PBS job. That decision is based on the &amp;lt;code&amp;gt;PBS_NODEFILE&amp;lt;/code&amp;gt; environment variable being present.&lt;br /&gt;
* You can supply another executable name or path in the variable &amp;lt;code&amp;gt;VASP_BINARY&amp;lt;/code&amp;gt;. &amp;lt;!-- If you have experience with shell variables; after loading the ase3 or atk module or just prior to deploying the calculator in an ASE script. --&amp;gt;&lt;br /&gt;
* The ASE calculator supports an alternative calling interface, a python script named in &amp;lt;code&amp;gt;VASP_SCRIPT&amp;lt;/code&amp;gt;. This variable is not set by default on Carbon. If you wish to define a personal &amp;lt;code&amp;gt;VASP_SCRIPT&amp;lt;/code&amp;gt;, unset &amp;lt;code&amp;gt;VASP_COMMAND&amp;lt;/code&amp;gt; in tandem.&lt;br /&gt;
** &amp;lt;code&amp;gt;VASP_COMMAND&amp;lt;/code&amp;gt; takes precendence over &amp;lt;code&amp;gt;VASP_SCRIPT&amp;lt;/code&amp;gt;.&lt;br /&gt;
** The stdout stream is redirected to a file under &amp;lt;code&amp;gt;VASP_COMMAND&amp;lt;/code&amp;gt;, but will appear on ASE&#039;s stdout under &amp;lt;code&amp;gt;VASP_SCRIPT&amp;lt;/code&amp;gt;.&lt;br /&gt;
** Inspect the [https://trac.fysik.dtu.dk/projects/ase/browser/trunk/ase/calculators/vasp.py#L519 calculator source code] for details; see function &amp;lt;code&amp;gt;run(self)&amp;lt;/code&amp;gt;.&lt;br /&gt;
* The directory for pseudopotentials is preconfigured to be the same as &amp;lt;code&amp;gt;$VASP_PP_PATH&amp;lt;/code&amp;gt; for the ASE calculator.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
== Usage with ATK/VNL ==&lt;br /&gt;
The [http://quantumwise.com/documents/manuals/latest/ReferenceManual ATK] package ([[../#atk|module atk]]) supports two different ways to interface with VASP.&lt;br /&gt;
# The [http://quantumwise.com/documents/manuals/latest/ReferenceManual/index.html/chap.python.html#sect1.appendix.nlpackages ase calculator interface] – see [[#Usage under ASE|previous section]].&lt;br /&gt;
# The [http://quantumwise.com/documents/tutorials/latest/VASPScripter VASPScripter] AddOn.&lt;br /&gt;
#* The scripter &amp;quot;merely&amp;quot; helps you to set up the VASP input files in VNL, the ATK GUI. It does not start or analyze a VASP run.&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Node resources for VASP ==&lt;br /&gt;
Consider the follwing to specify PBS node resources (in job files and on the qsub command line).&lt;br /&gt;
&lt;br /&gt;
=== Single-node jobs ===&lt;br /&gt;
* When memory-constrained, set &amp;lt;code&amp;gt;ppn&amp;lt;/code&amp;gt; to less than the number of cores, and disallow node sharing:&lt;br /&gt;
 #PBS -l nodes=1:ppn=16:gen6&lt;br /&gt;
 #PBS -l naccesspolicy=SINGLEJOB -n&lt;br /&gt;
&lt;br /&gt;
=== Multi-node jobs ===&lt;br /&gt;
Run on gen8, by using the following options for qsub or #PBS:&lt;br /&gt;
 #PBS -l nodes=__:ppn=__:gen8&lt;br /&gt;
&lt;br /&gt;
=== See also ===&lt;br /&gt;
* [[HPC/Submitting and Managing Jobs/Advanced node selection|Advanced node selection]]&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
* [[HPC/Benchmarks/Generation 1 vs 2|Benchmarks – Generation 1 vs 2]]&lt;br /&gt;
--&amp;gt;&lt;/div&gt;</summary>
		<author><name>Stern</name></author>
	</entry>
	<entry>
		<id>https://wiki.anl.gov/wiki_cnm/index.php?title=HPC/Applications/comsol&amp;diff=7509</id>
		<title>HPC/Applications/comsol</title>
		<link rel="alternate" type="text/html" href="https://wiki.anl.gov/wiki_cnm/index.php?title=HPC/Applications/comsol&amp;diff=7509"/>
		<updated>2026-06-09T17:52:57Z</updated>

		<summary type="html">&lt;p&gt;Stern: /* Access */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
The [http://www.comsol.com/products/multiphysics/ &#039;&#039;&#039;COMSOL Multiphysics&#039;&#039;&#039;] application suite&lt;br /&gt;
is available for Mac, Windows, and Linux.&lt;br /&gt;
&lt;br /&gt;
== Access ==&lt;br /&gt;
[[Image:HPC Comsol licensed modules.png|right|450px|thumb|COMSOL features licensed at CNM as of 2026-06.]]&lt;br /&gt;
=== COMSOL Multiphysics ===&lt;br /&gt;
Access to &#039;&#039;&#039;COMSOL Multiphysics&#039;&#039;&#039;, the main application with both a graphical user interface and batch computing capabilities, will be granted &#039;&#039;&#039;&#039;&#039;upon request&#039;&#039;&#039;&#039;&#039;&amp;amp;thinsp;.&lt;br /&gt;
&lt;br /&gt;
You must be:&lt;br /&gt;
* An &#039;&#039;&#039;&#039;&#039;Argonne employee&#039;&#039;&#039;&#039;&#039;&amp;amp;thinsp; in one of the following roles:&lt;br /&gt;
** &#039;&#039;&#039;&#039;&#039;NST staff member&#039;&#039;&#039;&#039;&#039;&amp;amp;thinsp; (including PostDocs, joint appointments, and students at NST).&lt;br /&gt;
** &#039;&#039;&#039;&#039;&#039;CNM Facility User&#039;&#039;&#039;&#039;&#039;&amp;amp;thinsp; (including &#039;&#039;non-NST Argonne employees&#039;&#039;), with an active proposal that has COMSOL in scope. Please see [[HPC/FAQ#Access_and_proposals]].&lt;br /&gt;
&lt;br /&gt;
The set of available COMSOL modules that we have licensed is shown at right.&lt;br /&gt;
&lt;br /&gt;
* The native desktop version can be installed only on &#039;&#039;Argonne-owned&#039;&#039; computers (laptop or desktop). Please contact [mailto:help@anl.gov?Subject=COMSOL%20license%20access%20request CNM support]. Make sure to review [http://www.comsol.com/support/updates/ Product Updates].&lt;br /&gt;
* To run COMSOL on our HPC system &#039;&#039;Carbon&#039;&#039;, as GUI or as batch computing jobs, your proposal must have &#039;&#039;Carbon&#039;&#039; access in scope.&lt;br /&gt;
&lt;br /&gt;
=== COMSOL Server ===&lt;br /&gt;
&#039;&#039;CNM Facility Users&#039;&#039; who are not Argonne employees are not eligible to access&lt;br /&gt;
the full &#039;&#039;&#039;COMSOL Multiphysics&#039;&#039;&#039; product, in compliance with its licensing terms and conditions.&lt;br /&gt;
However, the [https://www.comsol.com/comsol-server &#039;&#039;&#039;COMSOL Server&#039;&#039;&#039;] product offers an alternative&lt;br /&gt;
albeit more narrow means of access.&lt;br /&gt;
&lt;br /&gt;
All users, including &#039;&#039;&#039;&#039;&#039;non-Argonne users&#039;&#039;&#039;&#039;&#039; may be able to run, over a web interface in their browser,&lt;br /&gt;
pre-parameterized &amp;quot;fixed-model&amp;quot; simulations that were made with the &#039;&#039;&#039;COMSOL Application Builder&#039;&#039;&#039; (requires Windows).&lt;br /&gt;
&lt;br /&gt;
To inquire about using COMSOL server applications,&lt;br /&gt;
please contact us.&lt;br /&gt;
&amp;lt;!-- [mailto:cnm_useroffice@anl.gov?Subject=COMSOL%20server%20usage Support]. --&amp;gt;&lt;br /&gt;
We will review possible purchase paths for COMSOL Server, and the &#039;&#039;considerable effort&#039;&#039; likely required by users and the CNM to develop and deploy a COMSOL application.&lt;br /&gt;
&lt;br /&gt;
== Support ==&lt;br /&gt;
* For questions on how to run or start COMSOL:&lt;br /&gt;
*: Submit an [[HPC/Support | &#039;&#039;&#039;IT support request&#039;&#039;&#039;]]&lt;br /&gt;
* For questions related to most COMSOL data or scripts, contact COMSOL support at:&lt;br /&gt;
*: [mailto:support@comsol.com &#039;&#039;&#039;support&#039;&#039;&#039;@comsol.com]&lt;br /&gt;
* &#039;&#039;&#039;Exception:&#039;&#039;&#039; If your support question might contain data that is subject to &#039;&#039;&#039;US Export Control&#039;&#039;&#039; regulations, contact instead:&lt;br /&gt;
*: [mailto:us-export-control@us.comsol.com &#039;&#039;&#039;us-export-control&#039;&#039;&#039;@&#039;&#039;&#039;us&#039;&#039;&#039;.comsol.com]&lt;br /&gt;
&lt;br /&gt;
== The modes to run COMSOL ==&lt;br /&gt;
There are several ways of running COMSOL.&lt;br /&gt;
&lt;br /&gt;
=== Running the desktop application ===&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
# Run on your &#039;&#039;Argonne-provided&#039;&#039; computer, checking out Carbon&#039;s license remotely.&lt;br /&gt;
#* Requires a full installation of COMSOL on your desktop or laptop computer.&lt;br /&gt;
#* 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.&lt;br /&gt;
# Run on Carbon, display on your desktop using the [http://en.wikipedia.org/wiki/X_Window_System X Window system (X11)].&lt;br /&gt;
#* Requires an &#039;&#039;X11 Server&#039;&#039; application running on your client machine, and SSH X11 forwarding.&lt;br /&gt;
#* The X11 protocol can be slow over LAN.&lt;br /&gt;
# Run on Carbon in a [[HPC/Network Access/Virtual Desktop | virtual desktop environment (VNC)]], viewed in a VNC client on your machine.&lt;br /&gt;
#* Requires a VNC client on your machine.&lt;br /&gt;
#* It can be confusing where VNC and the app runs.&lt;br /&gt;
#* The virtual desktop presents a (deliberatly) sparse windowing environment – Copy&amp;amp;Paste can be difficult to use.&lt;br /&gt;
&lt;br /&gt;
=== Running a batch calculation ===&lt;br /&gt;
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.&lt;br /&gt;
See the [[#Batch jobs|section below]].&lt;br /&gt;
&lt;br /&gt;
== Native desktop version ==&lt;br /&gt;
To get the fastest response from the COMSOL GUI, run a native COMSOL version on your desktop machine or laptop, called &#039;&#039;client machine&#039;&#039; below.&lt;br /&gt;
&lt;br /&gt;
Enter license details either in the COMSOL Setup configuration dialog.&lt;br /&gt;
&lt;br /&gt;
== Use with X11 ==&lt;br /&gt;
For casual use, and with [[HPC/Network Access/SSH Tunnel Setup on Linux and MacOS | X11 tunneling to Carbon]] set up, simply add to your &amp;lt;code&amp;gt;~/.bashrc&amp;lt;/code&amp;gt; file on Carbon:&lt;br /&gt;
 module load comsol&lt;br /&gt;
&lt;br /&gt;
Then, from the command line on a Carbon login node, start the COMSOL GUI:&lt;br /&gt;
 comsol &amp;amp;&lt;br /&gt;
&lt;br /&gt;
License configuration is automatic on Carbon.&lt;br /&gt;
&lt;br /&gt;
Comsol will use a number of cores to run calculations multithreaded by default. (On Carbon, COMSOL_NUM_THREADS is set.)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Quit the application&#039;&#039;&#039; as soon as you are done. Only one user can use Comsol at a time.&lt;br /&gt;
&lt;br /&gt;
== Use with VNC ==&lt;br /&gt;
See general  [[HPC/Network Access/Virtual Desktop | instructions on using VNC]], and the COMSOL example therein.&lt;br /&gt;
&lt;br /&gt;
== License configuration ==&lt;br /&gt;
A client&#039;s COMSOL license needs to be configured depending on how the client reaches CNM network resources. Follow the appropriate section:&lt;br /&gt;
&lt;br /&gt;
* [[#License configuration when inside CNM or on CNM VPN|License configuration when &#039;&#039;&#039;inside CNM&#039;&#039;&#039; or on &#039;&#039;&#039;CNM VPN&#039;&#039;&#039;]]&lt;br /&gt;
: Requires that the user&#039;s machine is logically within the network of CNM/NST, either by a wired/auth WiFi connection in the building or by VPN under a CNM/NST profile.&lt;br /&gt;
* [[#License configuration when outside CNM – requires SSH Tunneling|License configuration when &#039;&#039;&#039;outside CNM&#039;&#039;&#039; – requires SSH Tunneling]]&lt;br /&gt;
: &#039;&#039;Non-NST staff&#039;&#039; usually have a VPN profile that places the machine logically [[#License configuration when outside CNM – requires SSH Tunneling|outside of NST&#039;s network.]]&lt;br /&gt;
&lt;br /&gt;
== License configuration when inside CNM or on CNM VPN ==&lt;br /&gt;
=== &amp;lt;span style=&amp;quot;color:#A00;&amp;quot;&amp;gt;Ensure correct DNS search domains&amp;lt;/span&amp;gt; ===&lt;br /&gt;
* Inspect the client machine&#039;s network configuration.&lt;br /&gt;
* Ensure that &#039;&#039;&#039;two&#039;&#039;&#039; entries are listed as DNS Search Domains for the current network profile:&lt;br /&gt;
 nst.anl.gov&lt;br /&gt;
 cnm.anl.gov&lt;br /&gt;
: (The order of entries does not matter for the purposes considered here.)&lt;br /&gt;
* If the client machine is &#039;&#039;wired to CNM networks&#039;&#039;, the domains are normally provided correctly by DHCP.&lt;br /&gt;
* If the client machine is &#039;&#039;connected over VPN&#039;&#039;, you may need edit the respective network profile.&lt;br /&gt;
:* 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 &amp;quot;Advanced…&amp;quot;. It appears that those changes are being saved and will be activated automatically the next time that this VPN session gets started.&lt;br /&gt;
: [[Image:VNC_add_cnm_to_DNS_1.png|400px]] [[Image:VNC_add_cnm_to_DNS_2.png|400px]]&lt;br /&gt;
:* On Windows or Linux machines, take &#039;&#039;analogous&#039;&#039; steps, using the platform&#039;s own configuration tools.&lt;br /&gt;
&lt;br /&gt;
* Exclude license manager components from client desktop installation. (Those are all handled server-side.)&lt;br /&gt;
&lt;br /&gt;
=== License format ===&lt;br /&gt;
* Floating Network License (FNL), &amp;quot;Three-server redundancy&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== License servers ===&lt;br /&gt;
* On client machines, while running the COMSOL installer or license configuration, specify license servers and ports as follows:&lt;br /&gt;
 1718    clicense1&lt;br /&gt;
 1718    clicense2&lt;br /&gt;
 1718    clicense3&lt;br /&gt;
: &#039;&#039;&#039;Note:&#039;&#039;&#039; Use &#039;&#039;short host names only&#039;&#039;. (Technical Reason: The license must be usable both on Carbon&#039;s internal network as well as on divisional networks).&lt;br /&gt;
 1718    clicense1&amp;lt;strike&amp;gt;.cnm.anl.gov&amp;lt;/strike&amp;gt;&lt;br /&gt;
 1718    clicense2&amp;lt;strike&amp;gt;.cnm.anl.gov&amp;lt;/strike&amp;gt;&lt;br /&gt;
 1718    clicense3&amp;lt;strike&amp;gt;.cnm.anl.gov&amp;lt;/strike&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Advanced:&#039;&#039;&#039; A client machine&#039;s COMSOL license file &amp;lt;code&amp;gt;&amp;amp;lt;COMSOLDIR&amp;amp;gt;/Multiphysics/license/license.dat&amp;lt;/code&amp;gt; should look as follows:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;make&amp;quot;&amp;gt;&lt;br /&gt;
SERVER clicense1 ANY 1718&lt;br /&gt;
SERVER clicense2 ANY 1718&lt;br /&gt;
SERVER clicense3 ANY 1718&lt;br /&gt;
USE_SERVER&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;amp;lt;COMSOLDIR&amp;amp;gt;&amp;lt;/code&amp;gt; is located by default at:&lt;br /&gt;
* &#039;&#039;&#039;Windows&#039;&#039;&#039;: C:\Program files\COMSOL\COMSOL&#039;&#039;nn&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Linux&#039;&#039;&#039;: /usr/local/comsol&#039;&#039;nn&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Mac&#039;&#039;&#039;: /Applications/COMSOL&#039;&#039;nn&#039;&#039;&lt;br /&gt;
(&amp;quot;&#039;&#039;nn&#039;&#039;&amp;quot; is the application&#039;s abbreviated version number.)&lt;br /&gt;
&lt;br /&gt;
=== Network Troubleshooting ===&lt;br /&gt;
When using the license access model descibed here (as opposed to tunneled over SSH), ensure the following:&lt;br /&gt;
* Verify that short host names can be resolved to IP addresses. Either one of the following commands should produce sensible output:&lt;br /&gt;
 host clicense1&lt;br /&gt;
: or:&lt;br /&gt;
 ping -c 3 clicense1&lt;br /&gt;
* Verify that &#039;&#039;both license ports on the same server&#039;&#039; can be reached from your client machine:&lt;br /&gt;
 telnet &#039;&#039;&#039;clicense1&#039;&#039;&#039; 1718&lt;br /&gt;
 telnet &#039;&#039;&#039;clicense1&#039;&#039;&#039; 1719&lt;br /&gt;
: or:&lt;br /&gt;
 telnet &#039;&#039;&#039;clicense2&#039;&#039;&#039; 1718&lt;br /&gt;
 telnet &#039;&#039;&#039;clicense2&#039;&#039;&#039; 1719&lt;br /&gt;
: A &#039;&#039;successful&#039;&#039; connection looks like:&lt;br /&gt;
 Trying 146.139.x.y...&lt;br /&gt;
 Connected to clicense1.cnm.anl.gov.&lt;br /&gt;
 Escape character is &#039;^]&#039;.&lt;br /&gt;
:: Do not enter any data. Instead,  close each connection by hitting &amp;lt;code&amp;gt;Ctrl&amp;lt;/code&amp;gt;&amp;lt;code&amp;gt;]&amp;lt;/code&amp;gt; (closing square bracket), followed by &amp;lt;code&amp;gt;Ctrl&amp;lt;/code&amp;gt;&amp;lt;code&amp;gt;D&amp;lt;/code&amp;gt;.&lt;br /&gt;
: A &#039;&#039;failed&#039;&#039; connection gives one of these errors:&lt;br /&gt;
 telnet: connect to address 146.139.x.y: Operation timed out&lt;br /&gt;
: or:&lt;br /&gt;
 telnet: connect to address 146.139.x.y: Connection refused&lt;br /&gt;
:: In these cases, ask that your IP firewall configuration be reviewed and changed.&lt;br /&gt;
&lt;br /&gt;
== License configuration when outside CNM – requires SSH Tunneling ==&lt;br /&gt;
This section documents how to run COMSOL from a network location outside CNM.&lt;br /&gt;
&lt;br /&gt;
As a one-time preparation step, two items must be configured:&lt;br /&gt;
* The license host that COMSOL is to contact, and&lt;br /&gt;
* An SSH connection that will allow your machine to access the COMSOL license server inside CNM&#039;s network.&lt;br /&gt;
&lt;br /&gt;
To then &#039;&#039;run&#039;&#039; the COMSOL application, the configured SSH connection must be up and kept running for the entire time that you run the COMSOL. When you exit COMSOL and wish to start it again, you can keep the SSH connection running, it will be re-used for the next COMSOL run.&lt;br /&gt;
&lt;br /&gt;
=== Configure COMSOL ===&lt;br /&gt;
The following needs to be done just once, typically during COMSOL installation:&lt;br /&gt;
&lt;br /&gt;
In the COMSOL Installer, or in COMSOL Preferences, enter:&lt;br /&gt;
* &#039;&#039;&#039;License format:&#039;&#039;&#039; Floating Network License (FNL), &amp;quot;Port number and Hostname&amp;quot;&lt;br /&gt;
:: &amp;lt;font style=&amp;quot;color:#777&amp;quot;&amp;gt;Do &#039;&#039;not use&#039;&#039; &amp;quot;Three-server redundancy&amp;quot;, since it cannot (easily) be accessed over SSH. Configure with just one server, and in the rare situation of a server failover, temporarily tweak your SSH configuration to contact the alternate server (see below).&amp;lt;/font&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Server:&#039;&#039;&#039; &amp;lt;code&amp;gt;127.0.0.1&amp;lt;/code&amp;gt;&lt;br /&gt;
:: Do not use &amp;quot;localhost&amp;quot;, as COMSOL interprets this incorrectly to mean that your machine &#039;&#039;is&#039;&#039; a license server.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Port:&#039;&#039;&#039; &amp;lt;code&amp;gt;1718&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
Or place a license file with this content:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;make&amp;quot;&amp;gt;&lt;br /&gt;
SERVER 127.0.0.1 ANY 1718&lt;br /&gt;
USE_SERVER&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
//--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Establish connection to CNM license server ===&lt;br /&gt;
This step needs to be done prior to running COMSOL in your desktop session:&lt;br /&gt;
* Connect to &amp;lt;code&amp;gt;mega&amp;lt;/code&amp;gt; with the following command in a terminal window:&lt;br /&gt;
 ssh  -L 1718:&#039;&#039;&#039;clicense1&#039;&#039;&#039;:1718  -L 1719:&#039;&#039;&#039;clicense1&#039;&#039;&#039;:1719  mega.cnm.anl.gov&lt;br /&gt;
* You can leave this connection running in your terminal window across several invocations of COMSOL.&lt;br /&gt;
&lt;br /&gt;
=== Run COMSOL ===&lt;br /&gt;
# Ensure your connection to &amp;quot;mega&amp;quot; is still running. If not, restart it.&lt;br /&gt;
# Start the COMSOL application.&lt;br /&gt;
&lt;br /&gt;
=== Troubleshooting ===&lt;br /&gt;
* If you get an error that the number of licenses is &amp;quot;exhausted&amp;quot;, that is confirmation that you correctly reached the license server, though other users are using licenses.&lt;br /&gt;
* 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:&lt;br /&gt;
 ssh  -L 1718:clicense&#039;&#039;&#039;2&#039;&#039;&#039;:1718  -L 1719:clicense&#039;&#039;&#039;2&#039;&#039;&#039;:1719  mega.cnm.anl.gov&lt;br /&gt;
&lt;br /&gt;
== General License Troubleshooting ==&lt;br /&gt;
The following are typical error messages.&lt;br /&gt;
=== Could not obtain license for COMSOL Multiphysics GUI ===&lt;br /&gt;
* Error details:&lt;br /&gt;
 License error: -4.&lt;br /&gt;
 &#039;&#039;&#039;Licensed number of users already reached.&#039;&#039;&#039;&lt;br /&gt;
 Feature:       COMSOLGUI&lt;br /&gt;
 License path:  /Users/stern/Applications/COMSOL52a/license/license.dat:&lt;br /&gt;
 FlexNet Licensing error:-4,132&lt;br /&gt;
* Reason: The connection to the license server succeeded, but the license token(s) you requested are in use.&lt;br /&gt;
* Solution: Wait a bit, or [http://carbonmgmt/ganglia/lic.php identify who&#039;s using COMSOL] and politely ask the user when they might be finished with their work.&lt;br /&gt;
&lt;br /&gt;
=== License server machine is down or not responding ===&lt;br /&gt;
* Error details:&lt;br /&gt;
  License error: -96.&lt;br /&gt;
  See the system administrator about starting the license server system, or&lt;br /&gt;
  make sure you&#039;re referring to the right host (see LM_LICENSE_FILE).&lt;br /&gt;
 Feature:       SERIAL&lt;br /&gt;
 Hostname:      clicense3&lt;br /&gt;
 License path:  /Users/stern/Applications/COMSOL52a/license/license.dat:&lt;br /&gt;
 FlexNet Licensing error:-96,7&lt;br /&gt;
* Reason: The license servers cannot be reached at all. The &amp;lt;code&amp;gt;ping&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;host&amp;lt;/code&amp;gt; tests mentioned above fail.&lt;br /&gt;
* Solution: Review the client license file and DNS lookup domains.&lt;br /&gt;
&lt;br /&gt;
=== License file does not support this version ===&lt;br /&gt;
* Error details:&lt;br /&gt;
  Feature: SERIAL&lt;br /&gt;
 &#039;&#039;&#039;Application version &amp;gt; License version: 5.21 &amp;gt; 3.5&#039;&#039;&#039;&lt;br /&gt;
 License path: /Users/stern/Applications/COMSOL52a/license/license.dat:&lt;br /&gt;
 FlexNet Licensing error:-21,126&lt;br /&gt;
* 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&#039;re connected to.&lt;br /&gt;
* Solution: When using SSH, try &amp;lt;code&amp;gt;clicense2&amp;lt;/code&amp;gt; instead of  &amp;lt;code&amp;gt;clicense1&amp;lt;/code&amp;gt;, or vice versa. Revisit your &amp;lt;code&amp;gt;~/.ssh/config&amp;lt;/code&amp;gt; file or use the alternate command line as shown in the SSH section above.&lt;br /&gt;
&lt;br /&gt;
== Multiple CPU cores ==&lt;br /&gt;
Ways to start multi-core (from http://www.comsol.com/support/knowledgebase/1096/)&lt;br /&gt;
 comsol -np 8&lt;br /&gt;
&lt;br /&gt;
 export COMSOL_NUM_THREADS=8    # automatically provided on &#039;&#039;Carbon&#039;&#039;&lt;br /&gt;
 comsol&lt;br /&gt;
* COMSOL does not benefit from hyperthreading (oversubscribing the physical core count).&lt;br /&gt;
&lt;br /&gt;
== Batch jobs ==&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
 comsol -clustersimple batch -inputfile input.mph -outputfile output.mph &lt;br /&gt;
&lt;br /&gt;
 &amp;lt;strike&amp;gt;comsol –nn 8 mpd boot&lt;br /&gt;
 comsol –nn 8 batch –inputfile in.mph&lt;br /&gt;
 comsol mpd allexit&amp;lt;/strike&amp;gt;&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
* http://www.comsol.com/support/knowledgebase/1001/ .&lt;br /&gt;
* [[Media:HPC 2012-05-16 Comsol parallel usage.pdf]] (Modified from http://www.comsol.com/support/knowledgebase/1001/files/4027/cluster_install_linux_42a.pptx – Appendix slide, PBS)&lt;br /&gt;
* &#039;&#039;&#039;Note:&#039;&#039;&#039; MPD is not supported on Carbon (I patched the main comsol script), and no longer necessary at all in Comsol-4.3.&lt;br /&gt;
&lt;br /&gt;
=== Sample Job file ===&lt;br /&gt;
See:&lt;br /&gt;
 $COMSOL_HOME/sample.job&lt;br /&gt;
&lt;br /&gt;
== Important COMSOL Support Articles ==&lt;br /&gt;
* Toplevel suport page: https://www.comsol.com/support&lt;br /&gt;
&lt;br /&gt;
=== KB Articles ===&lt;br /&gt;
* [https://www.comsol.com/support/knowledgebase/1001 Running COMSOL® in parallel on clusters]&lt;br /&gt;
* [https://www.comsol.com/support/knowledgebase/1250 Running parametric sweeps, batch sweeps, and cluster sweeps from the command line]&lt;br /&gt;
* [https://www.comsol.com/support/knowledgebase/1255 Reducing the amount of solution data stored in a model]&lt;br /&gt;
* [https://www.comsol.com/support/knowledgebase/830 Handling large models]&lt;br /&gt;
&lt;br /&gt;
=== Blog-style articles ===&lt;br /&gt;
* [https://www.comsol.com/blogs/the-power-of-the-batch-sweep/ The Power of the Batch Sweep]&lt;br /&gt;
* [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]&lt;/div&gt;</summary>
		<author><name>Stern</name></author>
	</entry>
	<entry>
		<id>https://wiki.anl.gov/wiki_cnm/index.php?title=File:HPC_Comsol_licensed_modules.png&amp;diff=7508</id>
		<title>File:HPC Comsol licensed modules.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.anl.gov/wiki_cnm/index.php?title=File:HPC_Comsol_licensed_modules.png&amp;diff=7508"/>
		<updated>2026-06-09T17:52:27Z</updated>

		<summary type="html">&lt;p&gt;Stern: Stern uploaded a new version of File:HPC Comsol licensed modules.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Stern</name></author>
	</entry>
	<entry>
		<id>https://wiki.anl.gov/wiki_cnm/index.php?title=HPC/Support&amp;diff=7507</id>
		<title>HPC/Support</title>
		<link rel="alternate" type="text/html" href="https://wiki.anl.gov/wiki_cnm/index.php?title=HPC/Support&amp;diff=7507"/>
		<updated>2026-03-09T17:03:32Z</updated>

		<summary type="html">&lt;p&gt;Stern: /* Required information */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Review the FAQ list ==&lt;br /&gt;
For frequently asked questions regarding the Carbon HPC system, review &#039;&#039;&#039;[[HPC/FAQ | Frequently Asked Questions]]&#039;&#039;&#039; to find answers.&lt;br /&gt;
&lt;br /&gt;
== Compose a support request for CNM HPC==&lt;br /&gt;
If your question is not answered in the FAQ: &amp;lt;!-- , choose one of the following to get help: --&amp;gt;&lt;br /&gt;
* [https://argonne.servicenowservices.com/sp?id=sc_cat_item&amp;amp;sys_id=4e37eb5b13199f0016ff33228144b036 &#039;&#039;&#039;Submit a support request&#039;&#039;&#039;]  – Log in with your regular Argonne username and password (same as on Carbon).&lt;br /&gt;
* Choose a suitable Request Type and provide the details as shown in the next section.&lt;br /&gt;
&amp;lt;!-- * [mailto:help@anl.gov?subject=CNM%20HPC%20issue Send an email to help@anl.gov] --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Required information ==&lt;br /&gt;
&amp;lt;!-- *: Do not merely hit &amp;quot;Reply&amp;quot; on a previous unrelated message - doing so might cause your request to get overlooked in a previous thread. --&amp;gt;&lt;br /&gt;
Be as &#039;&#039;specific as possible&#039;&#039; in your free-form description or form input fields.&lt;br /&gt;
&lt;br /&gt;
=== For all issues – local and remote ===&lt;br /&gt;
Provide the following:&lt;br /&gt;
* The &#039;&#039;&#039;command&#039;&#039;&#039; you were trying to run or the menu item you chose in a graphical user interface&lt;br /&gt;
* The &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;&#039;&#039;&#039;exact error message&#039;&#039;&#039;&amp;lt;/font&amp;gt; you get. Copy &amp;amp; Paste the message text, or take a screenshot and attach it to your mail.&lt;br /&gt;
* The &#039;&#039;&#039;directory path&#039;&#039;&#039; and &#039;&#039;&#039;file name&#039;&#039;&#039; you were working on, if applicable.&lt;br /&gt;
*: It is generally not necessary to include in your message copies of files that already reside on Carbon.&lt;br /&gt;
* Did the same command or action &#039;&#039;&#039;work previously&#039;&#039;&#039;, if ever?&lt;br /&gt;
* Which &#039;&#039;&#039;changes&#039;&#039;&#039;, if any, did you make to your configuration or input files since the last time this worked?&lt;br /&gt;
* Fill in an appropriate email &#039;&#039;&#039;Subject&#039;&#039;&#039; or form &#039;&#039;&#039;Title&#039;&#039;&#039;.&lt;br /&gt;
*: Best do this &#039;&#039;after&#039;&#039; you typed and reviewed the main text of your request.&lt;br /&gt;
* To reproduce your issue, we may ask for a [[#Test directory]] – (see next section)&lt;br /&gt;
&lt;br /&gt;
=== For issues with PBS jobs ===&lt;br /&gt;
In addition to the [[#For all issues|preceding section]], for questions concerning PBS jobs, provide:&lt;br /&gt;
* the &#039;&#039;&#039;working directory&#039;&#039;&#039; of the job&lt;br /&gt;
* the name of the &#039;&#039;&#039;job file&#039;&#039;&#039; used&lt;br /&gt;
* the &#039;&#039;&#039;job number&#039;&#039;&#039; (for queued or running jobs)&lt;br /&gt;
&lt;br /&gt;
=== For remote access ===&lt;br /&gt;
When you cannot log in to mega or a &#039;&#039;Carbon&#039;&#039; login node, provide:&lt;br /&gt;
* The details in section [[#For all issues]],&lt;br /&gt;
plus the following:&lt;br /&gt;
* The &#039;&#039;&#039;hostname&#039;&#039;&#039; you ran the command on. It is often shown in the command prompt. (If the prompt shows &amp;lt;code&amp;gt;localhost&amp;lt;/code&amp;gt; it is not specific enough – ask your local support person for help.)&lt;br /&gt;
* The &#039;&#039;&#039;hostname&#039;&#039;&#039; you&#039;re trying to &#039;&#039;reach.&#039;&#039;&lt;br /&gt;
* The &#039;&#039;&#039;username&#039;&#039;&#039; you use to connect.&lt;br /&gt;
* The &#039;&#039;&#039;software&#039;&#039;&#039; name and version you use to connect (e.g. SSH, VNC, or a browser).&lt;br /&gt;
* Your &#039;&#039;&#039;operating system&#039;&#039;&#039; and version.&lt;br /&gt;
&lt;br /&gt;
If you use ssh or scp, repeat your command in verbose mode by supplying the &amp;quot;-v&amp;quot; option twice:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
scp -v -v [… other options and arguments …]&lt;br /&gt;
ssh -v -v [… other options and arguments …]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
: Copy and Paste the possibly multi-page output into your request.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
=== Review ===&lt;br /&gt;
* Make sure you included the &#039;&#039;error message&#039;&#039; that prompted your request.&lt;br /&gt;
* Review and if needed edit the &#039;&#039;&#039;Subject&#039;&#039;&#039; to match your question. &amp;lt;!--  (A simple reply to an unrelated system announcement may get ignored.)&lt;br /&gt;
* Submit.&lt;br /&gt;
//--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Test directory ==&lt;br /&gt;
We may ask you to prepare a &#039;&#039;test directory&#039;&#039;, which should help to:&lt;br /&gt;
* Reproduce your problem.&lt;br /&gt;
* Diagnose your problem, especially when errors are subtle or difficult to reproduce, such as where your application runs but does not fail outright.&lt;br /&gt;
* Confirm resolution.&lt;br /&gt;
&lt;br /&gt;
Prepare the test directory so that it contains &#039;&#039;only&#039;&#039; files to run your application, either interactively or in a single PBS job, and possibly a file with correct output.&lt;br /&gt;
; Preferred location:&lt;br /&gt;
* In or under a &#039;&#039;sibling&#039;&#039; directory of one of a your failed runs (as opposed to a &#039;&#039;child&#039;&#039; directory).&lt;br /&gt;
; Include:&lt;br /&gt;
* PBS job file, if applicable,&lt;br /&gt;
* Run-specific data and script files (files named in input data or hardcoded in the code, possibly as symbolic links),&lt;br /&gt;
* If available, a file with the &#039;&#039;expected&#039;&#039; (correct) output, but with a file name different from the one generated by the job, such as by adding &amp;lt;code&amp;gt;.ref&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In the course of diagnostics, we will suitably duplicate your directory as needed.&lt;br /&gt;
&lt;br /&gt;
== Receiving support ==&lt;br /&gt;
When you get our support response:&lt;br /&gt;
* Carefully read it.&lt;br /&gt;
* Follow all instructions and answer all questions.&lt;br /&gt;
* For account- and password-related issues: it may take several hours for changes to take effect. If your initial attempt fails, wait at least that long before retrying.&lt;br /&gt;
&lt;br /&gt;
== Additional considerations ==&lt;br /&gt;
To help us diagnose a problem:&lt;br /&gt;
* Read [http://www.chiark.greenend.org.uk/~sgtatham/bugs.html How to Report Bugs Effectively], by [http://www.chiark.greenend.org.uk/~sgtatham/ Simon Tatham], programmer.&amp;lt;!-- of [http://www.chiark.greenend.org.uk/~sgtatham/putty/ PuTTY] fame. --&amp;gt;&lt;br /&gt;
* For deeper reading, consider [http://www.catb.org/~esr/faqs/smart-questions.html How To Ask Questions The Smart Way], by [http://en.wikipedia.org/wiki/Eric_S._Raymond Eric S. Raymond], open source pioneer.&lt;br /&gt;
&amp;lt;!-- * Also, the [http://mywiki.wooledge.org/XyProblem X-Y Problem] (mostly for programming-related tasks). --&amp;gt;&lt;/div&gt;</summary>
		<author><name>Stern</name></author>
	</entry>
	<entry>
		<id>https://wiki.anl.gov/wiki_cnm/index.php?title=HPC/Support&amp;diff=7506</id>
		<title>HPC/Support</title>
		<link rel="alternate" type="text/html" href="https://wiki.anl.gov/wiki_cnm/index.php?title=HPC/Support&amp;diff=7506"/>
		<updated>2026-03-09T17:01:06Z</updated>

		<summary type="html">&lt;p&gt;Stern: /* Test directory */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Review the FAQ list ==&lt;br /&gt;
For frequently asked questions regarding the Carbon HPC system, review &#039;&#039;&#039;[[HPC/FAQ | Frequently Asked Questions]]&#039;&#039;&#039; to find answers.&lt;br /&gt;
&lt;br /&gt;
== Compose a support request for CNM HPC==&lt;br /&gt;
If your question is not answered in the FAQ: &amp;lt;!-- , choose one of the following to get help: --&amp;gt;&lt;br /&gt;
* [https://argonne.servicenowservices.com/sp?id=sc_cat_item&amp;amp;sys_id=4e37eb5b13199f0016ff33228144b036 &#039;&#039;&#039;Submit a support request&#039;&#039;&#039;]  – Log in with your regular Argonne username and password (same as on Carbon).&lt;br /&gt;
* Choose a suitable Request Type and provide the details as shown in the next section.&lt;br /&gt;
&amp;lt;!-- * [mailto:help@anl.gov?subject=CNM%20HPC%20issue Send an email to help@anl.gov] --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Required information ==&lt;br /&gt;
&amp;lt;!-- *: Do not merely hit &amp;quot;Reply&amp;quot; on a previous unrelated message - doing so might cause your request to get overlooked in a previous thread. --&amp;gt;&lt;br /&gt;
Be as &#039;&#039;specific as possible&#039;&#039; in your free-form description or form input fields.&lt;br /&gt;
&lt;br /&gt;
=== For all issues – local and remote ===&lt;br /&gt;
Provide the following:&lt;br /&gt;
* The &#039;&#039;&#039;command&#039;&#039;&#039; you were trying to run or the menu item you chose in a graphical user interface&lt;br /&gt;
* The &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;&#039;&#039;&#039;exact error message&#039;&#039;&#039;&amp;lt;/font&amp;gt; you get. Copy &amp;amp; Paste the message text, or take a screenshot and attach it to your mail.&lt;br /&gt;
* The &#039;&#039;&#039;directory path&#039;&#039;&#039; and &#039;&#039;&#039;file name&#039;&#039;&#039; you were working on, if applicable.&lt;br /&gt;
*: It is generally not necessary to include in your message copies of files that already reside on Carbon.&lt;br /&gt;
* Did the same command or action &#039;&#039;&#039;work previously&#039;&#039;&#039;, if ever?&lt;br /&gt;
* Which &#039;&#039;&#039;changes&#039;&#039;&#039;, if any, did you make to your configuration or input files since the last time this worked?&lt;br /&gt;
* Fill in an appropriate email &#039;&#039;&#039;Subject&#039;&#039;&#039; or form &#039;&#039;&#039;Title&#039;&#039;&#039;.&lt;br /&gt;
*: Best do this &#039;&#039;after&#039;&#039; you typed and reviewed the main text of your request.&lt;br /&gt;
&lt;br /&gt;
=== For issues with PBS jobs ===&lt;br /&gt;
In addition to the [[#For all issues|preceding section]], for questions concerning PBS jobs, provide:&lt;br /&gt;
* the &#039;&#039;&#039;working directory&#039;&#039;&#039; of the job&lt;br /&gt;
* the name of the &#039;&#039;&#039;job file&#039;&#039;&#039; used&lt;br /&gt;
* the &#039;&#039;&#039;job number&#039;&#039;&#039; (for queued or running jobs)&lt;br /&gt;
&lt;br /&gt;
=== For remote access ===&lt;br /&gt;
When you cannot log in to mega or a &#039;&#039;Carbon&#039;&#039; login node, provide:&lt;br /&gt;
* The details in section [[#For all issues]],&lt;br /&gt;
plus the following:&lt;br /&gt;
* The &#039;&#039;&#039;hostname&#039;&#039;&#039; you ran the command on. It is often shown in the command prompt. (If the prompt shows &amp;lt;code&amp;gt;localhost&amp;lt;/code&amp;gt; it is not specific enough – ask your local support person for help.)&lt;br /&gt;
* The &#039;&#039;&#039;hostname&#039;&#039;&#039; you&#039;re trying to &#039;&#039;reach.&#039;&#039;&lt;br /&gt;
* The &#039;&#039;&#039;username&#039;&#039;&#039; you use to connect.&lt;br /&gt;
* The &#039;&#039;&#039;software&#039;&#039;&#039; name and version you use to connect (e.g. SSH, VNC, or a browser).&lt;br /&gt;
* Your &#039;&#039;&#039;operating system&#039;&#039;&#039; and version.&lt;br /&gt;
&lt;br /&gt;
If you use ssh or scp, repeat your command in verbose mode by supplying the &amp;quot;-v&amp;quot; option twice:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
scp -v -v [… other options and arguments …]&lt;br /&gt;
ssh -v -v [… other options and arguments …]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
: Copy and Paste the possibly multi-page output into your request.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
=== Review ===&lt;br /&gt;
* Make sure you included the &#039;&#039;error message&#039;&#039; that prompted your request.&lt;br /&gt;
* Review and if needed edit the &#039;&#039;&#039;Subject&#039;&#039;&#039; to match your question. &amp;lt;!--  (A simple reply to an unrelated system announcement may get ignored.)&lt;br /&gt;
* Submit.&lt;br /&gt;
//--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* [#Test directory] (see next section)&lt;br /&gt;
&lt;br /&gt;
== Test directory ==&lt;br /&gt;
We may ask you to prepare a &#039;&#039;test directory&#039;&#039;, which should help to:&lt;br /&gt;
* Reproduce your problem.&lt;br /&gt;
* Diagnose your problem, especially when errors are subtle or difficult to reproduce, such as where your application runs but does not fail outright.&lt;br /&gt;
* Confirm resolution.&lt;br /&gt;
&lt;br /&gt;
Prepare the test directory so that it contains &#039;&#039;only&#039;&#039; files to run your application, either interactively or in a single PBS job, and possibly a file with correct output.&lt;br /&gt;
; Preferred location:&lt;br /&gt;
* In or under a &#039;&#039;sibling&#039;&#039; directory of one of a your failed runs (as opposed to a &#039;&#039;child&#039;&#039; directory).&lt;br /&gt;
; Include:&lt;br /&gt;
* PBS job file, if applicable,&lt;br /&gt;
* Run-specific data and script files (files named in input data or hardcoded in the code, possibly as symbolic links),&lt;br /&gt;
* If available, a file with the &#039;&#039;expected&#039;&#039; (correct) output, but with a file name different from the one generated by the job, such as by adding &amp;lt;code&amp;gt;.ref&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In the course of diagnostics, we will suitably duplicate your directory as needed.&lt;br /&gt;
&lt;br /&gt;
== Receiving support ==&lt;br /&gt;
When you get our support response:&lt;br /&gt;
* Carefully read it.&lt;br /&gt;
* Follow all instructions and answer all questions.&lt;br /&gt;
* For account- and password-related issues: it may take several hours for changes to take effect. If your initial attempt fails, wait at least that long before retrying.&lt;br /&gt;
&lt;br /&gt;
== Additional considerations ==&lt;br /&gt;
To help us diagnose a problem:&lt;br /&gt;
* Read [http://www.chiark.greenend.org.uk/~sgtatham/bugs.html How to Report Bugs Effectively], by [http://www.chiark.greenend.org.uk/~sgtatham/ Simon Tatham], programmer.&amp;lt;!-- of [http://www.chiark.greenend.org.uk/~sgtatham/putty/ PuTTY] fame. --&amp;gt;&lt;br /&gt;
* For deeper reading, consider [http://www.catb.org/~esr/faqs/smart-questions.html How To Ask Questions The Smart Way], by [http://en.wikipedia.org/wiki/Eric_S._Raymond Eric S. Raymond], open source pioneer.&lt;br /&gt;
&amp;lt;!-- * Also, the [http://mywiki.wooledge.org/XyProblem X-Y Problem] (mostly for programming-related tasks). --&amp;gt;&lt;/div&gt;</summary>
		<author><name>Stern</name></author>
	</entry>
	<entry>
		<id>https://wiki.anl.gov/wiki_cnm/index.php?title=HPC/Applications/comsol&amp;diff=7505</id>
		<title>HPC/Applications/comsol</title>
		<link rel="alternate" type="text/html" href="https://wiki.anl.gov/wiki_cnm/index.php?title=HPC/Applications/comsol&amp;diff=7505"/>
		<updated>2026-03-04T18:33:18Z</updated>

		<summary type="html">&lt;p&gt;Stern: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
The [http://www.comsol.com/products/multiphysics/ &#039;&#039;&#039;COMSOL Multiphysics&#039;&#039;&#039;] application suite&lt;br /&gt;
is available for Mac, Windows, and Linux.&lt;br /&gt;
&lt;br /&gt;
== Access ==&lt;br /&gt;
[[Image:HPC Comsol licensed modules.png|right|450px|thumb|COMSOL features licensed at CNM as of 2024-10.]]&lt;br /&gt;
=== COMSOL Multiphysics ===&lt;br /&gt;
Access to &#039;&#039;&#039;COMSOL Multiphysics&#039;&#039;&#039;, the main application with both a graphical user interface and batch computing capabilities, will be granted &#039;&#039;&#039;&#039;&#039;upon request&#039;&#039;&#039;&#039;&#039;&amp;amp;thinsp;.&lt;br /&gt;
&lt;br /&gt;
You must be:&lt;br /&gt;
* An &#039;&#039;&#039;&#039;&#039;Argonne employee&#039;&#039;&#039;&#039;&#039;&amp;amp;thinsp; in one of the following roles:&lt;br /&gt;
** &#039;&#039;&#039;&#039;&#039;NST staff member&#039;&#039;&#039;&#039;&#039;&amp;amp;thinsp; (including PostDocs, joint appointments, and students at NST).&lt;br /&gt;
** &#039;&#039;&#039;&#039;&#039;CNM Facility User&#039;&#039;&#039;&#039;&#039;&amp;amp;thinsp; (including &#039;&#039;non-NST Argonne employees&#039;&#039;), with an active proposal that has COMSOL in scope. Please see [[HPC/FAQ#Access_and_proposals]].&lt;br /&gt;
&lt;br /&gt;
The set of available COMSOL modules that we have licensed is shown at right.&lt;br /&gt;
&lt;br /&gt;
* The native desktop version can be installed only on &#039;&#039;Argonne-owned&#039;&#039; computers (laptop or desktop). Please contact [mailto:help@anl.gov?Subject=COMSOL%20license%20access%20request CNM support]. Make sure to review [http://www.comsol.com/support/updates/ Product Updates].&lt;br /&gt;
* To run COMSOL on our HPC system &#039;&#039;Carbon&#039;&#039;, as GUI or as batch computing jobs, your proposal must have &#039;&#039;Carbon&#039;&#039; access in scope.&lt;br /&gt;
&lt;br /&gt;
=== COMSOL Server ===&lt;br /&gt;
&#039;&#039;CNM Facility Users&#039;&#039; who are not Argonne employees are not eligible to access&lt;br /&gt;
the full &#039;&#039;&#039;COMSOL Multiphysics&#039;&#039;&#039; product, in compliance with its licensing terms and conditions.&lt;br /&gt;
However, the [https://www.comsol.com/comsol-server &#039;&#039;&#039;COMSOL Server&#039;&#039;&#039;] product offers an alternative&lt;br /&gt;
albeit more narrow means of access.&lt;br /&gt;
&lt;br /&gt;
All users, including &#039;&#039;&#039;&#039;&#039;non-Argonne users&#039;&#039;&#039;&#039;&#039; may be able to run, over a web interface in their browser,&lt;br /&gt;
pre-parameterized &amp;quot;fixed-model&amp;quot; simulations that were made with the &#039;&#039;&#039;COMSOL Application Builder&#039;&#039;&#039; (requires Windows).&lt;br /&gt;
&lt;br /&gt;
To inquire about using COMSOL server applications,&lt;br /&gt;
please contact us.&lt;br /&gt;
&amp;lt;!-- [mailto:cnm_useroffice@anl.gov?Subject=COMSOL%20server%20usage Support]. --&amp;gt;&lt;br /&gt;
We will review possible purchase paths for COMSOL Server, and the &#039;&#039;considerable effort&#039;&#039; likely required by users and the CNM to develop and deploy a COMSOL application.&lt;br /&gt;
&lt;br /&gt;
== Support ==&lt;br /&gt;
* For questions on how to run or start COMSOL:&lt;br /&gt;
*: Submit an [[HPC/Support | &#039;&#039;&#039;IT support request&#039;&#039;&#039;]]&lt;br /&gt;
* For questions related to most COMSOL data or scripts, contact COMSOL support at:&lt;br /&gt;
*: [mailto:support@comsol.com &#039;&#039;&#039;support&#039;&#039;&#039;@comsol.com]&lt;br /&gt;
* &#039;&#039;&#039;Exception:&#039;&#039;&#039; If your support question might contain data that is subject to &#039;&#039;&#039;US Export Control&#039;&#039;&#039; regulations, contact instead:&lt;br /&gt;
*: [mailto:us-export-control@us.comsol.com &#039;&#039;&#039;us-export-control&#039;&#039;&#039;@&#039;&#039;&#039;us&#039;&#039;&#039;.comsol.com]&lt;br /&gt;
&lt;br /&gt;
== The modes to run COMSOL ==&lt;br /&gt;
There are several ways of running COMSOL.&lt;br /&gt;
&lt;br /&gt;
=== Running the desktop application ===&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
# Run on your &#039;&#039;Argonne-provided&#039;&#039; computer, checking out Carbon&#039;s license remotely.&lt;br /&gt;
#* Requires a full installation of COMSOL on your desktop or laptop computer.&lt;br /&gt;
#* 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.&lt;br /&gt;
# Run on Carbon, display on your desktop using the [http://en.wikipedia.org/wiki/X_Window_System X Window system (X11)].&lt;br /&gt;
#* Requires an &#039;&#039;X11 Server&#039;&#039; application running on your client machine, and SSH X11 forwarding.&lt;br /&gt;
#* The X11 protocol can be slow over LAN.&lt;br /&gt;
# Run on Carbon in a [[HPC/Network Access/Virtual Desktop | virtual desktop environment (VNC)]], viewed in a VNC client on your machine.&lt;br /&gt;
#* Requires a VNC client on your machine.&lt;br /&gt;
#* It can be confusing where VNC and the app runs.&lt;br /&gt;
#* The virtual desktop presents a (deliberatly) sparse windowing environment – Copy&amp;amp;Paste can be difficult to use.&lt;br /&gt;
&lt;br /&gt;
=== Running a batch calculation ===&lt;br /&gt;
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.&lt;br /&gt;
See the [[#Batch jobs|section below]].&lt;br /&gt;
&lt;br /&gt;
== Native desktop version ==&lt;br /&gt;
To get the fastest response from the COMSOL GUI, run a native COMSOL version on your desktop machine or laptop, called &#039;&#039;client machine&#039;&#039; below.&lt;br /&gt;
&lt;br /&gt;
Enter license details either in the COMSOL Setup configuration dialog.&lt;br /&gt;
&lt;br /&gt;
== Use with X11 ==&lt;br /&gt;
For casual use, and with [[HPC/Network Access/SSH Tunnel Setup on Linux and MacOS | X11 tunneling to Carbon]] set up, simply add to your &amp;lt;code&amp;gt;~/.bashrc&amp;lt;/code&amp;gt; file on Carbon:&lt;br /&gt;
 module load comsol&lt;br /&gt;
&lt;br /&gt;
Then, from the command line on a Carbon login node, start the COMSOL GUI:&lt;br /&gt;
 comsol &amp;amp;&lt;br /&gt;
&lt;br /&gt;
License configuration is automatic on Carbon.&lt;br /&gt;
&lt;br /&gt;
Comsol will use a number of cores to run calculations multithreaded by default. (On Carbon, COMSOL_NUM_THREADS is set.)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Quit the application&#039;&#039;&#039; as soon as you are done. Only one user can use Comsol at a time.&lt;br /&gt;
&lt;br /&gt;
== Use with VNC ==&lt;br /&gt;
See general  [[HPC/Network Access/Virtual Desktop | instructions on using VNC]], and the COMSOL example therein.&lt;br /&gt;
&lt;br /&gt;
== License configuration ==&lt;br /&gt;
A client&#039;s COMSOL license needs to be configured depending on how the client reaches CNM network resources. Follow the appropriate section:&lt;br /&gt;
&lt;br /&gt;
* [[#License configuration when inside CNM or on CNM VPN|License configuration when &#039;&#039;&#039;inside CNM&#039;&#039;&#039; or on &#039;&#039;&#039;CNM VPN&#039;&#039;&#039;]]&lt;br /&gt;
: Requires that the user&#039;s machine is logically within the network of CNM/NST, either by a wired/auth WiFi connection in the building or by VPN under a CNM/NST profile.&lt;br /&gt;
* [[#License configuration when outside CNM – requires SSH Tunneling|License configuration when &#039;&#039;&#039;outside CNM&#039;&#039;&#039; – requires SSH Tunneling]]&lt;br /&gt;
: &#039;&#039;Non-NST staff&#039;&#039; usually have a VPN profile that places the machine logically [[#License configuration when outside CNM – requires SSH Tunneling|outside of NST&#039;s network.]]&lt;br /&gt;
&lt;br /&gt;
== License configuration when inside CNM or on CNM VPN ==&lt;br /&gt;
=== &amp;lt;span style=&amp;quot;color:#A00;&amp;quot;&amp;gt;Ensure correct DNS search domains&amp;lt;/span&amp;gt; ===&lt;br /&gt;
* Inspect the client machine&#039;s network configuration.&lt;br /&gt;
* Ensure that &#039;&#039;&#039;two&#039;&#039;&#039; entries are listed as DNS Search Domains for the current network profile:&lt;br /&gt;
 nst.anl.gov&lt;br /&gt;
 cnm.anl.gov&lt;br /&gt;
: (The order of entries does not matter for the purposes considered here.)&lt;br /&gt;
* If the client machine is &#039;&#039;wired to CNM networks&#039;&#039;, the domains are normally provided correctly by DHCP.&lt;br /&gt;
* If the client machine is &#039;&#039;connected over VPN&#039;&#039;, you may need edit the respective network profile.&lt;br /&gt;
:* 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 &amp;quot;Advanced…&amp;quot;. It appears that those changes are being saved and will be activated automatically the next time that this VPN session gets started.&lt;br /&gt;
: [[Image:VNC_add_cnm_to_DNS_1.png|400px]] [[Image:VNC_add_cnm_to_DNS_2.png|400px]]&lt;br /&gt;
:* On Windows or Linux machines, take &#039;&#039;analogous&#039;&#039; steps, using the platform&#039;s own configuration tools.&lt;br /&gt;
&lt;br /&gt;
* Exclude license manager components from client desktop installation. (Those are all handled server-side.)&lt;br /&gt;
&lt;br /&gt;
=== License format ===&lt;br /&gt;
* Floating Network License (FNL), &amp;quot;Three-server redundancy&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== License servers ===&lt;br /&gt;
* On client machines, while running the COMSOL installer or license configuration, specify license servers and ports as follows:&lt;br /&gt;
 1718    clicense1&lt;br /&gt;
 1718    clicense2&lt;br /&gt;
 1718    clicense3&lt;br /&gt;
: &#039;&#039;&#039;Note:&#039;&#039;&#039; Use &#039;&#039;short host names only&#039;&#039;. (Technical Reason: The license must be usable both on Carbon&#039;s internal network as well as on divisional networks).&lt;br /&gt;
 1718    clicense1&amp;lt;strike&amp;gt;.cnm.anl.gov&amp;lt;/strike&amp;gt;&lt;br /&gt;
 1718    clicense2&amp;lt;strike&amp;gt;.cnm.anl.gov&amp;lt;/strike&amp;gt;&lt;br /&gt;
 1718    clicense3&amp;lt;strike&amp;gt;.cnm.anl.gov&amp;lt;/strike&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Advanced:&#039;&#039;&#039; A client machine&#039;s COMSOL license file &amp;lt;code&amp;gt;&amp;amp;lt;COMSOLDIR&amp;amp;gt;/Multiphysics/license/license.dat&amp;lt;/code&amp;gt; should look as follows:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;make&amp;quot;&amp;gt;&lt;br /&gt;
SERVER clicense1 ANY 1718&lt;br /&gt;
SERVER clicense2 ANY 1718&lt;br /&gt;
SERVER clicense3 ANY 1718&lt;br /&gt;
USE_SERVER&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;amp;lt;COMSOLDIR&amp;amp;gt;&amp;lt;/code&amp;gt; is located by default at:&lt;br /&gt;
* &#039;&#039;&#039;Windows&#039;&#039;&#039;: C:\Program files\COMSOL\COMSOL&#039;&#039;nn&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Linux&#039;&#039;&#039;: /usr/local/comsol&#039;&#039;nn&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Mac&#039;&#039;&#039;: /Applications/COMSOL&#039;&#039;nn&#039;&#039;&lt;br /&gt;
(&amp;quot;&#039;&#039;nn&#039;&#039;&amp;quot; is the application&#039;s abbreviated version number.)&lt;br /&gt;
&lt;br /&gt;
=== Network Troubleshooting ===&lt;br /&gt;
When using the license access model descibed here (as opposed to tunneled over SSH), ensure the following:&lt;br /&gt;
* Verify that short host names can be resolved to IP addresses. Either one of the following commands should produce sensible output:&lt;br /&gt;
 host clicense1&lt;br /&gt;
: or:&lt;br /&gt;
 ping -c 3 clicense1&lt;br /&gt;
* Verify that &#039;&#039;both license ports on the same server&#039;&#039; can be reached from your client machine:&lt;br /&gt;
 telnet &#039;&#039;&#039;clicense1&#039;&#039;&#039; 1718&lt;br /&gt;
 telnet &#039;&#039;&#039;clicense1&#039;&#039;&#039; 1719&lt;br /&gt;
: or:&lt;br /&gt;
 telnet &#039;&#039;&#039;clicense2&#039;&#039;&#039; 1718&lt;br /&gt;
 telnet &#039;&#039;&#039;clicense2&#039;&#039;&#039; 1719&lt;br /&gt;
: A &#039;&#039;successful&#039;&#039; connection looks like:&lt;br /&gt;
 Trying 146.139.x.y...&lt;br /&gt;
 Connected to clicense1.cnm.anl.gov.&lt;br /&gt;
 Escape character is &#039;^]&#039;.&lt;br /&gt;
:: Do not enter any data. Instead,  close each connection by hitting &amp;lt;code&amp;gt;Ctrl&amp;lt;/code&amp;gt;&amp;lt;code&amp;gt;]&amp;lt;/code&amp;gt; (closing square bracket), followed by &amp;lt;code&amp;gt;Ctrl&amp;lt;/code&amp;gt;&amp;lt;code&amp;gt;D&amp;lt;/code&amp;gt;.&lt;br /&gt;
: A &#039;&#039;failed&#039;&#039; connection gives one of these errors:&lt;br /&gt;
 telnet: connect to address 146.139.x.y: Operation timed out&lt;br /&gt;
: or:&lt;br /&gt;
 telnet: connect to address 146.139.x.y: Connection refused&lt;br /&gt;
:: In these cases, ask that your IP firewall configuration be reviewed and changed.&lt;br /&gt;
&lt;br /&gt;
== License configuration when outside CNM – requires SSH Tunneling ==&lt;br /&gt;
This section documents how to run COMSOL from a network location outside CNM.&lt;br /&gt;
&lt;br /&gt;
As a one-time preparation step, two items must be configured:&lt;br /&gt;
* The license host that COMSOL is to contact, and&lt;br /&gt;
* An SSH connection that will allow your machine to access the COMSOL license server inside CNM&#039;s network.&lt;br /&gt;
&lt;br /&gt;
To then &#039;&#039;run&#039;&#039; the COMSOL application, the configured SSH connection must be up and kept running for the entire time that you run the COMSOL. When you exit COMSOL and wish to start it again, you can keep the SSH connection running, it will be re-used for the next COMSOL run.&lt;br /&gt;
&lt;br /&gt;
=== Configure COMSOL ===&lt;br /&gt;
The following needs to be done just once, typically during COMSOL installation:&lt;br /&gt;
&lt;br /&gt;
In the COMSOL Installer, or in COMSOL Preferences, enter:&lt;br /&gt;
* &#039;&#039;&#039;License format:&#039;&#039;&#039; Floating Network License (FNL), &amp;quot;Port number and Hostname&amp;quot;&lt;br /&gt;
:: &amp;lt;font style=&amp;quot;color:#777&amp;quot;&amp;gt;Do &#039;&#039;not use&#039;&#039; &amp;quot;Three-server redundancy&amp;quot;, since it cannot (easily) be accessed over SSH. Configure with just one server, and in the rare situation of a server failover, temporarily tweak your SSH configuration to contact the alternate server (see below).&amp;lt;/font&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Server:&#039;&#039;&#039; &amp;lt;code&amp;gt;127.0.0.1&amp;lt;/code&amp;gt;&lt;br /&gt;
:: Do not use &amp;quot;localhost&amp;quot;, as COMSOL interprets this incorrectly to mean that your machine &#039;&#039;is&#039;&#039; a license server.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Port:&#039;&#039;&#039; &amp;lt;code&amp;gt;1718&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
Or place a license file with this content:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;make&amp;quot;&amp;gt;&lt;br /&gt;
SERVER 127.0.0.1 ANY 1718&lt;br /&gt;
USE_SERVER&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
//--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Establish connection to CNM license server ===&lt;br /&gt;
This step needs to be done prior to running COMSOL in your desktop session:&lt;br /&gt;
* Connect to &amp;lt;code&amp;gt;mega&amp;lt;/code&amp;gt; with the following command in a terminal window:&lt;br /&gt;
 ssh  -L 1718:&#039;&#039;&#039;clicense1&#039;&#039;&#039;:1718  -L 1719:&#039;&#039;&#039;clicense1&#039;&#039;&#039;:1719  mega.cnm.anl.gov&lt;br /&gt;
* You can leave this connection running in your terminal window across several invocations of COMSOL.&lt;br /&gt;
&lt;br /&gt;
=== Run COMSOL ===&lt;br /&gt;
# Ensure your connection to &amp;quot;mega&amp;quot; is still running. If not, restart it.&lt;br /&gt;
# Start the COMSOL application.&lt;br /&gt;
&lt;br /&gt;
=== Troubleshooting ===&lt;br /&gt;
* If you get an error that the number of licenses is &amp;quot;exhausted&amp;quot;, that is confirmation that you correctly reached the license server, though other users are using licenses.&lt;br /&gt;
* 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:&lt;br /&gt;
 ssh  -L 1718:clicense&#039;&#039;&#039;2&#039;&#039;&#039;:1718  -L 1719:clicense&#039;&#039;&#039;2&#039;&#039;&#039;:1719  mega.cnm.anl.gov&lt;br /&gt;
&lt;br /&gt;
== General License Troubleshooting ==&lt;br /&gt;
The following are typical error messages.&lt;br /&gt;
=== Could not obtain license for COMSOL Multiphysics GUI ===&lt;br /&gt;
* Error details:&lt;br /&gt;
 License error: -4.&lt;br /&gt;
 &#039;&#039;&#039;Licensed number of users already reached.&#039;&#039;&#039;&lt;br /&gt;
 Feature:       COMSOLGUI&lt;br /&gt;
 License path:  /Users/stern/Applications/COMSOL52a/license/license.dat:&lt;br /&gt;
 FlexNet Licensing error:-4,132&lt;br /&gt;
* Reason: The connection to the license server succeeded, but the license token(s) you requested are in use.&lt;br /&gt;
* Solution: Wait a bit, or [http://carbonmgmt/ganglia/lic.php identify who&#039;s using COMSOL] and politely ask the user when they might be finished with their work.&lt;br /&gt;
&lt;br /&gt;
=== License server machine is down or not responding ===&lt;br /&gt;
* Error details:&lt;br /&gt;
  License error: -96.&lt;br /&gt;
  See the system administrator about starting the license server system, or&lt;br /&gt;
  make sure you&#039;re referring to the right host (see LM_LICENSE_FILE).&lt;br /&gt;
 Feature:       SERIAL&lt;br /&gt;
 Hostname:      clicense3&lt;br /&gt;
 License path:  /Users/stern/Applications/COMSOL52a/license/license.dat:&lt;br /&gt;
 FlexNet Licensing error:-96,7&lt;br /&gt;
* Reason: The license servers cannot be reached at all. The &amp;lt;code&amp;gt;ping&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;host&amp;lt;/code&amp;gt; tests mentioned above fail.&lt;br /&gt;
* Solution: Review the client license file and DNS lookup domains.&lt;br /&gt;
&lt;br /&gt;
=== License file does not support this version ===&lt;br /&gt;
* Error details:&lt;br /&gt;
  Feature: SERIAL&lt;br /&gt;
 &#039;&#039;&#039;Application version &amp;gt; License version: 5.21 &amp;gt; 3.5&#039;&#039;&#039;&lt;br /&gt;
 License path: /Users/stern/Applications/COMSOL52a/license/license.dat:&lt;br /&gt;
 FlexNet Licensing error:-21,126&lt;br /&gt;
* 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&#039;re connected to.&lt;br /&gt;
* Solution: When using SSH, try &amp;lt;code&amp;gt;clicense2&amp;lt;/code&amp;gt; instead of  &amp;lt;code&amp;gt;clicense1&amp;lt;/code&amp;gt;, or vice versa. Revisit your &amp;lt;code&amp;gt;~/.ssh/config&amp;lt;/code&amp;gt; file or use the alternate command line as shown in the SSH section above.&lt;br /&gt;
&lt;br /&gt;
== Multiple CPU cores ==&lt;br /&gt;
Ways to start multi-core (from http://www.comsol.com/support/knowledgebase/1096/)&lt;br /&gt;
 comsol -np 8&lt;br /&gt;
&lt;br /&gt;
 export COMSOL_NUM_THREADS=8    # automatically provided on &#039;&#039;Carbon&#039;&#039;&lt;br /&gt;
 comsol&lt;br /&gt;
* COMSOL does not benefit from hyperthreading (oversubscribing the physical core count).&lt;br /&gt;
&lt;br /&gt;
== Batch jobs ==&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
 comsol -clustersimple batch -inputfile input.mph -outputfile output.mph &lt;br /&gt;
&lt;br /&gt;
 &amp;lt;strike&amp;gt;comsol –nn 8 mpd boot&lt;br /&gt;
 comsol –nn 8 batch –inputfile in.mph&lt;br /&gt;
 comsol mpd allexit&amp;lt;/strike&amp;gt;&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
* http://www.comsol.com/support/knowledgebase/1001/ .&lt;br /&gt;
* [[Media:HPC 2012-05-16 Comsol parallel usage.pdf]] (Modified from http://www.comsol.com/support/knowledgebase/1001/files/4027/cluster_install_linux_42a.pptx – Appendix slide, PBS)&lt;br /&gt;
* &#039;&#039;&#039;Note:&#039;&#039;&#039; MPD is not supported on Carbon (I patched the main comsol script), and no longer necessary at all in Comsol-4.3.&lt;br /&gt;
&lt;br /&gt;
=== Sample Job file ===&lt;br /&gt;
See:&lt;br /&gt;
 $COMSOL_HOME/sample.job&lt;br /&gt;
&lt;br /&gt;
== Important COMSOL Support Articles ==&lt;br /&gt;
* Toplevel suport page: https://www.comsol.com/support&lt;br /&gt;
&lt;br /&gt;
=== KB Articles ===&lt;br /&gt;
* [https://www.comsol.com/support/knowledgebase/1001 Running COMSOL® in parallel on clusters]&lt;br /&gt;
* [https://www.comsol.com/support/knowledgebase/1250 Running parametric sweeps, batch sweeps, and cluster sweeps from the command line]&lt;br /&gt;
* [https://www.comsol.com/support/knowledgebase/1255 Reducing the amount of solution data stored in a model]&lt;br /&gt;
* [https://www.comsol.com/support/knowledgebase/830 Handling large models]&lt;br /&gt;
&lt;br /&gt;
=== Blog-style articles ===&lt;br /&gt;
* [https://www.comsol.com/blogs/the-power-of-the-batch-sweep/ The Power of the Batch Sweep]&lt;br /&gt;
* [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]&lt;/div&gt;</summary>
		<author><name>Stern</name></author>
	</entry>
	<entry>
		<id>https://wiki.anl.gov/wiki_cnm/index.php?title=HPC/Applications/comsol&amp;diff=7504</id>
		<title>HPC/Applications/comsol</title>
		<link rel="alternate" type="text/html" href="https://wiki.anl.gov/wiki_cnm/index.php?title=HPC/Applications/comsol&amp;diff=7504"/>
		<updated>2026-03-04T18:31:45Z</updated>

		<summary type="html">&lt;p&gt;Stern: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
The [http://www.comsol.com/products/multiphysics/ &#039;&#039;&#039;COMSOL Multiphysics&#039;&#039;&#039;] application suite&lt;br /&gt;
is available for Mac, Windows, and Linux.&lt;br /&gt;
&lt;br /&gt;
== Access ==&lt;br /&gt;
[[Image:HPC Comsol licensed modules.png|right|450px|thumb|COMSOL features licensed at CNM as of 2024-10.]]&lt;br /&gt;
=== COMSOL Multiphysics ===&lt;br /&gt;
Access to &#039;&#039;&#039;COMSOL Multiphysics&#039;&#039;&#039;, the main application with both a graphical user interface and batch computing capabilities, will be granted &#039;&#039;&#039;&#039;&#039;upon request&#039;&#039;&#039;&#039;&#039;&amp;amp;thinsp;.&lt;br /&gt;
&lt;br /&gt;
You must be:&lt;br /&gt;
* An &#039;&#039;&#039;&#039;&#039;Argonne employee&#039;&#039;&#039;&#039;&#039;&amp;amp;thinsp; in one of the following roles:&lt;br /&gt;
** &#039;&#039;&#039;&#039;&#039;NST staff member&#039;&#039;&#039;&#039;&#039;&amp;amp;thinsp; (including PostDocs, joint appointments, and students at NST).&lt;br /&gt;
** &#039;&#039;&#039;&#039;&#039;CNM Facility User&#039;&#039;&#039;&#039;&#039;&amp;amp;thinsp; (including &#039;&#039;non-NST Argonne employees&#039;&#039;), with an active proposal that has COMSOL in scope. Please see [[HPC/FAQ#Access_and_proposals]].&lt;br /&gt;
&lt;br /&gt;
The set of available COMSOL modules that we have licensed is shown at right.&lt;br /&gt;
&lt;br /&gt;
* The native desktop version can be installed only on &#039;&#039;Argonne-owned&#039;&#039; computers (laptop or desktop). Please contact [mailto:help@anl.gov?Subject=COMSOL%20license%20access%20request CNM support]. Make sure to review [http://www.comsol.com/support/updates/ Product Updates].&lt;br /&gt;
* To run COMSOL on our HPC system &#039;&#039;Carbon&#039;&#039;, as GUI or as batch computing jobs, your proposal must have &#039;&#039;Carbon&#039;&#039; access in scope.&lt;br /&gt;
&lt;br /&gt;
=== COMSOL Server ===&lt;br /&gt;
&#039;&#039;CNM Facility Users&#039;&#039; who are not Argonne employees are not eligible to access&lt;br /&gt;
the full &#039;&#039;&#039;COMSOL Multiphysics&#039;&#039;&#039; product, in compliance with its licensing terms and conditions.&lt;br /&gt;
However, the [https://www.comsol.com/comsol-server &#039;&#039;&#039;COMSOL Server&#039;&#039;&#039;] product offers an alternative&lt;br /&gt;
albeit more narrow means of access.&lt;br /&gt;
&lt;br /&gt;
All users, including &#039;&#039;&#039;&#039;&#039;non-Argonne users&#039;&#039;&#039;&#039;&#039; may be able to run, over a web interface in their browser,&lt;br /&gt;
pre-parameterized &amp;quot;fixed-model&amp;quot; simulations that were made with the &#039;&#039;&#039;COMSOL Application Builder&#039;&#039;&#039; (requires Windows).&lt;br /&gt;
&lt;br /&gt;
To inquire about using COMSOL server applications,&lt;br /&gt;
please contact us.&lt;br /&gt;
&amp;lt;!-- [mailto:cnm_useroffice@anl.gov?Subject=COMSOL%20server%20usage Support]. --&amp;gt;&lt;br /&gt;
We will review possible purchase paths for COMSOL Server, and the &#039;&#039;considerable effort&#039;&#039; likely required by users and the CNM to develop and deploy a COMSOL application.&lt;br /&gt;
&lt;br /&gt;
== Support ==&lt;br /&gt;
* For questions on how to run or start COMSOL:&lt;br /&gt;
*: Submit an [[HPC/Support | &#039;&#039;&#039;IT support request&#039;&#039;&#039;]]&lt;br /&gt;
* For questions related to most COMSOL data or scripts, contact COMSOL support at:&lt;br /&gt;
*: [mailto:support@comsol.com &#039;&#039;&#039;support&#039;&#039;&#039;@comsol.com]&lt;br /&gt;
* &#039;&#039;&#039;Exception:&#039;&#039;&#039; If your support question might contain data that is subject to &#039;&#039;&#039;US Export Control&#039;&#039;&#039; regulations, contact instead:&lt;br /&gt;
*: [mailto:us-export-control@us.comsol.com &#039;&#039;&#039;us-export-control&#039;&#039;&#039;@&#039;&#039;&#039;us&#039;&#039;&#039;.comsol.com]&lt;br /&gt;
&lt;br /&gt;
== The modes to run COMSOL ==&lt;br /&gt;
There are several ways of running COMSOL.&lt;br /&gt;
&lt;br /&gt;
=== Running the desktop application ===&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
# Run on your &#039;&#039;Argonne-provided&#039;&#039; computer, checking out Carbon&#039;s license remotely.&lt;br /&gt;
#* Requires a full installation of COMSOL on your desktop or laptop computer.&lt;br /&gt;
#* 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.&lt;br /&gt;
# Run on Carbon, display on your desktop using the [http://en.wikipedia.org/wiki/X_Window_System X Window system (X11)].&lt;br /&gt;
#* Requires an &#039;&#039;X11 Server&#039;&#039; application running on your client machine, and SSH X11 forwarding.&lt;br /&gt;
#* The X11 protocol can be slow over LAN.&lt;br /&gt;
# Run on Carbon in a [[HPC/Network Access/Virtual Desktop | virtual desktop environment (VNC)]], viewed in a VNC client on your machine.&lt;br /&gt;
#* Requires a VNC client on your machine.&lt;br /&gt;
#* It can be confusing where VNC and the app runs.&lt;br /&gt;
#* The virtual desktop presents a (deliberatly) sparse windowing environment – Copy&amp;amp;Paste can be difficult to use.&lt;br /&gt;
&lt;br /&gt;
=== Running a batch calculation ===&lt;br /&gt;
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.&lt;br /&gt;
See the [[#Batch jobs|section below]].&lt;br /&gt;
&lt;br /&gt;
== Use with X11 ==&lt;br /&gt;
For casual use, and with [[HPC/Network Access/SSH Tunnel Setup on Linux and MacOS | X11 tunneling to Carbon]] set up, simply add to your &amp;lt;code&amp;gt;~/.bashrc&amp;lt;/code&amp;gt; file on Carbon:&lt;br /&gt;
 module load comsol&lt;br /&gt;
&lt;br /&gt;
Then, from the command line on a Carbon login node, start the COMSOL GUI:&lt;br /&gt;
 comsol &amp;amp;&lt;br /&gt;
&lt;br /&gt;
License configuration is automatic on Carbon.&lt;br /&gt;
&lt;br /&gt;
Comsol will use a number of cores to run calculations multithreaded by default. (On Carbon, COMSOL_NUM_THREADS is set.)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Quit the application&#039;&#039;&#039; as soon as you are done. Only one user can use Comsol at a time.&lt;br /&gt;
&lt;br /&gt;
== Use with VNC ==&lt;br /&gt;
See general  [[HPC/Network Access/Virtual Desktop | instructions on using VNC]], and the COMSOL example therein.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Native desktop version ==&lt;br /&gt;
To get the fastest response from the COMSOL GUI, run a native COMSOL version on your desktop machine or laptop, called &#039;&#039;client machine&#039;&#039; below.&lt;br /&gt;
&lt;br /&gt;
Enter license details either in the COMSOL Setup configuration dialog.&lt;br /&gt;
&lt;br /&gt;
== License configuration ==&lt;br /&gt;
A client&#039;s COMSOL license needs to be configured depending on how the client reaches CNM network resources. Follow the appropriate section:&lt;br /&gt;
&lt;br /&gt;
* [[#License configuration when inside CNM or on CNM VPN|License configuration when &#039;&#039;&#039;inside CNM&#039;&#039;&#039; or on &#039;&#039;&#039;CNM VPN&#039;&#039;&#039;]]&lt;br /&gt;
: Requires that the user&#039;s machine is logically within the network of CNM/NST, either by a wired/auth WiFi connection in the building or by VPN under a CNM/NST profile.&lt;br /&gt;
* [[#License configuration when outside CNM – requires SSH Tunneling|License configuration when &#039;&#039;&#039;outside CNM&#039;&#039;&#039; – requires SSH Tunneling]]&lt;br /&gt;
: &#039;&#039;Non-NST staff&#039;&#039; usually have a VPN profile that places the machine logically [[#License configuration when outside CNM – requires SSH Tunneling|outside of NST&#039;s network.]]&lt;br /&gt;
&lt;br /&gt;
== License configuration when inside CNM or on CNM VPN ==&lt;br /&gt;
=== &amp;lt;span style=&amp;quot;color:#A00;&amp;quot;&amp;gt;Ensure correct DNS search domains&amp;lt;/span&amp;gt; ===&lt;br /&gt;
* Inspect the client machine&#039;s network configuration.&lt;br /&gt;
* Ensure that &#039;&#039;&#039;two&#039;&#039;&#039; entries are listed as DNS Search Domains for the current network profile:&lt;br /&gt;
 nst.anl.gov&lt;br /&gt;
 cnm.anl.gov&lt;br /&gt;
: (The order of entries does not matter for the purposes considered here.)&lt;br /&gt;
* If the client machine is &#039;&#039;wired to CNM networks&#039;&#039;, the domains are normally provided correctly by DHCP.&lt;br /&gt;
* If the client machine is &#039;&#039;connected over VPN&#039;&#039;, you may need edit the respective network profile.&lt;br /&gt;
:* 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 &amp;quot;Advanced…&amp;quot;. It appears that those changes are being saved and will be activated automatically the next time that this VPN session gets started.&lt;br /&gt;
: [[Image:VNC_add_cnm_to_DNS_1.png|400px]] [[Image:VNC_add_cnm_to_DNS_2.png|400px]]&lt;br /&gt;
:* On Windows or Linux machines, take &#039;&#039;analogous&#039;&#039; steps, using the platform&#039;s own configuration tools.&lt;br /&gt;
&lt;br /&gt;
* Exclude license manager components from client desktop installation. (Those are all handled server-side.)&lt;br /&gt;
&lt;br /&gt;
=== License format ===&lt;br /&gt;
* Floating Network License (FNL), &amp;quot;Three-server redundancy&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== License servers ===&lt;br /&gt;
* On client machines, while running the COMSOL installer or license configuration, specify license servers and ports as follows:&lt;br /&gt;
 1718    clicense1&lt;br /&gt;
 1718    clicense2&lt;br /&gt;
 1718    clicense3&lt;br /&gt;
: &#039;&#039;&#039;Note:&#039;&#039;&#039; Use &#039;&#039;short host names only&#039;&#039;. (Technical Reason: The license must be usable both on Carbon&#039;s internal network as well as on divisional networks).&lt;br /&gt;
 1718    clicense1&amp;lt;strike&amp;gt;.cnm.anl.gov&amp;lt;/strike&amp;gt;&lt;br /&gt;
 1718    clicense2&amp;lt;strike&amp;gt;.cnm.anl.gov&amp;lt;/strike&amp;gt;&lt;br /&gt;
 1718    clicense3&amp;lt;strike&amp;gt;.cnm.anl.gov&amp;lt;/strike&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Advanced:&#039;&#039;&#039; A client machine&#039;s COMSOL license file &amp;lt;code&amp;gt;&amp;amp;lt;COMSOLDIR&amp;amp;gt;/Multiphysics/license/license.dat&amp;lt;/code&amp;gt; should look as follows:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;make&amp;quot;&amp;gt;&lt;br /&gt;
SERVER clicense1 ANY 1718&lt;br /&gt;
SERVER clicense2 ANY 1718&lt;br /&gt;
SERVER clicense3 ANY 1718&lt;br /&gt;
USE_SERVER&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;amp;lt;COMSOLDIR&amp;amp;gt;&amp;lt;/code&amp;gt; is located by default at:&lt;br /&gt;
* &#039;&#039;&#039;Windows&#039;&#039;&#039;: C:\Program files\COMSOL\COMSOL&#039;&#039;nn&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Linux&#039;&#039;&#039;: /usr/local/comsol&#039;&#039;nn&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Mac&#039;&#039;&#039;: /Applications/COMSOL&#039;&#039;nn&#039;&#039;&lt;br /&gt;
(&amp;quot;&#039;&#039;nn&#039;&#039;&amp;quot; is the application&#039;s abbreviated version number.)&lt;br /&gt;
&lt;br /&gt;
=== Network Troubleshooting ===&lt;br /&gt;
When using the license access model descibed here (as opposed to tunneled over SSH), ensure the following:&lt;br /&gt;
* Verify that short host names can be resolved to IP addresses. Either one of the following commands should produce sensible output:&lt;br /&gt;
 host clicense1&lt;br /&gt;
: or:&lt;br /&gt;
 ping -c 3 clicense1&lt;br /&gt;
* Verify that &#039;&#039;both license ports on the same server&#039;&#039; can be reached from your client machine:&lt;br /&gt;
 telnet &#039;&#039;&#039;clicense1&#039;&#039;&#039; 1718&lt;br /&gt;
 telnet &#039;&#039;&#039;clicense1&#039;&#039;&#039; 1719&lt;br /&gt;
: or:&lt;br /&gt;
 telnet &#039;&#039;&#039;clicense2&#039;&#039;&#039; 1718&lt;br /&gt;
 telnet &#039;&#039;&#039;clicense2&#039;&#039;&#039; 1719&lt;br /&gt;
: A &#039;&#039;successful&#039;&#039; connection looks like:&lt;br /&gt;
 Trying 146.139.x.y...&lt;br /&gt;
 Connected to clicense1.cnm.anl.gov.&lt;br /&gt;
 Escape character is &#039;^]&#039;.&lt;br /&gt;
:: Do not enter any data. Instead,  close each connection by hitting &amp;lt;code&amp;gt;Ctrl&amp;lt;/code&amp;gt;&amp;lt;code&amp;gt;]&amp;lt;/code&amp;gt; (closing square bracket), followed by &amp;lt;code&amp;gt;Ctrl&amp;lt;/code&amp;gt;&amp;lt;code&amp;gt;D&amp;lt;/code&amp;gt;.&lt;br /&gt;
: A &#039;&#039;failed&#039;&#039; connection gives one of these errors:&lt;br /&gt;
 telnet: connect to address 146.139.x.y: Operation timed out&lt;br /&gt;
: or:&lt;br /&gt;
 telnet: connect to address 146.139.x.y: Connection refused&lt;br /&gt;
:: In these cases, ask that your IP firewall configuration be reviewed and changed.&lt;br /&gt;
&lt;br /&gt;
== License configuration when outside CNM – requires SSH Tunneling ==&lt;br /&gt;
This section documents how to run COMSOL from a network location outside CNM.&lt;br /&gt;
&lt;br /&gt;
As a one-time preparation step, two items must be configured:&lt;br /&gt;
* The license host that COMSOL is to contact, and&lt;br /&gt;
* An SSH connection that will allow your machine to access the COMSOL license server inside CNM&#039;s network.&lt;br /&gt;
&lt;br /&gt;
To then &#039;&#039;run&#039;&#039; the COMSOL application, the configured SSH connection must be up and kept running for the entire time that you run the COMSOL. When you exit COMSOL and wish to start it again, you can keep the SSH connection running, it will be re-used for the next COMSOL run.&lt;br /&gt;
&lt;br /&gt;
=== Configure COMSOL ===&lt;br /&gt;
The following needs to be done just once, typically during COMSOL installation:&lt;br /&gt;
&lt;br /&gt;
In the COMSOL Installer, or in COMSOL Preferences, enter:&lt;br /&gt;
* &#039;&#039;&#039;License format:&#039;&#039;&#039; Floating Network License (FNL), &amp;quot;Port number and Hostname&amp;quot;&lt;br /&gt;
:: &amp;lt;font style=&amp;quot;color:#777&amp;quot;&amp;gt;Do &#039;&#039;not use&#039;&#039; &amp;quot;Three-server redundancy&amp;quot;, since it cannot (easily) be accessed over SSH. Configure with just one server, and in the rare situation of a server failover, temporarily tweak your SSH configuration to contact the alternate server (see below).&amp;lt;/font&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Server:&#039;&#039;&#039; &amp;lt;code&amp;gt;127.0.0.1&amp;lt;/code&amp;gt;&lt;br /&gt;
:: Do not use &amp;quot;localhost&amp;quot;, as COMSOL interprets this incorrectly to mean that your machine &#039;&#039;is&#039;&#039; a license server.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Port:&#039;&#039;&#039; &amp;lt;code&amp;gt;1718&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
Or place a license file with this content:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;make&amp;quot;&amp;gt;&lt;br /&gt;
SERVER 127.0.0.1 ANY 1718&lt;br /&gt;
USE_SERVER&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
//--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Establish connection to CNM license server ===&lt;br /&gt;
This step needs to be done prior to running COMSOL in your desktop session:&lt;br /&gt;
* Connect to &amp;lt;code&amp;gt;mega&amp;lt;/code&amp;gt; with the following command in a terminal window:&lt;br /&gt;
 ssh  -L 1718:&#039;&#039;&#039;clicense1&#039;&#039;&#039;:1718  -L 1719:&#039;&#039;&#039;clicense1&#039;&#039;&#039;:1719  mega.cnm.anl.gov&lt;br /&gt;
* You can leave this connection running in your terminal window across several invocations of COMSOL.&lt;br /&gt;
&lt;br /&gt;
=== Run COMSOL ===&lt;br /&gt;
# Ensure your connection to &amp;quot;mega&amp;quot; is still running. If not, restart it.&lt;br /&gt;
# Start the COMSOL application.&lt;br /&gt;
&lt;br /&gt;
=== Troubleshooting ===&lt;br /&gt;
* If you get an error that the number of licenses is &amp;quot;exhausted&amp;quot;, that is confirmation that you correctly reached the license server, though other users are using licenses.&lt;br /&gt;
* 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:&lt;br /&gt;
 ssh  -L 1718:clicense&#039;&#039;&#039;2&#039;&#039;&#039;:1718  -L 1719:clicense&#039;&#039;&#039;2&#039;&#039;&#039;:1719  mega.cnm.anl.gov&lt;br /&gt;
&lt;br /&gt;
== General License Troubleshooting ==&lt;br /&gt;
The following are typical error messages.&lt;br /&gt;
=== Could not obtain license for COMSOL Multiphysics GUI ===&lt;br /&gt;
* Error details:&lt;br /&gt;
 License error: -4.&lt;br /&gt;
 &#039;&#039;&#039;Licensed number of users already reached.&#039;&#039;&#039;&lt;br /&gt;
 Feature:       COMSOLGUI&lt;br /&gt;
 License path:  /Users/stern/Applications/COMSOL52a/license/license.dat:&lt;br /&gt;
 FlexNet Licensing error:-4,132&lt;br /&gt;
* Reason: The connection to the license server succeeded, but the license token(s) you requested are in use.&lt;br /&gt;
* Solution: Wait a bit, or [http://carbonmgmt/ganglia/lic.php identify who&#039;s using COMSOL] and politely ask the user when they might be finished with their work.&lt;br /&gt;
&lt;br /&gt;
=== License server machine is down or not responding ===&lt;br /&gt;
* Error details:&lt;br /&gt;
  License error: -96.&lt;br /&gt;
  See the system administrator about starting the license server system, or&lt;br /&gt;
  make sure you&#039;re referring to the right host (see LM_LICENSE_FILE).&lt;br /&gt;
 Feature:       SERIAL&lt;br /&gt;
 Hostname:      clicense3&lt;br /&gt;
 License path:  /Users/stern/Applications/COMSOL52a/license/license.dat:&lt;br /&gt;
 FlexNet Licensing error:-96,7&lt;br /&gt;
* Reason: The license servers cannot be reached at all. The &amp;lt;code&amp;gt;ping&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;host&amp;lt;/code&amp;gt; tests mentioned above fail.&lt;br /&gt;
* Solution: Review the client license file and DNS lookup domains.&lt;br /&gt;
&lt;br /&gt;
=== License file does not support this version ===&lt;br /&gt;
* Error details:&lt;br /&gt;
  Feature: SERIAL&lt;br /&gt;
 &#039;&#039;&#039;Application version &amp;gt; License version: 5.21 &amp;gt; 3.5&#039;&#039;&#039;&lt;br /&gt;
 License path: /Users/stern/Applications/COMSOL52a/license/license.dat:&lt;br /&gt;
 FlexNet Licensing error:-21,126&lt;br /&gt;
* 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&#039;re connected to.&lt;br /&gt;
* Solution: When using SSH, try &amp;lt;code&amp;gt;clicense2&amp;lt;/code&amp;gt; instead of  &amp;lt;code&amp;gt;clicense1&amp;lt;/code&amp;gt;, or vice versa. Revisit your &amp;lt;code&amp;gt;~/.ssh/config&amp;lt;/code&amp;gt; file or use the alternate command line as shown in the SSH section above.&lt;br /&gt;
&lt;br /&gt;
== Multiple CPU cores ==&lt;br /&gt;
Ways to start multi-core (from http://www.comsol.com/support/knowledgebase/1096/)&lt;br /&gt;
 comsol -np 8&lt;br /&gt;
&lt;br /&gt;
 export COMSOL_NUM_THREADS=8    # automatically provided on &#039;&#039;Carbon&#039;&#039;&lt;br /&gt;
 comsol&lt;br /&gt;
* COMSOL does not benefit from hyperthreading (oversubscribing the physical core count).&lt;br /&gt;
&lt;br /&gt;
== Batch jobs ==&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
 comsol -clustersimple batch -inputfile input.mph -outputfile output.mph &lt;br /&gt;
&lt;br /&gt;
 &amp;lt;strike&amp;gt;comsol –nn 8 mpd boot&lt;br /&gt;
 comsol –nn 8 batch –inputfile in.mph&lt;br /&gt;
 comsol mpd allexit&amp;lt;/strike&amp;gt;&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
* http://www.comsol.com/support/knowledgebase/1001/ .&lt;br /&gt;
* [[Media:HPC 2012-05-16 Comsol parallel usage.pdf]] (Modified from http://www.comsol.com/support/knowledgebase/1001/files/4027/cluster_install_linux_42a.pptx – Appendix slide, PBS)&lt;br /&gt;
* &#039;&#039;&#039;Note:&#039;&#039;&#039; MPD is not supported on Carbon (I patched the main comsol script), and no longer necessary at all in Comsol-4.3.&lt;br /&gt;
&lt;br /&gt;
=== Sample Job file ===&lt;br /&gt;
See:&lt;br /&gt;
 $COMSOL_HOME/sample.job&lt;br /&gt;
&lt;br /&gt;
== Important COMSOL Support Articles ==&lt;br /&gt;
* Toplevel suport page: https://www.comsol.com/support&lt;br /&gt;
&lt;br /&gt;
=== KB Articles ===&lt;br /&gt;
* [https://www.comsol.com/support/knowledgebase/1001 Running COMSOL® in parallel on clusters]&lt;br /&gt;
* [https://www.comsol.com/support/knowledgebase/1250 Running parametric sweeps, batch sweeps, and cluster sweeps from the command line]&lt;br /&gt;
* [https://www.comsol.com/support/knowledgebase/1255 Reducing the amount of solution data stored in a model]&lt;br /&gt;
* [https://www.comsol.com/support/knowledgebase/830 Handling large models]&lt;br /&gt;
&lt;br /&gt;
=== Blog-style articles ===&lt;br /&gt;
* [https://www.comsol.com/blogs/the-power-of-the-batch-sweep/ The Power of the Batch Sweep]&lt;br /&gt;
* [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]&lt;/div&gt;</summary>
		<author><name>Stern</name></author>
	</entry>
	<entry>
		<id>https://wiki.anl.gov/wiki_cnm/index.php?title=HPC/Applications/comsol&amp;diff=7503</id>
		<title>HPC/Applications/comsol</title>
		<link rel="alternate" type="text/html" href="https://wiki.anl.gov/wiki_cnm/index.php?title=HPC/Applications/comsol&amp;diff=7503"/>
		<updated>2026-03-04T18:30:28Z</updated>

		<summary type="html">&lt;p&gt;Stern: roll back 2 revs.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
The [http://www.comsol.com/products/multiphysics/ &#039;&#039;&#039;COMSOL Multiphysics&#039;&#039;&#039;] application suite&lt;br /&gt;
is available for Mac, Windows, and Linux.&lt;br /&gt;
&lt;br /&gt;
== Access ==&lt;br /&gt;
[[Image:HPC Comsol licensed modules.png|right|450px|thumb|COMSOL features licensed at CNM as of 2024-10.]]&lt;br /&gt;
=== COMSOL Multiphysics ===&lt;br /&gt;
Access to &#039;&#039;&#039;COMSOL Multiphysics&#039;&#039;&#039;, the main application with both a graphical user interface and batch computing capabilities, will be granted &#039;&#039;&#039;&#039;&#039;upon request&#039;&#039;&#039;&#039;&#039;&amp;amp;thinsp;.&lt;br /&gt;
&lt;br /&gt;
You must be:&lt;br /&gt;
* An &#039;&#039;&#039;&#039;&#039;Argonne employee&#039;&#039;&#039;&#039;&#039;&amp;amp;thinsp; in one of the following roles:&lt;br /&gt;
** &#039;&#039;&#039;&#039;&#039;NST staff member&#039;&#039;&#039;&#039;&#039;&amp;amp;thinsp; (including PostDocs, joint appointments, and students at NST).&lt;br /&gt;
** &#039;&#039;&#039;&#039;&#039;CNM Facility User&#039;&#039;&#039;&#039;&#039;&amp;amp;thinsp; (including &#039;&#039;non-NST Argonne employees&#039;&#039;), with an active proposal that has COMSOL in scope. Please see [[HPC/FAQ#Access_and_proposals]].&lt;br /&gt;
&lt;br /&gt;
The set of available COMSOL modules that we have licensed is shown at right.&lt;br /&gt;
&lt;br /&gt;
* The native desktop version can be installed only on &#039;&#039;Argonne-owned&#039;&#039; computers (laptop or desktop). Please contact [mailto:help@anl.gov?Subject=COMSOL%20license%20access%20request CNM support]. Make sure to review [http://www.comsol.com/support/updates/ Product Updates].&lt;br /&gt;
* To run COMSOL on our HPC system &#039;&#039;Carbon&#039;&#039;, as GUI or as batch computing jobs, your proposal must have &#039;&#039;Carbon&#039;&#039; access in scope.&lt;br /&gt;
&lt;br /&gt;
=== COMSOL Server ===&lt;br /&gt;
&#039;&#039;CNM Facility Users&#039;&#039; who are not Argonne employees are not eligible to access&lt;br /&gt;
the full &#039;&#039;&#039;COMSOL Multiphysics&#039;&#039;&#039; product, in compliance with its licensing terms and conditions.&lt;br /&gt;
However, the [https://www.comsol.com/comsol-server &#039;&#039;&#039;COMSOL Server&#039;&#039;&#039;] product offers an alternative&lt;br /&gt;
albeit more narrow means of access.&lt;br /&gt;
&lt;br /&gt;
All users, including &#039;&#039;&#039;&#039;&#039;non-Argonne users&#039;&#039;&#039;&#039;&#039; may be able to run, over a web interface in their browser,&lt;br /&gt;
pre-parameterized &amp;quot;fixed-model&amp;quot; simulations that were made with the &#039;&#039;&#039;COMSOL Application Builder&#039;&#039;&#039; (requires Windows).&lt;br /&gt;
&lt;br /&gt;
To inquire about using COMSOL server applications,&lt;br /&gt;
please contact us.&lt;br /&gt;
&amp;lt;!-- [mailto:cnm_useroffice@anl.gov?Subject=COMSOL%20server%20usage Support]. --&amp;gt;&lt;br /&gt;
We will review possible purchase paths for COMSOL Server, and the &#039;&#039;considerable effort&#039;&#039; likely required by users and the CNM to develop and deploy a COMSOL application.&lt;br /&gt;
&lt;br /&gt;
== Support ==&lt;br /&gt;
* For questions on how to run or start COMSOL:&lt;br /&gt;
*: Submit an [[HPC/Support | &#039;&#039;&#039;IT support request&#039;&#039;&#039;]]&lt;br /&gt;
* For questions related to most COMSOL data or scripts, contact COMSOL support at:&lt;br /&gt;
*: [mailto:support@comsol.com &#039;&#039;&#039;support&#039;&#039;&#039;@comsol.com]&lt;br /&gt;
* &#039;&#039;&#039;Exception:&#039;&#039;&#039; If your support question might contain data that is subject to &#039;&#039;&#039;US Export Control&#039;&#039;&#039; regulations, contact instead:&lt;br /&gt;
*: [mailto:us-export-control@us.comsol.com &#039;&#039;&#039;us-export-control&#039;&#039;&#039;@&#039;&#039;&#039;us&#039;&#039;&#039;.comsol.com]&lt;br /&gt;
&lt;br /&gt;
== The modes to run COMSOL ==&lt;br /&gt;
There are several ways of running COMSOL.&lt;br /&gt;
&lt;br /&gt;
=== Running the desktop application ===&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
# Run on your &#039;&#039;Argonne-provided&#039;&#039; computer, checking out Carbon&#039;s license remotely.&lt;br /&gt;
#* Requires a full installation of COMSOL on your desktop or laptop computer.&lt;br /&gt;
#* 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.&lt;br /&gt;
# Run on Carbon, display on your desktop using the [http://en.wikipedia.org/wiki/X_Window_System X Window system (X11)].&lt;br /&gt;
#* Requires an &#039;&#039;X11 Server&#039;&#039; application running on your client machine, and SSH X11 forwarding.&lt;br /&gt;
#* The X11 protocol can be slow over LAN.&lt;br /&gt;
# Run on Carbon in a [[HPC/Network Access/Virtual Desktop | virtual desktop environment (VNC)]], viewed in a VNC client on your machine.&lt;br /&gt;
#* Requires a VNC client on your machine.&lt;br /&gt;
#* It can be confusing where VNC and the app runs.&lt;br /&gt;
#* The virtual desktop presents a (deliberatly) sparse windowing environment – Copy&amp;amp;Paste can be difficult to use.&lt;br /&gt;
&lt;br /&gt;
=== Running a batch calculation ===&lt;br /&gt;
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.&lt;br /&gt;
See the [[#Batch jobs|section below]].&lt;br /&gt;
&lt;br /&gt;
== Native desktop version ==&lt;br /&gt;
&lt;br /&gt;
To get the fastest response from the COMSOL GUI, run a native COMSOL version on your desktop machine or laptop, called &#039;&#039;client machine&#039;&#039; below.&lt;br /&gt;
&lt;br /&gt;
Enter license details either in the COMSOL Setup configuration dialog.&lt;br /&gt;
&lt;br /&gt;
== Native desktop version — License configuration ==&lt;br /&gt;
A client&#039;s COMSOL license needs to be configured depending on how the client reaches CNM network resources. Follow the appropriate section:&lt;br /&gt;
&lt;br /&gt;
* [[#License configuration when inside CNM or on CNM VPN|License configuration when &#039;&#039;&#039;inside CNM&#039;&#039;&#039; or on &#039;&#039;&#039;CNM VPN&#039;&#039;&#039;]]&lt;br /&gt;
: Requires that the user&#039;s machine is logically within the network of CNM/NST, either by a wired/auth WiFi connection in the building or by VPN under a CNM/NST profile.&lt;br /&gt;
* [[#License configuration when outside CNM – requires SSH Tunneling|License configuration when &#039;&#039;&#039;outside CNM&#039;&#039;&#039; – requires SSH Tunneling]]&lt;br /&gt;
: &#039;&#039;Non-NST staff&#039;&#039; usually have a VPN profile that places the machine logically [[#License configuration when outside CNM – requires SSH Tunneling|outside of NST&#039;s network.]]&lt;br /&gt;
&lt;br /&gt;
== Use with X11 ==&lt;br /&gt;
For casual use, and with [[HPC/Network Access/SSH Tunnel Setup on Linux and MacOS | X11 tunneling to Carbon]] set up, simply add to your &amp;lt;code&amp;gt;~/.bashrc&amp;lt;/code&amp;gt; file on Carbon:&lt;br /&gt;
 module load comsol&lt;br /&gt;
&lt;br /&gt;
Then, from the command line on a Carbon login node, start the COMSOL GUI:&lt;br /&gt;
 comsol &amp;amp;&lt;br /&gt;
&lt;br /&gt;
License configuration is automatic on Carbon.&lt;br /&gt;
&lt;br /&gt;
Comsol will use a number of cores to run calculations multithreaded by default. (On Carbon, COMSOL_NUM_THREADS is set.)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Quit the application&#039;&#039;&#039; as soon as you are done. Only one user can use Comsol at a time.&lt;br /&gt;
&lt;br /&gt;
== Use with VNC ==&lt;br /&gt;
See general  [[HPC/Network Access/Virtual Desktop | instructions on using VNC]], and the COMSOL example therein.&lt;br /&gt;
&lt;br /&gt;
== License configuration when inside CNM or on CNM VPN ==&lt;br /&gt;
=== &amp;lt;span style=&amp;quot;color:#A00;&amp;quot;&amp;gt;Ensure correct DNS search domains&amp;lt;/span&amp;gt; ===&lt;br /&gt;
* Inspect the client machine&#039;s network configuration.&lt;br /&gt;
* Ensure that &#039;&#039;&#039;two&#039;&#039;&#039; entries are listed as DNS Search Domains for the current network profile:&lt;br /&gt;
 nst.anl.gov&lt;br /&gt;
 cnm.anl.gov&lt;br /&gt;
: (The order of entries does not matter for the purposes considered here.)&lt;br /&gt;
* If the client machine is &#039;&#039;wired to CNM networks&#039;&#039;, the domains are normally provided correctly by DHCP.&lt;br /&gt;
* If the client machine is &#039;&#039;connected over VPN&#039;&#039;, you may need edit the respective network profile.&lt;br /&gt;
:* 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 &amp;quot;Advanced…&amp;quot;. It appears that those changes are being saved and will be activated automatically the next time that this VPN session gets started.&lt;br /&gt;
: [[Image:VNC_add_cnm_to_DNS_1.png|400px]] [[Image:VNC_add_cnm_to_DNS_2.png|400px]]&lt;br /&gt;
:* On Windows or Linux machines, take &#039;&#039;analogous&#039;&#039; steps, using the platform&#039;s own configuration tools.&lt;br /&gt;
&lt;br /&gt;
* Exclude license manager components from client desktop installation. (Those are all handled server-side.)&lt;br /&gt;
&lt;br /&gt;
=== License format ===&lt;br /&gt;
* Floating Network License (FNL), &amp;quot;Three-server redundancy&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== License servers ===&lt;br /&gt;
* On client machines, while running the COMSOL installer or license configuration, specify license servers and ports as follows:&lt;br /&gt;
 1718    clicense1&lt;br /&gt;
 1718    clicense2&lt;br /&gt;
 1718    clicense3&lt;br /&gt;
: &#039;&#039;&#039;Note:&#039;&#039;&#039; Use &#039;&#039;short host names only&#039;&#039;. (Technical Reason: The license must be usable both on Carbon&#039;s internal network as well as on divisional networks).&lt;br /&gt;
 1718    clicense1&amp;lt;strike&amp;gt;.cnm.anl.gov&amp;lt;/strike&amp;gt;&lt;br /&gt;
 1718    clicense2&amp;lt;strike&amp;gt;.cnm.anl.gov&amp;lt;/strike&amp;gt;&lt;br /&gt;
 1718    clicense3&amp;lt;strike&amp;gt;.cnm.anl.gov&amp;lt;/strike&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Advanced:&#039;&#039;&#039; A client machine&#039;s COMSOL license file &amp;lt;code&amp;gt;&amp;amp;lt;COMSOLDIR&amp;amp;gt;/Multiphysics/license/license.dat&amp;lt;/code&amp;gt; should look as follows:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;make&amp;quot;&amp;gt;&lt;br /&gt;
SERVER clicense1 ANY 1718&lt;br /&gt;
SERVER clicense2 ANY 1718&lt;br /&gt;
SERVER clicense3 ANY 1718&lt;br /&gt;
USE_SERVER&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;amp;lt;COMSOLDIR&amp;amp;gt;&amp;lt;/code&amp;gt; is located by default at:&lt;br /&gt;
* &#039;&#039;&#039;Windows&#039;&#039;&#039;: C:\Program files\COMSOL\COMSOL&#039;&#039;nn&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Linux&#039;&#039;&#039;: /usr/local/comsol&#039;&#039;nn&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Mac&#039;&#039;&#039;: /Applications/COMSOL&#039;&#039;nn&#039;&#039;&lt;br /&gt;
(&amp;quot;&#039;&#039;nn&#039;&#039;&amp;quot; is the application&#039;s abbreviated version number.)&lt;br /&gt;
&lt;br /&gt;
=== Network Troubleshooting ===&lt;br /&gt;
When using the license access model descibed here (as opposed to tunneled over SSH), ensure the following:&lt;br /&gt;
* Verify that short host names can be resolved to IP addresses. Either one of the following commands should produce sensible output:&lt;br /&gt;
 host clicense1&lt;br /&gt;
: or:&lt;br /&gt;
 ping -c 3 clicense1&lt;br /&gt;
* Verify that &#039;&#039;both license ports on the same server&#039;&#039; can be reached from your client machine:&lt;br /&gt;
 telnet &#039;&#039;&#039;clicense1&#039;&#039;&#039; 1718&lt;br /&gt;
 telnet &#039;&#039;&#039;clicense1&#039;&#039;&#039; 1719&lt;br /&gt;
: or:&lt;br /&gt;
 telnet &#039;&#039;&#039;clicense2&#039;&#039;&#039; 1718&lt;br /&gt;
 telnet &#039;&#039;&#039;clicense2&#039;&#039;&#039; 1719&lt;br /&gt;
: A &#039;&#039;successful&#039;&#039; connection looks like:&lt;br /&gt;
 Trying 146.139.x.y...&lt;br /&gt;
 Connected to clicense1.cnm.anl.gov.&lt;br /&gt;
 Escape character is &#039;^]&#039;.&lt;br /&gt;
:: Do not enter any data. Instead,  close each connection by hitting &amp;lt;code&amp;gt;Ctrl&amp;lt;/code&amp;gt;&amp;lt;code&amp;gt;]&amp;lt;/code&amp;gt; (closing square bracket), followed by &amp;lt;code&amp;gt;Ctrl&amp;lt;/code&amp;gt;&amp;lt;code&amp;gt;D&amp;lt;/code&amp;gt;.&lt;br /&gt;
: A &#039;&#039;failed&#039;&#039; connection gives one of these errors:&lt;br /&gt;
 telnet: connect to address 146.139.x.y: Operation timed out&lt;br /&gt;
: or:&lt;br /&gt;
 telnet: connect to address 146.139.x.y: Connection refused&lt;br /&gt;
:: In these cases, ask that your IP firewall configuration be reviewed and changed.&lt;br /&gt;
&lt;br /&gt;
== License configuration when outside CNM – requires SSH Tunneling ==&lt;br /&gt;
This section documents how to run COMSOL from a network location outside CNM.&lt;br /&gt;
&lt;br /&gt;
As a one-time preparation step, two items must be configured:&lt;br /&gt;
* The license host that COMSOL is to contact, and&lt;br /&gt;
* An SSH connection that will allow your machine to access the COMSOL license server inside CNM&#039;s network.&lt;br /&gt;
&lt;br /&gt;
To then &#039;&#039;run&#039;&#039; the COMSOL application, the configured SSH connection must be up and kept running for the entire time that you run the COMSOL. When you exit COMSOL and wish to start it again, you can keep the SSH connection running, it will be re-used for the next COMSOL run.&lt;br /&gt;
&lt;br /&gt;
=== Configure COMSOL ===&lt;br /&gt;
The following needs to be done just once, typically during COMSOL installation:&lt;br /&gt;
&lt;br /&gt;
In the COMSOL Installer, or in COMSOL Preferences, enter:&lt;br /&gt;
* &#039;&#039;&#039;License format:&#039;&#039;&#039; Floating Network License (FNL), &amp;quot;Port number and Hostname&amp;quot;&lt;br /&gt;
:: &amp;lt;font style=&amp;quot;color:#777&amp;quot;&amp;gt;Do &#039;&#039;not use&#039;&#039; &amp;quot;Three-server redundancy&amp;quot;, since it cannot (easily) be accessed over SSH. Configure with just one server, and in the rare situation of a server failover, temporarily tweak your SSH configuration to contact the alternate server (see below).&amp;lt;/font&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Server:&#039;&#039;&#039; &amp;lt;code&amp;gt;127.0.0.1&amp;lt;/code&amp;gt;&lt;br /&gt;
:: Do not use &amp;quot;localhost&amp;quot;, as COMSOL interprets this incorrectly to mean that your machine &#039;&#039;is&#039;&#039; a license server.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Port:&#039;&#039;&#039; &amp;lt;code&amp;gt;1718&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
Or place a license file with this content:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;make&amp;quot;&amp;gt;&lt;br /&gt;
SERVER 127.0.0.1 ANY 1718&lt;br /&gt;
USE_SERVER&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
//--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Establish connection to CNM license server ===&lt;br /&gt;
This step needs to be done prior to running COMSOL in your desktop session:&lt;br /&gt;
* Connect to &amp;lt;code&amp;gt;mega&amp;lt;/code&amp;gt; with the following command in a terminal window:&lt;br /&gt;
 ssh  -L 1718:&#039;&#039;&#039;clicense1&#039;&#039;&#039;:1718  -L 1719:&#039;&#039;&#039;clicense1&#039;&#039;&#039;:1719  mega.cnm.anl.gov&lt;br /&gt;
* You can leave this connection running in your terminal window across several invocations of COMSOL.&lt;br /&gt;
&lt;br /&gt;
=== Run COMSOL ===&lt;br /&gt;
# Ensure your connection to &amp;quot;mega&amp;quot; is still running. If not, restart it.&lt;br /&gt;
# Start the COMSOL application.&lt;br /&gt;
&lt;br /&gt;
=== Troubleshooting ===&lt;br /&gt;
* If you get an error that the number of licenses is &amp;quot;exhausted&amp;quot;, that is confirmation that you correctly reached the license server, though other users are using licenses.&lt;br /&gt;
* 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:&lt;br /&gt;
 ssh  -L 1718:clicense&#039;&#039;&#039;2&#039;&#039;&#039;:1718  -L 1719:clicense&#039;&#039;&#039;2&#039;&#039;&#039;:1719  mega.cnm.anl.gov&lt;br /&gt;
&lt;br /&gt;
== General License Troubleshooting ==&lt;br /&gt;
The following are typical error messages.&lt;br /&gt;
=== Could not obtain license for COMSOL Multiphysics GUI ===&lt;br /&gt;
* Error details:&lt;br /&gt;
 License error: -4.&lt;br /&gt;
 &#039;&#039;&#039;Licensed number of users already reached.&#039;&#039;&#039;&lt;br /&gt;
 Feature:       COMSOLGUI&lt;br /&gt;
 License path:  /Users/stern/Applications/COMSOL52a/license/license.dat:&lt;br /&gt;
 FlexNet Licensing error:-4,132&lt;br /&gt;
* Reason: The connection to the license server succeeded, but the license token(s) you requested are in use.&lt;br /&gt;
* Solution: Wait a bit, or [http://carbonmgmt/ganglia/lic.php identify who&#039;s using COMSOL] and politely ask the user when they might be finished with their work.&lt;br /&gt;
&lt;br /&gt;
=== License server machine is down or not responding ===&lt;br /&gt;
* Error details:&lt;br /&gt;
  License error: -96.&lt;br /&gt;
  See the system administrator about starting the license server system, or&lt;br /&gt;
  make sure you&#039;re referring to the right host (see LM_LICENSE_FILE).&lt;br /&gt;
 Feature:       SERIAL&lt;br /&gt;
 Hostname:      clicense3&lt;br /&gt;
 License path:  /Users/stern/Applications/COMSOL52a/license/license.dat:&lt;br /&gt;
 FlexNet Licensing error:-96,7&lt;br /&gt;
* Reason: The license servers cannot be reached at all. The &amp;lt;code&amp;gt;ping&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;host&amp;lt;/code&amp;gt; tests mentioned above fail.&lt;br /&gt;
* Solution: Review the client license file and DNS lookup domains.&lt;br /&gt;
&lt;br /&gt;
=== License file does not support this version ===&lt;br /&gt;
* Error details:&lt;br /&gt;
  Feature: SERIAL&lt;br /&gt;
 &#039;&#039;&#039;Application version &amp;gt; License version: 5.21 &amp;gt; 3.5&#039;&#039;&#039;&lt;br /&gt;
 License path: /Users/stern/Applications/COMSOL52a/license/license.dat:&lt;br /&gt;
 FlexNet Licensing error:-21,126&lt;br /&gt;
* 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&#039;re connected to.&lt;br /&gt;
* Solution: When using SSH, try &amp;lt;code&amp;gt;clicense2&amp;lt;/code&amp;gt; instead of  &amp;lt;code&amp;gt;clicense1&amp;lt;/code&amp;gt;, or vice versa. Revisit your &amp;lt;code&amp;gt;~/.ssh/config&amp;lt;/code&amp;gt; file or use the alternate command line as shown in the SSH section above.&lt;br /&gt;
&lt;br /&gt;
== Multiple CPU cores ==&lt;br /&gt;
Ways to start multi-core (from http://www.comsol.com/support/knowledgebase/1096/)&lt;br /&gt;
 comsol -np 8&lt;br /&gt;
&lt;br /&gt;
 export COMSOL_NUM_THREADS=8    # automatically provided on &#039;&#039;Carbon&#039;&#039;&lt;br /&gt;
 comsol&lt;br /&gt;
* COMSOL does not benefit from hyperthreading (oversubscribing the physical core count).&lt;br /&gt;
&lt;br /&gt;
== Batch jobs ==&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
 comsol -clustersimple batch -inputfile input.mph -outputfile output.mph &lt;br /&gt;
&lt;br /&gt;
 &amp;lt;strike&amp;gt;comsol –nn 8 mpd boot&lt;br /&gt;
 comsol –nn 8 batch –inputfile in.mph&lt;br /&gt;
 comsol mpd allexit&amp;lt;/strike&amp;gt;&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
* http://www.comsol.com/support/knowledgebase/1001/ .&lt;br /&gt;
* [[Media:HPC 2012-05-16 Comsol parallel usage.pdf]] (Modified from http://www.comsol.com/support/knowledgebase/1001/files/4027/cluster_install_linux_42a.pptx – Appendix slide, PBS)&lt;br /&gt;
* &#039;&#039;&#039;Note:&#039;&#039;&#039; MPD is not supported on Carbon (I patched the main comsol script), and no longer necessary at all in Comsol-4.3.&lt;br /&gt;
&lt;br /&gt;
=== Sample Job file ===&lt;br /&gt;
See:&lt;br /&gt;
 $COMSOL_HOME/sample.job&lt;br /&gt;
&lt;br /&gt;
== Important COMSOL Support Articles ==&lt;br /&gt;
* Toplevel suport page: https://www.comsol.com/support&lt;br /&gt;
&lt;br /&gt;
=== KB Articles ===&lt;br /&gt;
* [https://www.comsol.com/support/knowledgebase/1001 Running COMSOL® in parallel on clusters]&lt;br /&gt;
* [https://www.comsol.com/support/knowledgebase/1250 Running parametric sweeps, batch sweeps, and cluster sweeps from the command line]&lt;br /&gt;
* [https://www.comsol.com/support/knowledgebase/1255 Reducing the amount of solution data stored in a model]&lt;br /&gt;
* [https://www.comsol.com/support/knowledgebase/830 Handling large models]&lt;br /&gt;
&lt;br /&gt;
=== Blog-style articles ===&lt;br /&gt;
* [https://www.comsol.com/blogs/the-power-of-the-batch-sweep/ The Power of the Batch Sweep]&lt;br /&gt;
* [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]&lt;/div&gt;</summary>
		<author><name>Stern</name></author>
	</entry>
	<entry>
		<id>https://wiki.anl.gov/wiki_cnm/index.php?title=HPC/Applications/comsol&amp;diff=7502</id>
		<title>HPC/Applications/comsol</title>
		<link rel="alternate" type="text/html" href="https://wiki.anl.gov/wiki_cnm/index.php?title=HPC/Applications/comsol&amp;diff=7502"/>
		<updated>2026-03-04T18:27:27Z</updated>

		<summary type="html">&lt;p&gt;Stern: /* Native desktop version — License configuration */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
The [http://www.comsol.com/products/multiphysics/ &#039;&#039;&#039;COMSOL Multiphysics&#039;&#039;&#039;] application suite&lt;br /&gt;
is available for Mac, Windows, and Linux.&lt;br /&gt;
&lt;br /&gt;
== Access ==&lt;br /&gt;
[[Image:HPC Comsol licensed modules.png|right|450px|thumb|COMSOL features licensed at CNM as of 2024-10.]]&lt;br /&gt;
=== COMSOL Multiphysics ===&lt;br /&gt;
Access to &#039;&#039;&#039;COMSOL Multiphysics&#039;&#039;&#039;, the main application with both a graphical user interface and batch computing capabilities, will be granted &#039;&#039;&#039;&#039;&#039;upon request&#039;&#039;&#039;&#039;&#039;&amp;amp;thinsp;.&lt;br /&gt;
&lt;br /&gt;
You must be:&lt;br /&gt;
* An &#039;&#039;&#039;&#039;&#039;Argonne employee&#039;&#039;&#039;&#039;&#039;&amp;amp;thinsp; in one of the following roles:&lt;br /&gt;
** &#039;&#039;&#039;&#039;&#039;NST staff member&#039;&#039;&#039;&#039;&#039;&amp;amp;thinsp; (including PostDocs, joint appointments, and students at NST).&lt;br /&gt;
** &#039;&#039;&#039;&#039;&#039;CNM Facility User&#039;&#039;&#039;&#039;&#039;&amp;amp;thinsp; (including &#039;&#039;non-NST Argonne employees&#039;&#039;), with an active proposal that has COMSOL in scope. Please see [[HPC/FAQ#Access_and_proposals]].&lt;br /&gt;
&lt;br /&gt;
The set of available COMSOL modules that we have licensed is shown at right.&lt;br /&gt;
&lt;br /&gt;
* The native desktop version can be installed only on &#039;&#039;Argonne-owned&#039;&#039; computers (laptop or desktop). Please contact [mailto:help@anl.gov?Subject=COMSOL%20license%20access%20request CNM support]. Make sure to review [http://www.comsol.com/support/updates/ Product Updates].&lt;br /&gt;
* To run COMSOL on our HPC system &#039;&#039;Carbon&#039;&#039;, as GUI or as batch computing jobs, your proposal must have &#039;&#039;Carbon&#039;&#039; access in scope.&lt;br /&gt;
&lt;br /&gt;
=== COMSOL Server ===&lt;br /&gt;
&#039;&#039;CNM Facility Users&#039;&#039; who are not Argonne employees are not eligible to access&lt;br /&gt;
the full &#039;&#039;&#039;COMSOL Multiphysics&#039;&#039;&#039; product, in compliance with its licensing terms and conditions.&lt;br /&gt;
However, the [https://www.comsol.com/comsol-server &#039;&#039;&#039;COMSOL Server&#039;&#039;&#039;] product offers an alternative&lt;br /&gt;
albeit more narrow means of access.&lt;br /&gt;
&lt;br /&gt;
All users, including &#039;&#039;&#039;&#039;&#039;non-Argonne users&#039;&#039;&#039;&#039;&#039; may be able to run, over a web interface in their browser,&lt;br /&gt;
pre-parameterized &amp;quot;fixed-model&amp;quot; simulations that were made with the &#039;&#039;&#039;COMSOL Application Builder&#039;&#039;&#039; (requires Windows).&lt;br /&gt;
&lt;br /&gt;
To inquire about using COMSOL server applications,&lt;br /&gt;
please contact us.&lt;br /&gt;
&amp;lt;!-- [mailto:cnm_useroffice@anl.gov?Subject=COMSOL%20server%20usage Support]. --&amp;gt;&lt;br /&gt;
We will review possible purchase paths for COMSOL Server, and the &#039;&#039;considerable effort&#039;&#039; likely required by users and the CNM to develop and deploy a COMSOL application.&lt;br /&gt;
&lt;br /&gt;
== Support ==&lt;br /&gt;
* For questions on how to run or start COMSOL:&lt;br /&gt;
*: Submit an [[HPC/Support | &#039;&#039;&#039;IT support request&#039;&#039;&#039;]]&lt;br /&gt;
* For questions related to most COMSOL data or scripts, contact COMSOL support at:&lt;br /&gt;
*: [mailto:support@comsol.com &#039;&#039;&#039;support&#039;&#039;&#039;@comsol.com]&lt;br /&gt;
* &#039;&#039;&#039;Exception:&#039;&#039;&#039; If your support question might contain data that is subject to &#039;&#039;&#039;US Export Control&#039;&#039;&#039; regulations, contact instead:&lt;br /&gt;
*: [mailto:us-export-control@us.comsol.com &#039;&#039;&#039;us-export-control&#039;&#039;&#039;@&#039;&#039;&#039;us&#039;&#039;&#039;.comsol.com]&lt;br /&gt;
&lt;br /&gt;
== The modes to run COMSOL ==&lt;br /&gt;
There are several ways of running COMSOL.&lt;br /&gt;
&lt;br /&gt;
=== Running the desktop application ===&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
# Run on your &#039;&#039;Argonne-provided&#039;&#039; computer, checking out Carbon&#039;s license remotely.&lt;br /&gt;
#* Requires a full installation of COMSOL on your desktop or laptop computer.&lt;br /&gt;
#* 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.&lt;br /&gt;
# Run on Carbon, display on your desktop using the [http://en.wikipedia.org/wiki/X_Window_System X Window system (X11)].&lt;br /&gt;
#* Requires an &#039;&#039;X11 Server&#039;&#039; application running on your client machine, and SSH X11 forwarding.&lt;br /&gt;
#* The X11 protocol can be slow over LAN.&lt;br /&gt;
# Run on Carbon in a [[HPC/Network Access/Virtual Desktop | virtual desktop environment (VNC)]], viewed in a VNC client on your machine.&lt;br /&gt;
#* Requires a VNC client on your machine.&lt;br /&gt;
#* It can be confusing where VNC and the app runs.&lt;br /&gt;
#* The virtual desktop presents a (deliberatly) sparse windowing environment – Copy&amp;amp;Paste can be difficult to use.&lt;br /&gt;
&lt;br /&gt;
=== Running a batch calculation ===&lt;br /&gt;
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.&lt;br /&gt;
See the [[#Batch jobs|section below]].&lt;br /&gt;
&lt;br /&gt;
== Native desktop version ==&lt;br /&gt;
&lt;br /&gt;
To get the fastest response from the COMSOL GUI, run a native COMSOL version on your desktop machine or laptop, called &#039;&#039;client machine&#039;&#039; below.&lt;br /&gt;
&lt;br /&gt;
Enter license details either in the COMSOL Setup configuration dialog.&lt;br /&gt;
&lt;br /&gt;
=== License configuration ===&lt;br /&gt;
A client&#039;s COMSOL license needs to be configured depending on how the client reaches CNM network resources. Follow the appropriate section:&lt;br /&gt;
&lt;br /&gt;
* [[#License configuration when inside CNM or on CNM VPN|License configuration when &#039;&#039;&#039;inside CNM&#039;&#039;&#039; or on &#039;&#039;&#039;CNM VPN&#039;&#039;&#039;]]&lt;br /&gt;
: Requires that the user&#039;s machine is logically within the network of CNM/NST, either by a wired/auth WiFi connection in the building or by VPN under a CNM/NST profile.&lt;br /&gt;
* [[#License configuration when outside CNM – requires SSH Tunneling|License configuration when &#039;&#039;&#039;outside CNM&#039;&#039;&#039; – requires SSH Tunneling]]&lt;br /&gt;
: &#039;&#039;Non-NST staff&#039;&#039; usually have a VPN profile that places the machine logically [[#License configuration when outside CNM – requires SSH Tunneling|outside of NST&#039;s network.]]&lt;br /&gt;
&lt;br /&gt;
== Use with X11 ==&lt;br /&gt;
For casual use, and with [[HPC/Network Access/SSH Tunnel Setup on Linux and MacOS | X11 tunneling to Carbon]] set up, simply add to your &amp;lt;code&amp;gt;~/.bashrc&amp;lt;/code&amp;gt; file on Carbon:&lt;br /&gt;
 module load comsol&lt;br /&gt;
&lt;br /&gt;
Then, from the command line on a Carbon login node, start the COMSOL GUI:&lt;br /&gt;
 comsol &amp;amp;&lt;br /&gt;
&lt;br /&gt;
License configuration is automatic on Carbon.&lt;br /&gt;
&lt;br /&gt;
Comsol will use a number of cores to run calculations multithreaded by default. (On Carbon, COMSOL_NUM_THREADS is set.)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Quit the application&#039;&#039;&#039; as soon as you are done. Only one user can use Comsol at a time.&lt;br /&gt;
&lt;br /&gt;
== Use with VNC ==&lt;br /&gt;
See general  [[HPC/Network Access/Virtual Desktop | instructions on using VNC]], and the COMSOL example therein.&lt;br /&gt;
&lt;br /&gt;
== License configuration when inside CNM or on CNM VPN ==&lt;br /&gt;
=== &amp;lt;span style=&amp;quot;color:#A00;&amp;quot;&amp;gt;Ensure correct DNS search domains&amp;lt;/span&amp;gt; ===&lt;br /&gt;
* Inspect the client machine&#039;s network configuration.&lt;br /&gt;
* Ensure that &#039;&#039;&#039;two&#039;&#039;&#039; entries are listed as DNS Search Domains for the current network profile:&lt;br /&gt;
 nst.anl.gov&lt;br /&gt;
 cnm.anl.gov&lt;br /&gt;
: (The order of entries does not matter for the purposes considered here.)&lt;br /&gt;
* If the client machine is &#039;&#039;wired to CNM networks&#039;&#039;, the domains are normally provided correctly by DHCP.&lt;br /&gt;
* If the client machine is &#039;&#039;connected over VPN&#039;&#039;, you may need edit the respective network profile.&lt;br /&gt;
:* 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 &amp;quot;Advanced…&amp;quot;. It appears that those changes are being saved and will be activated automatically the next time that this VPN session gets started.&lt;br /&gt;
: [[Image:VNC_add_cnm_to_DNS_1.png|400px]] [[Image:VNC_add_cnm_to_DNS_2.png|400px]]&lt;br /&gt;
:* On Windows or Linux machines, take &#039;&#039;analogous&#039;&#039; steps, using the platform&#039;s own configuration tools.&lt;br /&gt;
&lt;br /&gt;
* Exclude license manager components from client desktop installation. (Those are all handled server-side.)&lt;br /&gt;
&lt;br /&gt;
=== License format ===&lt;br /&gt;
* Floating Network License (FNL), &amp;quot;Three-server redundancy&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== License servers ===&lt;br /&gt;
* On client machines, while running the COMSOL installer or license configuration, specify license servers and ports as follows:&lt;br /&gt;
 1718    clicense1&lt;br /&gt;
 1718    clicense2&lt;br /&gt;
 1718    clicense3&lt;br /&gt;
: &#039;&#039;&#039;Note:&#039;&#039;&#039; Use &#039;&#039;short host names only&#039;&#039;. (Technical Reason: The license must be usable both on Carbon&#039;s internal network as well as on divisional networks).&lt;br /&gt;
 1718    clicense1&amp;lt;strike&amp;gt;.cnm.anl.gov&amp;lt;/strike&amp;gt;&lt;br /&gt;
 1718    clicense2&amp;lt;strike&amp;gt;.cnm.anl.gov&amp;lt;/strike&amp;gt;&lt;br /&gt;
 1718    clicense3&amp;lt;strike&amp;gt;.cnm.anl.gov&amp;lt;/strike&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Advanced:&#039;&#039;&#039; A client machine&#039;s COMSOL license file &amp;lt;code&amp;gt;&amp;amp;lt;COMSOLDIR&amp;amp;gt;/Multiphysics/license/license.dat&amp;lt;/code&amp;gt; should look as follows:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;make&amp;quot;&amp;gt;&lt;br /&gt;
SERVER clicense1 ANY 1718&lt;br /&gt;
SERVER clicense2 ANY 1718&lt;br /&gt;
SERVER clicense3 ANY 1718&lt;br /&gt;
USE_SERVER&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;amp;lt;COMSOLDIR&amp;amp;gt;&amp;lt;/code&amp;gt; is located by default at:&lt;br /&gt;
* &#039;&#039;&#039;Windows&#039;&#039;&#039;: C:\Program files\COMSOL\COMSOL&#039;&#039;nn&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Linux&#039;&#039;&#039;: /usr/local/comsol&#039;&#039;nn&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Mac&#039;&#039;&#039;: /Applications/COMSOL&#039;&#039;nn&#039;&#039;&lt;br /&gt;
(&amp;quot;&#039;&#039;nn&#039;&#039;&amp;quot; is the application&#039;s abbreviated version number.)&lt;br /&gt;
&lt;br /&gt;
=== Network Troubleshooting ===&lt;br /&gt;
When using the license access model descibed here (as opposed to tunneled over SSH), ensure the following:&lt;br /&gt;
* Verify that short host names can be resolved to IP addresses. Either one of the following commands should produce sensible output:&lt;br /&gt;
 host clicense1&lt;br /&gt;
: or:&lt;br /&gt;
 ping -c 3 clicense1&lt;br /&gt;
* Verify that &#039;&#039;both license ports on the same server&#039;&#039; can be reached from your client machine:&lt;br /&gt;
 telnet &#039;&#039;&#039;clicense1&#039;&#039;&#039; 1718&lt;br /&gt;
 telnet &#039;&#039;&#039;clicense1&#039;&#039;&#039; 1719&lt;br /&gt;
: or:&lt;br /&gt;
 telnet &#039;&#039;&#039;clicense2&#039;&#039;&#039; 1718&lt;br /&gt;
 telnet &#039;&#039;&#039;clicense2&#039;&#039;&#039; 1719&lt;br /&gt;
: A &#039;&#039;successful&#039;&#039; connection looks like:&lt;br /&gt;
 Trying 146.139.x.y...&lt;br /&gt;
 Connected to clicense1.cnm.anl.gov.&lt;br /&gt;
 Escape character is &#039;^]&#039;.&lt;br /&gt;
:: Do not enter any data. Instead,  close each connection by hitting &amp;lt;code&amp;gt;Ctrl&amp;lt;/code&amp;gt;&amp;lt;code&amp;gt;]&amp;lt;/code&amp;gt; (closing square bracket), followed by &amp;lt;code&amp;gt;Ctrl&amp;lt;/code&amp;gt;&amp;lt;code&amp;gt;D&amp;lt;/code&amp;gt;.&lt;br /&gt;
: A &#039;&#039;failed&#039;&#039; connection gives one of these errors:&lt;br /&gt;
 telnet: connect to address 146.139.x.y: Operation timed out&lt;br /&gt;
: or:&lt;br /&gt;
 telnet: connect to address 146.139.x.y: Connection refused&lt;br /&gt;
:: In these cases, ask that your IP firewall configuration be reviewed and changed.&lt;br /&gt;
&lt;br /&gt;
== License configuration when outside CNM – requires SSH Tunneling ==&lt;br /&gt;
This section documents how to run COMSOL from a network location outside CNM.&lt;br /&gt;
&lt;br /&gt;
As a one-time preparation step, two items must be configured:&lt;br /&gt;
* The license host that COMSOL is to contact, and&lt;br /&gt;
* An SSH connection that will allow your machine to access the COMSOL license server inside CNM&#039;s network.&lt;br /&gt;
&lt;br /&gt;
To then &#039;&#039;run&#039;&#039; the COMSOL application, the configured SSH connection must be up and kept running for the entire time that you run the COMSOL. When you exit COMSOL and wish to start it again, you can keep the SSH connection running, it will be re-used for the next COMSOL run.&lt;br /&gt;
&lt;br /&gt;
=== Configure COMSOL ===&lt;br /&gt;
The following needs to be done just once, typically during COMSOL installation:&lt;br /&gt;
&lt;br /&gt;
In the COMSOL Installer, or in COMSOL Preferences, enter:&lt;br /&gt;
* &#039;&#039;&#039;License format:&#039;&#039;&#039; Floating Network License (FNL), &amp;quot;Port number and Hostname&amp;quot;&lt;br /&gt;
:: &amp;lt;font style=&amp;quot;color:#777&amp;quot;&amp;gt;Do &#039;&#039;not use&#039;&#039; &amp;quot;Three-server redundancy&amp;quot;, since it cannot (easily) be accessed over SSH. Configure with just one server, and in the rare situation of a server failover, temporarily tweak your SSH configuration to contact the alternate server (see below).&amp;lt;/font&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Server:&#039;&#039;&#039; &amp;lt;code&amp;gt;127.0.0.1&amp;lt;/code&amp;gt;&lt;br /&gt;
:: Do not use &amp;quot;localhost&amp;quot;, as COMSOL interprets this incorrectly to mean that your machine &#039;&#039;is&#039;&#039; a license server.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Port:&#039;&#039;&#039; &amp;lt;code&amp;gt;1718&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
Or place a license file with this content:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;make&amp;quot;&amp;gt;&lt;br /&gt;
SERVER 127.0.0.1 ANY 1718&lt;br /&gt;
USE_SERVER&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
//--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Establish connection to CNM license server ===&lt;br /&gt;
This step needs to be done prior to running COMSOL in your desktop session:&lt;br /&gt;
* Connect to &amp;lt;code&amp;gt;mega&amp;lt;/code&amp;gt; with the following command in a terminal window:&lt;br /&gt;
 ssh  -L 1718:&#039;&#039;&#039;clicense1&#039;&#039;&#039;:1718  -L 1719:&#039;&#039;&#039;clicense1&#039;&#039;&#039;:1719  mega.cnm.anl.gov&lt;br /&gt;
* You can leave this connection running in your terminal window across several invocations of COMSOL.&lt;br /&gt;
&lt;br /&gt;
=== Run COMSOL ===&lt;br /&gt;
# Ensure your connection to &amp;quot;mega&amp;quot; is still running. If not, restart it.&lt;br /&gt;
# Start the COMSOL application.&lt;br /&gt;
&lt;br /&gt;
=== Troubleshooting ===&lt;br /&gt;
* If you get an error that the number of licenses is &amp;quot;exhausted&amp;quot;, that is confirmation that you correctly reached the license server, though other users are using licenses.&lt;br /&gt;
* 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:&lt;br /&gt;
 ssh  -L 1718:clicense&#039;&#039;&#039;2&#039;&#039;&#039;:1718  -L 1719:clicense&#039;&#039;&#039;2&#039;&#039;&#039;:1719  mega.cnm.anl.gov&lt;br /&gt;
&lt;br /&gt;
== General License Troubleshooting ==&lt;br /&gt;
The following are typical error messages.&lt;br /&gt;
=== Could not obtain license for COMSOL Multiphysics GUI ===&lt;br /&gt;
* Error details:&lt;br /&gt;
 License error: -4.&lt;br /&gt;
 &#039;&#039;&#039;Licensed number of users already reached.&#039;&#039;&#039;&lt;br /&gt;
 Feature:       COMSOLGUI&lt;br /&gt;
 License path:  /Users/stern/Applications/COMSOL52a/license/license.dat:&lt;br /&gt;
 FlexNet Licensing error:-4,132&lt;br /&gt;
* Reason: The connection to the license server succeeded, but the license token(s) you requested are in use.&lt;br /&gt;
* Solution: Wait a bit, or [http://carbonmgmt/ganglia/lic.php identify who&#039;s using COMSOL] and politely ask the user when they might be finished with their work.&lt;br /&gt;
&lt;br /&gt;
=== License server machine is down or not responding ===&lt;br /&gt;
* Error details:&lt;br /&gt;
  License error: -96.&lt;br /&gt;
  See the system administrator about starting the license server system, or&lt;br /&gt;
  make sure you&#039;re referring to the right host (see LM_LICENSE_FILE).&lt;br /&gt;
 Feature:       SERIAL&lt;br /&gt;
 Hostname:      clicense3&lt;br /&gt;
 License path:  /Users/stern/Applications/COMSOL52a/license/license.dat:&lt;br /&gt;
 FlexNet Licensing error:-96,7&lt;br /&gt;
* Reason: The license servers cannot be reached at all. The &amp;lt;code&amp;gt;ping&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;host&amp;lt;/code&amp;gt; tests mentioned above fail.&lt;br /&gt;
* Solution: Review the client license file and DNS lookup domains.&lt;br /&gt;
&lt;br /&gt;
=== License file does not support this version ===&lt;br /&gt;
* Error details:&lt;br /&gt;
  Feature: SERIAL&lt;br /&gt;
 &#039;&#039;&#039;Application version &amp;gt; License version: 5.21 &amp;gt; 3.5&#039;&#039;&#039;&lt;br /&gt;
 License path: /Users/stern/Applications/COMSOL52a/license/license.dat:&lt;br /&gt;
 FlexNet Licensing error:-21,126&lt;br /&gt;
* 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&#039;re connected to.&lt;br /&gt;
* Solution: When using SSH, try &amp;lt;code&amp;gt;clicense2&amp;lt;/code&amp;gt; instead of  &amp;lt;code&amp;gt;clicense1&amp;lt;/code&amp;gt;, or vice versa. Revisit your &amp;lt;code&amp;gt;~/.ssh/config&amp;lt;/code&amp;gt; file or use the alternate command line as shown in the SSH section above.&lt;br /&gt;
&lt;br /&gt;
== Multiple CPU cores ==&lt;br /&gt;
Ways to start multi-core (from http://www.comsol.com/support/knowledgebase/1096/)&lt;br /&gt;
 comsol -np 8&lt;br /&gt;
&lt;br /&gt;
 export COMSOL_NUM_THREADS=8    # automatically provided on &#039;&#039;Carbon&#039;&#039;&lt;br /&gt;
 comsol&lt;br /&gt;
* COMSOL does not benefit from hyperthreading (oversubscribing the physical core count).&lt;br /&gt;
&lt;br /&gt;
== Batch jobs ==&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
 comsol -clustersimple batch -inputfile input.mph -outputfile output.mph &lt;br /&gt;
&lt;br /&gt;
 &amp;lt;strike&amp;gt;comsol –nn 8 mpd boot&lt;br /&gt;
 comsol –nn 8 batch –inputfile in.mph&lt;br /&gt;
 comsol mpd allexit&amp;lt;/strike&amp;gt;&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
* http://www.comsol.com/support/knowledgebase/1001/ .&lt;br /&gt;
* [[Media:HPC 2012-05-16 Comsol parallel usage.pdf]] (Modified from http://www.comsol.com/support/knowledgebase/1001/files/4027/cluster_install_linux_42a.pptx – Appendix slide, PBS)&lt;br /&gt;
* &#039;&#039;&#039;Note:&#039;&#039;&#039; MPD is not supported on Carbon (I patched the main comsol script), and no longer necessary at all in Comsol-4.3.&lt;br /&gt;
&lt;br /&gt;
=== Sample Job file ===&lt;br /&gt;
See:&lt;br /&gt;
 $COMSOL_HOME/sample.job&lt;br /&gt;
&lt;br /&gt;
== Important COMSOL Support Articles ==&lt;br /&gt;
* Toplevel suport page: https://www.comsol.com/support&lt;br /&gt;
&lt;br /&gt;
=== KB Articles ===&lt;br /&gt;
* [https://www.comsol.com/support/knowledgebase/1001 Running COMSOL® in parallel on clusters]&lt;br /&gt;
* [https://www.comsol.com/support/knowledgebase/1250 Running parametric sweeps, batch sweeps, and cluster sweeps from the command line]&lt;br /&gt;
* [https://www.comsol.com/support/knowledgebase/1255 Reducing the amount of solution data stored in a model]&lt;br /&gt;
* [https://www.comsol.com/support/knowledgebase/830 Handling large models]&lt;br /&gt;
&lt;br /&gt;
=== Blog-style articles ===&lt;br /&gt;
* [https://www.comsol.com/blogs/the-power-of-the-batch-sweep/ The Power of the Batch Sweep]&lt;br /&gt;
* [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]&lt;/div&gt;</summary>
		<author><name>Stern</name></author>
	</entry>
	<entry>
		<id>https://wiki.anl.gov/wiki_cnm/index.php?title=HPC/Applications/comsol&amp;diff=7501</id>
		<title>HPC/Applications/comsol</title>
		<link rel="alternate" type="text/html" href="https://wiki.anl.gov/wiki_cnm/index.php?title=HPC/Applications/comsol&amp;diff=7501"/>
		<updated>2026-03-04T18:26:10Z</updated>

		<summary type="html">&lt;p&gt;Stern: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
The [http://www.comsol.com/products/multiphysics/ &#039;&#039;&#039;COMSOL Multiphysics&#039;&#039;&#039;] application suite&lt;br /&gt;
is available for Mac, Windows, and Linux.&lt;br /&gt;
&lt;br /&gt;
== Access ==&lt;br /&gt;
[[Image:HPC Comsol licensed modules.png|right|450px|thumb|COMSOL features licensed at CNM as of 2024-10.]]&lt;br /&gt;
=== COMSOL Multiphysics ===&lt;br /&gt;
Access to &#039;&#039;&#039;COMSOL Multiphysics&#039;&#039;&#039;, the main application with both a graphical user interface and batch computing capabilities, will be granted &#039;&#039;&#039;&#039;&#039;upon request&#039;&#039;&#039;&#039;&#039;&amp;amp;thinsp;.&lt;br /&gt;
&lt;br /&gt;
You must be:&lt;br /&gt;
* An &#039;&#039;&#039;&#039;&#039;Argonne employee&#039;&#039;&#039;&#039;&#039;&amp;amp;thinsp; in one of the following roles:&lt;br /&gt;
** &#039;&#039;&#039;&#039;&#039;NST staff member&#039;&#039;&#039;&#039;&#039;&amp;amp;thinsp; (including PostDocs, joint appointments, and students at NST).&lt;br /&gt;
** &#039;&#039;&#039;&#039;&#039;CNM Facility User&#039;&#039;&#039;&#039;&#039;&amp;amp;thinsp; (including &#039;&#039;non-NST Argonne employees&#039;&#039;), with an active proposal that has COMSOL in scope. Please see [[HPC/FAQ#Access_and_proposals]].&lt;br /&gt;
&lt;br /&gt;
The set of available COMSOL modules that we have licensed is shown at right.&lt;br /&gt;
&lt;br /&gt;
* The native desktop version can be installed only on &#039;&#039;Argonne-owned&#039;&#039; computers (laptop or desktop). Please contact [mailto:help@anl.gov?Subject=COMSOL%20license%20access%20request CNM support]. Make sure to review [http://www.comsol.com/support/updates/ Product Updates].&lt;br /&gt;
* To run COMSOL on our HPC system &#039;&#039;Carbon&#039;&#039;, as GUI or as batch computing jobs, your proposal must have &#039;&#039;Carbon&#039;&#039; access in scope.&lt;br /&gt;
&lt;br /&gt;
=== COMSOL Server ===&lt;br /&gt;
&#039;&#039;CNM Facility Users&#039;&#039; who are not Argonne employees are not eligible to access&lt;br /&gt;
the full &#039;&#039;&#039;COMSOL Multiphysics&#039;&#039;&#039; product, in compliance with its licensing terms and conditions.&lt;br /&gt;
However, the [https://www.comsol.com/comsol-server &#039;&#039;&#039;COMSOL Server&#039;&#039;&#039;] product offers an alternative&lt;br /&gt;
albeit more narrow means of access.&lt;br /&gt;
&lt;br /&gt;
All users, including &#039;&#039;&#039;&#039;&#039;non-Argonne users&#039;&#039;&#039;&#039;&#039; may be able to run, over a web interface in their browser,&lt;br /&gt;
pre-parameterized &amp;quot;fixed-model&amp;quot; simulations that were made with the &#039;&#039;&#039;COMSOL Application Builder&#039;&#039;&#039; (requires Windows).&lt;br /&gt;
&lt;br /&gt;
To inquire about using COMSOL server applications,&lt;br /&gt;
please contact us.&lt;br /&gt;
&amp;lt;!-- [mailto:cnm_useroffice@anl.gov?Subject=COMSOL%20server%20usage Support]. --&amp;gt;&lt;br /&gt;
We will review possible purchase paths for COMSOL Server, and the &#039;&#039;considerable effort&#039;&#039; likely required by users and the CNM to develop and deploy a COMSOL application.&lt;br /&gt;
&lt;br /&gt;
== Support ==&lt;br /&gt;
* For questions on how to run or start COMSOL:&lt;br /&gt;
*: Submit an [[HPC/Support | &#039;&#039;&#039;IT support request&#039;&#039;&#039;]]&lt;br /&gt;
* For questions related to most COMSOL data or scripts, contact COMSOL support at:&lt;br /&gt;
*: [mailto:support@comsol.com &#039;&#039;&#039;support&#039;&#039;&#039;@comsol.com]&lt;br /&gt;
* &#039;&#039;&#039;Exception:&#039;&#039;&#039; If your support question might contain data that is subject to &#039;&#039;&#039;US Export Control&#039;&#039;&#039; regulations, contact instead:&lt;br /&gt;
*: [mailto:us-export-control@us.comsol.com &#039;&#039;&#039;us-export-control&#039;&#039;&#039;@&#039;&#039;&#039;us&#039;&#039;&#039;.comsol.com]&lt;br /&gt;
&lt;br /&gt;
== The modes to run COMSOL ==&lt;br /&gt;
There are several ways of running COMSOL.&lt;br /&gt;
&lt;br /&gt;
=== Running the desktop application ===&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
# Run on your &#039;&#039;Argonne-provided&#039;&#039; computer, checking out Carbon&#039;s license remotely.&lt;br /&gt;
#* Requires a full installation of COMSOL on your desktop or laptop computer.&lt;br /&gt;
#* 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.&lt;br /&gt;
# Run on Carbon, display on your desktop using the [http://en.wikipedia.org/wiki/X_Window_System X Window system (X11)].&lt;br /&gt;
#* Requires an &#039;&#039;X11 Server&#039;&#039; application running on your client machine, and SSH X11 forwarding.&lt;br /&gt;
#* The X11 protocol can be slow over LAN.&lt;br /&gt;
# Run on Carbon in a [[HPC/Network Access/Virtual Desktop | virtual desktop environment (VNC)]], viewed in a VNC client on your machine.&lt;br /&gt;
#* Requires a VNC client on your machine.&lt;br /&gt;
#* It can be confusing where VNC and the app runs.&lt;br /&gt;
#* The virtual desktop presents a (deliberatly) sparse windowing environment – Copy&amp;amp;Paste can be difficult to use.&lt;br /&gt;
&lt;br /&gt;
=== Running a batch calculation ===&lt;br /&gt;
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.&lt;br /&gt;
See the [[#Batch jobs|section below]].&lt;br /&gt;
&lt;br /&gt;
== Native desktop version ==&lt;br /&gt;
&lt;br /&gt;
To get the fastest response from the COMSOL GUI, run a native COMSOL version on your desktop machine or laptop, called &#039;&#039;client machine&#039;&#039; below.&lt;br /&gt;
&lt;br /&gt;
Enter license details either in the COMSOL Setup configuration dialog.&lt;br /&gt;
&lt;br /&gt;
== Native desktop version — License configuration ==&lt;br /&gt;
A client&#039;s COMSOL license needs to be configured depending on how the client reaches CNM network resources. Follow the appropriate section:&lt;br /&gt;
&lt;br /&gt;
* [[#License configuration when inside CNM or on CNM VPN|License configuration when &#039;&#039;&#039;inside CNM&#039;&#039;&#039; or on &#039;&#039;&#039;CNM VPN&#039;&#039;&#039;]]&lt;br /&gt;
: Requires that the user&#039;s machine is logically within the network of CNM/NST, either by a wired/auth WiFi connection in the building or by VPN under a CNM/NST profile.&lt;br /&gt;
* [[#License configuration when outside CNM – requires SSH Tunneling|License configuration when &#039;&#039;&#039;outside CNM&#039;&#039;&#039; – requires SSH Tunneling]]&lt;br /&gt;
: &#039;&#039;Non-NST staff&#039;&#039; usually have a VPN profile that places the machine logically [[#License configuration when outside CNM – requires SSH Tunneling|outside of NST&#039;s network.]]&lt;br /&gt;
&lt;br /&gt;
== Use with X11 ==&lt;br /&gt;
For casual use, and with [[HPC/Network Access/SSH Tunnel Setup on Linux and MacOS | X11 tunneling to Carbon]] set up, simply add to your &amp;lt;code&amp;gt;~/.bashrc&amp;lt;/code&amp;gt; file on Carbon:&lt;br /&gt;
 module load comsol&lt;br /&gt;
&lt;br /&gt;
Then, from the command line on a Carbon login node, start the COMSOL GUI:&lt;br /&gt;
 comsol &amp;amp;&lt;br /&gt;
&lt;br /&gt;
License configuration is automatic on Carbon.&lt;br /&gt;
&lt;br /&gt;
Comsol will use a number of cores to run calculations multithreaded by default. (On Carbon, COMSOL_NUM_THREADS is set.)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Quit the application&#039;&#039;&#039; as soon as you are done. Only one user can use Comsol at a time.&lt;br /&gt;
&lt;br /&gt;
== Use with VNC ==&lt;br /&gt;
See general  [[HPC/Network Access/Virtual Desktop | instructions on using VNC]], and the COMSOL example therein.&lt;br /&gt;
&lt;br /&gt;
== License configuration when inside CNM or on CNM VPN ==&lt;br /&gt;
=== &amp;lt;span style=&amp;quot;color:#A00;&amp;quot;&amp;gt;Ensure correct DNS search domains&amp;lt;/span&amp;gt; ===&lt;br /&gt;
* Inspect the client machine&#039;s network configuration.&lt;br /&gt;
* Ensure that &#039;&#039;&#039;two&#039;&#039;&#039; entries are listed as DNS Search Domains for the current network profile:&lt;br /&gt;
 nst.anl.gov&lt;br /&gt;
 cnm.anl.gov&lt;br /&gt;
: (The order of entries does not matter for the purposes considered here.)&lt;br /&gt;
* If the client machine is &#039;&#039;wired to CNM networks&#039;&#039;, the domains are normally provided correctly by DHCP.&lt;br /&gt;
* If the client machine is &#039;&#039;connected over VPN&#039;&#039;, you may need edit the respective network profile.&lt;br /&gt;
:* 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 &amp;quot;Advanced…&amp;quot;. It appears that those changes are being saved and will be activated automatically the next time that this VPN session gets started.&lt;br /&gt;
: [[Image:VNC_add_cnm_to_DNS_1.png|400px]] [[Image:VNC_add_cnm_to_DNS_2.png|400px]]&lt;br /&gt;
:* On Windows or Linux machines, take &#039;&#039;analogous&#039;&#039; steps, using the platform&#039;s own configuration tools.&lt;br /&gt;
&lt;br /&gt;
* Exclude license manager components from client desktop installation. (Those are all handled server-side.)&lt;br /&gt;
&lt;br /&gt;
=== License format ===&lt;br /&gt;
* Floating Network License (FNL), &amp;quot;Three-server redundancy&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== License servers ===&lt;br /&gt;
* On client machines, while running the COMSOL installer or license configuration, specify license servers and ports as follows:&lt;br /&gt;
 1718    clicense1&lt;br /&gt;
 1718    clicense2&lt;br /&gt;
 1718    clicense3&lt;br /&gt;
: &#039;&#039;&#039;Note:&#039;&#039;&#039; Use &#039;&#039;short host names only&#039;&#039;. (Technical Reason: The license must be usable both on Carbon&#039;s internal network as well as on divisional networks).&lt;br /&gt;
 1718    clicense1&amp;lt;strike&amp;gt;.cnm.anl.gov&amp;lt;/strike&amp;gt;&lt;br /&gt;
 1718    clicense2&amp;lt;strike&amp;gt;.cnm.anl.gov&amp;lt;/strike&amp;gt;&lt;br /&gt;
 1718    clicense3&amp;lt;strike&amp;gt;.cnm.anl.gov&amp;lt;/strike&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Advanced:&#039;&#039;&#039; A client machine&#039;s COMSOL license file &amp;lt;code&amp;gt;&amp;amp;lt;COMSOLDIR&amp;amp;gt;/Multiphysics/license/license.dat&amp;lt;/code&amp;gt; should look as follows:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;make&amp;quot;&amp;gt;&lt;br /&gt;
SERVER clicense1 ANY 1718&lt;br /&gt;
SERVER clicense2 ANY 1718&lt;br /&gt;
SERVER clicense3 ANY 1718&lt;br /&gt;
USE_SERVER&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;amp;lt;COMSOLDIR&amp;amp;gt;&amp;lt;/code&amp;gt; is located by default at:&lt;br /&gt;
* &#039;&#039;&#039;Windows&#039;&#039;&#039;: C:\Program files\COMSOL\COMSOL&#039;&#039;nn&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Linux&#039;&#039;&#039;: /usr/local/comsol&#039;&#039;nn&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Mac&#039;&#039;&#039;: /Applications/COMSOL&#039;&#039;nn&#039;&#039;&lt;br /&gt;
(&amp;quot;&#039;&#039;nn&#039;&#039;&amp;quot; is the application&#039;s abbreviated version number.)&lt;br /&gt;
&lt;br /&gt;
=== Network Troubleshooting ===&lt;br /&gt;
When using the license access model descibed here (as opposed to tunneled over SSH), ensure the following:&lt;br /&gt;
* Verify that short host names can be resolved to IP addresses. Either one of the following commands should produce sensible output:&lt;br /&gt;
 host clicense1&lt;br /&gt;
: or:&lt;br /&gt;
 ping -c 3 clicense1&lt;br /&gt;
* Verify that &#039;&#039;both license ports on the same server&#039;&#039; can be reached from your client machine:&lt;br /&gt;
 telnet &#039;&#039;&#039;clicense1&#039;&#039;&#039; 1718&lt;br /&gt;
 telnet &#039;&#039;&#039;clicense1&#039;&#039;&#039; 1719&lt;br /&gt;
: or:&lt;br /&gt;
 telnet &#039;&#039;&#039;clicense2&#039;&#039;&#039; 1718&lt;br /&gt;
 telnet &#039;&#039;&#039;clicense2&#039;&#039;&#039; 1719&lt;br /&gt;
: A &#039;&#039;successful&#039;&#039; connection looks like:&lt;br /&gt;
 Trying 146.139.x.y...&lt;br /&gt;
 Connected to clicense1.cnm.anl.gov.&lt;br /&gt;
 Escape character is &#039;^]&#039;.&lt;br /&gt;
:: Do not enter any data. Instead,  close each connection by hitting &amp;lt;code&amp;gt;Ctrl&amp;lt;/code&amp;gt;&amp;lt;code&amp;gt;]&amp;lt;/code&amp;gt; (closing square bracket), followed by &amp;lt;code&amp;gt;Ctrl&amp;lt;/code&amp;gt;&amp;lt;code&amp;gt;D&amp;lt;/code&amp;gt;.&lt;br /&gt;
: A &#039;&#039;failed&#039;&#039; connection gives one of these errors:&lt;br /&gt;
 telnet: connect to address 146.139.x.y: Operation timed out&lt;br /&gt;
: or:&lt;br /&gt;
 telnet: connect to address 146.139.x.y: Connection refused&lt;br /&gt;
:: In these cases, ask that your IP firewall configuration be reviewed and changed.&lt;br /&gt;
&lt;br /&gt;
== License configuration when outside CNM – requires SSH Tunneling ==&lt;br /&gt;
This section documents how to run COMSOL from a network location outside CNM.&lt;br /&gt;
&lt;br /&gt;
As a one-time preparation step, two items must be configured:&lt;br /&gt;
* The license host that COMSOL is to contact, and&lt;br /&gt;
* An SSH connection that will allow your machine to access the COMSOL license server inside CNM&#039;s network.&lt;br /&gt;
&lt;br /&gt;
To then &#039;&#039;run&#039;&#039; the COMSOL application, the configured SSH connection must be up and kept running for the entire time that you run the COMSOL. When you exit COMSOL and wish to start it again, you can keep the SSH connection running, it will be re-used for the next COMSOL run.&lt;br /&gt;
&lt;br /&gt;
=== Configure COMSOL ===&lt;br /&gt;
The following needs to be done just once, typically during COMSOL installation:&lt;br /&gt;
&lt;br /&gt;
In the COMSOL Installer, or in COMSOL Preferences, enter:&lt;br /&gt;
* &#039;&#039;&#039;License format:&#039;&#039;&#039; Floating Network License (FNL), &amp;quot;Port number and Hostname&amp;quot;&lt;br /&gt;
:: &amp;lt;font style=&amp;quot;color:#777&amp;quot;&amp;gt;Do &#039;&#039;not use&#039;&#039; &amp;quot;Three-server redundancy&amp;quot;, since it cannot (easily) be accessed over SSH. Configure with just one server, and in the rare situation of a server failover, temporarily tweak your SSH configuration to contact the alternate server (see below).&amp;lt;/font&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Server:&#039;&#039;&#039; &amp;lt;code&amp;gt;127.0.0.1&amp;lt;/code&amp;gt;&lt;br /&gt;
:: Do not use &amp;quot;localhost&amp;quot;, as COMSOL interprets this incorrectly to mean that your machine &#039;&#039;is&#039;&#039; a license server.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Port:&#039;&#039;&#039; &amp;lt;code&amp;gt;1718&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
Or place a license file with this content:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;make&amp;quot;&amp;gt;&lt;br /&gt;
SERVER 127.0.0.1 ANY 1718&lt;br /&gt;
USE_SERVER&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
//--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Establish connection to CNM license server ===&lt;br /&gt;
This step needs to be done prior to running COMSOL in your desktop session:&lt;br /&gt;
* Connect to &amp;lt;code&amp;gt;mega&amp;lt;/code&amp;gt; with the following command in a terminal window:&lt;br /&gt;
 ssh  -L 1718:&#039;&#039;&#039;clicense1&#039;&#039;&#039;:1718  -L 1719:&#039;&#039;&#039;clicense1&#039;&#039;&#039;:1719  mega.cnm.anl.gov&lt;br /&gt;
* You can leave this connection running in your terminal window across several invocations of COMSOL.&lt;br /&gt;
&lt;br /&gt;
=== Run COMSOL ===&lt;br /&gt;
# Ensure your connection to &amp;quot;mega&amp;quot; is still running. If not, restart it.&lt;br /&gt;
# Start the COMSOL application.&lt;br /&gt;
&lt;br /&gt;
=== Troubleshooting ===&lt;br /&gt;
* If you get an error that the number of licenses is &amp;quot;exhausted&amp;quot;, that is confirmation that you correctly reached the license server, though other users are using licenses.&lt;br /&gt;
* 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:&lt;br /&gt;
 ssh  -L 1718:clicense&#039;&#039;&#039;2&#039;&#039;&#039;:1718  -L 1719:clicense&#039;&#039;&#039;2&#039;&#039;&#039;:1719  mega.cnm.anl.gov&lt;br /&gt;
&lt;br /&gt;
== General License Troubleshooting ==&lt;br /&gt;
The following are typical error messages.&lt;br /&gt;
=== Could not obtain license for COMSOL Multiphysics GUI ===&lt;br /&gt;
* Error details:&lt;br /&gt;
 License error: -4.&lt;br /&gt;
 &#039;&#039;&#039;Licensed number of users already reached.&#039;&#039;&#039;&lt;br /&gt;
 Feature:       COMSOLGUI&lt;br /&gt;
 License path:  /Users/stern/Applications/COMSOL52a/license/license.dat:&lt;br /&gt;
 FlexNet Licensing error:-4,132&lt;br /&gt;
* Reason: The connection to the license server succeeded, but the license token(s) you requested are in use.&lt;br /&gt;
* Solution: Wait a bit, or [http://carbonmgmt/ganglia/lic.php identify who&#039;s using COMSOL] and politely ask the user when they might be finished with their work.&lt;br /&gt;
&lt;br /&gt;
=== License server machine is down or not responding ===&lt;br /&gt;
* Error details:&lt;br /&gt;
  License error: -96.&lt;br /&gt;
  See the system administrator about starting the license server system, or&lt;br /&gt;
  make sure you&#039;re referring to the right host (see LM_LICENSE_FILE).&lt;br /&gt;
 Feature:       SERIAL&lt;br /&gt;
 Hostname:      clicense3&lt;br /&gt;
 License path:  /Users/stern/Applications/COMSOL52a/license/license.dat:&lt;br /&gt;
 FlexNet Licensing error:-96,7&lt;br /&gt;
* Reason: The license servers cannot be reached at all. The &amp;lt;code&amp;gt;ping&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;host&amp;lt;/code&amp;gt; tests mentioned above fail.&lt;br /&gt;
* Solution: Review the client license file and DNS lookup domains.&lt;br /&gt;
&lt;br /&gt;
=== License file does not support this version ===&lt;br /&gt;
* Error details:&lt;br /&gt;
  Feature: SERIAL&lt;br /&gt;
 &#039;&#039;&#039;Application version &amp;gt; License version: 5.21 &amp;gt; 3.5&#039;&#039;&#039;&lt;br /&gt;
 License path: /Users/stern/Applications/COMSOL52a/license/license.dat:&lt;br /&gt;
 FlexNet Licensing error:-21,126&lt;br /&gt;
* 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&#039;re connected to.&lt;br /&gt;
* Solution: When using SSH, try &amp;lt;code&amp;gt;clicense2&amp;lt;/code&amp;gt; instead of  &amp;lt;code&amp;gt;clicense1&amp;lt;/code&amp;gt;, or vice versa. Revisit your &amp;lt;code&amp;gt;~/.ssh/config&amp;lt;/code&amp;gt; file or use the alternate command line as shown in the SSH section above.&lt;br /&gt;
&lt;br /&gt;
== Multiple CPU cores ==&lt;br /&gt;
Ways to start multi-core (from http://www.comsol.com/support/knowledgebase/1096/)&lt;br /&gt;
 comsol -np 8&lt;br /&gt;
&lt;br /&gt;
 export COMSOL_NUM_THREADS=8    # automatically provided on &#039;&#039;Carbon&#039;&#039;&lt;br /&gt;
 comsol&lt;br /&gt;
* COMSOL does not benefit from hyperthreading (oversubscribing the physical core count).&lt;br /&gt;
&lt;br /&gt;
== Batch jobs ==&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
 comsol -clustersimple batch -inputfile input.mph -outputfile output.mph &lt;br /&gt;
&lt;br /&gt;
 &amp;lt;strike&amp;gt;comsol –nn 8 mpd boot&lt;br /&gt;
 comsol –nn 8 batch –inputfile in.mph&lt;br /&gt;
 comsol mpd allexit&amp;lt;/strike&amp;gt;&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
* http://www.comsol.com/support/knowledgebase/1001/ .&lt;br /&gt;
* [[Media:HPC 2012-05-16 Comsol parallel usage.pdf]] (Modified from http://www.comsol.com/support/knowledgebase/1001/files/4027/cluster_install_linux_42a.pptx – Appendix slide, PBS)&lt;br /&gt;
* &#039;&#039;&#039;Note:&#039;&#039;&#039; MPD is not supported on Carbon (I patched the main comsol script), and no longer necessary at all in Comsol-4.3.&lt;br /&gt;
&lt;br /&gt;
=== Sample Job file ===&lt;br /&gt;
See:&lt;br /&gt;
 $COMSOL_HOME/sample.job&lt;br /&gt;
&lt;br /&gt;
== Important COMSOL Support Articles ==&lt;br /&gt;
* Toplevel suport page: https://www.comsol.com/support&lt;br /&gt;
&lt;br /&gt;
=== KB Articles ===&lt;br /&gt;
* [https://www.comsol.com/support/knowledgebase/1001 Running COMSOL® in parallel on clusters]&lt;br /&gt;
* [https://www.comsol.com/support/knowledgebase/1250 Running parametric sweeps, batch sweeps, and cluster sweeps from the command line]&lt;br /&gt;
* [https://www.comsol.com/support/knowledgebase/1255 Reducing the amount of solution data stored in a model]&lt;br /&gt;
* [https://www.comsol.com/support/knowledgebase/830 Handling large models]&lt;br /&gt;
&lt;br /&gt;
=== Blog-style articles ===&lt;br /&gt;
* [https://www.comsol.com/blogs/the-power-of-the-batch-sweep/ The Power of the Batch Sweep]&lt;br /&gt;
* [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]&lt;/div&gt;</summary>
		<author><name>Stern</name></author>
	</entry>
	<entry>
		<id>https://wiki.anl.gov/wiki_cnm/index.php?title=HPC/Applications/comsol&amp;diff=7500</id>
		<title>HPC/Applications/comsol</title>
		<link rel="alternate" type="text/html" href="https://wiki.anl.gov/wiki_cnm/index.php?title=HPC/Applications/comsol&amp;diff=7500"/>
		<updated>2026-03-04T18:24:55Z</updated>

		<summary type="html">&lt;p&gt;Stern: /* Running the desktop application */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
The [http://www.comsol.com/products/multiphysics/ &#039;&#039;&#039;COMSOL Multiphysics&#039;&#039;&#039;] application suite&lt;br /&gt;
is available for Mac, Windows, and Linux.&lt;br /&gt;
&lt;br /&gt;
== Access ==&lt;br /&gt;
[[Image:HPC Comsol licensed modules.png|right|450px|thumb|COMSOL features licensed at CNM as of 2024-10.]]&lt;br /&gt;
=== COMSOL Multiphysics ===&lt;br /&gt;
Access to &#039;&#039;&#039;COMSOL Multiphysics&#039;&#039;&#039;, the main application with both a graphical user interface and batch computing capabilities, will be granted &#039;&#039;&#039;&#039;&#039;upon request&#039;&#039;&#039;&#039;&#039;&amp;amp;thinsp;.&lt;br /&gt;
&lt;br /&gt;
You must be:&lt;br /&gt;
* An &#039;&#039;&#039;&#039;&#039;Argonne employee&#039;&#039;&#039;&#039;&#039;&amp;amp;thinsp; in one of the following roles:&lt;br /&gt;
** &#039;&#039;&#039;&#039;&#039;NST staff member&#039;&#039;&#039;&#039;&#039;&amp;amp;thinsp; (including PostDocs, joint appointments, and students at NST).&lt;br /&gt;
** &#039;&#039;&#039;&#039;&#039;CNM Facility User&#039;&#039;&#039;&#039;&#039;&amp;amp;thinsp; (including &#039;&#039;non-NST Argonne employees&#039;&#039;), with an active proposal that has COMSOL in scope. Please see [[HPC/FAQ#Access_and_proposals]].&lt;br /&gt;
&lt;br /&gt;
The set of available COMSOL modules that we have licensed is shown at right.&lt;br /&gt;
&lt;br /&gt;
* The native desktop version can be installed only on &#039;&#039;Argonne-owned&#039;&#039; computers (laptop or desktop). Please contact [mailto:help@anl.gov?Subject=COMSOL%20license%20access%20request CNM support]. Make sure to review [http://www.comsol.com/support/updates/ Product Updates].&lt;br /&gt;
* To run COMSOL on our HPC system &#039;&#039;Carbon&#039;&#039;, as GUI or as batch computing jobs, your proposal must have &#039;&#039;Carbon&#039;&#039; access in scope.&lt;br /&gt;
&lt;br /&gt;
=== COMSOL Server ===&lt;br /&gt;
&#039;&#039;CNM Facility Users&#039;&#039; who are not Argonne employees are not eligible to access&lt;br /&gt;
the full &#039;&#039;&#039;COMSOL Multiphysics&#039;&#039;&#039; product, in compliance with its licensing terms and conditions.&lt;br /&gt;
However, the [https://www.comsol.com/comsol-server &#039;&#039;&#039;COMSOL Server&#039;&#039;&#039;] product offers an alternative&lt;br /&gt;
albeit more narrow means of access.&lt;br /&gt;
&lt;br /&gt;
All users, including &#039;&#039;&#039;&#039;&#039;non-Argonne users&#039;&#039;&#039;&#039;&#039; may be able to run, over a web interface in their browser,&lt;br /&gt;
pre-parameterized &amp;quot;fixed-model&amp;quot; simulations that were made with the &#039;&#039;&#039;COMSOL Application Builder&#039;&#039;&#039; (requires Windows).&lt;br /&gt;
&lt;br /&gt;
To inquire about using COMSOL server applications,&lt;br /&gt;
please contact us.&lt;br /&gt;
&amp;lt;!-- [mailto:cnm_useroffice@anl.gov?Subject=COMSOL%20server%20usage Support]. --&amp;gt;&lt;br /&gt;
We will review possible purchase paths for COMSOL Server, and the &#039;&#039;considerable effort&#039;&#039; likely required by users and the CNM to develop and deploy a COMSOL application.&lt;br /&gt;
&lt;br /&gt;
== Support ==&lt;br /&gt;
* For questions on how to run or start COMSOL:&lt;br /&gt;
*: Submit an [[HPC/Support | &#039;&#039;&#039;IT support request&#039;&#039;&#039;]]&lt;br /&gt;
* For questions related to most COMSOL data or scripts, contact COMSOL support at:&lt;br /&gt;
*: [mailto:support@comsol.com &#039;&#039;&#039;support&#039;&#039;&#039;@comsol.com]&lt;br /&gt;
* &#039;&#039;&#039;Exception:&#039;&#039;&#039; If your support question might contain data that is subject to &#039;&#039;&#039;US Export Control&#039;&#039;&#039; regulations, contact instead:&lt;br /&gt;
*: [mailto:us-export-control@us.comsol.com &#039;&#039;&#039;us-export-control&#039;&#039;&#039;@&#039;&#039;&#039;us&#039;&#039;&#039;.comsol.com]&lt;br /&gt;
&lt;br /&gt;
== The modes to run COMSOL ==&lt;br /&gt;
There are several ways of running COMSOL.&lt;br /&gt;
&lt;br /&gt;
=== Running the desktop application ===&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
# Run on your &#039;&#039;Argonne-provided&#039;&#039; computer, checking out Carbon&#039;s license remotely.&lt;br /&gt;
#* Requires a full installation of COMSOL on your desktop or laptop computer.&lt;br /&gt;
#* 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.&lt;br /&gt;
# Run on Carbon, display on your desktop using the [http://en.wikipedia.org/wiki/X_Window_System X Window system (X11)].&lt;br /&gt;
#* Requires an &#039;&#039;X11 Server&#039;&#039; application running on your client machine, and SSH X11 forwarding.&lt;br /&gt;
#* The X11 protocol can be slow over LAN.&lt;br /&gt;
# Run on Carbon in a [[HPC/Network Access/Virtual Desktop | virtual desktop environment (VNC)]], viewed in a VNC client on your machine.&lt;br /&gt;
#* Requires a VNC client on your machine.&lt;br /&gt;
#* It can be confusing where VNC and the app runs.&lt;br /&gt;
#* The virtual desktop presents a (deliberatly) sparse windowing environment – Copy&amp;amp;Paste can be difficult to use.&lt;br /&gt;
&lt;br /&gt;
=== Running a batch calculation ===&lt;br /&gt;
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.&lt;br /&gt;
See the [[#Batch jobs|section below]].&lt;br /&gt;
&lt;br /&gt;
== Use with X11 ==&lt;br /&gt;
For casual use, and with [[HPC/Network Access/SSH Tunnel Setup on Linux and MacOS | X11 tunneling to Carbon]] set up, simply add to your &amp;lt;code&amp;gt;~/.bashrc&amp;lt;/code&amp;gt; file on Carbon:&lt;br /&gt;
 module load comsol&lt;br /&gt;
&lt;br /&gt;
Then, from the command line on a Carbon login node, start the COMSOL GUI:&lt;br /&gt;
 comsol &amp;amp;&lt;br /&gt;
&lt;br /&gt;
License configuration is automatic on Carbon.&lt;br /&gt;
&lt;br /&gt;
Comsol will use a number of cores to run calculations multithreaded by default. (On Carbon, COMSOL_NUM_THREADS is set.)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Quit the application&#039;&#039;&#039; as soon as you are done. Only one user can use Comsol at a time.&lt;br /&gt;
&lt;br /&gt;
== Use with VNC ==&lt;br /&gt;
See general  [[HPC/Network Access/Virtual Desktop | instructions on using VNC]], and the COMSOL example therein.&lt;br /&gt;
&lt;br /&gt;
== Native desktop version ==&lt;br /&gt;
&lt;br /&gt;
To get the fastest response from the COMSOL GUI, run a native COMSOL version on your desktop machine or laptop, called &#039;&#039;client machine&#039;&#039; below.&lt;br /&gt;
&lt;br /&gt;
Enter license details either in the COMSOL Setup configuration dialog.&lt;br /&gt;
&lt;br /&gt;
== Native desktop version — License configuration ==&lt;br /&gt;
A client&#039;s COMSOL license needs to be configured depending on how the client reaches CNM network resources. Follow the appropriate section:&lt;br /&gt;
&lt;br /&gt;
* [[#License configuration when inside CNM or on CNM VPN|License configuration when &#039;&#039;&#039;inside CNM&#039;&#039;&#039; or on &#039;&#039;&#039;CNM VPN&#039;&#039;&#039;]]&lt;br /&gt;
: Requires that the user&#039;s machine is logically within the network of CNM/NST, either by a wired/auth WiFi connection in the building or by VPN under a CNM/NST profile.&lt;br /&gt;
* [[#License configuration when outside CNM – requires SSH Tunneling|License configuration when &#039;&#039;&#039;outside CNM&#039;&#039;&#039; – requires SSH Tunneling]]&lt;br /&gt;
: &#039;&#039;Non-NST staff&#039;&#039; usually have a VPN profile that places the machine logically [[#License configuration when outside CNM – requires SSH Tunneling|outside of NST&#039;s network.]]&lt;br /&gt;
&lt;br /&gt;
== License configuration when inside CNM or on CNM VPN ==&lt;br /&gt;
=== &amp;lt;span style=&amp;quot;color:#A00;&amp;quot;&amp;gt;Ensure correct DNS search domains&amp;lt;/span&amp;gt; ===&lt;br /&gt;
* Inspect the client machine&#039;s network configuration.&lt;br /&gt;
* Ensure that &#039;&#039;&#039;two&#039;&#039;&#039; entries are listed as DNS Search Domains for the current network profile:&lt;br /&gt;
 nst.anl.gov&lt;br /&gt;
 cnm.anl.gov&lt;br /&gt;
: (The order of entries does not matter for the purposes considered here.)&lt;br /&gt;
* If the client machine is &#039;&#039;wired to CNM networks&#039;&#039;, the domains are normally provided correctly by DHCP.&lt;br /&gt;
* If the client machine is &#039;&#039;connected over VPN&#039;&#039;, you may need edit the respective network profile.&lt;br /&gt;
:* 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 &amp;quot;Advanced…&amp;quot;. It appears that those changes are being saved and will be activated automatically the next time that this VPN session gets started.&lt;br /&gt;
: [[Image:VNC_add_cnm_to_DNS_1.png|400px]] [[Image:VNC_add_cnm_to_DNS_2.png|400px]]&lt;br /&gt;
:* On Windows or Linux machines, take &#039;&#039;analogous&#039;&#039; steps, using the platform&#039;s own configuration tools.&lt;br /&gt;
&lt;br /&gt;
* Exclude license manager components from client desktop installation. (Those are all handled server-side.)&lt;br /&gt;
&lt;br /&gt;
=== License format ===&lt;br /&gt;
* Floating Network License (FNL), &amp;quot;Three-server redundancy&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== License servers ===&lt;br /&gt;
* On client machines, while running the COMSOL installer or license configuration, specify license servers and ports as follows:&lt;br /&gt;
 1718    clicense1&lt;br /&gt;
 1718    clicense2&lt;br /&gt;
 1718    clicense3&lt;br /&gt;
: &#039;&#039;&#039;Note:&#039;&#039;&#039; Use &#039;&#039;short host names only&#039;&#039;. (Technical Reason: The license must be usable both on Carbon&#039;s internal network as well as on divisional networks).&lt;br /&gt;
 1718    clicense1&amp;lt;strike&amp;gt;.cnm.anl.gov&amp;lt;/strike&amp;gt;&lt;br /&gt;
 1718    clicense2&amp;lt;strike&amp;gt;.cnm.anl.gov&amp;lt;/strike&amp;gt;&lt;br /&gt;
 1718    clicense3&amp;lt;strike&amp;gt;.cnm.anl.gov&amp;lt;/strike&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Advanced:&#039;&#039;&#039; A client machine&#039;s COMSOL license file &amp;lt;code&amp;gt;&amp;amp;lt;COMSOLDIR&amp;amp;gt;/Multiphysics/license/license.dat&amp;lt;/code&amp;gt; should look as follows:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;make&amp;quot;&amp;gt;&lt;br /&gt;
SERVER clicense1 ANY 1718&lt;br /&gt;
SERVER clicense2 ANY 1718&lt;br /&gt;
SERVER clicense3 ANY 1718&lt;br /&gt;
USE_SERVER&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;amp;lt;COMSOLDIR&amp;amp;gt;&amp;lt;/code&amp;gt; is located by default at:&lt;br /&gt;
* &#039;&#039;&#039;Windows&#039;&#039;&#039;: C:\Program files\COMSOL\COMSOL&#039;&#039;nn&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Linux&#039;&#039;&#039;: /usr/local/comsol&#039;&#039;nn&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Mac&#039;&#039;&#039;: /Applications/COMSOL&#039;&#039;nn&#039;&#039;&lt;br /&gt;
(&amp;quot;&#039;&#039;nn&#039;&#039;&amp;quot; is the application&#039;s abbreviated version number.)&lt;br /&gt;
&lt;br /&gt;
=== Network Troubleshooting ===&lt;br /&gt;
When using the license access model descibed here (as opposed to tunneled over SSH), ensure the following:&lt;br /&gt;
* Verify that short host names can be resolved to IP addresses. Either one of the following commands should produce sensible output:&lt;br /&gt;
 host clicense1&lt;br /&gt;
: or:&lt;br /&gt;
 ping -c 3 clicense1&lt;br /&gt;
* Verify that &#039;&#039;both license ports on the same server&#039;&#039; can be reached from your client machine:&lt;br /&gt;
 telnet &#039;&#039;&#039;clicense1&#039;&#039;&#039; 1718&lt;br /&gt;
 telnet &#039;&#039;&#039;clicense1&#039;&#039;&#039; 1719&lt;br /&gt;
: or:&lt;br /&gt;
 telnet &#039;&#039;&#039;clicense2&#039;&#039;&#039; 1718&lt;br /&gt;
 telnet &#039;&#039;&#039;clicense2&#039;&#039;&#039; 1719&lt;br /&gt;
: A &#039;&#039;successful&#039;&#039; connection looks like:&lt;br /&gt;
 Trying 146.139.x.y...&lt;br /&gt;
 Connected to clicense1.cnm.anl.gov.&lt;br /&gt;
 Escape character is &#039;^]&#039;.&lt;br /&gt;
:: Do not enter any data. Instead,  close each connection by hitting &amp;lt;code&amp;gt;Ctrl&amp;lt;/code&amp;gt;&amp;lt;code&amp;gt;]&amp;lt;/code&amp;gt; (closing square bracket), followed by &amp;lt;code&amp;gt;Ctrl&amp;lt;/code&amp;gt;&amp;lt;code&amp;gt;D&amp;lt;/code&amp;gt;.&lt;br /&gt;
: A &#039;&#039;failed&#039;&#039; connection gives one of these errors:&lt;br /&gt;
 telnet: connect to address 146.139.x.y: Operation timed out&lt;br /&gt;
: or:&lt;br /&gt;
 telnet: connect to address 146.139.x.y: Connection refused&lt;br /&gt;
:: In these cases, ask that your IP firewall configuration be reviewed and changed.&lt;br /&gt;
&lt;br /&gt;
== License configuration when outside CNM – requires SSH Tunneling ==&lt;br /&gt;
This section documents how to run COMSOL from a network location outside CNM.&lt;br /&gt;
&lt;br /&gt;
As a one-time preparation step, two items must be configured:&lt;br /&gt;
* The license host that COMSOL is to contact, and&lt;br /&gt;
* An SSH connection that will allow your machine to access the COMSOL license server inside CNM&#039;s network.&lt;br /&gt;
&lt;br /&gt;
To then &#039;&#039;run&#039;&#039; the COMSOL application, the configured SSH connection must be up and kept running for the entire time that you run the COMSOL. When you exit COMSOL and wish to start it again, you can keep the SSH connection running, it will be re-used for the next COMSOL run.&lt;br /&gt;
&lt;br /&gt;
=== Configure COMSOL ===&lt;br /&gt;
The following needs to be done just once, typically during COMSOL installation:&lt;br /&gt;
&lt;br /&gt;
In the COMSOL Installer, or in COMSOL Preferences, enter:&lt;br /&gt;
* &#039;&#039;&#039;License format:&#039;&#039;&#039; Floating Network License (FNL), &amp;quot;Port number and Hostname&amp;quot;&lt;br /&gt;
:: &amp;lt;font style=&amp;quot;color:#777&amp;quot;&amp;gt;Do &#039;&#039;not use&#039;&#039; &amp;quot;Three-server redundancy&amp;quot;, since it cannot (easily) be accessed over SSH. Configure with just one server, and in the rare situation of a server failover, temporarily tweak your SSH configuration to contact the alternate server (see below).&amp;lt;/font&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Server:&#039;&#039;&#039; &amp;lt;code&amp;gt;127.0.0.1&amp;lt;/code&amp;gt;&lt;br /&gt;
:: Do not use &amp;quot;localhost&amp;quot;, as COMSOL interprets this incorrectly to mean that your machine &#039;&#039;is&#039;&#039; a license server.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Port:&#039;&#039;&#039; &amp;lt;code&amp;gt;1718&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
Or place a license file with this content:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;make&amp;quot;&amp;gt;&lt;br /&gt;
SERVER 127.0.0.1 ANY 1718&lt;br /&gt;
USE_SERVER&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
//--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Establish connection to CNM license server ===&lt;br /&gt;
This step needs to be done prior to running COMSOL in your desktop session:&lt;br /&gt;
* Connect to &amp;lt;code&amp;gt;mega&amp;lt;/code&amp;gt; with the following command in a terminal window:&lt;br /&gt;
 ssh  -L 1718:&#039;&#039;&#039;clicense1&#039;&#039;&#039;:1718  -L 1719:&#039;&#039;&#039;clicense1&#039;&#039;&#039;:1719  mega.cnm.anl.gov&lt;br /&gt;
* You can leave this connection running in your terminal window across several invocations of COMSOL.&lt;br /&gt;
&lt;br /&gt;
=== Run COMSOL ===&lt;br /&gt;
# Ensure your connection to &amp;quot;mega&amp;quot; is still running. If not, restart it.&lt;br /&gt;
# Start the COMSOL application.&lt;br /&gt;
&lt;br /&gt;
=== Troubleshooting ===&lt;br /&gt;
* If you get an error that the number of licenses is &amp;quot;exhausted&amp;quot;, that is confirmation that you correctly reached the license server, though other users are using licenses.&lt;br /&gt;
* 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:&lt;br /&gt;
 ssh  -L 1718:clicense&#039;&#039;&#039;2&#039;&#039;&#039;:1718  -L 1719:clicense&#039;&#039;&#039;2&#039;&#039;&#039;:1719  mega.cnm.anl.gov&lt;br /&gt;
&lt;br /&gt;
== General License Troubleshooting ==&lt;br /&gt;
The following are typical error messages.&lt;br /&gt;
=== Could not obtain license for COMSOL Multiphysics GUI ===&lt;br /&gt;
* Error details:&lt;br /&gt;
 License error: -4.&lt;br /&gt;
 &#039;&#039;&#039;Licensed number of users already reached.&#039;&#039;&#039;&lt;br /&gt;
 Feature:       COMSOLGUI&lt;br /&gt;
 License path:  /Users/stern/Applications/COMSOL52a/license/license.dat:&lt;br /&gt;
 FlexNet Licensing error:-4,132&lt;br /&gt;
* Reason: The connection to the license server succeeded, but the license token(s) you requested are in use.&lt;br /&gt;
* Solution: Wait a bit, or [http://carbonmgmt/ganglia/lic.php identify who&#039;s using COMSOL] and politely ask the user when they might be finished with their work.&lt;br /&gt;
&lt;br /&gt;
=== License server machine is down or not responding ===&lt;br /&gt;
* Error details:&lt;br /&gt;
  License error: -96.&lt;br /&gt;
  See the system administrator about starting the license server system, or&lt;br /&gt;
  make sure you&#039;re referring to the right host (see LM_LICENSE_FILE).&lt;br /&gt;
 Feature:       SERIAL&lt;br /&gt;
 Hostname:      clicense3&lt;br /&gt;
 License path:  /Users/stern/Applications/COMSOL52a/license/license.dat:&lt;br /&gt;
 FlexNet Licensing error:-96,7&lt;br /&gt;
* Reason: The license servers cannot be reached at all. The &amp;lt;code&amp;gt;ping&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;host&amp;lt;/code&amp;gt; tests mentioned above fail.&lt;br /&gt;
* Solution: Review the client license file and DNS lookup domains.&lt;br /&gt;
&lt;br /&gt;
=== License file does not support this version ===&lt;br /&gt;
* Error details:&lt;br /&gt;
  Feature: SERIAL&lt;br /&gt;
 &#039;&#039;&#039;Application version &amp;gt; License version: 5.21 &amp;gt; 3.5&#039;&#039;&#039;&lt;br /&gt;
 License path: /Users/stern/Applications/COMSOL52a/license/license.dat:&lt;br /&gt;
 FlexNet Licensing error:-21,126&lt;br /&gt;
* 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&#039;re connected to.&lt;br /&gt;
* Solution: When using SSH, try &amp;lt;code&amp;gt;clicense2&amp;lt;/code&amp;gt; instead of  &amp;lt;code&amp;gt;clicense1&amp;lt;/code&amp;gt;, or vice versa. Revisit your &amp;lt;code&amp;gt;~/.ssh/config&amp;lt;/code&amp;gt; file or use the alternate command line as shown in the SSH section above.&lt;br /&gt;
&lt;br /&gt;
== Multiple CPU cores ==&lt;br /&gt;
Ways to start multi-core (from http://www.comsol.com/support/knowledgebase/1096/)&lt;br /&gt;
 comsol -np 8&lt;br /&gt;
&lt;br /&gt;
 export COMSOL_NUM_THREADS=8    # automatically provided on &#039;&#039;Carbon&#039;&#039;&lt;br /&gt;
 comsol&lt;br /&gt;
* COMSOL does not benefit from hyperthreading (oversubscribing the physical core count).&lt;br /&gt;
&lt;br /&gt;
== Batch jobs ==&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
 comsol -clustersimple batch -inputfile input.mph -outputfile output.mph &lt;br /&gt;
&lt;br /&gt;
 &amp;lt;strike&amp;gt;comsol –nn 8 mpd boot&lt;br /&gt;
 comsol –nn 8 batch –inputfile in.mph&lt;br /&gt;
 comsol mpd allexit&amp;lt;/strike&amp;gt;&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
* http://www.comsol.com/support/knowledgebase/1001/ .&lt;br /&gt;
* [[Media:HPC 2012-05-16 Comsol parallel usage.pdf]] (Modified from http://www.comsol.com/support/knowledgebase/1001/files/4027/cluster_install_linux_42a.pptx – Appendix slide, PBS)&lt;br /&gt;
* &#039;&#039;&#039;Note:&#039;&#039;&#039; MPD is not supported on Carbon (I patched the main comsol script), and no longer necessary at all in Comsol-4.3.&lt;br /&gt;
&lt;br /&gt;
=== Sample Job file ===&lt;br /&gt;
See:&lt;br /&gt;
 $COMSOL_HOME/sample.job&lt;br /&gt;
&lt;br /&gt;
== Important COMSOL Support Articles ==&lt;br /&gt;
* Toplevel suport page: https://www.comsol.com/support&lt;br /&gt;
&lt;br /&gt;
=== KB Articles ===&lt;br /&gt;
* [https://www.comsol.com/support/knowledgebase/1001 Running COMSOL® in parallel on clusters]&lt;br /&gt;
* [https://www.comsol.com/support/knowledgebase/1250 Running parametric sweeps, batch sweeps, and cluster sweeps from the command line]&lt;br /&gt;
* [https://www.comsol.com/support/knowledgebase/1255 Reducing the amount of solution data stored in a model]&lt;br /&gt;
* [https://www.comsol.com/support/knowledgebase/830 Handling large models]&lt;br /&gt;
&lt;br /&gt;
=== Blog-style articles ===&lt;br /&gt;
* [https://www.comsol.com/blogs/the-power-of-the-batch-sweep/ The Power of the Batch Sweep]&lt;br /&gt;
* [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]&lt;/div&gt;</summary>
		<author><name>Stern</name></author>
	</entry>
	<entry>
		<id>https://wiki.anl.gov/wiki_cnm/index.php?title=HPC/Applications/comsol&amp;diff=7499</id>
		<title>HPC/Applications/comsol</title>
		<link rel="alternate" type="text/html" href="https://wiki.anl.gov/wiki_cnm/index.php?title=HPC/Applications/comsol&amp;diff=7499"/>
		<updated>2026-03-04T18:24:43Z</updated>

		<summary type="html">&lt;p&gt;Stern: /* Running the desktop application */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
The [http://www.comsol.com/products/multiphysics/ &#039;&#039;&#039;COMSOL Multiphysics&#039;&#039;&#039;] application suite&lt;br /&gt;
is available for Mac, Windows, and Linux.&lt;br /&gt;
&lt;br /&gt;
== Access ==&lt;br /&gt;
[[Image:HPC Comsol licensed modules.png|right|450px|thumb|COMSOL features licensed at CNM as of 2024-10.]]&lt;br /&gt;
=== COMSOL Multiphysics ===&lt;br /&gt;
Access to &#039;&#039;&#039;COMSOL Multiphysics&#039;&#039;&#039;, the main application with both a graphical user interface and batch computing capabilities, will be granted &#039;&#039;&#039;&#039;&#039;upon request&#039;&#039;&#039;&#039;&#039;&amp;amp;thinsp;.&lt;br /&gt;
&lt;br /&gt;
You must be:&lt;br /&gt;
* An &#039;&#039;&#039;&#039;&#039;Argonne employee&#039;&#039;&#039;&#039;&#039;&amp;amp;thinsp; in one of the following roles:&lt;br /&gt;
** &#039;&#039;&#039;&#039;&#039;NST staff member&#039;&#039;&#039;&#039;&#039;&amp;amp;thinsp; (including PostDocs, joint appointments, and students at NST).&lt;br /&gt;
** &#039;&#039;&#039;&#039;&#039;CNM Facility User&#039;&#039;&#039;&#039;&#039;&amp;amp;thinsp; (including &#039;&#039;non-NST Argonne employees&#039;&#039;), with an active proposal that has COMSOL in scope. Please see [[HPC/FAQ#Access_and_proposals]].&lt;br /&gt;
&lt;br /&gt;
The set of available COMSOL modules that we have licensed is shown at right.&lt;br /&gt;
&lt;br /&gt;
* The native desktop version can be installed only on &#039;&#039;Argonne-owned&#039;&#039; computers (laptop or desktop). Please contact [mailto:help@anl.gov?Subject=COMSOL%20license%20access%20request CNM support]. Make sure to review [http://www.comsol.com/support/updates/ Product Updates].&lt;br /&gt;
* To run COMSOL on our HPC system &#039;&#039;Carbon&#039;&#039;, as GUI or as batch computing jobs, your proposal must have &#039;&#039;Carbon&#039;&#039; access in scope.&lt;br /&gt;
&lt;br /&gt;
=== COMSOL Server ===&lt;br /&gt;
&#039;&#039;CNM Facility Users&#039;&#039; who are not Argonne employees are not eligible to access&lt;br /&gt;
the full &#039;&#039;&#039;COMSOL Multiphysics&#039;&#039;&#039; product, in compliance with its licensing terms and conditions.&lt;br /&gt;
However, the [https://www.comsol.com/comsol-server &#039;&#039;&#039;COMSOL Server&#039;&#039;&#039;] product offers an alternative&lt;br /&gt;
albeit more narrow means of access.&lt;br /&gt;
&lt;br /&gt;
All users, including &#039;&#039;&#039;&#039;&#039;non-Argonne users&#039;&#039;&#039;&#039;&#039; may be able to run, over a web interface in their browser,&lt;br /&gt;
pre-parameterized &amp;quot;fixed-model&amp;quot; simulations that were made with the &#039;&#039;&#039;COMSOL Application Builder&#039;&#039;&#039; (requires Windows).&lt;br /&gt;
&lt;br /&gt;
To inquire about using COMSOL server applications,&lt;br /&gt;
please contact us.&lt;br /&gt;
&amp;lt;!-- [mailto:cnm_useroffice@anl.gov?Subject=COMSOL%20server%20usage Support]. --&amp;gt;&lt;br /&gt;
We will review possible purchase paths for COMSOL Server, and the &#039;&#039;considerable effort&#039;&#039; likely required by users and the CNM to develop and deploy a COMSOL application.&lt;br /&gt;
&lt;br /&gt;
== Support ==&lt;br /&gt;
* For questions on how to run or start COMSOL:&lt;br /&gt;
*: Submit an [[HPC/Support | &#039;&#039;&#039;IT support request&#039;&#039;&#039;]]&lt;br /&gt;
* For questions related to most COMSOL data or scripts, contact COMSOL support at:&lt;br /&gt;
*: [mailto:support@comsol.com &#039;&#039;&#039;support&#039;&#039;&#039;@comsol.com]&lt;br /&gt;
* &#039;&#039;&#039;Exception:&#039;&#039;&#039; If your support question might contain data that is subject to &#039;&#039;&#039;US Export Control&#039;&#039;&#039; regulations, contact instead:&lt;br /&gt;
*: [mailto:us-export-control@us.comsol.com &#039;&#039;&#039;us-export-control&#039;&#039;&#039;@&#039;&#039;&#039;us&#039;&#039;&#039;.comsol.com]&lt;br /&gt;
&lt;br /&gt;
== The modes to run COMSOL ==&lt;br /&gt;
There are several ways of running COMSOL.&lt;br /&gt;
&lt;br /&gt;
=== Running the desktop application ===&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
# Run on your &#039;&#039;Argonne-provided&#039;&#039; computer, checking out Carbon&#039;s license remotely.&lt;br /&gt;
#* Requires a full installation of COMSOL on your desktoo or laptop computer.&lt;br /&gt;
#* 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.&lt;br /&gt;
# Run on Carbon, display on your desktop using the [http://en.wikipedia.org/wiki/X_Window_System X Window system (X11)].&lt;br /&gt;
#* Requires an &#039;&#039;X11 Server&#039;&#039; application running on your client machine, and SSH X11 forwarding.&lt;br /&gt;
#* The X11 protocol can be slow over LAN.&lt;br /&gt;
# Run on Carbon in a [[HPC/Network Access/Virtual Desktop | virtual desktop environment (VNC)]], viewed in a VNC client on your machine.&lt;br /&gt;
#* Requires a VNC client on your machine.&lt;br /&gt;
#* It can be confusing where VNC and the app runs.&lt;br /&gt;
#* The virtual desktop presents a (deliberatly) sparse windowing environment – Copy&amp;amp;Paste can be difficult to use.&lt;br /&gt;
&lt;br /&gt;
=== Running a batch calculation ===&lt;br /&gt;
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.&lt;br /&gt;
See the [[#Batch jobs|section below]].&lt;br /&gt;
&lt;br /&gt;
== Use with X11 ==&lt;br /&gt;
For casual use, and with [[HPC/Network Access/SSH Tunnel Setup on Linux and MacOS | X11 tunneling to Carbon]] set up, simply add to your &amp;lt;code&amp;gt;~/.bashrc&amp;lt;/code&amp;gt; file on Carbon:&lt;br /&gt;
 module load comsol&lt;br /&gt;
&lt;br /&gt;
Then, from the command line on a Carbon login node, start the COMSOL GUI:&lt;br /&gt;
 comsol &amp;amp;&lt;br /&gt;
&lt;br /&gt;
License configuration is automatic on Carbon.&lt;br /&gt;
&lt;br /&gt;
Comsol will use a number of cores to run calculations multithreaded by default. (On Carbon, COMSOL_NUM_THREADS is set.)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Quit the application&#039;&#039;&#039; as soon as you are done. Only one user can use Comsol at a time.&lt;br /&gt;
&lt;br /&gt;
== Use with VNC ==&lt;br /&gt;
See general  [[HPC/Network Access/Virtual Desktop | instructions on using VNC]], and the COMSOL example therein.&lt;br /&gt;
&lt;br /&gt;
== Native desktop version ==&lt;br /&gt;
&lt;br /&gt;
To get the fastest response from the COMSOL GUI, run a native COMSOL version on your desktop machine or laptop, called &#039;&#039;client machine&#039;&#039; below.&lt;br /&gt;
&lt;br /&gt;
Enter license details either in the COMSOL Setup configuration dialog.&lt;br /&gt;
&lt;br /&gt;
== Native desktop version — License configuration ==&lt;br /&gt;
A client&#039;s COMSOL license needs to be configured depending on how the client reaches CNM network resources. Follow the appropriate section:&lt;br /&gt;
&lt;br /&gt;
* [[#License configuration when inside CNM or on CNM VPN|License configuration when &#039;&#039;&#039;inside CNM&#039;&#039;&#039; or on &#039;&#039;&#039;CNM VPN&#039;&#039;&#039;]]&lt;br /&gt;
: Requires that the user&#039;s machine is logically within the network of CNM/NST, either by a wired/auth WiFi connection in the building or by VPN under a CNM/NST profile.&lt;br /&gt;
* [[#License configuration when outside CNM – requires SSH Tunneling|License configuration when &#039;&#039;&#039;outside CNM&#039;&#039;&#039; – requires SSH Tunneling]]&lt;br /&gt;
: &#039;&#039;Non-NST staff&#039;&#039; usually have a VPN profile that places the machine logically [[#License configuration when outside CNM – requires SSH Tunneling|outside of NST&#039;s network.]]&lt;br /&gt;
&lt;br /&gt;
== License configuration when inside CNM or on CNM VPN ==&lt;br /&gt;
=== &amp;lt;span style=&amp;quot;color:#A00;&amp;quot;&amp;gt;Ensure correct DNS search domains&amp;lt;/span&amp;gt; ===&lt;br /&gt;
* Inspect the client machine&#039;s network configuration.&lt;br /&gt;
* Ensure that &#039;&#039;&#039;two&#039;&#039;&#039; entries are listed as DNS Search Domains for the current network profile:&lt;br /&gt;
 nst.anl.gov&lt;br /&gt;
 cnm.anl.gov&lt;br /&gt;
: (The order of entries does not matter for the purposes considered here.)&lt;br /&gt;
* If the client machine is &#039;&#039;wired to CNM networks&#039;&#039;, the domains are normally provided correctly by DHCP.&lt;br /&gt;
* If the client machine is &#039;&#039;connected over VPN&#039;&#039;, you may need edit the respective network profile.&lt;br /&gt;
:* 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 &amp;quot;Advanced…&amp;quot;. It appears that those changes are being saved and will be activated automatically the next time that this VPN session gets started.&lt;br /&gt;
: [[Image:VNC_add_cnm_to_DNS_1.png|400px]] [[Image:VNC_add_cnm_to_DNS_2.png|400px]]&lt;br /&gt;
:* On Windows or Linux machines, take &#039;&#039;analogous&#039;&#039; steps, using the platform&#039;s own configuration tools.&lt;br /&gt;
&lt;br /&gt;
* Exclude license manager components from client desktop installation. (Those are all handled server-side.)&lt;br /&gt;
&lt;br /&gt;
=== License format ===&lt;br /&gt;
* Floating Network License (FNL), &amp;quot;Three-server redundancy&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== License servers ===&lt;br /&gt;
* On client machines, while running the COMSOL installer or license configuration, specify license servers and ports as follows:&lt;br /&gt;
 1718    clicense1&lt;br /&gt;
 1718    clicense2&lt;br /&gt;
 1718    clicense3&lt;br /&gt;
: &#039;&#039;&#039;Note:&#039;&#039;&#039; Use &#039;&#039;short host names only&#039;&#039;. (Technical Reason: The license must be usable both on Carbon&#039;s internal network as well as on divisional networks).&lt;br /&gt;
 1718    clicense1&amp;lt;strike&amp;gt;.cnm.anl.gov&amp;lt;/strike&amp;gt;&lt;br /&gt;
 1718    clicense2&amp;lt;strike&amp;gt;.cnm.anl.gov&amp;lt;/strike&amp;gt;&lt;br /&gt;
 1718    clicense3&amp;lt;strike&amp;gt;.cnm.anl.gov&amp;lt;/strike&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Advanced:&#039;&#039;&#039; A client machine&#039;s COMSOL license file &amp;lt;code&amp;gt;&amp;amp;lt;COMSOLDIR&amp;amp;gt;/Multiphysics/license/license.dat&amp;lt;/code&amp;gt; should look as follows:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;make&amp;quot;&amp;gt;&lt;br /&gt;
SERVER clicense1 ANY 1718&lt;br /&gt;
SERVER clicense2 ANY 1718&lt;br /&gt;
SERVER clicense3 ANY 1718&lt;br /&gt;
USE_SERVER&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;amp;lt;COMSOLDIR&amp;amp;gt;&amp;lt;/code&amp;gt; is located by default at:&lt;br /&gt;
* &#039;&#039;&#039;Windows&#039;&#039;&#039;: C:\Program files\COMSOL\COMSOL&#039;&#039;nn&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Linux&#039;&#039;&#039;: /usr/local/comsol&#039;&#039;nn&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Mac&#039;&#039;&#039;: /Applications/COMSOL&#039;&#039;nn&#039;&#039;&lt;br /&gt;
(&amp;quot;&#039;&#039;nn&#039;&#039;&amp;quot; is the application&#039;s abbreviated version number.)&lt;br /&gt;
&lt;br /&gt;
=== Network Troubleshooting ===&lt;br /&gt;
When using the license access model descibed here (as opposed to tunneled over SSH), ensure the following:&lt;br /&gt;
* Verify that short host names can be resolved to IP addresses. Either one of the following commands should produce sensible output:&lt;br /&gt;
 host clicense1&lt;br /&gt;
: or:&lt;br /&gt;
 ping -c 3 clicense1&lt;br /&gt;
* Verify that &#039;&#039;both license ports on the same server&#039;&#039; can be reached from your client machine:&lt;br /&gt;
 telnet &#039;&#039;&#039;clicense1&#039;&#039;&#039; 1718&lt;br /&gt;
 telnet &#039;&#039;&#039;clicense1&#039;&#039;&#039; 1719&lt;br /&gt;
: or:&lt;br /&gt;
 telnet &#039;&#039;&#039;clicense2&#039;&#039;&#039; 1718&lt;br /&gt;
 telnet &#039;&#039;&#039;clicense2&#039;&#039;&#039; 1719&lt;br /&gt;
: A &#039;&#039;successful&#039;&#039; connection looks like:&lt;br /&gt;
 Trying 146.139.x.y...&lt;br /&gt;
 Connected to clicense1.cnm.anl.gov.&lt;br /&gt;
 Escape character is &#039;^]&#039;.&lt;br /&gt;
:: Do not enter any data. Instead,  close each connection by hitting &amp;lt;code&amp;gt;Ctrl&amp;lt;/code&amp;gt;&amp;lt;code&amp;gt;]&amp;lt;/code&amp;gt; (closing square bracket), followed by &amp;lt;code&amp;gt;Ctrl&amp;lt;/code&amp;gt;&amp;lt;code&amp;gt;D&amp;lt;/code&amp;gt;.&lt;br /&gt;
: A &#039;&#039;failed&#039;&#039; connection gives one of these errors:&lt;br /&gt;
 telnet: connect to address 146.139.x.y: Operation timed out&lt;br /&gt;
: or:&lt;br /&gt;
 telnet: connect to address 146.139.x.y: Connection refused&lt;br /&gt;
:: In these cases, ask that your IP firewall configuration be reviewed and changed.&lt;br /&gt;
&lt;br /&gt;
== License configuration when outside CNM – requires SSH Tunneling ==&lt;br /&gt;
This section documents how to run COMSOL from a network location outside CNM.&lt;br /&gt;
&lt;br /&gt;
As a one-time preparation step, two items must be configured:&lt;br /&gt;
* The license host that COMSOL is to contact, and&lt;br /&gt;
* An SSH connection that will allow your machine to access the COMSOL license server inside CNM&#039;s network.&lt;br /&gt;
&lt;br /&gt;
To then &#039;&#039;run&#039;&#039; the COMSOL application, the configured SSH connection must be up and kept running for the entire time that you run the COMSOL. When you exit COMSOL and wish to start it again, you can keep the SSH connection running, it will be re-used for the next COMSOL run.&lt;br /&gt;
&lt;br /&gt;
=== Configure COMSOL ===&lt;br /&gt;
The following needs to be done just once, typically during COMSOL installation:&lt;br /&gt;
&lt;br /&gt;
In the COMSOL Installer, or in COMSOL Preferences, enter:&lt;br /&gt;
* &#039;&#039;&#039;License format:&#039;&#039;&#039; Floating Network License (FNL), &amp;quot;Port number and Hostname&amp;quot;&lt;br /&gt;
:: &amp;lt;font style=&amp;quot;color:#777&amp;quot;&amp;gt;Do &#039;&#039;not use&#039;&#039; &amp;quot;Three-server redundancy&amp;quot;, since it cannot (easily) be accessed over SSH. Configure with just one server, and in the rare situation of a server failover, temporarily tweak your SSH configuration to contact the alternate server (see below).&amp;lt;/font&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Server:&#039;&#039;&#039; &amp;lt;code&amp;gt;127.0.0.1&amp;lt;/code&amp;gt;&lt;br /&gt;
:: Do not use &amp;quot;localhost&amp;quot;, as COMSOL interprets this incorrectly to mean that your machine &#039;&#039;is&#039;&#039; a license server.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Port:&#039;&#039;&#039; &amp;lt;code&amp;gt;1718&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
Or place a license file with this content:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;make&amp;quot;&amp;gt;&lt;br /&gt;
SERVER 127.0.0.1 ANY 1718&lt;br /&gt;
USE_SERVER&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
//--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Establish connection to CNM license server ===&lt;br /&gt;
This step needs to be done prior to running COMSOL in your desktop session:&lt;br /&gt;
* Connect to &amp;lt;code&amp;gt;mega&amp;lt;/code&amp;gt; with the following command in a terminal window:&lt;br /&gt;
 ssh  -L 1718:&#039;&#039;&#039;clicense1&#039;&#039;&#039;:1718  -L 1719:&#039;&#039;&#039;clicense1&#039;&#039;&#039;:1719  mega.cnm.anl.gov&lt;br /&gt;
* You can leave this connection running in your terminal window across several invocations of COMSOL.&lt;br /&gt;
&lt;br /&gt;
=== Run COMSOL ===&lt;br /&gt;
# Ensure your connection to &amp;quot;mega&amp;quot; is still running. If not, restart it.&lt;br /&gt;
# Start the COMSOL application.&lt;br /&gt;
&lt;br /&gt;
=== Troubleshooting ===&lt;br /&gt;
* If you get an error that the number of licenses is &amp;quot;exhausted&amp;quot;, that is confirmation that you correctly reached the license server, though other users are using licenses.&lt;br /&gt;
* 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:&lt;br /&gt;
 ssh  -L 1718:clicense&#039;&#039;&#039;2&#039;&#039;&#039;:1718  -L 1719:clicense&#039;&#039;&#039;2&#039;&#039;&#039;:1719  mega.cnm.anl.gov&lt;br /&gt;
&lt;br /&gt;
== General License Troubleshooting ==&lt;br /&gt;
The following are typical error messages.&lt;br /&gt;
=== Could not obtain license for COMSOL Multiphysics GUI ===&lt;br /&gt;
* Error details:&lt;br /&gt;
 License error: -4.&lt;br /&gt;
 &#039;&#039;&#039;Licensed number of users already reached.&#039;&#039;&#039;&lt;br /&gt;
 Feature:       COMSOLGUI&lt;br /&gt;
 License path:  /Users/stern/Applications/COMSOL52a/license/license.dat:&lt;br /&gt;
 FlexNet Licensing error:-4,132&lt;br /&gt;
* Reason: The connection to the license server succeeded, but the license token(s) you requested are in use.&lt;br /&gt;
* Solution: Wait a bit, or [http://carbonmgmt/ganglia/lic.php identify who&#039;s using COMSOL] and politely ask the user when they might be finished with their work.&lt;br /&gt;
&lt;br /&gt;
=== License server machine is down or not responding ===&lt;br /&gt;
* Error details:&lt;br /&gt;
  License error: -96.&lt;br /&gt;
  See the system administrator about starting the license server system, or&lt;br /&gt;
  make sure you&#039;re referring to the right host (see LM_LICENSE_FILE).&lt;br /&gt;
 Feature:       SERIAL&lt;br /&gt;
 Hostname:      clicense3&lt;br /&gt;
 License path:  /Users/stern/Applications/COMSOL52a/license/license.dat:&lt;br /&gt;
 FlexNet Licensing error:-96,7&lt;br /&gt;
* Reason: The license servers cannot be reached at all. The &amp;lt;code&amp;gt;ping&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;host&amp;lt;/code&amp;gt; tests mentioned above fail.&lt;br /&gt;
* Solution: Review the client license file and DNS lookup domains.&lt;br /&gt;
&lt;br /&gt;
=== License file does not support this version ===&lt;br /&gt;
* Error details:&lt;br /&gt;
  Feature: SERIAL&lt;br /&gt;
 &#039;&#039;&#039;Application version &amp;gt; License version: 5.21 &amp;gt; 3.5&#039;&#039;&#039;&lt;br /&gt;
 License path: /Users/stern/Applications/COMSOL52a/license/license.dat:&lt;br /&gt;
 FlexNet Licensing error:-21,126&lt;br /&gt;
* 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&#039;re connected to.&lt;br /&gt;
* Solution: When using SSH, try &amp;lt;code&amp;gt;clicense2&amp;lt;/code&amp;gt; instead of  &amp;lt;code&amp;gt;clicense1&amp;lt;/code&amp;gt;, or vice versa. Revisit your &amp;lt;code&amp;gt;~/.ssh/config&amp;lt;/code&amp;gt; file or use the alternate command line as shown in the SSH section above.&lt;br /&gt;
&lt;br /&gt;
== Multiple CPU cores ==&lt;br /&gt;
Ways to start multi-core (from http://www.comsol.com/support/knowledgebase/1096/)&lt;br /&gt;
 comsol -np 8&lt;br /&gt;
&lt;br /&gt;
 export COMSOL_NUM_THREADS=8    # automatically provided on &#039;&#039;Carbon&#039;&#039;&lt;br /&gt;
 comsol&lt;br /&gt;
* COMSOL does not benefit from hyperthreading (oversubscribing the physical core count).&lt;br /&gt;
&lt;br /&gt;
== Batch jobs ==&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
 comsol -clustersimple batch -inputfile input.mph -outputfile output.mph &lt;br /&gt;
&lt;br /&gt;
 &amp;lt;strike&amp;gt;comsol –nn 8 mpd boot&lt;br /&gt;
 comsol –nn 8 batch –inputfile in.mph&lt;br /&gt;
 comsol mpd allexit&amp;lt;/strike&amp;gt;&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
* http://www.comsol.com/support/knowledgebase/1001/ .&lt;br /&gt;
* [[Media:HPC 2012-05-16 Comsol parallel usage.pdf]] (Modified from http://www.comsol.com/support/knowledgebase/1001/files/4027/cluster_install_linux_42a.pptx – Appendix slide, PBS)&lt;br /&gt;
* &#039;&#039;&#039;Note:&#039;&#039;&#039; MPD is not supported on Carbon (I patched the main comsol script), and no longer necessary at all in Comsol-4.3.&lt;br /&gt;
&lt;br /&gt;
=== Sample Job file ===&lt;br /&gt;
See:&lt;br /&gt;
 $COMSOL_HOME/sample.job&lt;br /&gt;
&lt;br /&gt;
== Important COMSOL Support Articles ==&lt;br /&gt;
* Toplevel suport page: https://www.comsol.com/support&lt;br /&gt;
&lt;br /&gt;
=== KB Articles ===&lt;br /&gt;
* [https://www.comsol.com/support/knowledgebase/1001 Running COMSOL® in parallel on clusters]&lt;br /&gt;
* [https://www.comsol.com/support/knowledgebase/1250 Running parametric sweeps, batch sweeps, and cluster sweeps from the command line]&lt;br /&gt;
* [https://www.comsol.com/support/knowledgebase/1255 Reducing the amount of solution data stored in a model]&lt;br /&gt;
* [https://www.comsol.com/support/knowledgebase/830 Handling large models]&lt;br /&gt;
&lt;br /&gt;
=== Blog-style articles ===&lt;br /&gt;
* [https://www.comsol.com/blogs/the-power-of-the-batch-sweep/ The Power of the Batch Sweep]&lt;br /&gt;
* [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]&lt;/div&gt;</summary>
		<author><name>Stern</name></author>
	</entry>
	<entry>
		<id>https://wiki.anl.gov/wiki_cnm/index.php?title=HPC/Applications/comsol&amp;diff=7498</id>
		<title>HPC/Applications/comsol</title>
		<link rel="alternate" type="text/html" href="https://wiki.anl.gov/wiki_cnm/index.php?title=HPC/Applications/comsol&amp;diff=7498"/>
		<updated>2026-03-04T18:24:27Z</updated>

		<summary type="html">&lt;p&gt;Stern: /* Running the desktop application */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
The [http://www.comsol.com/products/multiphysics/ &#039;&#039;&#039;COMSOL Multiphysics&#039;&#039;&#039;] application suite&lt;br /&gt;
is available for Mac, Windows, and Linux.&lt;br /&gt;
&lt;br /&gt;
== Access ==&lt;br /&gt;
[[Image:HPC Comsol licensed modules.png|right|450px|thumb|COMSOL features licensed at CNM as of 2024-10.]]&lt;br /&gt;
=== COMSOL Multiphysics ===&lt;br /&gt;
Access to &#039;&#039;&#039;COMSOL Multiphysics&#039;&#039;&#039;, the main application with both a graphical user interface and batch computing capabilities, will be granted &#039;&#039;&#039;&#039;&#039;upon request&#039;&#039;&#039;&#039;&#039;&amp;amp;thinsp;.&lt;br /&gt;
&lt;br /&gt;
You must be:&lt;br /&gt;
* An &#039;&#039;&#039;&#039;&#039;Argonne employee&#039;&#039;&#039;&#039;&#039;&amp;amp;thinsp; in one of the following roles:&lt;br /&gt;
** &#039;&#039;&#039;&#039;&#039;NST staff member&#039;&#039;&#039;&#039;&#039;&amp;amp;thinsp; (including PostDocs, joint appointments, and students at NST).&lt;br /&gt;
** &#039;&#039;&#039;&#039;&#039;CNM Facility User&#039;&#039;&#039;&#039;&#039;&amp;amp;thinsp; (including &#039;&#039;non-NST Argonne employees&#039;&#039;), with an active proposal that has COMSOL in scope. Please see [[HPC/FAQ#Access_and_proposals]].&lt;br /&gt;
&lt;br /&gt;
The set of available COMSOL modules that we have licensed is shown at right.&lt;br /&gt;
&lt;br /&gt;
* The native desktop version can be installed only on &#039;&#039;Argonne-owned&#039;&#039; computers (laptop or desktop). Please contact [mailto:help@anl.gov?Subject=COMSOL%20license%20access%20request CNM support]. Make sure to review [http://www.comsol.com/support/updates/ Product Updates].&lt;br /&gt;
* To run COMSOL on our HPC system &#039;&#039;Carbon&#039;&#039;, as GUI or as batch computing jobs, your proposal must have &#039;&#039;Carbon&#039;&#039; access in scope.&lt;br /&gt;
&lt;br /&gt;
=== COMSOL Server ===&lt;br /&gt;
&#039;&#039;CNM Facility Users&#039;&#039; who are not Argonne employees are not eligible to access&lt;br /&gt;
the full &#039;&#039;&#039;COMSOL Multiphysics&#039;&#039;&#039; product, in compliance with its licensing terms and conditions.&lt;br /&gt;
However, the [https://www.comsol.com/comsol-server &#039;&#039;&#039;COMSOL Server&#039;&#039;&#039;] product offers an alternative&lt;br /&gt;
albeit more narrow means of access.&lt;br /&gt;
&lt;br /&gt;
All users, including &#039;&#039;&#039;&#039;&#039;non-Argonne users&#039;&#039;&#039;&#039;&#039; may be able to run, over a web interface in their browser,&lt;br /&gt;
pre-parameterized &amp;quot;fixed-model&amp;quot; simulations that were made with the &#039;&#039;&#039;COMSOL Application Builder&#039;&#039;&#039; (requires Windows).&lt;br /&gt;
&lt;br /&gt;
To inquire about using COMSOL server applications,&lt;br /&gt;
please contact us.&lt;br /&gt;
&amp;lt;!-- [mailto:cnm_useroffice@anl.gov?Subject=COMSOL%20server%20usage Support]. --&amp;gt;&lt;br /&gt;
We will review possible purchase paths for COMSOL Server, and the &#039;&#039;considerable effort&#039;&#039; likely required by users and the CNM to develop and deploy a COMSOL application.&lt;br /&gt;
&lt;br /&gt;
== Support ==&lt;br /&gt;
* For questions on how to run or start COMSOL:&lt;br /&gt;
*: Submit an [[HPC/Support | &#039;&#039;&#039;IT support request&#039;&#039;&#039;]]&lt;br /&gt;
* For questions related to most COMSOL data or scripts, contact COMSOL support at:&lt;br /&gt;
*: [mailto:support@comsol.com &#039;&#039;&#039;support&#039;&#039;&#039;@comsol.com]&lt;br /&gt;
* &#039;&#039;&#039;Exception:&#039;&#039;&#039; If your support question might contain data that is subject to &#039;&#039;&#039;US Export Control&#039;&#039;&#039; regulations, contact instead:&lt;br /&gt;
*: [mailto:us-export-control@us.comsol.com &#039;&#039;&#039;us-export-control&#039;&#039;&#039;@&#039;&#039;&#039;us&#039;&#039;&#039;.comsol.com]&lt;br /&gt;
&lt;br /&gt;
== The modes to run COMSOL ==&lt;br /&gt;
There are several ways of running COMSOL.&lt;br /&gt;
&lt;br /&gt;
=== Running the desktop application ===&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
# Run on your Argonne-provided computer, checking out Carbon&#039;s license remotely.&lt;br /&gt;
#* Requires a full installation of COMSOL on your desktoo or laptop computer.&lt;br /&gt;
#* 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.&lt;br /&gt;
# Run on Carbon, display on your desktop using the [http://en.wikipedia.org/wiki/X_Window_System X Window system (X11)].&lt;br /&gt;
#* Requires an &#039;&#039;X11 Server&#039;&#039; application running on your client machine, and SSH X11 forwarding.&lt;br /&gt;
#* The X11 protocol can be slow over LAN.&lt;br /&gt;
# Run on Carbon in a [[HPC/Network Access/Virtual Desktop | virtual desktop environment (VNC)]], viewed in a VNC client on your machine.&lt;br /&gt;
#* Requires a VNC client on your machine.&lt;br /&gt;
#* It can be confusing where VNC and the app runs.&lt;br /&gt;
#* The virtual desktop presents a (deliberatly) sparse windowing environment – Copy&amp;amp;Paste can be difficult to use.&lt;br /&gt;
&lt;br /&gt;
=== Running a batch calculation ===&lt;br /&gt;
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.&lt;br /&gt;
See the [[#Batch jobs|section below]].&lt;br /&gt;
&lt;br /&gt;
== Use with X11 ==&lt;br /&gt;
For casual use, and with [[HPC/Network Access/SSH Tunnel Setup on Linux and MacOS | X11 tunneling to Carbon]] set up, simply add to your &amp;lt;code&amp;gt;~/.bashrc&amp;lt;/code&amp;gt; file on Carbon:&lt;br /&gt;
 module load comsol&lt;br /&gt;
&lt;br /&gt;
Then, from the command line on a Carbon login node, start the COMSOL GUI:&lt;br /&gt;
 comsol &amp;amp;&lt;br /&gt;
&lt;br /&gt;
License configuration is automatic on Carbon.&lt;br /&gt;
&lt;br /&gt;
Comsol will use a number of cores to run calculations multithreaded by default. (On Carbon, COMSOL_NUM_THREADS is set.)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Quit the application&#039;&#039;&#039; as soon as you are done. Only one user can use Comsol at a time.&lt;br /&gt;
&lt;br /&gt;
== Use with VNC ==&lt;br /&gt;
See general  [[HPC/Network Access/Virtual Desktop | instructions on using VNC]], and the COMSOL example therein.&lt;br /&gt;
&lt;br /&gt;
== Native desktop version ==&lt;br /&gt;
&lt;br /&gt;
To get the fastest response from the COMSOL GUI, run a native COMSOL version on your desktop machine or laptop, called &#039;&#039;client machine&#039;&#039; below.&lt;br /&gt;
&lt;br /&gt;
Enter license details either in the COMSOL Setup configuration dialog.&lt;br /&gt;
&lt;br /&gt;
== Native desktop version — License configuration ==&lt;br /&gt;
A client&#039;s COMSOL license needs to be configured depending on how the client reaches CNM network resources. Follow the appropriate section:&lt;br /&gt;
&lt;br /&gt;
* [[#License configuration when inside CNM or on CNM VPN|License configuration when &#039;&#039;&#039;inside CNM&#039;&#039;&#039; or on &#039;&#039;&#039;CNM VPN&#039;&#039;&#039;]]&lt;br /&gt;
: Requires that the user&#039;s machine is logically within the network of CNM/NST, either by a wired/auth WiFi connection in the building or by VPN under a CNM/NST profile.&lt;br /&gt;
* [[#License configuration when outside CNM – requires SSH Tunneling|License configuration when &#039;&#039;&#039;outside CNM&#039;&#039;&#039; – requires SSH Tunneling]]&lt;br /&gt;
: &#039;&#039;Non-NST staff&#039;&#039; usually have a VPN profile that places the machine logically [[#License configuration when outside CNM – requires SSH Tunneling|outside of NST&#039;s network.]]&lt;br /&gt;
&lt;br /&gt;
== License configuration when inside CNM or on CNM VPN ==&lt;br /&gt;
=== &amp;lt;span style=&amp;quot;color:#A00;&amp;quot;&amp;gt;Ensure correct DNS search domains&amp;lt;/span&amp;gt; ===&lt;br /&gt;
* Inspect the client machine&#039;s network configuration.&lt;br /&gt;
* Ensure that &#039;&#039;&#039;two&#039;&#039;&#039; entries are listed as DNS Search Domains for the current network profile:&lt;br /&gt;
 nst.anl.gov&lt;br /&gt;
 cnm.anl.gov&lt;br /&gt;
: (The order of entries does not matter for the purposes considered here.)&lt;br /&gt;
* If the client machine is &#039;&#039;wired to CNM networks&#039;&#039;, the domains are normally provided correctly by DHCP.&lt;br /&gt;
* If the client machine is &#039;&#039;connected over VPN&#039;&#039;, you may need edit the respective network profile.&lt;br /&gt;
:* 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 &amp;quot;Advanced…&amp;quot;. It appears that those changes are being saved and will be activated automatically the next time that this VPN session gets started.&lt;br /&gt;
: [[Image:VNC_add_cnm_to_DNS_1.png|400px]] [[Image:VNC_add_cnm_to_DNS_2.png|400px]]&lt;br /&gt;
:* On Windows or Linux machines, take &#039;&#039;analogous&#039;&#039; steps, using the platform&#039;s own configuration tools.&lt;br /&gt;
&lt;br /&gt;
* Exclude license manager components from client desktop installation. (Those are all handled server-side.)&lt;br /&gt;
&lt;br /&gt;
=== License format ===&lt;br /&gt;
* Floating Network License (FNL), &amp;quot;Three-server redundancy&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== License servers ===&lt;br /&gt;
* On client machines, while running the COMSOL installer or license configuration, specify license servers and ports as follows:&lt;br /&gt;
 1718    clicense1&lt;br /&gt;
 1718    clicense2&lt;br /&gt;
 1718    clicense3&lt;br /&gt;
: &#039;&#039;&#039;Note:&#039;&#039;&#039; Use &#039;&#039;short host names only&#039;&#039;. (Technical Reason: The license must be usable both on Carbon&#039;s internal network as well as on divisional networks).&lt;br /&gt;
 1718    clicense1&amp;lt;strike&amp;gt;.cnm.anl.gov&amp;lt;/strike&amp;gt;&lt;br /&gt;
 1718    clicense2&amp;lt;strike&amp;gt;.cnm.anl.gov&amp;lt;/strike&amp;gt;&lt;br /&gt;
 1718    clicense3&amp;lt;strike&amp;gt;.cnm.anl.gov&amp;lt;/strike&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Advanced:&#039;&#039;&#039; A client machine&#039;s COMSOL license file &amp;lt;code&amp;gt;&amp;amp;lt;COMSOLDIR&amp;amp;gt;/Multiphysics/license/license.dat&amp;lt;/code&amp;gt; should look as follows:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;make&amp;quot;&amp;gt;&lt;br /&gt;
SERVER clicense1 ANY 1718&lt;br /&gt;
SERVER clicense2 ANY 1718&lt;br /&gt;
SERVER clicense3 ANY 1718&lt;br /&gt;
USE_SERVER&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;amp;lt;COMSOLDIR&amp;amp;gt;&amp;lt;/code&amp;gt; is located by default at:&lt;br /&gt;
* &#039;&#039;&#039;Windows&#039;&#039;&#039;: C:\Program files\COMSOL\COMSOL&#039;&#039;nn&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Linux&#039;&#039;&#039;: /usr/local/comsol&#039;&#039;nn&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Mac&#039;&#039;&#039;: /Applications/COMSOL&#039;&#039;nn&#039;&#039;&lt;br /&gt;
(&amp;quot;&#039;&#039;nn&#039;&#039;&amp;quot; is the application&#039;s abbreviated version number.)&lt;br /&gt;
&lt;br /&gt;
=== Network Troubleshooting ===&lt;br /&gt;
When using the license access model descibed here (as opposed to tunneled over SSH), ensure the following:&lt;br /&gt;
* Verify that short host names can be resolved to IP addresses. Either one of the following commands should produce sensible output:&lt;br /&gt;
 host clicense1&lt;br /&gt;
: or:&lt;br /&gt;
 ping -c 3 clicense1&lt;br /&gt;
* Verify that &#039;&#039;both license ports on the same server&#039;&#039; can be reached from your client machine:&lt;br /&gt;
 telnet &#039;&#039;&#039;clicense1&#039;&#039;&#039; 1718&lt;br /&gt;
 telnet &#039;&#039;&#039;clicense1&#039;&#039;&#039; 1719&lt;br /&gt;
: or:&lt;br /&gt;
 telnet &#039;&#039;&#039;clicense2&#039;&#039;&#039; 1718&lt;br /&gt;
 telnet &#039;&#039;&#039;clicense2&#039;&#039;&#039; 1719&lt;br /&gt;
: A &#039;&#039;successful&#039;&#039; connection looks like:&lt;br /&gt;
 Trying 146.139.x.y...&lt;br /&gt;
 Connected to clicense1.cnm.anl.gov.&lt;br /&gt;
 Escape character is &#039;^]&#039;.&lt;br /&gt;
:: Do not enter any data. Instead,  close each connection by hitting &amp;lt;code&amp;gt;Ctrl&amp;lt;/code&amp;gt;&amp;lt;code&amp;gt;]&amp;lt;/code&amp;gt; (closing square bracket), followed by &amp;lt;code&amp;gt;Ctrl&amp;lt;/code&amp;gt;&amp;lt;code&amp;gt;D&amp;lt;/code&amp;gt;.&lt;br /&gt;
: A &#039;&#039;failed&#039;&#039; connection gives one of these errors:&lt;br /&gt;
 telnet: connect to address 146.139.x.y: Operation timed out&lt;br /&gt;
: or:&lt;br /&gt;
 telnet: connect to address 146.139.x.y: Connection refused&lt;br /&gt;
:: In these cases, ask that your IP firewall configuration be reviewed and changed.&lt;br /&gt;
&lt;br /&gt;
== License configuration when outside CNM – requires SSH Tunneling ==&lt;br /&gt;
This section documents how to run COMSOL from a network location outside CNM.&lt;br /&gt;
&lt;br /&gt;
As a one-time preparation step, two items must be configured:&lt;br /&gt;
* The license host that COMSOL is to contact, and&lt;br /&gt;
* An SSH connection that will allow your machine to access the COMSOL license server inside CNM&#039;s network.&lt;br /&gt;
&lt;br /&gt;
To then &#039;&#039;run&#039;&#039; the COMSOL application, the configured SSH connection must be up and kept running for the entire time that you run the COMSOL. When you exit COMSOL and wish to start it again, you can keep the SSH connection running, it will be re-used for the next COMSOL run.&lt;br /&gt;
&lt;br /&gt;
=== Configure COMSOL ===&lt;br /&gt;
The following needs to be done just once, typically during COMSOL installation:&lt;br /&gt;
&lt;br /&gt;
In the COMSOL Installer, or in COMSOL Preferences, enter:&lt;br /&gt;
* &#039;&#039;&#039;License format:&#039;&#039;&#039; Floating Network License (FNL), &amp;quot;Port number and Hostname&amp;quot;&lt;br /&gt;
:: &amp;lt;font style=&amp;quot;color:#777&amp;quot;&amp;gt;Do &#039;&#039;not use&#039;&#039; &amp;quot;Three-server redundancy&amp;quot;, since it cannot (easily) be accessed over SSH. Configure with just one server, and in the rare situation of a server failover, temporarily tweak your SSH configuration to contact the alternate server (see below).&amp;lt;/font&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Server:&#039;&#039;&#039; &amp;lt;code&amp;gt;127.0.0.1&amp;lt;/code&amp;gt;&lt;br /&gt;
:: Do not use &amp;quot;localhost&amp;quot;, as COMSOL interprets this incorrectly to mean that your machine &#039;&#039;is&#039;&#039; a license server.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Port:&#039;&#039;&#039; &amp;lt;code&amp;gt;1718&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
Or place a license file with this content:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;make&amp;quot;&amp;gt;&lt;br /&gt;
SERVER 127.0.0.1 ANY 1718&lt;br /&gt;
USE_SERVER&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
//--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Establish connection to CNM license server ===&lt;br /&gt;
This step needs to be done prior to running COMSOL in your desktop session:&lt;br /&gt;
* Connect to &amp;lt;code&amp;gt;mega&amp;lt;/code&amp;gt; with the following command in a terminal window:&lt;br /&gt;
 ssh  -L 1718:&#039;&#039;&#039;clicense1&#039;&#039;&#039;:1718  -L 1719:&#039;&#039;&#039;clicense1&#039;&#039;&#039;:1719  mega.cnm.anl.gov&lt;br /&gt;
* You can leave this connection running in your terminal window across several invocations of COMSOL.&lt;br /&gt;
&lt;br /&gt;
=== Run COMSOL ===&lt;br /&gt;
# Ensure your connection to &amp;quot;mega&amp;quot; is still running. If not, restart it.&lt;br /&gt;
# Start the COMSOL application.&lt;br /&gt;
&lt;br /&gt;
=== Troubleshooting ===&lt;br /&gt;
* If you get an error that the number of licenses is &amp;quot;exhausted&amp;quot;, that is confirmation that you correctly reached the license server, though other users are using licenses.&lt;br /&gt;
* 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:&lt;br /&gt;
 ssh  -L 1718:clicense&#039;&#039;&#039;2&#039;&#039;&#039;:1718  -L 1719:clicense&#039;&#039;&#039;2&#039;&#039;&#039;:1719  mega.cnm.anl.gov&lt;br /&gt;
&lt;br /&gt;
== General License Troubleshooting ==&lt;br /&gt;
The following are typical error messages.&lt;br /&gt;
=== Could not obtain license for COMSOL Multiphysics GUI ===&lt;br /&gt;
* Error details:&lt;br /&gt;
 License error: -4.&lt;br /&gt;
 &#039;&#039;&#039;Licensed number of users already reached.&#039;&#039;&#039;&lt;br /&gt;
 Feature:       COMSOLGUI&lt;br /&gt;
 License path:  /Users/stern/Applications/COMSOL52a/license/license.dat:&lt;br /&gt;
 FlexNet Licensing error:-4,132&lt;br /&gt;
* Reason: The connection to the license server succeeded, but the license token(s) you requested are in use.&lt;br /&gt;
* Solution: Wait a bit, or [http://carbonmgmt/ganglia/lic.php identify who&#039;s using COMSOL] and politely ask the user when they might be finished with their work.&lt;br /&gt;
&lt;br /&gt;
=== License server machine is down or not responding ===&lt;br /&gt;
* Error details:&lt;br /&gt;
  License error: -96.&lt;br /&gt;
  See the system administrator about starting the license server system, or&lt;br /&gt;
  make sure you&#039;re referring to the right host (see LM_LICENSE_FILE).&lt;br /&gt;
 Feature:       SERIAL&lt;br /&gt;
 Hostname:      clicense3&lt;br /&gt;
 License path:  /Users/stern/Applications/COMSOL52a/license/license.dat:&lt;br /&gt;
 FlexNet Licensing error:-96,7&lt;br /&gt;
* Reason: The license servers cannot be reached at all. The &amp;lt;code&amp;gt;ping&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;host&amp;lt;/code&amp;gt; tests mentioned above fail.&lt;br /&gt;
* Solution: Review the client license file and DNS lookup domains.&lt;br /&gt;
&lt;br /&gt;
=== License file does not support this version ===&lt;br /&gt;
* Error details:&lt;br /&gt;
  Feature: SERIAL&lt;br /&gt;
 &#039;&#039;&#039;Application version &amp;gt; License version: 5.21 &amp;gt; 3.5&#039;&#039;&#039;&lt;br /&gt;
 License path: /Users/stern/Applications/COMSOL52a/license/license.dat:&lt;br /&gt;
 FlexNet Licensing error:-21,126&lt;br /&gt;
* 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&#039;re connected to.&lt;br /&gt;
* Solution: When using SSH, try &amp;lt;code&amp;gt;clicense2&amp;lt;/code&amp;gt; instead of  &amp;lt;code&amp;gt;clicense1&amp;lt;/code&amp;gt;, or vice versa. Revisit your &amp;lt;code&amp;gt;~/.ssh/config&amp;lt;/code&amp;gt; file or use the alternate command line as shown in the SSH section above.&lt;br /&gt;
&lt;br /&gt;
== Multiple CPU cores ==&lt;br /&gt;
Ways to start multi-core (from http://www.comsol.com/support/knowledgebase/1096/)&lt;br /&gt;
 comsol -np 8&lt;br /&gt;
&lt;br /&gt;
 export COMSOL_NUM_THREADS=8    # automatically provided on &#039;&#039;Carbon&#039;&#039;&lt;br /&gt;
 comsol&lt;br /&gt;
* COMSOL does not benefit from hyperthreading (oversubscribing the physical core count).&lt;br /&gt;
&lt;br /&gt;
== Batch jobs ==&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
 comsol -clustersimple batch -inputfile input.mph -outputfile output.mph &lt;br /&gt;
&lt;br /&gt;
 &amp;lt;strike&amp;gt;comsol –nn 8 mpd boot&lt;br /&gt;
 comsol –nn 8 batch –inputfile in.mph&lt;br /&gt;
 comsol mpd allexit&amp;lt;/strike&amp;gt;&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
* http://www.comsol.com/support/knowledgebase/1001/ .&lt;br /&gt;
* [[Media:HPC 2012-05-16 Comsol parallel usage.pdf]] (Modified from http://www.comsol.com/support/knowledgebase/1001/files/4027/cluster_install_linux_42a.pptx – Appendix slide, PBS)&lt;br /&gt;
* &#039;&#039;&#039;Note:&#039;&#039;&#039; MPD is not supported on Carbon (I patched the main comsol script), and no longer necessary at all in Comsol-4.3.&lt;br /&gt;
&lt;br /&gt;
=== Sample Job file ===&lt;br /&gt;
See:&lt;br /&gt;
 $COMSOL_HOME/sample.job&lt;br /&gt;
&lt;br /&gt;
== Important COMSOL Support Articles ==&lt;br /&gt;
* Toplevel suport page: https://www.comsol.com/support&lt;br /&gt;
&lt;br /&gt;
=== KB Articles ===&lt;br /&gt;
* [https://www.comsol.com/support/knowledgebase/1001 Running COMSOL® in parallel on clusters]&lt;br /&gt;
* [https://www.comsol.com/support/knowledgebase/1250 Running parametric sweeps, batch sweeps, and cluster sweeps from the command line]&lt;br /&gt;
* [https://www.comsol.com/support/knowledgebase/1255 Reducing the amount of solution data stored in a model]&lt;br /&gt;
* [https://www.comsol.com/support/knowledgebase/830 Handling large models]&lt;br /&gt;
&lt;br /&gt;
=== Blog-style articles ===&lt;br /&gt;
* [https://www.comsol.com/blogs/the-power-of-the-batch-sweep/ The Power of the Batch Sweep]&lt;br /&gt;
* [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]&lt;/div&gt;</summary>
		<author><name>Stern</name></author>
	</entry>
	<entry>
		<id>https://wiki.anl.gov/wiki_cnm/index.php?title=HPC/Applications/comsol&amp;diff=7497</id>
		<title>HPC/Applications/comsol</title>
		<link rel="alternate" type="text/html" href="https://wiki.anl.gov/wiki_cnm/index.php?title=HPC/Applications/comsol&amp;diff=7497"/>
		<updated>2026-02-26T17:17:36Z</updated>

		<summary type="html">&lt;p&gt;Stern: /* License Troubleshooting */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
The [http://www.comsol.com/products/multiphysics/ &#039;&#039;&#039;COMSOL Multiphysics&#039;&#039;&#039;] application suite&lt;br /&gt;
is available for Mac, Windows, and Linux.&lt;br /&gt;
&lt;br /&gt;
== Access ==&lt;br /&gt;
[[Image:HPC Comsol licensed modules.png|right|450px|thumb|COMSOL features licensed at CNM as of 2024-10.]]&lt;br /&gt;
=== COMSOL Multiphysics ===&lt;br /&gt;
Access to &#039;&#039;&#039;COMSOL Multiphysics&#039;&#039;&#039;, the main application with both a graphical user interface and batch computing capabilities, will be granted &#039;&#039;&#039;&#039;&#039;upon request&#039;&#039;&#039;&#039;&#039;&amp;amp;thinsp;.&lt;br /&gt;
&lt;br /&gt;
You must be:&lt;br /&gt;
* An &#039;&#039;&#039;&#039;&#039;Argonne employee&#039;&#039;&#039;&#039;&#039;&amp;amp;thinsp; in one of the following roles:&lt;br /&gt;
** &#039;&#039;&#039;&#039;&#039;NST staff member&#039;&#039;&#039;&#039;&#039;&amp;amp;thinsp; (including PostDocs, joint appointments, and students at NST).&lt;br /&gt;
** &#039;&#039;&#039;&#039;&#039;CNM Facility User&#039;&#039;&#039;&#039;&#039;&amp;amp;thinsp; (including &#039;&#039;non-NST Argonne employees&#039;&#039;), with an active proposal that has COMSOL in scope. Please see [[HPC/FAQ#Access_and_proposals]].&lt;br /&gt;
&lt;br /&gt;
The set of available COMSOL modules that we have licensed is shown at right.&lt;br /&gt;
&lt;br /&gt;
* The native desktop version can be installed only on &#039;&#039;Argonne-owned&#039;&#039; computers (laptop or desktop). Please contact [mailto:help@anl.gov?Subject=COMSOL%20license%20access%20request CNM support]. Make sure to review [http://www.comsol.com/support/updates/ Product Updates].&lt;br /&gt;
* To run COMSOL on our HPC system &#039;&#039;Carbon&#039;&#039;, as GUI or as batch computing jobs, your proposal must have &#039;&#039;Carbon&#039;&#039; access in scope.&lt;br /&gt;
&lt;br /&gt;
=== COMSOL Server ===&lt;br /&gt;
&#039;&#039;CNM Facility Users&#039;&#039; who are not Argonne employees are not eligible to access&lt;br /&gt;
the full &#039;&#039;&#039;COMSOL Multiphysics&#039;&#039;&#039; product, in compliance with its licensing terms and conditions.&lt;br /&gt;
However, the [https://www.comsol.com/comsol-server &#039;&#039;&#039;COMSOL Server&#039;&#039;&#039;] product offers an alternative&lt;br /&gt;
albeit more narrow means of access.&lt;br /&gt;
&lt;br /&gt;
All users, including &#039;&#039;&#039;&#039;&#039;non-Argonne users&#039;&#039;&#039;&#039;&#039; may be able to run, over a web interface in their browser,&lt;br /&gt;
pre-parameterized &amp;quot;fixed-model&amp;quot; simulations that were made with the &#039;&#039;&#039;COMSOL Application Builder&#039;&#039;&#039; (requires Windows).&lt;br /&gt;
&lt;br /&gt;
To inquire about using COMSOL server applications,&lt;br /&gt;
please contact us.&lt;br /&gt;
&amp;lt;!-- [mailto:cnm_useroffice@anl.gov?Subject=COMSOL%20server%20usage Support]. --&amp;gt;&lt;br /&gt;
We will review possible purchase paths for COMSOL Server, and the &#039;&#039;considerable effort&#039;&#039; likely required by users and the CNM to develop and deploy a COMSOL application.&lt;br /&gt;
&lt;br /&gt;
== Support ==&lt;br /&gt;
* For questions on how to run or start COMSOL:&lt;br /&gt;
*: Submit an [[HPC/Support | &#039;&#039;&#039;IT support request&#039;&#039;&#039;]]&lt;br /&gt;
* For questions related to most COMSOL data or scripts, contact COMSOL support at:&lt;br /&gt;
*: [mailto:support@comsol.com &#039;&#039;&#039;support&#039;&#039;&#039;@comsol.com]&lt;br /&gt;
* &#039;&#039;&#039;Exception:&#039;&#039;&#039; If your support question might contain data that is subject to &#039;&#039;&#039;US Export Control&#039;&#039;&#039; regulations, contact instead:&lt;br /&gt;
*: [mailto:us-export-control@us.comsol.com &#039;&#039;&#039;us-export-control&#039;&#039;&#039;@&#039;&#039;&#039;us&#039;&#039;&#039;.comsol.com]&lt;br /&gt;
&lt;br /&gt;
== The modes to run COMSOL ==&lt;br /&gt;
There are several ways of running COMSOL.&lt;br /&gt;
&lt;br /&gt;
=== Running the desktop application ===&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
# Run on Carbon, display on your desktop using the [http://en.wikipedia.org/wiki/X_Window_System X Window system (X11)].&lt;br /&gt;
#* Requires an &#039;&#039;X11 Server&#039;&#039; application running on your client machine, and SSH X11 forwarding.&lt;br /&gt;
#* The X11 protocol can be slow over LAN.&lt;br /&gt;
# Run on Carbon within a [[HPC/Network Access/Virtual Desktop | virtual desktop environment (VNC)]].&lt;br /&gt;
#* Requires a VNC client on your machine.&lt;br /&gt;
#* It can be confusing where VNC and the app runs.&lt;br /&gt;
#* The virtual desktop presents a (deliberatly) sparse windowing environment – Copy&amp;amp;Paste can be difficult to use.&lt;br /&gt;
# Run on your Argonne-provided computer, checking out Carbon&#039;s license remotely.&lt;br /&gt;
#* Requires a full installation of COMSOL on your desktoo or laptop computer.&lt;br /&gt;
#* 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.&lt;br /&gt;
&lt;br /&gt;
=== Running a batch calculation ===&lt;br /&gt;
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.&lt;br /&gt;
See the [[#Batch jobs|section below]].&lt;br /&gt;
&lt;br /&gt;
== Use with X11 ==&lt;br /&gt;
For casual use, and with [[HPC/Network Access/SSH Tunnel Setup on Linux and MacOS | X11 tunneling to Carbon]] set up, simply add to your &amp;lt;code&amp;gt;~/.bashrc&amp;lt;/code&amp;gt; file on Carbon:&lt;br /&gt;
 module load comsol&lt;br /&gt;
&lt;br /&gt;
Then, from the command line on a Carbon login node, start the COMSOL GUI:&lt;br /&gt;
 comsol &amp;amp;&lt;br /&gt;
&lt;br /&gt;
License configuration is automatic on Carbon.&lt;br /&gt;
&lt;br /&gt;
Comsol will use a number of cores to run calculations multithreaded by default. (On Carbon, COMSOL_NUM_THREADS is set.)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Quit the application&#039;&#039;&#039; as soon as you are done. Only one user can use Comsol at a time.&lt;br /&gt;
&lt;br /&gt;
== Use with VNC ==&lt;br /&gt;
See general  [[HPC/Network Access/Virtual Desktop | instructions on using VNC]], and the COMSOL example therein.&lt;br /&gt;
&lt;br /&gt;
== Native desktop version ==&lt;br /&gt;
&lt;br /&gt;
To get the fastest response from the COMSOL GUI, run a native COMSOL version on your desktop machine or laptop, called &#039;&#039;client machine&#039;&#039; below.&lt;br /&gt;
&lt;br /&gt;
Enter license details either in the COMSOL Setup configuration dialog.&lt;br /&gt;
&lt;br /&gt;
== Native desktop version — License configuration ==&lt;br /&gt;
A client&#039;s COMSOL license needs to be configured depending on how the client reaches CNM network resources. Follow the appropriate section:&lt;br /&gt;
&lt;br /&gt;
* [[#License configuration when inside CNM or on CNM VPN|License configuration when &#039;&#039;&#039;inside CNM&#039;&#039;&#039; or on &#039;&#039;&#039;CNM VPN&#039;&#039;&#039;]]&lt;br /&gt;
: Requires that the user&#039;s machine is logically within the network of CNM/NST, either by a wired/auth WiFi connection in the building or by VPN under a CNM/NST profile.&lt;br /&gt;
* [[#License configuration when outside CNM – requires SSH Tunneling|License configuration when &#039;&#039;&#039;outside CNM&#039;&#039;&#039; – requires SSH Tunneling]]&lt;br /&gt;
: &#039;&#039;Non-NST staff&#039;&#039; usually have a VPN profile that places the machine logically [[#License configuration when outside CNM – requires SSH Tunneling|outside of NST&#039;s network.]]&lt;br /&gt;
&lt;br /&gt;
== License configuration when inside CNM or on CNM VPN ==&lt;br /&gt;
=== &amp;lt;span style=&amp;quot;color:#A00;&amp;quot;&amp;gt;Ensure correct DNS search domains&amp;lt;/span&amp;gt; ===&lt;br /&gt;
* Inspect the client machine&#039;s network configuration.&lt;br /&gt;
* Ensure that &#039;&#039;&#039;two&#039;&#039;&#039; entries are listed as DNS Search Domains for the current network profile:&lt;br /&gt;
 nst.anl.gov&lt;br /&gt;
 cnm.anl.gov&lt;br /&gt;
: (The order of entries does not matter for the purposes considered here.)&lt;br /&gt;
* If the client machine is &#039;&#039;wired to CNM networks&#039;&#039;, the domains are normally provided correctly by DHCP.&lt;br /&gt;
* If the client machine is &#039;&#039;connected over VPN&#039;&#039;, you may need edit the respective network profile.&lt;br /&gt;
:* 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 &amp;quot;Advanced…&amp;quot;. It appears that those changes are being saved and will be activated automatically the next time that this VPN session gets started.&lt;br /&gt;
: [[Image:VNC_add_cnm_to_DNS_1.png|400px]] [[Image:VNC_add_cnm_to_DNS_2.png|400px]]&lt;br /&gt;
:* On Windows or Linux machines, take &#039;&#039;analogous&#039;&#039; steps, using the platform&#039;s own configuration tools.&lt;br /&gt;
&lt;br /&gt;
* Exclude license manager components from client desktop installation. (Those are all handled server-side.)&lt;br /&gt;
&lt;br /&gt;
=== License format ===&lt;br /&gt;
* Floating Network License (FNL), &amp;quot;Three-server redundancy&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== License servers ===&lt;br /&gt;
* On client machines, while running the COMSOL installer or license configuration, specify license servers and ports as follows:&lt;br /&gt;
 1718    clicense1&lt;br /&gt;
 1718    clicense2&lt;br /&gt;
 1718    clicense3&lt;br /&gt;
: &#039;&#039;&#039;Note:&#039;&#039;&#039; Use &#039;&#039;short host names only&#039;&#039;. (Technical Reason: The license must be usable both on Carbon&#039;s internal network as well as on divisional networks).&lt;br /&gt;
 1718    clicense1&amp;lt;strike&amp;gt;.cnm.anl.gov&amp;lt;/strike&amp;gt;&lt;br /&gt;
 1718    clicense2&amp;lt;strike&amp;gt;.cnm.anl.gov&amp;lt;/strike&amp;gt;&lt;br /&gt;
 1718    clicense3&amp;lt;strike&amp;gt;.cnm.anl.gov&amp;lt;/strike&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Advanced:&#039;&#039;&#039; A client machine&#039;s COMSOL license file &amp;lt;code&amp;gt;&amp;amp;lt;COMSOLDIR&amp;amp;gt;/Multiphysics/license/license.dat&amp;lt;/code&amp;gt; should look as follows:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;make&amp;quot;&amp;gt;&lt;br /&gt;
SERVER clicense1 ANY 1718&lt;br /&gt;
SERVER clicense2 ANY 1718&lt;br /&gt;
SERVER clicense3 ANY 1718&lt;br /&gt;
USE_SERVER&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;amp;lt;COMSOLDIR&amp;amp;gt;&amp;lt;/code&amp;gt; is located by default at:&lt;br /&gt;
* &#039;&#039;&#039;Windows&#039;&#039;&#039;: C:\Program files\COMSOL\COMSOL&#039;&#039;nn&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Linux&#039;&#039;&#039;: /usr/local/comsol&#039;&#039;nn&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Mac&#039;&#039;&#039;: /Applications/COMSOL&#039;&#039;nn&#039;&#039;&lt;br /&gt;
(&amp;quot;&#039;&#039;nn&#039;&#039;&amp;quot; is the application&#039;s abbreviated version number.)&lt;br /&gt;
&lt;br /&gt;
=== Network Troubleshooting ===&lt;br /&gt;
When using the license access model descibed here (as opposed to tunneled over SSH), ensure the following:&lt;br /&gt;
* Verify that short host names can be resolved to IP addresses. Either one of the following commands should produce sensible output:&lt;br /&gt;
 host clicense1&lt;br /&gt;
: or:&lt;br /&gt;
 ping -c 3 clicense1&lt;br /&gt;
* Verify that &#039;&#039;both license ports on the same server&#039;&#039; can be reached from your client machine:&lt;br /&gt;
 telnet &#039;&#039;&#039;clicense1&#039;&#039;&#039; 1718&lt;br /&gt;
 telnet &#039;&#039;&#039;clicense1&#039;&#039;&#039; 1719&lt;br /&gt;
: or:&lt;br /&gt;
 telnet &#039;&#039;&#039;clicense2&#039;&#039;&#039; 1718&lt;br /&gt;
 telnet &#039;&#039;&#039;clicense2&#039;&#039;&#039; 1719&lt;br /&gt;
: A &#039;&#039;successful&#039;&#039; connection looks like:&lt;br /&gt;
 Trying 146.139.x.y...&lt;br /&gt;
 Connected to clicense1.cnm.anl.gov.&lt;br /&gt;
 Escape character is &#039;^]&#039;.&lt;br /&gt;
:: Do not enter any data. Instead,  close each connection by hitting &amp;lt;code&amp;gt;Ctrl&amp;lt;/code&amp;gt;&amp;lt;code&amp;gt;]&amp;lt;/code&amp;gt; (closing square bracket), followed by &amp;lt;code&amp;gt;Ctrl&amp;lt;/code&amp;gt;&amp;lt;code&amp;gt;D&amp;lt;/code&amp;gt;.&lt;br /&gt;
: A &#039;&#039;failed&#039;&#039; connection gives one of these errors:&lt;br /&gt;
 telnet: connect to address 146.139.x.y: Operation timed out&lt;br /&gt;
: or:&lt;br /&gt;
 telnet: connect to address 146.139.x.y: Connection refused&lt;br /&gt;
:: In these cases, ask that your IP firewall configuration be reviewed and changed.&lt;br /&gt;
&lt;br /&gt;
== License configuration when outside CNM – requires SSH Tunneling ==&lt;br /&gt;
This section documents how to run COMSOL from a network location outside CNM.&lt;br /&gt;
&lt;br /&gt;
As a one-time preparation step, two items must be configured:&lt;br /&gt;
* The license host that COMSOL is to contact, and&lt;br /&gt;
* An SSH connection that will allow your machine to access the COMSOL license server inside CNM&#039;s network.&lt;br /&gt;
&lt;br /&gt;
To then &#039;&#039;run&#039;&#039; the COMSOL application, the configured SSH connection must be up and kept running for the entire time that you run the COMSOL. When you exit COMSOL and wish to start it again, you can keep the SSH connection running, it will be re-used for the next COMSOL run.&lt;br /&gt;
&lt;br /&gt;
=== Configure COMSOL ===&lt;br /&gt;
The following needs to be done just once, typically during COMSOL installation:&lt;br /&gt;
&lt;br /&gt;
In the COMSOL Installer, or in COMSOL Preferences, enter:&lt;br /&gt;
* &#039;&#039;&#039;License format:&#039;&#039;&#039; Floating Network License (FNL), &amp;quot;Port number and Hostname&amp;quot;&lt;br /&gt;
:: &amp;lt;font style=&amp;quot;color:#777&amp;quot;&amp;gt;Do &#039;&#039;not use&#039;&#039; &amp;quot;Three-server redundancy&amp;quot;, since it cannot (easily) be accessed over SSH. Configure with just one server, and in the rare situation of a server failover, temporarily tweak your SSH configuration to contact the alternate server (see below).&amp;lt;/font&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Server:&#039;&#039;&#039; &amp;lt;code&amp;gt;127.0.0.1&amp;lt;/code&amp;gt;&lt;br /&gt;
:: Do not use &amp;quot;localhost&amp;quot;, as COMSOL interprets this incorrectly to mean that your machine &#039;&#039;is&#039;&#039; a license server.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Port:&#039;&#039;&#039; &amp;lt;code&amp;gt;1718&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
Or place a license file with this content:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;make&amp;quot;&amp;gt;&lt;br /&gt;
SERVER 127.0.0.1 ANY 1718&lt;br /&gt;
USE_SERVER&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
//--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Establish connection to CNM license server ===&lt;br /&gt;
This step needs to be done prior to running COMSOL in your desktop session:&lt;br /&gt;
* Connect to &amp;lt;code&amp;gt;mega&amp;lt;/code&amp;gt; with the following command in a terminal window:&lt;br /&gt;
 ssh  -L 1718:&#039;&#039;&#039;clicense1&#039;&#039;&#039;:1718  -L 1719:&#039;&#039;&#039;clicense1&#039;&#039;&#039;:1719  mega.cnm.anl.gov&lt;br /&gt;
* You can leave this connection running in your terminal window across several invocations of COMSOL.&lt;br /&gt;
&lt;br /&gt;
=== Run COMSOL ===&lt;br /&gt;
# Ensure your connection to &amp;quot;mega&amp;quot; is still running. If not, restart it.&lt;br /&gt;
# Start the COMSOL application.&lt;br /&gt;
&lt;br /&gt;
=== Troubleshooting ===&lt;br /&gt;
* If you get an error that the number of licenses is &amp;quot;exhausted&amp;quot;, that is confirmation that you correctly reached the license server, though other users are using licenses.&lt;br /&gt;
* 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:&lt;br /&gt;
 ssh  -L 1718:clicense&#039;&#039;&#039;2&#039;&#039;&#039;:1718  -L 1719:clicense&#039;&#039;&#039;2&#039;&#039;&#039;:1719  mega.cnm.anl.gov&lt;br /&gt;
&lt;br /&gt;
== General License Troubleshooting ==&lt;br /&gt;
The following are typical error messages.&lt;br /&gt;
=== Could not obtain license for COMSOL Multiphysics GUI ===&lt;br /&gt;
* Error details:&lt;br /&gt;
 License error: -4.&lt;br /&gt;
 &#039;&#039;&#039;Licensed number of users already reached.&#039;&#039;&#039;&lt;br /&gt;
 Feature:       COMSOLGUI&lt;br /&gt;
 License path:  /Users/stern/Applications/COMSOL52a/license/license.dat:&lt;br /&gt;
 FlexNet Licensing error:-4,132&lt;br /&gt;
* Reason: The connection to the license server succeeded, but the license token(s) you requested are in use.&lt;br /&gt;
* Solution: Wait a bit, or [http://carbonmgmt/ganglia/lic.php identify who&#039;s using COMSOL] and politely ask the user when they might be finished with their work.&lt;br /&gt;
&lt;br /&gt;
=== License server machine is down or not responding ===&lt;br /&gt;
* Error details:&lt;br /&gt;
  License error: -96.&lt;br /&gt;
  See the system administrator about starting the license server system, or&lt;br /&gt;
  make sure you&#039;re referring to the right host (see LM_LICENSE_FILE).&lt;br /&gt;
 Feature:       SERIAL&lt;br /&gt;
 Hostname:      clicense3&lt;br /&gt;
 License path:  /Users/stern/Applications/COMSOL52a/license/license.dat:&lt;br /&gt;
 FlexNet Licensing error:-96,7&lt;br /&gt;
* Reason: The license servers cannot be reached at all. The &amp;lt;code&amp;gt;ping&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;host&amp;lt;/code&amp;gt; tests mentioned above fail.&lt;br /&gt;
* Solution: Review the client license file and DNS lookup domains.&lt;br /&gt;
&lt;br /&gt;
=== License file does not support this version ===&lt;br /&gt;
* Error details:&lt;br /&gt;
  Feature: SERIAL&lt;br /&gt;
 &#039;&#039;&#039;Application version &amp;gt; License version: 5.21 &amp;gt; 3.5&#039;&#039;&#039;&lt;br /&gt;
 License path: /Users/stern/Applications/COMSOL52a/license/license.dat:&lt;br /&gt;
 FlexNet Licensing error:-21,126&lt;br /&gt;
* 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&#039;re connected to.&lt;br /&gt;
* Solution: When using SSH, try &amp;lt;code&amp;gt;clicense2&amp;lt;/code&amp;gt; instead of  &amp;lt;code&amp;gt;clicense1&amp;lt;/code&amp;gt;, or vice versa. Revisit your &amp;lt;code&amp;gt;~/.ssh/config&amp;lt;/code&amp;gt; file or use the alternate command line as shown in the SSH section above.&lt;br /&gt;
&lt;br /&gt;
== Multiple CPU cores ==&lt;br /&gt;
Ways to start multi-core (from http://www.comsol.com/support/knowledgebase/1096/)&lt;br /&gt;
 comsol -np 8&lt;br /&gt;
&lt;br /&gt;
 export COMSOL_NUM_THREADS=8    # automatically provided on &#039;&#039;Carbon&#039;&#039;&lt;br /&gt;
 comsol&lt;br /&gt;
* COMSOL does not benefit from hyperthreading (oversubscribing the physical core count).&lt;br /&gt;
&lt;br /&gt;
== Batch jobs ==&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
 comsol -clustersimple batch -inputfile input.mph -outputfile output.mph &lt;br /&gt;
&lt;br /&gt;
 &amp;lt;strike&amp;gt;comsol –nn 8 mpd boot&lt;br /&gt;
 comsol –nn 8 batch –inputfile in.mph&lt;br /&gt;
 comsol mpd allexit&amp;lt;/strike&amp;gt;&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
* http://www.comsol.com/support/knowledgebase/1001/ .&lt;br /&gt;
* [[Media:HPC 2012-05-16 Comsol parallel usage.pdf]] (Modified from http://www.comsol.com/support/knowledgebase/1001/files/4027/cluster_install_linux_42a.pptx – Appendix slide, PBS)&lt;br /&gt;
* &#039;&#039;&#039;Note:&#039;&#039;&#039; MPD is not supported on Carbon (I patched the main comsol script), and no longer necessary at all in Comsol-4.3.&lt;br /&gt;
&lt;br /&gt;
=== Sample Job file ===&lt;br /&gt;
See:&lt;br /&gt;
 $COMSOL_HOME/sample.job&lt;br /&gt;
&lt;br /&gt;
== Important COMSOL Support Articles ==&lt;br /&gt;
* Toplevel suport page: https://www.comsol.com/support&lt;br /&gt;
&lt;br /&gt;
=== KB Articles ===&lt;br /&gt;
* [https://www.comsol.com/support/knowledgebase/1001 Running COMSOL® in parallel on clusters]&lt;br /&gt;
* [https://www.comsol.com/support/knowledgebase/1250 Running parametric sweeps, batch sweeps, and cluster sweeps from the command line]&lt;br /&gt;
* [https://www.comsol.com/support/knowledgebase/1255 Reducing the amount of solution data stored in a model]&lt;br /&gt;
* [https://www.comsol.com/support/knowledgebase/830 Handling large models]&lt;br /&gt;
&lt;br /&gt;
=== Blog-style articles ===&lt;br /&gt;
* [https://www.comsol.com/blogs/the-power-of-the-batch-sweep/ The Power of the Batch Sweep]&lt;br /&gt;
* [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]&lt;/div&gt;</summary>
		<author><name>Stern</name></author>
	</entry>
	<entry>
		<id>https://wiki.anl.gov/wiki_cnm/index.php?title=HPC/Applications/comsol&amp;diff=7496</id>
		<title>HPC/Applications/comsol</title>
		<link rel="alternate" type="text/html" href="https://wiki.anl.gov/wiki_cnm/index.php?title=HPC/Applications/comsol&amp;diff=7496"/>
		<updated>2026-02-26T17:17:10Z</updated>

		<summary type="html">&lt;p&gt;Stern: /* Establish connection to CNM license server */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
The [http://www.comsol.com/products/multiphysics/ &#039;&#039;&#039;COMSOL Multiphysics&#039;&#039;&#039;] application suite&lt;br /&gt;
is available for Mac, Windows, and Linux.&lt;br /&gt;
&lt;br /&gt;
== Access ==&lt;br /&gt;
[[Image:HPC Comsol licensed modules.png|right|450px|thumb|COMSOL features licensed at CNM as of 2024-10.]]&lt;br /&gt;
=== COMSOL Multiphysics ===&lt;br /&gt;
Access to &#039;&#039;&#039;COMSOL Multiphysics&#039;&#039;&#039;, the main application with both a graphical user interface and batch computing capabilities, will be granted &#039;&#039;&#039;&#039;&#039;upon request&#039;&#039;&#039;&#039;&#039;&amp;amp;thinsp;.&lt;br /&gt;
&lt;br /&gt;
You must be:&lt;br /&gt;
* An &#039;&#039;&#039;&#039;&#039;Argonne employee&#039;&#039;&#039;&#039;&#039;&amp;amp;thinsp; in one of the following roles:&lt;br /&gt;
** &#039;&#039;&#039;&#039;&#039;NST staff member&#039;&#039;&#039;&#039;&#039;&amp;amp;thinsp; (including PostDocs, joint appointments, and students at NST).&lt;br /&gt;
** &#039;&#039;&#039;&#039;&#039;CNM Facility User&#039;&#039;&#039;&#039;&#039;&amp;amp;thinsp; (including &#039;&#039;non-NST Argonne employees&#039;&#039;), with an active proposal that has COMSOL in scope. Please see [[HPC/FAQ#Access_and_proposals]].&lt;br /&gt;
&lt;br /&gt;
The set of available COMSOL modules that we have licensed is shown at right.&lt;br /&gt;
&lt;br /&gt;
* The native desktop version can be installed only on &#039;&#039;Argonne-owned&#039;&#039; computers (laptop or desktop). Please contact [mailto:help@anl.gov?Subject=COMSOL%20license%20access%20request CNM support]. Make sure to review [http://www.comsol.com/support/updates/ Product Updates].&lt;br /&gt;
* To run COMSOL on our HPC system &#039;&#039;Carbon&#039;&#039;, as GUI or as batch computing jobs, your proposal must have &#039;&#039;Carbon&#039;&#039; access in scope.&lt;br /&gt;
&lt;br /&gt;
=== COMSOL Server ===&lt;br /&gt;
&#039;&#039;CNM Facility Users&#039;&#039; who are not Argonne employees are not eligible to access&lt;br /&gt;
the full &#039;&#039;&#039;COMSOL Multiphysics&#039;&#039;&#039; product, in compliance with its licensing terms and conditions.&lt;br /&gt;
However, the [https://www.comsol.com/comsol-server &#039;&#039;&#039;COMSOL Server&#039;&#039;&#039;] product offers an alternative&lt;br /&gt;
albeit more narrow means of access.&lt;br /&gt;
&lt;br /&gt;
All users, including &#039;&#039;&#039;&#039;&#039;non-Argonne users&#039;&#039;&#039;&#039;&#039; may be able to run, over a web interface in their browser,&lt;br /&gt;
pre-parameterized &amp;quot;fixed-model&amp;quot; simulations that were made with the &#039;&#039;&#039;COMSOL Application Builder&#039;&#039;&#039; (requires Windows).&lt;br /&gt;
&lt;br /&gt;
To inquire about using COMSOL server applications,&lt;br /&gt;
please contact us.&lt;br /&gt;
&amp;lt;!-- [mailto:cnm_useroffice@anl.gov?Subject=COMSOL%20server%20usage Support]. --&amp;gt;&lt;br /&gt;
We will review possible purchase paths for COMSOL Server, and the &#039;&#039;considerable effort&#039;&#039; likely required by users and the CNM to develop and deploy a COMSOL application.&lt;br /&gt;
&lt;br /&gt;
== Support ==&lt;br /&gt;
* For questions on how to run or start COMSOL:&lt;br /&gt;
*: Submit an [[HPC/Support | &#039;&#039;&#039;IT support request&#039;&#039;&#039;]]&lt;br /&gt;
* For questions related to most COMSOL data or scripts, contact COMSOL support at:&lt;br /&gt;
*: [mailto:support@comsol.com &#039;&#039;&#039;support&#039;&#039;&#039;@comsol.com]&lt;br /&gt;
* &#039;&#039;&#039;Exception:&#039;&#039;&#039; If your support question might contain data that is subject to &#039;&#039;&#039;US Export Control&#039;&#039;&#039; regulations, contact instead:&lt;br /&gt;
*: [mailto:us-export-control@us.comsol.com &#039;&#039;&#039;us-export-control&#039;&#039;&#039;@&#039;&#039;&#039;us&#039;&#039;&#039;.comsol.com]&lt;br /&gt;
&lt;br /&gt;
== The modes to run COMSOL ==&lt;br /&gt;
There are several ways of running COMSOL.&lt;br /&gt;
&lt;br /&gt;
=== Running the desktop application ===&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
# Run on Carbon, display on your desktop using the [http://en.wikipedia.org/wiki/X_Window_System X Window system (X11)].&lt;br /&gt;
#* Requires an &#039;&#039;X11 Server&#039;&#039; application running on your client machine, and SSH X11 forwarding.&lt;br /&gt;
#* The X11 protocol can be slow over LAN.&lt;br /&gt;
# Run on Carbon within a [[HPC/Network Access/Virtual Desktop | virtual desktop environment (VNC)]].&lt;br /&gt;
#* Requires a VNC client on your machine.&lt;br /&gt;
#* It can be confusing where VNC and the app runs.&lt;br /&gt;
#* The virtual desktop presents a (deliberatly) sparse windowing environment – Copy&amp;amp;Paste can be difficult to use.&lt;br /&gt;
# Run on your Argonne-provided computer, checking out Carbon&#039;s license remotely.&lt;br /&gt;
#* Requires a full installation of COMSOL on your desktoo or laptop computer.&lt;br /&gt;
#* 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.&lt;br /&gt;
&lt;br /&gt;
=== Running a batch calculation ===&lt;br /&gt;
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.&lt;br /&gt;
See the [[#Batch jobs|section below]].&lt;br /&gt;
&lt;br /&gt;
== Use with X11 ==&lt;br /&gt;
For casual use, and with [[HPC/Network Access/SSH Tunnel Setup on Linux and MacOS | X11 tunneling to Carbon]] set up, simply add to your &amp;lt;code&amp;gt;~/.bashrc&amp;lt;/code&amp;gt; file on Carbon:&lt;br /&gt;
 module load comsol&lt;br /&gt;
&lt;br /&gt;
Then, from the command line on a Carbon login node, start the COMSOL GUI:&lt;br /&gt;
 comsol &amp;amp;&lt;br /&gt;
&lt;br /&gt;
License configuration is automatic on Carbon.&lt;br /&gt;
&lt;br /&gt;
Comsol will use a number of cores to run calculations multithreaded by default. (On Carbon, COMSOL_NUM_THREADS is set.)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Quit the application&#039;&#039;&#039; as soon as you are done. Only one user can use Comsol at a time.&lt;br /&gt;
&lt;br /&gt;
== Use with VNC ==&lt;br /&gt;
See general  [[HPC/Network Access/Virtual Desktop | instructions on using VNC]], and the COMSOL example therein.&lt;br /&gt;
&lt;br /&gt;
== Native desktop version ==&lt;br /&gt;
&lt;br /&gt;
To get the fastest response from the COMSOL GUI, run a native COMSOL version on your desktop machine or laptop, called &#039;&#039;client machine&#039;&#039; below.&lt;br /&gt;
&lt;br /&gt;
Enter license details either in the COMSOL Setup configuration dialog.&lt;br /&gt;
&lt;br /&gt;
== Native desktop version — License configuration ==&lt;br /&gt;
A client&#039;s COMSOL license needs to be configured depending on how the client reaches CNM network resources. Follow the appropriate section:&lt;br /&gt;
&lt;br /&gt;
* [[#License configuration when inside CNM or on CNM VPN|License configuration when &#039;&#039;&#039;inside CNM&#039;&#039;&#039; or on &#039;&#039;&#039;CNM VPN&#039;&#039;&#039;]]&lt;br /&gt;
: Requires that the user&#039;s machine is logically within the network of CNM/NST, either by a wired/auth WiFi connection in the building or by VPN under a CNM/NST profile.&lt;br /&gt;
* [[#License configuration when outside CNM – requires SSH Tunneling|License configuration when &#039;&#039;&#039;outside CNM&#039;&#039;&#039; – requires SSH Tunneling]]&lt;br /&gt;
: &#039;&#039;Non-NST staff&#039;&#039; usually have a VPN profile that places the machine logically [[#License configuration when outside CNM – requires SSH Tunneling|outside of NST&#039;s network.]]&lt;br /&gt;
&lt;br /&gt;
== License configuration when inside CNM or on CNM VPN ==&lt;br /&gt;
=== &amp;lt;span style=&amp;quot;color:#A00;&amp;quot;&amp;gt;Ensure correct DNS search domains&amp;lt;/span&amp;gt; ===&lt;br /&gt;
* Inspect the client machine&#039;s network configuration.&lt;br /&gt;
* Ensure that &#039;&#039;&#039;two&#039;&#039;&#039; entries are listed as DNS Search Domains for the current network profile:&lt;br /&gt;
 nst.anl.gov&lt;br /&gt;
 cnm.anl.gov&lt;br /&gt;
: (The order of entries does not matter for the purposes considered here.)&lt;br /&gt;
* If the client machine is &#039;&#039;wired to CNM networks&#039;&#039;, the domains are normally provided correctly by DHCP.&lt;br /&gt;
* If the client machine is &#039;&#039;connected over VPN&#039;&#039;, you may need edit the respective network profile.&lt;br /&gt;
:* 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 &amp;quot;Advanced…&amp;quot;. It appears that those changes are being saved and will be activated automatically the next time that this VPN session gets started.&lt;br /&gt;
: [[Image:VNC_add_cnm_to_DNS_1.png|400px]] [[Image:VNC_add_cnm_to_DNS_2.png|400px]]&lt;br /&gt;
:* On Windows or Linux machines, take &#039;&#039;analogous&#039;&#039; steps, using the platform&#039;s own configuration tools.&lt;br /&gt;
&lt;br /&gt;
* Exclude license manager components from client desktop installation. (Those are all handled server-side.)&lt;br /&gt;
&lt;br /&gt;
=== License format ===&lt;br /&gt;
* Floating Network License (FNL), &amp;quot;Three-server redundancy&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== License servers ===&lt;br /&gt;
* On client machines, while running the COMSOL installer or license configuration, specify license servers and ports as follows:&lt;br /&gt;
 1718    clicense1&lt;br /&gt;
 1718    clicense2&lt;br /&gt;
 1718    clicense3&lt;br /&gt;
: &#039;&#039;&#039;Note:&#039;&#039;&#039; Use &#039;&#039;short host names only&#039;&#039;. (Technical Reason: The license must be usable both on Carbon&#039;s internal network as well as on divisional networks).&lt;br /&gt;
 1718    clicense1&amp;lt;strike&amp;gt;.cnm.anl.gov&amp;lt;/strike&amp;gt;&lt;br /&gt;
 1718    clicense2&amp;lt;strike&amp;gt;.cnm.anl.gov&amp;lt;/strike&amp;gt;&lt;br /&gt;
 1718    clicense3&amp;lt;strike&amp;gt;.cnm.anl.gov&amp;lt;/strike&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Advanced:&#039;&#039;&#039; A client machine&#039;s COMSOL license file &amp;lt;code&amp;gt;&amp;amp;lt;COMSOLDIR&amp;amp;gt;/Multiphysics/license/license.dat&amp;lt;/code&amp;gt; should look as follows:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;make&amp;quot;&amp;gt;&lt;br /&gt;
SERVER clicense1 ANY 1718&lt;br /&gt;
SERVER clicense2 ANY 1718&lt;br /&gt;
SERVER clicense3 ANY 1718&lt;br /&gt;
USE_SERVER&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;amp;lt;COMSOLDIR&amp;amp;gt;&amp;lt;/code&amp;gt; is located by default at:&lt;br /&gt;
* &#039;&#039;&#039;Windows&#039;&#039;&#039;: C:\Program files\COMSOL\COMSOL&#039;&#039;nn&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Linux&#039;&#039;&#039;: /usr/local/comsol&#039;&#039;nn&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Mac&#039;&#039;&#039;: /Applications/COMSOL&#039;&#039;nn&#039;&#039;&lt;br /&gt;
(&amp;quot;&#039;&#039;nn&#039;&#039;&amp;quot; is the application&#039;s abbreviated version number.)&lt;br /&gt;
&lt;br /&gt;
=== Network Troubleshooting ===&lt;br /&gt;
When using the license access model descibed here (as opposed to tunneled over SSH), ensure the following:&lt;br /&gt;
* Verify that short host names can be resolved to IP addresses. Either one of the following commands should produce sensible output:&lt;br /&gt;
 host clicense1&lt;br /&gt;
: or:&lt;br /&gt;
 ping -c 3 clicense1&lt;br /&gt;
* Verify that &#039;&#039;both license ports on the same server&#039;&#039; can be reached from your client machine:&lt;br /&gt;
 telnet &#039;&#039;&#039;clicense1&#039;&#039;&#039; 1718&lt;br /&gt;
 telnet &#039;&#039;&#039;clicense1&#039;&#039;&#039; 1719&lt;br /&gt;
: or:&lt;br /&gt;
 telnet &#039;&#039;&#039;clicense2&#039;&#039;&#039; 1718&lt;br /&gt;
 telnet &#039;&#039;&#039;clicense2&#039;&#039;&#039; 1719&lt;br /&gt;
: A &#039;&#039;successful&#039;&#039; connection looks like:&lt;br /&gt;
 Trying 146.139.x.y...&lt;br /&gt;
 Connected to clicense1.cnm.anl.gov.&lt;br /&gt;
 Escape character is &#039;^]&#039;.&lt;br /&gt;
:: Do not enter any data. Instead,  close each connection by hitting &amp;lt;code&amp;gt;Ctrl&amp;lt;/code&amp;gt;&amp;lt;code&amp;gt;]&amp;lt;/code&amp;gt; (closing square bracket), followed by &amp;lt;code&amp;gt;Ctrl&amp;lt;/code&amp;gt;&amp;lt;code&amp;gt;D&amp;lt;/code&amp;gt;.&lt;br /&gt;
: A &#039;&#039;failed&#039;&#039; connection gives one of these errors:&lt;br /&gt;
 telnet: connect to address 146.139.x.y: Operation timed out&lt;br /&gt;
: or:&lt;br /&gt;
 telnet: connect to address 146.139.x.y: Connection refused&lt;br /&gt;
:: In these cases, ask that your IP firewall configuration be reviewed and changed.&lt;br /&gt;
&lt;br /&gt;
== License configuration when outside CNM – requires SSH Tunneling ==&lt;br /&gt;
This section documents how to run COMSOL from a network location outside CNM.&lt;br /&gt;
&lt;br /&gt;
As a one-time preparation step, two items must be configured:&lt;br /&gt;
* The license host that COMSOL is to contact, and&lt;br /&gt;
* An SSH connection that will allow your machine to access the COMSOL license server inside CNM&#039;s network.&lt;br /&gt;
&lt;br /&gt;
To then &#039;&#039;run&#039;&#039; the COMSOL application, the configured SSH connection must be up and kept running for the entire time that you run the COMSOL. When you exit COMSOL and wish to start it again, you can keep the SSH connection running, it will be re-used for the next COMSOL run.&lt;br /&gt;
&lt;br /&gt;
=== Configure COMSOL ===&lt;br /&gt;
The following needs to be done just once, typically during COMSOL installation:&lt;br /&gt;
&lt;br /&gt;
In the COMSOL Installer, or in COMSOL Preferences, enter:&lt;br /&gt;
* &#039;&#039;&#039;License format:&#039;&#039;&#039; Floating Network License (FNL), &amp;quot;Port number and Hostname&amp;quot;&lt;br /&gt;
:: &amp;lt;font style=&amp;quot;color:#777&amp;quot;&amp;gt;Do &#039;&#039;not use&#039;&#039; &amp;quot;Three-server redundancy&amp;quot;, since it cannot (easily) be accessed over SSH. Configure with just one server, and in the rare situation of a server failover, temporarily tweak your SSH configuration to contact the alternate server (see below).&amp;lt;/font&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Server:&#039;&#039;&#039; &amp;lt;code&amp;gt;127.0.0.1&amp;lt;/code&amp;gt;&lt;br /&gt;
:: Do not use &amp;quot;localhost&amp;quot;, as COMSOL interprets this incorrectly to mean that your machine &#039;&#039;is&#039;&#039; a license server.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Port:&#039;&#039;&#039; &amp;lt;code&amp;gt;1718&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
Or place a license file with this content:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;make&amp;quot;&amp;gt;&lt;br /&gt;
SERVER 127.0.0.1 ANY 1718&lt;br /&gt;
USE_SERVER&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
//--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Establish connection to CNM license server ===&lt;br /&gt;
This step needs to be done prior to running COMSOL in your desktop session:&lt;br /&gt;
* Connect to &amp;lt;code&amp;gt;mega&amp;lt;/code&amp;gt; with the following command in a terminal window:&lt;br /&gt;
 ssh  -L 1718:&#039;&#039;&#039;clicense1&#039;&#039;&#039;:1718  -L 1719:&#039;&#039;&#039;clicense1&#039;&#039;&#039;:1719  mega.cnm.anl.gov&lt;br /&gt;
* You can leave this connection running in your terminal window across several invocations of COMSOL.&lt;br /&gt;
&lt;br /&gt;
=== Run COMSOL ===&lt;br /&gt;
# Ensure your connection to &amp;quot;mega&amp;quot; is still running. If not, restart it.&lt;br /&gt;
# Start the COMSOL application.&lt;br /&gt;
&lt;br /&gt;
=== Troubleshooting ===&lt;br /&gt;
* If you get an error that the number of licenses is &amp;quot;exhausted&amp;quot;, that is confirmation that you correctly reached the license server, though other users are using licenses.&lt;br /&gt;
* 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:&lt;br /&gt;
 ssh  -L 1718:clicense&#039;&#039;&#039;2&#039;&#039;&#039;:1718  -L 1719:clicense&#039;&#039;&#039;2&#039;&#039;&#039;:1719  mega.cnm.anl.gov&lt;br /&gt;
&lt;br /&gt;
== License Troubleshooting ==&lt;br /&gt;
The following are typical error messages.&lt;br /&gt;
=== Could not obtain license for COMSOL Multiphysics GUI ===&lt;br /&gt;
* Error details:&lt;br /&gt;
 License error: -4.&lt;br /&gt;
 &#039;&#039;&#039;Licensed number of users already reached.&#039;&#039;&#039;&lt;br /&gt;
 Feature:       COMSOLGUI&lt;br /&gt;
 License path:  /Users/stern/Applications/COMSOL52a/license/license.dat:&lt;br /&gt;
 FlexNet Licensing error:-4,132&lt;br /&gt;
* Reason: The connection to the license server succeeded, but the license token(s) you requested are in use.&lt;br /&gt;
* Solution: Wait a bit, or [http://carbonmgmt/ganglia/lic.php identify who&#039;s using COMSOL] and politely ask the user when they might be finished with their work.&lt;br /&gt;
&lt;br /&gt;
=== License server machine is down or not responding ===&lt;br /&gt;
* Error details:&lt;br /&gt;
  License error: -96.&lt;br /&gt;
  See the system administrator about starting the license server system, or&lt;br /&gt;
  make sure you&#039;re referring to the right host (see LM_LICENSE_FILE).&lt;br /&gt;
 Feature:       SERIAL&lt;br /&gt;
 Hostname:      clicense3&lt;br /&gt;
 License path:  /Users/stern/Applications/COMSOL52a/license/license.dat:&lt;br /&gt;
 FlexNet Licensing error:-96,7&lt;br /&gt;
* Reason: The license servers cannot be reached at all. The &amp;lt;code&amp;gt;ping&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;host&amp;lt;/code&amp;gt; tests mentioned above fail.&lt;br /&gt;
* Solution: Review the client license file and DNS lookup domains.&lt;br /&gt;
&lt;br /&gt;
=== License file does not support this version ===&lt;br /&gt;
* Error details:&lt;br /&gt;
  Feature: SERIAL&lt;br /&gt;
 &#039;&#039;&#039;Application version &amp;gt; License version: 5.21 &amp;gt; 3.5&#039;&#039;&#039;&lt;br /&gt;
 License path: /Users/stern/Applications/COMSOL52a/license/license.dat:&lt;br /&gt;
 FlexNet Licensing error:-21,126&lt;br /&gt;
* 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&#039;re connected to.&lt;br /&gt;
* Solution: When using SSH, try &amp;lt;code&amp;gt;clicense2&amp;lt;/code&amp;gt; instead of  &amp;lt;code&amp;gt;clicense1&amp;lt;/code&amp;gt;, or vice versa. Revisit your &amp;lt;code&amp;gt;~/.ssh/config&amp;lt;/code&amp;gt; file or use the alternate command line as shown in the SSH section above.&lt;br /&gt;
&lt;br /&gt;
== Multiple CPU cores ==&lt;br /&gt;
Ways to start multi-core (from http://www.comsol.com/support/knowledgebase/1096/)&lt;br /&gt;
 comsol -np 8&lt;br /&gt;
&lt;br /&gt;
 export COMSOL_NUM_THREADS=8    # automatically provided on &#039;&#039;Carbon&#039;&#039;&lt;br /&gt;
 comsol&lt;br /&gt;
* COMSOL does not benefit from hyperthreading (oversubscribing the physical core count).&lt;br /&gt;
&lt;br /&gt;
== Batch jobs ==&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
 comsol -clustersimple batch -inputfile input.mph -outputfile output.mph &lt;br /&gt;
&lt;br /&gt;
 &amp;lt;strike&amp;gt;comsol –nn 8 mpd boot&lt;br /&gt;
 comsol –nn 8 batch –inputfile in.mph&lt;br /&gt;
 comsol mpd allexit&amp;lt;/strike&amp;gt;&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
* http://www.comsol.com/support/knowledgebase/1001/ .&lt;br /&gt;
* [[Media:HPC 2012-05-16 Comsol parallel usage.pdf]] (Modified from http://www.comsol.com/support/knowledgebase/1001/files/4027/cluster_install_linux_42a.pptx – Appendix slide, PBS)&lt;br /&gt;
* &#039;&#039;&#039;Note:&#039;&#039;&#039; MPD is not supported on Carbon (I patched the main comsol script), and no longer necessary at all in Comsol-4.3.&lt;br /&gt;
&lt;br /&gt;
=== Sample Job file ===&lt;br /&gt;
See:&lt;br /&gt;
 $COMSOL_HOME/sample.job&lt;br /&gt;
&lt;br /&gt;
== Important COMSOL Support Articles ==&lt;br /&gt;
* Toplevel suport page: https://www.comsol.com/support&lt;br /&gt;
&lt;br /&gt;
=== KB Articles ===&lt;br /&gt;
* [https://www.comsol.com/support/knowledgebase/1001 Running COMSOL® in parallel on clusters]&lt;br /&gt;
* [https://www.comsol.com/support/knowledgebase/1250 Running parametric sweeps, batch sweeps, and cluster sweeps from the command line]&lt;br /&gt;
* [https://www.comsol.com/support/knowledgebase/1255 Reducing the amount of solution data stored in a model]&lt;br /&gt;
* [https://www.comsol.com/support/knowledgebase/830 Handling large models]&lt;br /&gt;
&lt;br /&gt;
=== Blog-style articles ===&lt;br /&gt;
* [https://www.comsol.com/blogs/the-power-of-the-batch-sweep/ The Power of the Batch Sweep]&lt;br /&gt;
* [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]&lt;/div&gt;</summary>
		<author><name>Stern</name></author>
	</entry>
	<entry>
		<id>https://wiki.anl.gov/wiki_cnm/index.php?title=HPC/Applications/comsol&amp;diff=7495</id>
		<title>HPC/Applications/comsol</title>
		<link rel="alternate" type="text/html" href="https://wiki.anl.gov/wiki_cnm/index.php?title=HPC/Applications/comsol&amp;diff=7495"/>
		<updated>2026-02-26T17:14:48Z</updated>

		<summary type="html">&lt;p&gt;Stern: /* Establish connection to CNM license server */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
The [http://www.comsol.com/products/multiphysics/ &#039;&#039;&#039;COMSOL Multiphysics&#039;&#039;&#039;] application suite&lt;br /&gt;
is available for Mac, Windows, and Linux.&lt;br /&gt;
&lt;br /&gt;
== Access ==&lt;br /&gt;
[[Image:HPC Comsol licensed modules.png|right|450px|thumb|COMSOL features licensed at CNM as of 2024-10.]]&lt;br /&gt;
=== COMSOL Multiphysics ===&lt;br /&gt;
Access to &#039;&#039;&#039;COMSOL Multiphysics&#039;&#039;&#039;, the main application with both a graphical user interface and batch computing capabilities, will be granted &#039;&#039;&#039;&#039;&#039;upon request&#039;&#039;&#039;&#039;&#039;&amp;amp;thinsp;.&lt;br /&gt;
&lt;br /&gt;
You must be:&lt;br /&gt;
* An &#039;&#039;&#039;&#039;&#039;Argonne employee&#039;&#039;&#039;&#039;&#039;&amp;amp;thinsp; in one of the following roles:&lt;br /&gt;
** &#039;&#039;&#039;&#039;&#039;NST staff member&#039;&#039;&#039;&#039;&#039;&amp;amp;thinsp; (including PostDocs, joint appointments, and students at NST).&lt;br /&gt;
** &#039;&#039;&#039;&#039;&#039;CNM Facility User&#039;&#039;&#039;&#039;&#039;&amp;amp;thinsp; (including &#039;&#039;non-NST Argonne employees&#039;&#039;), with an active proposal that has COMSOL in scope. Please see [[HPC/FAQ#Access_and_proposals]].&lt;br /&gt;
&lt;br /&gt;
The set of available COMSOL modules that we have licensed is shown at right.&lt;br /&gt;
&lt;br /&gt;
* The native desktop version can be installed only on &#039;&#039;Argonne-owned&#039;&#039; computers (laptop or desktop). Please contact [mailto:help@anl.gov?Subject=COMSOL%20license%20access%20request CNM support]. Make sure to review [http://www.comsol.com/support/updates/ Product Updates].&lt;br /&gt;
* To run COMSOL on our HPC system &#039;&#039;Carbon&#039;&#039;, as GUI or as batch computing jobs, your proposal must have &#039;&#039;Carbon&#039;&#039; access in scope.&lt;br /&gt;
&lt;br /&gt;
=== COMSOL Server ===&lt;br /&gt;
&#039;&#039;CNM Facility Users&#039;&#039; who are not Argonne employees are not eligible to access&lt;br /&gt;
the full &#039;&#039;&#039;COMSOL Multiphysics&#039;&#039;&#039; product, in compliance with its licensing terms and conditions.&lt;br /&gt;
However, the [https://www.comsol.com/comsol-server &#039;&#039;&#039;COMSOL Server&#039;&#039;&#039;] product offers an alternative&lt;br /&gt;
albeit more narrow means of access.&lt;br /&gt;
&lt;br /&gt;
All users, including &#039;&#039;&#039;&#039;&#039;non-Argonne users&#039;&#039;&#039;&#039;&#039; may be able to run, over a web interface in their browser,&lt;br /&gt;
pre-parameterized &amp;quot;fixed-model&amp;quot; simulations that were made with the &#039;&#039;&#039;COMSOL Application Builder&#039;&#039;&#039; (requires Windows).&lt;br /&gt;
&lt;br /&gt;
To inquire about using COMSOL server applications,&lt;br /&gt;
please contact us.&lt;br /&gt;
&amp;lt;!-- [mailto:cnm_useroffice@anl.gov?Subject=COMSOL%20server%20usage Support]. --&amp;gt;&lt;br /&gt;
We will review possible purchase paths for COMSOL Server, and the &#039;&#039;considerable effort&#039;&#039; likely required by users and the CNM to develop and deploy a COMSOL application.&lt;br /&gt;
&lt;br /&gt;
== Support ==&lt;br /&gt;
* For questions on how to run or start COMSOL:&lt;br /&gt;
*: Submit an [[HPC/Support | &#039;&#039;&#039;IT support request&#039;&#039;&#039;]]&lt;br /&gt;
* For questions related to most COMSOL data or scripts, contact COMSOL support at:&lt;br /&gt;
*: [mailto:support@comsol.com &#039;&#039;&#039;support&#039;&#039;&#039;@comsol.com]&lt;br /&gt;
* &#039;&#039;&#039;Exception:&#039;&#039;&#039; If your support question might contain data that is subject to &#039;&#039;&#039;US Export Control&#039;&#039;&#039; regulations, contact instead:&lt;br /&gt;
*: [mailto:us-export-control@us.comsol.com &#039;&#039;&#039;us-export-control&#039;&#039;&#039;@&#039;&#039;&#039;us&#039;&#039;&#039;.comsol.com]&lt;br /&gt;
&lt;br /&gt;
== The modes to run COMSOL ==&lt;br /&gt;
There are several ways of running COMSOL.&lt;br /&gt;
&lt;br /&gt;
=== Running the desktop application ===&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
# Run on Carbon, display on your desktop using the [http://en.wikipedia.org/wiki/X_Window_System X Window system (X11)].&lt;br /&gt;
#* Requires an &#039;&#039;X11 Server&#039;&#039; application running on your client machine, and SSH X11 forwarding.&lt;br /&gt;
#* The X11 protocol can be slow over LAN.&lt;br /&gt;
# Run on Carbon within a [[HPC/Network Access/Virtual Desktop | virtual desktop environment (VNC)]].&lt;br /&gt;
#* Requires a VNC client on your machine.&lt;br /&gt;
#* It can be confusing where VNC and the app runs.&lt;br /&gt;
#* The virtual desktop presents a (deliberatly) sparse windowing environment – Copy&amp;amp;Paste can be difficult to use.&lt;br /&gt;
# Run on your Argonne-provided computer, checking out Carbon&#039;s license remotely.&lt;br /&gt;
#* Requires a full installation of COMSOL on your desktoo or laptop computer.&lt;br /&gt;
#* 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.&lt;br /&gt;
&lt;br /&gt;
=== Running a batch calculation ===&lt;br /&gt;
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.&lt;br /&gt;
See the [[#Batch jobs|section below]].&lt;br /&gt;
&lt;br /&gt;
== Use with X11 ==&lt;br /&gt;
For casual use, and with [[HPC/Network Access/SSH Tunnel Setup on Linux and MacOS | X11 tunneling to Carbon]] set up, simply add to your &amp;lt;code&amp;gt;~/.bashrc&amp;lt;/code&amp;gt; file on Carbon:&lt;br /&gt;
 module load comsol&lt;br /&gt;
&lt;br /&gt;
Then, from the command line on a Carbon login node, start the COMSOL GUI:&lt;br /&gt;
 comsol &amp;amp;&lt;br /&gt;
&lt;br /&gt;
License configuration is automatic on Carbon.&lt;br /&gt;
&lt;br /&gt;
Comsol will use a number of cores to run calculations multithreaded by default. (On Carbon, COMSOL_NUM_THREADS is set.)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Quit the application&#039;&#039;&#039; as soon as you are done. Only one user can use Comsol at a time.&lt;br /&gt;
&lt;br /&gt;
== Use with VNC ==&lt;br /&gt;
See general  [[HPC/Network Access/Virtual Desktop | instructions on using VNC]], and the COMSOL example therein.&lt;br /&gt;
&lt;br /&gt;
== Native desktop version ==&lt;br /&gt;
&lt;br /&gt;
To get the fastest response from the COMSOL GUI, run a native COMSOL version on your desktop machine or laptop, called &#039;&#039;client machine&#039;&#039; below.&lt;br /&gt;
&lt;br /&gt;
Enter license details either in the COMSOL Setup configuration dialog.&lt;br /&gt;
&lt;br /&gt;
== Native desktop version — License configuration ==&lt;br /&gt;
A client&#039;s COMSOL license needs to be configured depending on how the client reaches CNM network resources. Follow the appropriate section:&lt;br /&gt;
&lt;br /&gt;
* [[#License configuration when inside CNM or on CNM VPN|License configuration when &#039;&#039;&#039;inside CNM&#039;&#039;&#039; or on &#039;&#039;&#039;CNM VPN&#039;&#039;&#039;]]&lt;br /&gt;
: Requires that the user&#039;s machine is logically within the network of CNM/NST, either by a wired/auth WiFi connection in the building or by VPN under a CNM/NST profile.&lt;br /&gt;
* [[#License configuration when outside CNM – requires SSH Tunneling|License configuration when &#039;&#039;&#039;outside CNM&#039;&#039;&#039; – requires SSH Tunneling]]&lt;br /&gt;
: &#039;&#039;Non-NST staff&#039;&#039; usually have a VPN profile that places the machine logically [[#License configuration when outside CNM – requires SSH Tunneling|outside of NST&#039;s network.]]&lt;br /&gt;
&lt;br /&gt;
== License configuration when inside CNM or on CNM VPN ==&lt;br /&gt;
=== &amp;lt;span style=&amp;quot;color:#A00;&amp;quot;&amp;gt;Ensure correct DNS search domains&amp;lt;/span&amp;gt; ===&lt;br /&gt;
* Inspect the client machine&#039;s network configuration.&lt;br /&gt;
* Ensure that &#039;&#039;&#039;two&#039;&#039;&#039; entries are listed as DNS Search Domains for the current network profile:&lt;br /&gt;
 nst.anl.gov&lt;br /&gt;
 cnm.anl.gov&lt;br /&gt;
: (The order of entries does not matter for the purposes considered here.)&lt;br /&gt;
* If the client machine is &#039;&#039;wired to CNM networks&#039;&#039;, the domains are normally provided correctly by DHCP.&lt;br /&gt;
* If the client machine is &#039;&#039;connected over VPN&#039;&#039;, you may need edit the respective network profile.&lt;br /&gt;
:* 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 &amp;quot;Advanced…&amp;quot;. It appears that those changes are being saved and will be activated automatically the next time that this VPN session gets started.&lt;br /&gt;
: [[Image:VNC_add_cnm_to_DNS_1.png|400px]] [[Image:VNC_add_cnm_to_DNS_2.png|400px]]&lt;br /&gt;
:* On Windows or Linux machines, take &#039;&#039;analogous&#039;&#039; steps, using the platform&#039;s own configuration tools.&lt;br /&gt;
&lt;br /&gt;
* Exclude license manager components from client desktop installation. (Those are all handled server-side.)&lt;br /&gt;
&lt;br /&gt;
=== License format ===&lt;br /&gt;
* Floating Network License (FNL), &amp;quot;Three-server redundancy&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== License servers ===&lt;br /&gt;
* On client machines, while running the COMSOL installer or license configuration, specify license servers and ports as follows:&lt;br /&gt;
 1718    clicense1&lt;br /&gt;
 1718    clicense2&lt;br /&gt;
 1718    clicense3&lt;br /&gt;
: &#039;&#039;&#039;Note:&#039;&#039;&#039; Use &#039;&#039;short host names only&#039;&#039;. (Technical Reason: The license must be usable both on Carbon&#039;s internal network as well as on divisional networks).&lt;br /&gt;
 1718    clicense1&amp;lt;strike&amp;gt;.cnm.anl.gov&amp;lt;/strike&amp;gt;&lt;br /&gt;
 1718    clicense2&amp;lt;strike&amp;gt;.cnm.anl.gov&amp;lt;/strike&amp;gt;&lt;br /&gt;
 1718    clicense3&amp;lt;strike&amp;gt;.cnm.anl.gov&amp;lt;/strike&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Advanced:&#039;&#039;&#039; A client machine&#039;s COMSOL license file &amp;lt;code&amp;gt;&amp;amp;lt;COMSOLDIR&amp;amp;gt;/Multiphysics/license/license.dat&amp;lt;/code&amp;gt; should look as follows:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;make&amp;quot;&amp;gt;&lt;br /&gt;
SERVER clicense1 ANY 1718&lt;br /&gt;
SERVER clicense2 ANY 1718&lt;br /&gt;
SERVER clicense3 ANY 1718&lt;br /&gt;
USE_SERVER&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;amp;lt;COMSOLDIR&amp;amp;gt;&amp;lt;/code&amp;gt; is located by default at:&lt;br /&gt;
* &#039;&#039;&#039;Windows&#039;&#039;&#039;: C:\Program files\COMSOL\COMSOL&#039;&#039;nn&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Linux&#039;&#039;&#039;: /usr/local/comsol&#039;&#039;nn&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Mac&#039;&#039;&#039;: /Applications/COMSOL&#039;&#039;nn&#039;&#039;&lt;br /&gt;
(&amp;quot;&#039;&#039;nn&#039;&#039;&amp;quot; is the application&#039;s abbreviated version number.)&lt;br /&gt;
&lt;br /&gt;
=== Network Troubleshooting ===&lt;br /&gt;
When using the license access model descibed here (as opposed to tunneled over SSH), ensure the following:&lt;br /&gt;
* Verify that short host names can be resolved to IP addresses. Either one of the following commands should produce sensible output:&lt;br /&gt;
 host clicense1&lt;br /&gt;
: or:&lt;br /&gt;
 ping -c 3 clicense1&lt;br /&gt;
* Verify that &#039;&#039;both license ports on the same server&#039;&#039; can be reached from your client machine:&lt;br /&gt;
 telnet &#039;&#039;&#039;clicense1&#039;&#039;&#039; 1718&lt;br /&gt;
 telnet &#039;&#039;&#039;clicense1&#039;&#039;&#039; 1719&lt;br /&gt;
: or:&lt;br /&gt;
 telnet &#039;&#039;&#039;clicense2&#039;&#039;&#039; 1718&lt;br /&gt;
 telnet &#039;&#039;&#039;clicense2&#039;&#039;&#039; 1719&lt;br /&gt;
: A &#039;&#039;successful&#039;&#039; connection looks like:&lt;br /&gt;
 Trying 146.139.x.y...&lt;br /&gt;
 Connected to clicense1.cnm.anl.gov.&lt;br /&gt;
 Escape character is &#039;^]&#039;.&lt;br /&gt;
:: Do not enter any data. Instead,  close each connection by hitting &amp;lt;code&amp;gt;Ctrl&amp;lt;/code&amp;gt;&amp;lt;code&amp;gt;]&amp;lt;/code&amp;gt; (closing square bracket), followed by &amp;lt;code&amp;gt;Ctrl&amp;lt;/code&amp;gt;&amp;lt;code&amp;gt;D&amp;lt;/code&amp;gt;.&lt;br /&gt;
: A &#039;&#039;failed&#039;&#039; connection gives one of these errors:&lt;br /&gt;
 telnet: connect to address 146.139.x.y: Operation timed out&lt;br /&gt;
: or:&lt;br /&gt;
 telnet: connect to address 146.139.x.y: Connection refused&lt;br /&gt;
:: In these cases, ask that your IP firewall configuration be reviewed and changed.&lt;br /&gt;
&lt;br /&gt;
== License configuration when outside CNM – requires SSH Tunneling ==&lt;br /&gt;
This section documents how to run COMSOL from a network location outside CNM.&lt;br /&gt;
&lt;br /&gt;
As a one-time preparation step, two items must be configured:&lt;br /&gt;
* The license host that COMSOL is to contact, and&lt;br /&gt;
* An SSH connection that will allow your machine to access the COMSOL license server inside CNM&#039;s network.&lt;br /&gt;
&lt;br /&gt;
To then &#039;&#039;run&#039;&#039; the COMSOL application, the configured SSH connection must be up and kept running for the entire time that you run the COMSOL. When you exit COMSOL and wish to start it again, you can keep the SSH connection running, it will be re-used for the next COMSOL run.&lt;br /&gt;
&lt;br /&gt;
=== Configure COMSOL ===&lt;br /&gt;
The following needs to be done just once, typically during COMSOL installation:&lt;br /&gt;
&lt;br /&gt;
In the COMSOL Installer, or in COMSOL Preferences, enter:&lt;br /&gt;
* &#039;&#039;&#039;License format:&#039;&#039;&#039; Floating Network License (FNL), &amp;quot;Port number and Hostname&amp;quot;&lt;br /&gt;
:: &amp;lt;font style=&amp;quot;color:#777&amp;quot;&amp;gt;Do &#039;&#039;not use&#039;&#039; &amp;quot;Three-server redundancy&amp;quot;, since it cannot (easily) be accessed over SSH. Configure with just one server, and in the rare situation of a server failover, temporarily tweak your SSH configuration to contact the alternate server (see below).&amp;lt;/font&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Server:&#039;&#039;&#039; &amp;lt;code&amp;gt;127.0.0.1&amp;lt;/code&amp;gt;&lt;br /&gt;
:: Do not use &amp;quot;localhost&amp;quot;, as COMSOL interprets this incorrectly to mean that your machine &#039;&#039;is&#039;&#039; a license server.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Port:&#039;&#039;&#039; &amp;lt;code&amp;gt;1718&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
Or place a license file with this content:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;make&amp;quot;&amp;gt;&lt;br /&gt;
SERVER 127.0.0.1 ANY 1718&lt;br /&gt;
USE_SERVER&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
//--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Establish connection to CNM license server ===&lt;br /&gt;
This step needs to be done prior to running COMSOL in your desktop session:&lt;br /&gt;
* Connect to &amp;lt;code&amp;gt;mega&amp;lt;/code&amp;gt; with the following ssh command:&lt;br /&gt;
 ssh  -L 1718:&#039;&#039;&#039;clicense1&#039;&#039;&#039;:1718  -L 1719:&#039;&#039;&#039;clicense1&#039;&#039;&#039;:1719  mega.cnm.anl.gov&lt;br /&gt;
* Leave the command running between invocations of COMSOL.&lt;br /&gt;
&lt;br /&gt;
=== Run COMSOL ===&lt;br /&gt;
# Ensure your connection to &amp;quot;mega&amp;quot; is still running. If not, restart it.&lt;br /&gt;
# Start the COMSOL application.&lt;br /&gt;
&lt;br /&gt;
=== Troubleshooting ===&lt;br /&gt;
* If you get an error that the number of licenses is &amp;quot;exhausted&amp;quot;, that is confirmation that you correctly reached the license server, though other users are using licenses.&lt;br /&gt;
* 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:&lt;br /&gt;
 ssh  -L 1718:clicense&#039;&#039;&#039;2&#039;&#039;&#039;:1718  -L 1719:clicense&#039;&#039;&#039;2&#039;&#039;&#039;:1719  mega.cnm.anl.gov&lt;br /&gt;
&lt;br /&gt;
== License Troubleshooting ==&lt;br /&gt;
The following are typical error messages.&lt;br /&gt;
=== Could not obtain license for COMSOL Multiphysics GUI ===&lt;br /&gt;
* Error details:&lt;br /&gt;
 License error: -4.&lt;br /&gt;
 &#039;&#039;&#039;Licensed number of users already reached.&#039;&#039;&#039;&lt;br /&gt;
 Feature:       COMSOLGUI&lt;br /&gt;
 License path:  /Users/stern/Applications/COMSOL52a/license/license.dat:&lt;br /&gt;
 FlexNet Licensing error:-4,132&lt;br /&gt;
* Reason: The connection to the license server succeeded, but the license token(s) you requested are in use.&lt;br /&gt;
* Solution: Wait a bit, or [http://carbonmgmt/ganglia/lic.php identify who&#039;s using COMSOL] and politely ask the user when they might be finished with their work.&lt;br /&gt;
&lt;br /&gt;
=== License server machine is down or not responding ===&lt;br /&gt;
* Error details:&lt;br /&gt;
  License error: -96.&lt;br /&gt;
  See the system administrator about starting the license server system, or&lt;br /&gt;
  make sure you&#039;re referring to the right host (see LM_LICENSE_FILE).&lt;br /&gt;
 Feature:       SERIAL&lt;br /&gt;
 Hostname:      clicense3&lt;br /&gt;
 License path:  /Users/stern/Applications/COMSOL52a/license/license.dat:&lt;br /&gt;
 FlexNet Licensing error:-96,7&lt;br /&gt;
* Reason: The license servers cannot be reached at all. The &amp;lt;code&amp;gt;ping&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;host&amp;lt;/code&amp;gt; tests mentioned above fail.&lt;br /&gt;
* Solution: Review the client license file and DNS lookup domains.&lt;br /&gt;
&lt;br /&gt;
=== License file does not support this version ===&lt;br /&gt;
* Error details:&lt;br /&gt;
  Feature: SERIAL&lt;br /&gt;
 &#039;&#039;&#039;Application version &amp;gt; License version: 5.21 &amp;gt; 3.5&#039;&#039;&#039;&lt;br /&gt;
 License path: /Users/stern/Applications/COMSOL52a/license/license.dat:&lt;br /&gt;
 FlexNet Licensing error:-21,126&lt;br /&gt;
* 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&#039;re connected to.&lt;br /&gt;
* Solution: When using SSH, try &amp;lt;code&amp;gt;clicense2&amp;lt;/code&amp;gt; instead of  &amp;lt;code&amp;gt;clicense1&amp;lt;/code&amp;gt;, or vice versa. Revisit your &amp;lt;code&amp;gt;~/.ssh/config&amp;lt;/code&amp;gt; file or use the alternate command line as shown in the SSH section above.&lt;br /&gt;
&lt;br /&gt;
== Multiple CPU cores ==&lt;br /&gt;
Ways to start multi-core (from http://www.comsol.com/support/knowledgebase/1096/)&lt;br /&gt;
 comsol -np 8&lt;br /&gt;
&lt;br /&gt;
 export COMSOL_NUM_THREADS=8    # automatically provided on &#039;&#039;Carbon&#039;&#039;&lt;br /&gt;
 comsol&lt;br /&gt;
* COMSOL does not benefit from hyperthreading (oversubscribing the physical core count).&lt;br /&gt;
&lt;br /&gt;
== Batch jobs ==&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
 comsol -clustersimple batch -inputfile input.mph -outputfile output.mph &lt;br /&gt;
&lt;br /&gt;
 &amp;lt;strike&amp;gt;comsol –nn 8 mpd boot&lt;br /&gt;
 comsol –nn 8 batch –inputfile in.mph&lt;br /&gt;
 comsol mpd allexit&amp;lt;/strike&amp;gt;&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
* http://www.comsol.com/support/knowledgebase/1001/ .&lt;br /&gt;
* [[Media:HPC 2012-05-16 Comsol parallel usage.pdf]] (Modified from http://www.comsol.com/support/knowledgebase/1001/files/4027/cluster_install_linux_42a.pptx – Appendix slide, PBS)&lt;br /&gt;
* &#039;&#039;&#039;Note:&#039;&#039;&#039; MPD is not supported on Carbon (I patched the main comsol script), and no longer necessary at all in Comsol-4.3.&lt;br /&gt;
&lt;br /&gt;
=== Sample Job file ===&lt;br /&gt;
See:&lt;br /&gt;
 $COMSOL_HOME/sample.job&lt;br /&gt;
&lt;br /&gt;
== Important COMSOL Support Articles ==&lt;br /&gt;
* Toplevel suport page: https://www.comsol.com/support&lt;br /&gt;
&lt;br /&gt;
=== KB Articles ===&lt;br /&gt;
* [https://www.comsol.com/support/knowledgebase/1001 Running COMSOL® in parallel on clusters]&lt;br /&gt;
* [https://www.comsol.com/support/knowledgebase/1250 Running parametric sweeps, batch sweeps, and cluster sweeps from the command line]&lt;br /&gt;
* [https://www.comsol.com/support/knowledgebase/1255 Reducing the amount of solution data stored in a model]&lt;br /&gt;
* [https://www.comsol.com/support/knowledgebase/830 Handling large models]&lt;br /&gt;
&lt;br /&gt;
=== Blog-style articles ===&lt;br /&gt;
* [https://www.comsol.com/blogs/the-power-of-the-batch-sweep/ The Power of the Batch Sweep]&lt;br /&gt;
* [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]&lt;/div&gt;</summary>
		<author><name>Stern</name></author>
	</entry>
	<entry>
		<id>https://wiki.anl.gov/wiki_cnm/index.php?title=HPC/Applications/comsol&amp;diff=7494</id>
		<title>HPC/Applications/comsol</title>
		<link rel="alternate" type="text/html" href="https://wiki.anl.gov/wiki_cnm/index.php?title=HPC/Applications/comsol&amp;diff=7494"/>
		<updated>2026-02-26T17:14:07Z</updated>

		<summary type="html">&lt;p&gt;Stern: /* Configure COMSOL */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
The [http://www.comsol.com/products/multiphysics/ &#039;&#039;&#039;COMSOL Multiphysics&#039;&#039;&#039;] application suite&lt;br /&gt;
is available for Mac, Windows, and Linux.&lt;br /&gt;
&lt;br /&gt;
== Access ==&lt;br /&gt;
[[Image:HPC Comsol licensed modules.png|right|450px|thumb|COMSOL features licensed at CNM as of 2024-10.]]&lt;br /&gt;
=== COMSOL Multiphysics ===&lt;br /&gt;
Access to &#039;&#039;&#039;COMSOL Multiphysics&#039;&#039;&#039;, the main application with both a graphical user interface and batch computing capabilities, will be granted &#039;&#039;&#039;&#039;&#039;upon request&#039;&#039;&#039;&#039;&#039;&amp;amp;thinsp;.&lt;br /&gt;
&lt;br /&gt;
You must be:&lt;br /&gt;
* An &#039;&#039;&#039;&#039;&#039;Argonne employee&#039;&#039;&#039;&#039;&#039;&amp;amp;thinsp; in one of the following roles:&lt;br /&gt;
** &#039;&#039;&#039;&#039;&#039;NST staff member&#039;&#039;&#039;&#039;&#039;&amp;amp;thinsp; (including PostDocs, joint appointments, and students at NST).&lt;br /&gt;
** &#039;&#039;&#039;&#039;&#039;CNM Facility User&#039;&#039;&#039;&#039;&#039;&amp;amp;thinsp; (including &#039;&#039;non-NST Argonne employees&#039;&#039;), with an active proposal that has COMSOL in scope. Please see [[HPC/FAQ#Access_and_proposals]].&lt;br /&gt;
&lt;br /&gt;
The set of available COMSOL modules that we have licensed is shown at right.&lt;br /&gt;
&lt;br /&gt;
* The native desktop version can be installed only on &#039;&#039;Argonne-owned&#039;&#039; computers (laptop or desktop). Please contact [mailto:help@anl.gov?Subject=COMSOL%20license%20access%20request CNM support]. Make sure to review [http://www.comsol.com/support/updates/ Product Updates].&lt;br /&gt;
* To run COMSOL on our HPC system &#039;&#039;Carbon&#039;&#039;, as GUI or as batch computing jobs, your proposal must have &#039;&#039;Carbon&#039;&#039; access in scope.&lt;br /&gt;
&lt;br /&gt;
=== COMSOL Server ===&lt;br /&gt;
&#039;&#039;CNM Facility Users&#039;&#039; who are not Argonne employees are not eligible to access&lt;br /&gt;
the full &#039;&#039;&#039;COMSOL Multiphysics&#039;&#039;&#039; product, in compliance with its licensing terms and conditions.&lt;br /&gt;
However, the [https://www.comsol.com/comsol-server &#039;&#039;&#039;COMSOL Server&#039;&#039;&#039;] product offers an alternative&lt;br /&gt;
albeit more narrow means of access.&lt;br /&gt;
&lt;br /&gt;
All users, including &#039;&#039;&#039;&#039;&#039;non-Argonne users&#039;&#039;&#039;&#039;&#039; may be able to run, over a web interface in their browser,&lt;br /&gt;
pre-parameterized &amp;quot;fixed-model&amp;quot; simulations that were made with the &#039;&#039;&#039;COMSOL Application Builder&#039;&#039;&#039; (requires Windows).&lt;br /&gt;
&lt;br /&gt;
To inquire about using COMSOL server applications,&lt;br /&gt;
please contact us.&lt;br /&gt;
&amp;lt;!-- [mailto:cnm_useroffice@anl.gov?Subject=COMSOL%20server%20usage Support]. --&amp;gt;&lt;br /&gt;
We will review possible purchase paths for COMSOL Server, and the &#039;&#039;considerable effort&#039;&#039; likely required by users and the CNM to develop and deploy a COMSOL application.&lt;br /&gt;
&lt;br /&gt;
== Support ==&lt;br /&gt;
* For questions on how to run or start COMSOL:&lt;br /&gt;
*: Submit an [[HPC/Support | &#039;&#039;&#039;IT support request&#039;&#039;&#039;]]&lt;br /&gt;
* For questions related to most COMSOL data or scripts, contact COMSOL support at:&lt;br /&gt;
*: [mailto:support@comsol.com &#039;&#039;&#039;support&#039;&#039;&#039;@comsol.com]&lt;br /&gt;
* &#039;&#039;&#039;Exception:&#039;&#039;&#039; If your support question might contain data that is subject to &#039;&#039;&#039;US Export Control&#039;&#039;&#039; regulations, contact instead:&lt;br /&gt;
*: [mailto:us-export-control@us.comsol.com &#039;&#039;&#039;us-export-control&#039;&#039;&#039;@&#039;&#039;&#039;us&#039;&#039;&#039;.comsol.com]&lt;br /&gt;
&lt;br /&gt;
== The modes to run COMSOL ==&lt;br /&gt;
There are several ways of running COMSOL.&lt;br /&gt;
&lt;br /&gt;
=== Running the desktop application ===&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
# Run on Carbon, display on your desktop using the [http://en.wikipedia.org/wiki/X_Window_System X Window system (X11)].&lt;br /&gt;
#* Requires an &#039;&#039;X11 Server&#039;&#039; application running on your client machine, and SSH X11 forwarding.&lt;br /&gt;
#* The X11 protocol can be slow over LAN.&lt;br /&gt;
# Run on Carbon within a [[HPC/Network Access/Virtual Desktop | virtual desktop environment (VNC)]].&lt;br /&gt;
#* Requires a VNC client on your machine.&lt;br /&gt;
#* It can be confusing where VNC and the app runs.&lt;br /&gt;
#* The virtual desktop presents a (deliberatly) sparse windowing environment – Copy&amp;amp;Paste can be difficult to use.&lt;br /&gt;
# Run on your Argonne-provided computer, checking out Carbon&#039;s license remotely.&lt;br /&gt;
#* Requires a full installation of COMSOL on your desktoo or laptop computer.&lt;br /&gt;
#* 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.&lt;br /&gt;
&lt;br /&gt;
=== Running a batch calculation ===&lt;br /&gt;
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.&lt;br /&gt;
See the [[#Batch jobs|section below]].&lt;br /&gt;
&lt;br /&gt;
== Use with X11 ==&lt;br /&gt;
For casual use, and with [[HPC/Network Access/SSH Tunnel Setup on Linux and MacOS | X11 tunneling to Carbon]] set up, simply add to your &amp;lt;code&amp;gt;~/.bashrc&amp;lt;/code&amp;gt; file on Carbon:&lt;br /&gt;
 module load comsol&lt;br /&gt;
&lt;br /&gt;
Then, from the command line on a Carbon login node, start the COMSOL GUI:&lt;br /&gt;
 comsol &amp;amp;&lt;br /&gt;
&lt;br /&gt;
License configuration is automatic on Carbon.&lt;br /&gt;
&lt;br /&gt;
Comsol will use a number of cores to run calculations multithreaded by default. (On Carbon, COMSOL_NUM_THREADS is set.)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Quit the application&#039;&#039;&#039; as soon as you are done. Only one user can use Comsol at a time.&lt;br /&gt;
&lt;br /&gt;
== Use with VNC ==&lt;br /&gt;
See general  [[HPC/Network Access/Virtual Desktop | instructions on using VNC]], and the COMSOL example therein.&lt;br /&gt;
&lt;br /&gt;
== Native desktop version ==&lt;br /&gt;
&lt;br /&gt;
To get the fastest response from the COMSOL GUI, run a native COMSOL version on your desktop machine or laptop, called &#039;&#039;client machine&#039;&#039; below.&lt;br /&gt;
&lt;br /&gt;
Enter license details either in the COMSOL Setup configuration dialog.&lt;br /&gt;
&lt;br /&gt;
== Native desktop version — License configuration ==&lt;br /&gt;
A client&#039;s COMSOL license needs to be configured depending on how the client reaches CNM network resources. Follow the appropriate section:&lt;br /&gt;
&lt;br /&gt;
* [[#License configuration when inside CNM or on CNM VPN|License configuration when &#039;&#039;&#039;inside CNM&#039;&#039;&#039; or on &#039;&#039;&#039;CNM VPN&#039;&#039;&#039;]]&lt;br /&gt;
: Requires that the user&#039;s machine is logically within the network of CNM/NST, either by a wired/auth WiFi connection in the building or by VPN under a CNM/NST profile.&lt;br /&gt;
* [[#License configuration when outside CNM – requires SSH Tunneling|License configuration when &#039;&#039;&#039;outside CNM&#039;&#039;&#039; – requires SSH Tunneling]]&lt;br /&gt;
: &#039;&#039;Non-NST staff&#039;&#039; usually have a VPN profile that places the machine logically [[#License configuration when outside CNM – requires SSH Tunneling|outside of NST&#039;s network.]]&lt;br /&gt;
&lt;br /&gt;
== License configuration when inside CNM or on CNM VPN ==&lt;br /&gt;
=== &amp;lt;span style=&amp;quot;color:#A00;&amp;quot;&amp;gt;Ensure correct DNS search domains&amp;lt;/span&amp;gt; ===&lt;br /&gt;
* Inspect the client machine&#039;s network configuration.&lt;br /&gt;
* Ensure that &#039;&#039;&#039;two&#039;&#039;&#039; entries are listed as DNS Search Domains for the current network profile:&lt;br /&gt;
 nst.anl.gov&lt;br /&gt;
 cnm.anl.gov&lt;br /&gt;
: (The order of entries does not matter for the purposes considered here.)&lt;br /&gt;
* If the client machine is &#039;&#039;wired to CNM networks&#039;&#039;, the domains are normally provided correctly by DHCP.&lt;br /&gt;
* If the client machine is &#039;&#039;connected over VPN&#039;&#039;, you may need edit the respective network profile.&lt;br /&gt;
:* 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 &amp;quot;Advanced…&amp;quot;. It appears that those changes are being saved and will be activated automatically the next time that this VPN session gets started.&lt;br /&gt;
: [[Image:VNC_add_cnm_to_DNS_1.png|400px]] [[Image:VNC_add_cnm_to_DNS_2.png|400px]]&lt;br /&gt;
:* On Windows or Linux machines, take &#039;&#039;analogous&#039;&#039; steps, using the platform&#039;s own configuration tools.&lt;br /&gt;
&lt;br /&gt;
* Exclude license manager components from client desktop installation. (Those are all handled server-side.)&lt;br /&gt;
&lt;br /&gt;
=== License format ===&lt;br /&gt;
* Floating Network License (FNL), &amp;quot;Three-server redundancy&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== License servers ===&lt;br /&gt;
* On client machines, while running the COMSOL installer or license configuration, specify license servers and ports as follows:&lt;br /&gt;
 1718    clicense1&lt;br /&gt;
 1718    clicense2&lt;br /&gt;
 1718    clicense3&lt;br /&gt;
: &#039;&#039;&#039;Note:&#039;&#039;&#039; Use &#039;&#039;short host names only&#039;&#039;. (Technical Reason: The license must be usable both on Carbon&#039;s internal network as well as on divisional networks).&lt;br /&gt;
 1718    clicense1&amp;lt;strike&amp;gt;.cnm.anl.gov&amp;lt;/strike&amp;gt;&lt;br /&gt;
 1718    clicense2&amp;lt;strike&amp;gt;.cnm.anl.gov&amp;lt;/strike&amp;gt;&lt;br /&gt;
 1718    clicense3&amp;lt;strike&amp;gt;.cnm.anl.gov&amp;lt;/strike&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Advanced:&#039;&#039;&#039; A client machine&#039;s COMSOL license file &amp;lt;code&amp;gt;&amp;amp;lt;COMSOLDIR&amp;amp;gt;/Multiphysics/license/license.dat&amp;lt;/code&amp;gt; should look as follows:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;make&amp;quot;&amp;gt;&lt;br /&gt;
SERVER clicense1 ANY 1718&lt;br /&gt;
SERVER clicense2 ANY 1718&lt;br /&gt;
SERVER clicense3 ANY 1718&lt;br /&gt;
USE_SERVER&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;amp;lt;COMSOLDIR&amp;amp;gt;&amp;lt;/code&amp;gt; is located by default at:&lt;br /&gt;
* &#039;&#039;&#039;Windows&#039;&#039;&#039;: C:\Program files\COMSOL\COMSOL&#039;&#039;nn&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Linux&#039;&#039;&#039;: /usr/local/comsol&#039;&#039;nn&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Mac&#039;&#039;&#039;: /Applications/COMSOL&#039;&#039;nn&#039;&#039;&lt;br /&gt;
(&amp;quot;&#039;&#039;nn&#039;&#039;&amp;quot; is the application&#039;s abbreviated version number.)&lt;br /&gt;
&lt;br /&gt;
=== Network Troubleshooting ===&lt;br /&gt;
When using the license access model descibed here (as opposed to tunneled over SSH), ensure the following:&lt;br /&gt;
* Verify that short host names can be resolved to IP addresses. Either one of the following commands should produce sensible output:&lt;br /&gt;
 host clicense1&lt;br /&gt;
: or:&lt;br /&gt;
 ping -c 3 clicense1&lt;br /&gt;
* Verify that &#039;&#039;both license ports on the same server&#039;&#039; can be reached from your client machine:&lt;br /&gt;
 telnet &#039;&#039;&#039;clicense1&#039;&#039;&#039; 1718&lt;br /&gt;
 telnet &#039;&#039;&#039;clicense1&#039;&#039;&#039; 1719&lt;br /&gt;
: or:&lt;br /&gt;
 telnet &#039;&#039;&#039;clicense2&#039;&#039;&#039; 1718&lt;br /&gt;
 telnet &#039;&#039;&#039;clicense2&#039;&#039;&#039; 1719&lt;br /&gt;
: A &#039;&#039;successful&#039;&#039; connection looks like:&lt;br /&gt;
 Trying 146.139.x.y...&lt;br /&gt;
 Connected to clicense1.cnm.anl.gov.&lt;br /&gt;
 Escape character is &#039;^]&#039;.&lt;br /&gt;
:: Do not enter any data. Instead,  close each connection by hitting &amp;lt;code&amp;gt;Ctrl&amp;lt;/code&amp;gt;&amp;lt;code&amp;gt;]&amp;lt;/code&amp;gt; (closing square bracket), followed by &amp;lt;code&amp;gt;Ctrl&amp;lt;/code&amp;gt;&amp;lt;code&amp;gt;D&amp;lt;/code&amp;gt;.&lt;br /&gt;
: A &#039;&#039;failed&#039;&#039; connection gives one of these errors:&lt;br /&gt;
 telnet: connect to address 146.139.x.y: Operation timed out&lt;br /&gt;
: or:&lt;br /&gt;
 telnet: connect to address 146.139.x.y: Connection refused&lt;br /&gt;
:: In these cases, ask that your IP firewall configuration be reviewed and changed.&lt;br /&gt;
&lt;br /&gt;
== License configuration when outside CNM – requires SSH Tunneling ==&lt;br /&gt;
This section documents how to run COMSOL from a network location outside CNM.&lt;br /&gt;
&lt;br /&gt;
As a one-time preparation step, two items must be configured:&lt;br /&gt;
* The license host that COMSOL is to contact, and&lt;br /&gt;
* An SSH connection that will allow your machine to access the COMSOL license server inside CNM&#039;s network.&lt;br /&gt;
&lt;br /&gt;
To then &#039;&#039;run&#039;&#039; the COMSOL application, the configured SSH connection must be up and kept running for the entire time that you run the COMSOL. When you exit COMSOL and wish to start it again, you can keep the SSH connection running, it will be re-used for the next COMSOL run.&lt;br /&gt;
&lt;br /&gt;
=== Configure COMSOL ===&lt;br /&gt;
The following needs to be done just once, typically during COMSOL installation:&lt;br /&gt;
&lt;br /&gt;
In the COMSOL Installer, or in COMSOL Preferences, enter:&lt;br /&gt;
* &#039;&#039;&#039;License format:&#039;&#039;&#039; Floating Network License (FNL), &amp;quot;Port number and Hostname&amp;quot;&lt;br /&gt;
:: &amp;lt;font style=&amp;quot;color:#777&amp;quot;&amp;gt;Do &#039;&#039;not use&#039;&#039; &amp;quot;Three-server redundancy&amp;quot;, since it cannot (easily) be accessed over SSH. Configure with just one server, and in the rare situation of a server failover, temporarily tweak your SSH configuration to contact the alternate server (see below).&amp;lt;/font&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Server:&#039;&#039;&#039; &amp;lt;code&amp;gt;127.0.0.1&amp;lt;/code&amp;gt;&lt;br /&gt;
:: Do not use &amp;quot;localhost&amp;quot;, as COMSOL interprets this incorrectly to mean that your machine &#039;&#039;is&#039;&#039; a license server.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Port:&#039;&#039;&#039; &amp;lt;code&amp;gt;1718&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
Or place a license file with this content:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;make&amp;quot;&amp;gt;&lt;br /&gt;
SERVER 127.0.0.1 ANY 1718&lt;br /&gt;
USE_SERVER&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
//--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Establish connection to CNM license server ===&lt;br /&gt;
This step needs to be done prior to running COMSOL in your desktop session:&lt;br /&gt;
# Connect to &amp;lt;code&amp;gt;mega&amp;lt;/code&amp;gt; with the following ssh command:&lt;br /&gt;
 ssh  -L 1718:&#039;&#039;&#039;clicense1&#039;&#039;&#039;:1718  -L 1719:&#039;&#039;&#039;clicense1&#039;&#039;&#039;:1719  mega.cnm.anl.gov&lt;br /&gt;
# Leave the command running between invocations of COMSOL.&lt;br /&gt;
&lt;br /&gt;
=== Run COMSOL ===&lt;br /&gt;
# Ensure your connection to &amp;quot;mega&amp;quot; is still running. If not, restart it.&lt;br /&gt;
# Start the COMSOL application.&lt;br /&gt;
&lt;br /&gt;
=== Troubleshooting ===&lt;br /&gt;
* If you get an error that the number of licenses is &amp;quot;exhausted&amp;quot;, that is confirmation that you correctly reached the license server, though other users are using licenses.&lt;br /&gt;
* 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:&lt;br /&gt;
 ssh  -L 1718:clicense&#039;&#039;&#039;2&#039;&#039;&#039;:1718  -L 1719:clicense&#039;&#039;&#039;2&#039;&#039;&#039;:1719  mega.cnm.anl.gov&lt;br /&gt;
&lt;br /&gt;
== License Troubleshooting ==&lt;br /&gt;
The following are typical error messages.&lt;br /&gt;
=== Could not obtain license for COMSOL Multiphysics GUI ===&lt;br /&gt;
* Error details:&lt;br /&gt;
 License error: -4.&lt;br /&gt;
 &#039;&#039;&#039;Licensed number of users already reached.&#039;&#039;&#039;&lt;br /&gt;
 Feature:       COMSOLGUI&lt;br /&gt;
 License path:  /Users/stern/Applications/COMSOL52a/license/license.dat:&lt;br /&gt;
 FlexNet Licensing error:-4,132&lt;br /&gt;
* Reason: The connection to the license server succeeded, but the license token(s) you requested are in use.&lt;br /&gt;
* Solution: Wait a bit, or [http://carbonmgmt/ganglia/lic.php identify who&#039;s using COMSOL] and politely ask the user when they might be finished with their work.&lt;br /&gt;
&lt;br /&gt;
=== License server machine is down or not responding ===&lt;br /&gt;
* Error details:&lt;br /&gt;
  License error: -96.&lt;br /&gt;
  See the system administrator about starting the license server system, or&lt;br /&gt;
  make sure you&#039;re referring to the right host (see LM_LICENSE_FILE).&lt;br /&gt;
 Feature:       SERIAL&lt;br /&gt;
 Hostname:      clicense3&lt;br /&gt;
 License path:  /Users/stern/Applications/COMSOL52a/license/license.dat:&lt;br /&gt;
 FlexNet Licensing error:-96,7&lt;br /&gt;
* Reason: The license servers cannot be reached at all. The &amp;lt;code&amp;gt;ping&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;host&amp;lt;/code&amp;gt; tests mentioned above fail.&lt;br /&gt;
* Solution: Review the client license file and DNS lookup domains.&lt;br /&gt;
&lt;br /&gt;
=== License file does not support this version ===&lt;br /&gt;
* Error details:&lt;br /&gt;
  Feature: SERIAL&lt;br /&gt;
 &#039;&#039;&#039;Application version &amp;gt; License version: 5.21 &amp;gt; 3.5&#039;&#039;&#039;&lt;br /&gt;
 License path: /Users/stern/Applications/COMSOL52a/license/license.dat:&lt;br /&gt;
 FlexNet Licensing error:-21,126&lt;br /&gt;
* 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&#039;re connected to.&lt;br /&gt;
* Solution: When using SSH, try &amp;lt;code&amp;gt;clicense2&amp;lt;/code&amp;gt; instead of  &amp;lt;code&amp;gt;clicense1&amp;lt;/code&amp;gt;, or vice versa. Revisit your &amp;lt;code&amp;gt;~/.ssh/config&amp;lt;/code&amp;gt; file or use the alternate command line as shown in the SSH section above.&lt;br /&gt;
&lt;br /&gt;
== Multiple CPU cores ==&lt;br /&gt;
Ways to start multi-core (from http://www.comsol.com/support/knowledgebase/1096/)&lt;br /&gt;
 comsol -np 8&lt;br /&gt;
&lt;br /&gt;
 export COMSOL_NUM_THREADS=8    # automatically provided on &#039;&#039;Carbon&#039;&#039;&lt;br /&gt;
 comsol&lt;br /&gt;
* COMSOL does not benefit from hyperthreading (oversubscribing the physical core count).&lt;br /&gt;
&lt;br /&gt;
== Batch jobs ==&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
 comsol -clustersimple batch -inputfile input.mph -outputfile output.mph &lt;br /&gt;
&lt;br /&gt;
 &amp;lt;strike&amp;gt;comsol –nn 8 mpd boot&lt;br /&gt;
 comsol –nn 8 batch –inputfile in.mph&lt;br /&gt;
 comsol mpd allexit&amp;lt;/strike&amp;gt;&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
* http://www.comsol.com/support/knowledgebase/1001/ .&lt;br /&gt;
* [[Media:HPC 2012-05-16 Comsol parallel usage.pdf]] (Modified from http://www.comsol.com/support/knowledgebase/1001/files/4027/cluster_install_linux_42a.pptx – Appendix slide, PBS)&lt;br /&gt;
* &#039;&#039;&#039;Note:&#039;&#039;&#039; MPD is not supported on Carbon (I patched the main comsol script), and no longer necessary at all in Comsol-4.3.&lt;br /&gt;
&lt;br /&gt;
=== Sample Job file ===&lt;br /&gt;
See:&lt;br /&gt;
 $COMSOL_HOME/sample.job&lt;br /&gt;
&lt;br /&gt;
== Important COMSOL Support Articles ==&lt;br /&gt;
* Toplevel suport page: https://www.comsol.com/support&lt;br /&gt;
&lt;br /&gt;
=== KB Articles ===&lt;br /&gt;
* [https://www.comsol.com/support/knowledgebase/1001 Running COMSOL® in parallel on clusters]&lt;br /&gt;
* [https://www.comsol.com/support/knowledgebase/1250 Running parametric sweeps, batch sweeps, and cluster sweeps from the command line]&lt;br /&gt;
* [https://www.comsol.com/support/knowledgebase/1255 Reducing the amount of solution data stored in a model]&lt;br /&gt;
* [https://www.comsol.com/support/knowledgebase/830 Handling large models]&lt;br /&gt;
&lt;br /&gt;
=== Blog-style articles ===&lt;br /&gt;
* [https://www.comsol.com/blogs/the-power-of-the-batch-sweep/ The Power of the Batch Sweep]&lt;br /&gt;
* [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]&lt;/div&gt;</summary>
		<author><name>Stern</name></author>
	</entry>
	<entry>
		<id>https://wiki.anl.gov/wiki_cnm/index.php?title=HPC/Applications/comsol&amp;diff=7493</id>
		<title>HPC/Applications/comsol</title>
		<link rel="alternate" type="text/html" href="https://wiki.anl.gov/wiki_cnm/index.php?title=HPC/Applications/comsol&amp;diff=7493"/>
		<updated>2026-02-26T17:13:49Z</updated>

		<summary type="html">&lt;p&gt;Stern: /* Configure COMSOL */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
The [http://www.comsol.com/products/multiphysics/ &#039;&#039;&#039;COMSOL Multiphysics&#039;&#039;&#039;] application suite&lt;br /&gt;
is available for Mac, Windows, and Linux.&lt;br /&gt;
&lt;br /&gt;
== Access ==&lt;br /&gt;
[[Image:HPC Comsol licensed modules.png|right|450px|thumb|COMSOL features licensed at CNM as of 2024-10.]]&lt;br /&gt;
=== COMSOL Multiphysics ===&lt;br /&gt;
Access to &#039;&#039;&#039;COMSOL Multiphysics&#039;&#039;&#039;, the main application with both a graphical user interface and batch computing capabilities, will be granted &#039;&#039;&#039;&#039;&#039;upon request&#039;&#039;&#039;&#039;&#039;&amp;amp;thinsp;.&lt;br /&gt;
&lt;br /&gt;
You must be:&lt;br /&gt;
* An &#039;&#039;&#039;&#039;&#039;Argonne employee&#039;&#039;&#039;&#039;&#039;&amp;amp;thinsp; in one of the following roles:&lt;br /&gt;
** &#039;&#039;&#039;&#039;&#039;NST staff member&#039;&#039;&#039;&#039;&#039;&amp;amp;thinsp; (including PostDocs, joint appointments, and students at NST).&lt;br /&gt;
** &#039;&#039;&#039;&#039;&#039;CNM Facility User&#039;&#039;&#039;&#039;&#039;&amp;amp;thinsp; (including &#039;&#039;non-NST Argonne employees&#039;&#039;), with an active proposal that has COMSOL in scope. Please see [[HPC/FAQ#Access_and_proposals]].&lt;br /&gt;
&lt;br /&gt;
The set of available COMSOL modules that we have licensed is shown at right.&lt;br /&gt;
&lt;br /&gt;
* The native desktop version can be installed only on &#039;&#039;Argonne-owned&#039;&#039; computers (laptop or desktop). Please contact [mailto:help@anl.gov?Subject=COMSOL%20license%20access%20request CNM support]. Make sure to review [http://www.comsol.com/support/updates/ Product Updates].&lt;br /&gt;
* To run COMSOL on our HPC system &#039;&#039;Carbon&#039;&#039;, as GUI or as batch computing jobs, your proposal must have &#039;&#039;Carbon&#039;&#039; access in scope.&lt;br /&gt;
&lt;br /&gt;
=== COMSOL Server ===&lt;br /&gt;
&#039;&#039;CNM Facility Users&#039;&#039; who are not Argonne employees are not eligible to access&lt;br /&gt;
the full &#039;&#039;&#039;COMSOL Multiphysics&#039;&#039;&#039; product, in compliance with its licensing terms and conditions.&lt;br /&gt;
However, the [https://www.comsol.com/comsol-server &#039;&#039;&#039;COMSOL Server&#039;&#039;&#039;] product offers an alternative&lt;br /&gt;
albeit more narrow means of access.&lt;br /&gt;
&lt;br /&gt;
All users, including &#039;&#039;&#039;&#039;&#039;non-Argonne users&#039;&#039;&#039;&#039;&#039; may be able to run, over a web interface in their browser,&lt;br /&gt;
pre-parameterized &amp;quot;fixed-model&amp;quot; simulations that were made with the &#039;&#039;&#039;COMSOL Application Builder&#039;&#039;&#039; (requires Windows).&lt;br /&gt;
&lt;br /&gt;
To inquire about using COMSOL server applications,&lt;br /&gt;
please contact us.&lt;br /&gt;
&amp;lt;!-- [mailto:cnm_useroffice@anl.gov?Subject=COMSOL%20server%20usage Support]. --&amp;gt;&lt;br /&gt;
We will review possible purchase paths for COMSOL Server, and the &#039;&#039;considerable effort&#039;&#039; likely required by users and the CNM to develop and deploy a COMSOL application.&lt;br /&gt;
&lt;br /&gt;
== Support ==&lt;br /&gt;
* For questions on how to run or start COMSOL:&lt;br /&gt;
*: Submit an [[HPC/Support | &#039;&#039;&#039;IT support request&#039;&#039;&#039;]]&lt;br /&gt;
* For questions related to most COMSOL data or scripts, contact COMSOL support at:&lt;br /&gt;
*: [mailto:support@comsol.com &#039;&#039;&#039;support&#039;&#039;&#039;@comsol.com]&lt;br /&gt;
* &#039;&#039;&#039;Exception:&#039;&#039;&#039; If your support question might contain data that is subject to &#039;&#039;&#039;US Export Control&#039;&#039;&#039; regulations, contact instead:&lt;br /&gt;
*: [mailto:us-export-control@us.comsol.com &#039;&#039;&#039;us-export-control&#039;&#039;&#039;@&#039;&#039;&#039;us&#039;&#039;&#039;.comsol.com]&lt;br /&gt;
&lt;br /&gt;
== The modes to run COMSOL ==&lt;br /&gt;
There are several ways of running COMSOL.&lt;br /&gt;
&lt;br /&gt;
=== Running the desktop application ===&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
# Run on Carbon, display on your desktop using the [http://en.wikipedia.org/wiki/X_Window_System X Window system (X11)].&lt;br /&gt;
#* Requires an &#039;&#039;X11 Server&#039;&#039; application running on your client machine, and SSH X11 forwarding.&lt;br /&gt;
#* The X11 protocol can be slow over LAN.&lt;br /&gt;
# Run on Carbon within a [[HPC/Network Access/Virtual Desktop | virtual desktop environment (VNC)]].&lt;br /&gt;
#* Requires a VNC client on your machine.&lt;br /&gt;
#* It can be confusing where VNC and the app runs.&lt;br /&gt;
#* The virtual desktop presents a (deliberatly) sparse windowing environment – Copy&amp;amp;Paste can be difficult to use.&lt;br /&gt;
# Run on your Argonne-provided computer, checking out Carbon&#039;s license remotely.&lt;br /&gt;
#* Requires a full installation of COMSOL on your desktoo or laptop computer.&lt;br /&gt;
#* 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.&lt;br /&gt;
&lt;br /&gt;
=== Running a batch calculation ===&lt;br /&gt;
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.&lt;br /&gt;
See the [[#Batch jobs|section below]].&lt;br /&gt;
&lt;br /&gt;
== Use with X11 ==&lt;br /&gt;
For casual use, and with [[HPC/Network Access/SSH Tunnel Setup on Linux and MacOS | X11 tunneling to Carbon]] set up, simply add to your &amp;lt;code&amp;gt;~/.bashrc&amp;lt;/code&amp;gt; file on Carbon:&lt;br /&gt;
 module load comsol&lt;br /&gt;
&lt;br /&gt;
Then, from the command line on a Carbon login node, start the COMSOL GUI:&lt;br /&gt;
 comsol &amp;amp;&lt;br /&gt;
&lt;br /&gt;
License configuration is automatic on Carbon.&lt;br /&gt;
&lt;br /&gt;
Comsol will use a number of cores to run calculations multithreaded by default. (On Carbon, COMSOL_NUM_THREADS is set.)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Quit the application&#039;&#039;&#039; as soon as you are done. Only one user can use Comsol at a time.&lt;br /&gt;
&lt;br /&gt;
== Use with VNC ==&lt;br /&gt;
See general  [[HPC/Network Access/Virtual Desktop | instructions on using VNC]], and the COMSOL example therein.&lt;br /&gt;
&lt;br /&gt;
== Native desktop version ==&lt;br /&gt;
&lt;br /&gt;
To get the fastest response from the COMSOL GUI, run a native COMSOL version on your desktop machine or laptop, called &#039;&#039;client machine&#039;&#039; below.&lt;br /&gt;
&lt;br /&gt;
Enter license details either in the COMSOL Setup configuration dialog.&lt;br /&gt;
&lt;br /&gt;
== Native desktop version — License configuration ==&lt;br /&gt;
A client&#039;s COMSOL license needs to be configured depending on how the client reaches CNM network resources. Follow the appropriate section:&lt;br /&gt;
&lt;br /&gt;
* [[#License configuration when inside CNM or on CNM VPN|License configuration when &#039;&#039;&#039;inside CNM&#039;&#039;&#039; or on &#039;&#039;&#039;CNM VPN&#039;&#039;&#039;]]&lt;br /&gt;
: Requires that the user&#039;s machine is logically within the network of CNM/NST, either by a wired/auth WiFi connection in the building or by VPN under a CNM/NST profile.&lt;br /&gt;
* [[#License configuration when outside CNM – requires SSH Tunneling|License configuration when &#039;&#039;&#039;outside CNM&#039;&#039;&#039; – requires SSH Tunneling]]&lt;br /&gt;
: &#039;&#039;Non-NST staff&#039;&#039; usually have a VPN profile that places the machine logically [[#License configuration when outside CNM – requires SSH Tunneling|outside of NST&#039;s network.]]&lt;br /&gt;
&lt;br /&gt;
== License configuration when inside CNM or on CNM VPN ==&lt;br /&gt;
=== &amp;lt;span style=&amp;quot;color:#A00;&amp;quot;&amp;gt;Ensure correct DNS search domains&amp;lt;/span&amp;gt; ===&lt;br /&gt;
* Inspect the client machine&#039;s network configuration.&lt;br /&gt;
* Ensure that &#039;&#039;&#039;two&#039;&#039;&#039; entries are listed as DNS Search Domains for the current network profile:&lt;br /&gt;
 nst.anl.gov&lt;br /&gt;
 cnm.anl.gov&lt;br /&gt;
: (The order of entries does not matter for the purposes considered here.)&lt;br /&gt;
* If the client machine is &#039;&#039;wired to CNM networks&#039;&#039;, the domains are normally provided correctly by DHCP.&lt;br /&gt;
* If the client machine is &#039;&#039;connected over VPN&#039;&#039;, you may need edit the respective network profile.&lt;br /&gt;
:* 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 &amp;quot;Advanced…&amp;quot;. It appears that those changes are being saved and will be activated automatically the next time that this VPN session gets started.&lt;br /&gt;
: [[Image:VNC_add_cnm_to_DNS_1.png|400px]] [[Image:VNC_add_cnm_to_DNS_2.png|400px]]&lt;br /&gt;
:* On Windows or Linux machines, take &#039;&#039;analogous&#039;&#039; steps, using the platform&#039;s own configuration tools.&lt;br /&gt;
&lt;br /&gt;
* Exclude license manager components from client desktop installation. (Those are all handled server-side.)&lt;br /&gt;
&lt;br /&gt;
=== License format ===&lt;br /&gt;
* Floating Network License (FNL), &amp;quot;Three-server redundancy&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== License servers ===&lt;br /&gt;
* On client machines, while running the COMSOL installer or license configuration, specify license servers and ports as follows:&lt;br /&gt;
 1718    clicense1&lt;br /&gt;
 1718    clicense2&lt;br /&gt;
 1718    clicense3&lt;br /&gt;
: &#039;&#039;&#039;Note:&#039;&#039;&#039; Use &#039;&#039;short host names only&#039;&#039;. (Technical Reason: The license must be usable both on Carbon&#039;s internal network as well as on divisional networks).&lt;br /&gt;
 1718    clicense1&amp;lt;strike&amp;gt;.cnm.anl.gov&amp;lt;/strike&amp;gt;&lt;br /&gt;
 1718    clicense2&amp;lt;strike&amp;gt;.cnm.anl.gov&amp;lt;/strike&amp;gt;&lt;br /&gt;
 1718    clicense3&amp;lt;strike&amp;gt;.cnm.anl.gov&amp;lt;/strike&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Advanced:&#039;&#039;&#039; A client machine&#039;s COMSOL license file &amp;lt;code&amp;gt;&amp;amp;lt;COMSOLDIR&amp;amp;gt;/Multiphysics/license/license.dat&amp;lt;/code&amp;gt; should look as follows:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;make&amp;quot;&amp;gt;&lt;br /&gt;
SERVER clicense1 ANY 1718&lt;br /&gt;
SERVER clicense2 ANY 1718&lt;br /&gt;
SERVER clicense3 ANY 1718&lt;br /&gt;
USE_SERVER&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;amp;lt;COMSOLDIR&amp;amp;gt;&amp;lt;/code&amp;gt; is located by default at:&lt;br /&gt;
* &#039;&#039;&#039;Windows&#039;&#039;&#039;: C:\Program files\COMSOL\COMSOL&#039;&#039;nn&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Linux&#039;&#039;&#039;: /usr/local/comsol&#039;&#039;nn&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Mac&#039;&#039;&#039;: /Applications/COMSOL&#039;&#039;nn&#039;&#039;&lt;br /&gt;
(&amp;quot;&#039;&#039;nn&#039;&#039;&amp;quot; is the application&#039;s abbreviated version number.)&lt;br /&gt;
&lt;br /&gt;
=== Network Troubleshooting ===&lt;br /&gt;
When using the license access model descibed here (as opposed to tunneled over SSH), ensure the following:&lt;br /&gt;
* Verify that short host names can be resolved to IP addresses. Either one of the following commands should produce sensible output:&lt;br /&gt;
 host clicense1&lt;br /&gt;
: or:&lt;br /&gt;
 ping -c 3 clicense1&lt;br /&gt;
* Verify that &#039;&#039;both license ports on the same server&#039;&#039; can be reached from your client machine:&lt;br /&gt;
 telnet &#039;&#039;&#039;clicense1&#039;&#039;&#039; 1718&lt;br /&gt;
 telnet &#039;&#039;&#039;clicense1&#039;&#039;&#039; 1719&lt;br /&gt;
: or:&lt;br /&gt;
 telnet &#039;&#039;&#039;clicense2&#039;&#039;&#039; 1718&lt;br /&gt;
 telnet &#039;&#039;&#039;clicense2&#039;&#039;&#039; 1719&lt;br /&gt;
: A &#039;&#039;successful&#039;&#039; connection looks like:&lt;br /&gt;
 Trying 146.139.x.y...&lt;br /&gt;
 Connected to clicense1.cnm.anl.gov.&lt;br /&gt;
 Escape character is &#039;^]&#039;.&lt;br /&gt;
:: Do not enter any data. Instead,  close each connection by hitting &amp;lt;code&amp;gt;Ctrl&amp;lt;/code&amp;gt;&amp;lt;code&amp;gt;]&amp;lt;/code&amp;gt; (closing square bracket), followed by &amp;lt;code&amp;gt;Ctrl&amp;lt;/code&amp;gt;&amp;lt;code&amp;gt;D&amp;lt;/code&amp;gt;.&lt;br /&gt;
: A &#039;&#039;failed&#039;&#039; connection gives one of these errors:&lt;br /&gt;
 telnet: connect to address 146.139.x.y: Operation timed out&lt;br /&gt;
: or:&lt;br /&gt;
 telnet: connect to address 146.139.x.y: Connection refused&lt;br /&gt;
:: In these cases, ask that your IP firewall configuration be reviewed and changed.&lt;br /&gt;
&lt;br /&gt;
== License configuration when outside CNM – requires SSH Tunneling ==&lt;br /&gt;
This section documents how to run COMSOL from a network location outside CNM.&lt;br /&gt;
&lt;br /&gt;
As a one-time preparation step, two items must be configured:&lt;br /&gt;
* The license host that COMSOL is to contact, and&lt;br /&gt;
* An SSH connection that will allow your machine to access the COMSOL license server inside CNM&#039;s network.&lt;br /&gt;
&lt;br /&gt;
To then &#039;&#039;run&#039;&#039; the COMSOL application, the configured SSH connection must be up and kept running for the entire time that you run the COMSOL. When you exit COMSOL and wish to start it again, you can keep the SSH connection running, it will be re-used for the next COMSOL run.&lt;br /&gt;
&lt;br /&gt;
=== Configure COMSOL ===&lt;br /&gt;
The following needs to be done just once, typically during COMSOL installation:&lt;br /&gt;
&lt;br /&gt;
In the COMSOL Installer, or in COMSOL Preferences, enter:&lt;br /&gt;
* &#039;&#039;&#039;License format:&#039;&#039;&#039; Floating Network License (FNL), &amp;quot;Port number and Hostname&amp;quot;&lt;br /&gt;
:: &amp;lt;font style=&amp;quot;color:#777&amp;quot;&amp;gt;Do &#039;&#039;not use&#039;&#039; &amp;quot;Three-server redundancy&amp;quot;, since it cannot (easily) be accessed over SSH. Configure with just one server, and in the rare situation of a server failover, tweak your SSH configuration to contact the alternate server.&amp;lt;/font&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Server:&#039;&#039;&#039; &amp;lt;code&amp;gt;127.0.0.1&amp;lt;/code&amp;gt;&lt;br /&gt;
:: Do not use &amp;quot;localhost&amp;quot;, as COMSOL interprets this incorrectly to mean that your machine &#039;&#039;is&#039;&#039; a license server.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Port:&#039;&#039;&#039; &amp;lt;code&amp;gt;1718&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
Or place a license file with this content:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;make&amp;quot;&amp;gt;&lt;br /&gt;
SERVER 127.0.0.1 ANY 1718&lt;br /&gt;
USE_SERVER&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
//--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Establish connection to CNM license server ===&lt;br /&gt;
This step needs to be done prior to running COMSOL in your desktop session:&lt;br /&gt;
# Connect to &amp;lt;code&amp;gt;mega&amp;lt;/code&amp;gt; with the following ssh command:&lt;br /&gt;
 ssh  -L 1718:&#039;&#039;&#039;clicense1&#039;&#039;&#039;:1718  -L 1719:&#039;&#039;&#039;clicense1&#039;&#039;&#039;:1719  mega.cnm.anl.gov&lt;br /&gt;
# Leave the command running between invocations of COMSOL.&lt;br /&gt;
&lt;br /&gt;
=== Run COMSOL ===&lt;br /&gt;
# Ensure your connection to &amp;quot;mega&amp;quot; is still running. If not, restart it.&lt;br /&gt;
# Start the COMSOL application.&lt;br /&gt;
&lt;br /&gt;
=== Troubleshooting ===&lt;br /&gt;
* If you get an error that the number of licenses is &amp;quot;exhausted&amp;quot;, that is confirmation that you correctly reached the license server, though other users are using licenses.&lt;br /&gt;
* 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:&lt;br /&gt;
 ssh  -L 1718:clicense&#039;&#039;&#039;2&#039;&#039;&#039;:1718  -L 1719:clicense&#039;&#039;&#039;2&#039;&#039;&#039;:1719  mega.cnm.anl.gov&lt;br /&gt;
&lt;br /&gt;
== License Troubleshooting ==&lt;br /&gt;
The following are typical error messages.&lt;br /&gt;
=== Could not obtain license for COMSOL Multiphysics GUI ===&lt;br /&gt;
* Error details:&lt;br /&gt;
 License error: -4.&lt;br /&gt;
 &#039;&#039;&#039;Licensed number of users already reached.&#039;&#039;&#039;&lt;br /&gt;
 Feature:       COMSOLGUI&lt;br /&gt;
 License path:  /Users/stern/Applications/COMSOL52a/license/license.dat:&lt;br /&gt;
 FlexNet Licensing error:-4,132&lt;br /&gt;
* Reason: The connection to the license server succeeded, but the license token(s) you requested are in use.&lt;br /&gt;
* Solution: Wait a bit, or [http://carbonmgmt/ganglia/lic.php identify who&#039;s using COMSOL] and politely ask the user when they might be finished with their work.&lt;br /&gt;
&lt;br /&gt;
=== License server machine is down or not responding ===&lt;br /&gt;
* Error details:&lt;br /&gt;
  License error: -96.&lt;br /&gt;
  See the system administrator about starting the license server system, or&lt;br /&gt;
  make sure you&#039;re referring to the right host (see LM_LICENSE_FILE).&lt;br /&gt;
 Feature:       SERIAL&lt;br /&gt;
 Hostname:      clicense3&lt;br /&gt;
 License path:  /Users/stern/Applications/COMSOL52a/license/license.dat:&lt;br /&gt;
 FlexNet Licensing error:-96,7&lt;br /&gt;
* Reason: The license servers cannot be reached at all. The &amp;lt;code&amp;gt;ping&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;host&amp;lt;/code&amp;gt; tests mentioned above fail.&lt;br /&gt;
* Solution: Review the client license file and DNS lookup domains.&lt;br /&gt;
&lt;br /&gt;
=== License file does not support this version ===&lt;br /&gt;
* Error details:&lt;br /&gt;
  Feature: SERIAL&lt;br /&gt;
 &#039;&#039;&#039;Application version &amp;gt; License version: 5.21 &amp;gt; 3.5&#039;&#039;&#039;&lt;br /&gt;
 License path: /Users/stern/Applications/COMSOL52a/license/license.dat:&lt;br /&gt;
 FlexNet Licensing error:-21,126&lt;br /&gt;
* 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&#039;re connected to.&lt;br /&gt;
* Solution: When using SSH, try &amp;lt;code&amp;gt;clicense2&amp;lt;/code&amp;gt; instead of  &amp;lt;code&amp;gt;clicense1&amp;lt;/code&amp;gt;, or vice versa. Revisit your &amp;lt;code&amp;gt;~/.ssh/config&amp;lt;/code&amp;gt; file or use the alternate command line as shown in the SSH section above.&lt;br /&gt;
&lt;br /&gt;
== Multiple CPU cores ==&lt;br /&gt;
Ways to start multi-core (from http://www.comsol.com/support/knowledgebase/1096/)&lt;br /&gt;
 comsol -np 8&lt;br /&gt;
&lt;br /&gt;
 export COMSOL_NUM_THREADS=8    # automatically provided on &#039;&#039;Carbon&#039;&#039;&lt;br /&gt;
 comsol&lt;br /&gt;
* COMSOL does not benefit from hyperthreading (oversubscribing the physical core count).&lt;br /&gt;
&lt;br /&gt;
== Batch jobs ==&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
 comsol -clustersimple batch -inputfile input.mph -outputfile output.mph &lt;br /&gt;
&lt;br /&gt;
 &amp;lt;strike&amp;gt;comsol –nn 8 mpd boot&lt;br /&gt;
 comsol –nn 8 batch –inputfile in.mph&lt;br /&gt;
 comsol mpd allexit&amp;lt;/strike&amp;gt;&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
* http://www.comsol.com/support/knowledgebase/1001/ .&lt;br /&gt;
* [[Media:HPC 2012-05-16 Comsol parallel usage.pdf]] (Modified from http://www.comsol.com/support/knowledgebase/1001/files/4027/cluster_install_linux_42a.pptx – Appendix slide, PBS)&lt;br /&gt;
* &#039;&#039;&#039;Note:&#039;&#039;&#039; MPD is not supported on Carbon (I patched the main comsol script), and no longer necessary at all in Comsol-4.3.&lt;br /&gt;
&lt;br /&gt;
=== Sample Job file ===&lt;br /&gt;
See:&lt;br /&gt;
 $COMSOL_HOME/sample.job&lt;br /&gt;
&lt;br /&gt;
== Important COMSOL Support Articles ==&lt;br /&gt;
* Toplevel suport page: https://www.comsol.com/support&lt;br /&gt;
&lt;br /&gt;
=== KB Articles ===&lt;br /&gt;
* [https://www.comsol.com/support/knowledgebase/1001 Running COMSOL® in parallel on clusters]&lt;br /&gt;
* [https://www.comsol.com/support/knowledgebase/1250 Running parametric sweeps, batch sweeps, and cluster sweeps from the command line]&lt;br /&gt;
* [https://www.comsol.com/support/knowledgebase/1255 Reducing the amount of solution data stored in a model]&lt;br /&gt;
* [https://www.comsol.com/support/knowledgebase/830 Handling large models]&lt;br /&gt;
&lt;br /&gt;
=== Blog-style articles ===&lt;br /&gt;
* [https://www.comsol.com/blogs/the-power-of-the-batch-sweep/ The Power of the Batch Sweep]&lt;br /&gt;
* [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]&lt;/div&gt;</summary>
		<author><name>Stern</name></author>
	</entry>
	<entry>
		<id>https://wiki.anl.gov/wiki_cnm/index.php?title=HPC/Applications/comsol&amp;diff=7492</id>
		<title>HPC/Applications/comsol</title>
		<link rel="alternate" type="text/html" href="https://wiki.anl.gov/wiki_cnm/index.php?title=HPC/Applications/comsol&amp;diff=7492"/>
		<updated>2026-02-26T17:11:15Z</updated>

		<summary type="html">&lt;p&gt;Stern: /* License configuration when outside CNM – requires SSH Tunneling */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
The [http://www.comsol.com/products/multiphysics/ &#039;&#039;&#039;COMSOL Multiphysics&#039;&#039;&#039;] application suite&lt;br /&gt;
is available for Mac, Windows, and Linux.&lt;br /&gt;
&lt;br /&gt;
== Access ==&lt;br /&gt;
[[Image:HPC Comsol licensed modules.png|right|450px|thumb|COMSOL features licensed at CNM as of 2024-10.]]&lt;br /&gt;
=== COMSOL Multiphysics ===&lt;br /&gt;
Access to &#039;&#039;&#039;COMSOL Multiphysics&#039;&#039;&#039;, the main application with both a graphical user interface and batch computing capabilities, will be granted &#039;&#039;&#039;&#039;&#039;upon request&#039;&#039;&#039;&#039;&#039;&amp;amp;thinsp;.&lt;br /&gt;
&lt;br /&gt;
You must be:&lt;br /&gt;
* An &#039;&#039;&#039;&#039;&#039;Argonne employee&#039;&#039;&#039;&#039;&#039;&amp;amp;thinsp; in one of the following roles:&lt;br /&gt;
** &#039;&#039;&#039;&#039;&#039;NST staff member&#039;&#039;&#039;&#039;&#039;&amp;amp;thinsp; (including PostDocs, joint appointments, and students at NST).&lt;br /&gt;
** &#039;&#039;&#039;&#039;&#039;CNM Facility User&#039;&#039;&#039;&#039;&#039;&amp;amp;thinsp; (including &#039;&#039;non-NST Argonne employees&#039;&#039;), with an active proposal that has COMSOL in scope. Please see [[HPC/FAQ#Access_and_proposals]].&lt;br /&gt;
&lt;br /&gt;
The set of available COMSOL modules that we have licensed is shown at right.&lt;br /&gt;
&lt;br /&gt;
* The native desktop version can be installed only on &#039;&#039;Argonne-owned&#039;&#039; computers (laptop or desktop). Please contact [mailto:help@anl.gov?Subject=COMSOL%20license%20access%20request CNM support]. Make sure to review [http://www.comsol.com/support/updates/ Product Updates].&lt;br /&gt;
* To run COMSOL on our HPC system &#039;&#039;Carbon&#039;&#039;, as GUI or as batch computing jobs, your proposal must have &#039;&#039;Carbon&#039;&#039; access in scope.&lt;br /&gt;
&lt;br /&gt;
=== COMSOL Server ===&lt;br /&gt;
&#039;&#039;CNM Facility Users&#039;&#039; who are not Argonne employees are not eligible to access&lt;br /&gt;
the full &#039;&#039;&#039;COMSOL Multiphysics&#039;&#039;&#039; product, in compliance with its licensing terms and conditions.&lt;br /&gt;
However, the [https://www.comsol.com/comsol-server &#039;&#039;&#039;COMSOL Server&#039;&#039;&#039;] product offers an alternative&lt;br /&gt;
albeit more narrow means of access.&lt;br /&gt;
&lt;br /&gt;
All users, including &#039;&#039;&#039;&#039;&#039;non-Argonne users&#039;&#039;&#039;&#039;&#039; may be able to run, over a web interface in their browser,&lt;br /&gt;
pre-parameterized &amp;quot;fixed-model&amp;quot; simulations that were made with the &#039;&#039;&#039;COMSOL Application Builder&#039;&#039;&#039; (requires Windows).&lt;br /&gt;
&lt;br /&gt;
To inquire about using COMSOL server applications,&lt;br /&gt;
please contact us.&lt;br /&gt;
&amp;lt;!-- [mailto:cnm_useroffice@anl.gov?Subject=COMSOL%20server%20usage Support]. --&amp;gt;&lt;br /&gt;
We will review possible purchase paths for COMSOL Server, and the &#039;&#039;considerable effort&#039;&#039; likely required by users and the CNM to develop and deploy a COMSOL application.&lt;br /&gt;
&lt;br /&gt;
== Support ==&lt;br /&gt;
* For questions on how to run or start COMSOL:&lt;br /&gt;
*: Submit an [[HPC/Support | &#039;&#039;&#039;IT support request&#039;&#039;&#039;]]&lt;br /&gt;
* For questions related to most COMSOL data or scripts, contact COMSOL support at:&lt;br /&gt;
*: [mailto:support@comsol.com &#039;&#039;&#039;support&#039;&#039;&#039;@comsol.com]&lt;br /&gt;
* &#039;&#039;&#039;Exception:&#039;&#039;&#039; If your support question might contain data that is subject to &#039;&#039;&#039;US Export Control&#039;&#039;&#039; regulations, contact instead:&lt;br /&gt;
*: [mailto:us-export-control@us.comsol.com &#039;&#039;&#039;us-export-control&#039;&#039;&#039;@&#039;&#039;&#039;us&#039;&#039;&#039;.comsol.com]&lt;br /&gt;
&lt;br /&gt;
== The modes to run COMSOL ==&lt;br /&gt;
There are several ways of running COMSOL.&lt;br /&gt;
&lt;br /&gt;
=== Running the desktop application ===&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
# Run on Carbon, display on your desktop using the [http://en.wikipedia.org/wiki/X_Window_System X Window system (X11)].&lt;br /&gt;
#* Requires an &#039;&#039;X11 Server&#039;&#039; application running on your client machine, and SSH X11 forwarding.&lt;br /&gt;
#* The X11 protocol can be slow over LAN.&lt;br /&gt;
# Run on Carbon within a [[HPC/Network Access/Virtual Desktop | virtual desktop environment (VNC)]].&lt;br /&gt;
#* Requires a VNC client on your machine.&lt;br /&gt;
#* It can be confusing where VNC and the app runs.&lt;br /&gt;
#* The virtual desktop presents a (deliberatly) sparse windowing environment – Copy&amp;amp;Paste can be difficult to use.&lt;br /&gt;
# Run on your Argonne-provided computer, checking out Carbon&#039;s license remotely.&lt;br /&gt;
#* Requires a full installation of COMSOL on your desktoo or laptop computer.&lt;br /&gt;
#* 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.&lt;br /&gt;
&lt;br /&gt;
=== Running a batch calculation ===&lt;br /&gt;
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.&lt;br /&gt;
See the [[#Batch jobs|section below]].&lt;br /&gt;
&lt;br /&gt;
== Use with X11 ==&lt;br /&gt;
For casual use, and with [[HPC/Network Access/SSH Tunnel Setup on Linux and MacOS | X11 tunneling to Carbon]] set up, simply add to your &amp;lt;code&amp;gt;~/.bashrc&amp;lt;/code&amp;gt; file on Carbon:&lt;br /&gt;
 module load comsol&lt;br /&gt;
&lt;br /&gt;
Then, from the command line on a Carbon login node, start the COMSOL GUI:&lt;br /&gt;
 comsol &amp;amp;&lt;br /&gt;
&lt;br /&gt;
License configuration is automatic on Carbon.&lt;br /&gt;
&lt;br /&gt;
Comsol will use a number of cores to run calculations multithreaded by default. (On Carbon, COMSOL_NUM_THREADS is set.)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Quit the application&#039;&#039;&#039; as soon as you are done. Only one user can use Comsol at a time.&lt;br /&gt;
&lt;br /&gt;
== Use with VNC ==&lt;br /&gt;
See general  [[HPC/Network Access/Virtual Desktop | instructions on using VNC]], and the COMSOL example therein.&lt;br /&gt;
&lt;br /&gt;
== Native desktop version ==&lt;br /&gt;
&lt;br /&gt;
To get the fastest response from the COMSOL GUI, run a native COMSOL version on your desktop machine or laptop, called &#039;&#039;client machine&#039;&#039; below.&lt;br /&gt;
&lt;br /&gt;
Enter license details either in the COMSOL Setup configuration dialog.&lt;br /&gt;
&lt;br /&gt;
== Native desktop version — License configuration ==&lt;br /&gt;
A client&#039;s COMSOL license needs to be configured depending on how the client reaches CNM network resources. Follow the appropriate section:&lt;br /&gt;
&lt;br /&gt;
* [[#License configuration when inside CNM or on CNM VPN|License configuration when &#039;&#039;&#039;inside CNM&#039;&#039;&#039; or on &#039;&#039;&#039;CNM VPN&#039;&#039;&#039;]]&lt;br /&gt;
: Requires that the user&#039;s machine is logically within the network of CNM/NST, either by a wired/auth WiFi connection in the building or by VPN under a CNM/NST profile.&lt;br /&gt;
* [[#License configuration when outside CNM – requires SSH Tunneling|License configuration when &#039;&#039;&#039;outside CNM&#039;&#039;&#039; – requires SSH Tunneling]]&lt;br /&gt;
: &#039;&#039;Non-NST staff&#039;&#039; usually have a VPN profile that places the machine logically [[#License configuration when outside CNM – requires SSH Tunneling|outside of NST&#039;s network.]]&lt;br /&gt;
&lt;br /&gt;
== License configuration when inside CNM or on CNM VPN ==&lt;br /&gt;
=== &amp;lt;span style=&amp;quot;color:#A00;&amp;quot;&amp;gt;Ensure correct DNS search domains&amp;lt;/span&amp;gt; ===&lt;br /&gt;
* Inspect the client machine&#039;s network configuration.&lt;br /&gt;
* Ensure that &#039;&#039;&#039;two&#039;&#039;&#039; entries are listed as DNS Search Domains for the current network profile:&lt;br /&gt;
 nst.anl.gov&lt;br /&gt;
 cnm.anl.gov&lt;br /&gt;
: (The order of entries does not matter for the purposes considered here.)&lt;br /&gt;
* If the client machine is &#039;&#039;wired to CNM networks&#039;&#039;, the domains are normally provided correctly by DHCP.&lt;br /&gt;
* If the client machine is &#039;&#039;connected over VPN&#039;&#039;, you may need edit the respective network profile.&lt;br /&gt;
:* 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 &amp;quot;Advanced…&amp;quot;. It appears that those changes are being saved and will be activated automatically the next time that this VPN session gets started.&lt;br /&gt;
: [[Image:VNC_add_cnm_to_DNS_1.png|400px]] [[Image:VNC_add_cnm_to_DNS_2.png|400px]]&lt;br /&gt;
:* On Windows or Linux machines, take &#039;&#039;analogous&#039;&#039; steps, using the platform&#039;s own configuration tools.&lt;br /&gt;
&lt;br /&gt;
* Exclude license manager components from client desktop installation. (Those are all handled server-side.)&lt;br /&gt;
&lt;br /&gt;
=== License format ===&lt;br /&gt;
* Floating Network License (FNL), &amp;quot;Three-server redundancy&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== License servers ===&lt;br /&gt;
* On client machines, while running the COMSOL installer or license configuration, specify license servers and ports as follows:&lt;br /&gt;
 1718    clicense1&lt;br /&gt;
 1718    clicense2&lt;br /&gt;
 1718    clicense3&lt;br /&gt;
: &#039;&#039;&#039;Note:&#039;&#039;&#039; Use &#039;&#039;short host names only&#039;&#039;. (Technical Reason: The license must be usable both on Carbon&#039;s internal network as well as on divisional networks).&lt;br /&gt;
 1718    clicense1&amp;lt;strike&amp;gt;.cnm.anl.gov&amp;lt;/strike&amp;gt;&lt;br /&gt;
 1718    clicense2&amp;lt;strike&amp;gt;.cnm.anl.gov&amp;lt;/strike&amp;gt;&lt;br /&gt;
 1718    clicense3&amp;lt;strike&amp;gt;.cnm.anl.gov&amp;lt;/strike&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Advanced:&#039;&#039;&#039; A client machine&#039;s COMSOL license file &amp;lt;code&amp;gt;&amp;amp;lt;COMSOLDIR&amp;amp;gt;/Multiphysics/license/license.dat&amp;lt;/code&amp;gt; should look as follows:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;make&amp;quot;&amp;gt;&lt;br /&gt;
SERVER clicense1 ANY 1718&lt;br /&gt;
SERVER clicense2 ANY 1718&lt;br /&gt;
SERVER clicense3 ANY 1718&lt;br /&gt;
USE_SERVER&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;amp;lt;COMSOLDIR&amp;amp;gt;&amp;lt;/code&amp;gt; is located by default at:&lt;br /&gt;
* &#039;&#039;&#039;Windows&#039;&#039;&#039;: C:\Program files\COMSOL\COMSOL&#039;&#039;nn&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Linux&#039;&#039;&#039;: /usr/local/comsol&#039;&#039;nn&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Mac&#039;&#039;&#039;: /Applications/COMSOL&#039;&#039;nn&#039;&#039;&lt;br /&gt;
(&amp;quot;&#039;&#039;nn&#039;&#039;&amp;quot; is the application&#039;s abbreviated version number.)&lt;br /&gt;
&lt;br /&gt;
=== Network Troubleshooting ===&lt;br /&gt;
When using the license access model descibed here (as opposed to tunneled over SSH), ensure the following:&lt;br /&gt;
* Verify that short host names can be resolved to IP addresses. Either one of the following commands should produce sensible output:&lt;br /&gt;
 host clicense1&lt;br /&gt;
: or:&lt;br /&gt;
 ping -c 3 clicense1&lt;br /&gt;
* Verify that &#039;&#039;both license ports on the same server&#039;&#039; can be reached from your client machine:&lt;br /&gt;
 telnet &#039;&#039;&#039;clicense1&#039;&#039;&#039; 1718&lt;br /&gt;
 telnet &#039;&#039;&#039;clicense1&#039;&#039;&#039; 1719&lt;br /&gt;
: or:&lt;br /&gt;
 telnet &#039;&#039;&#039;clicense2&#039;&#039;&#039; 1718&lt;br /&gt;
 telnet &#039;&#039;&#039;clicense2&#039;&#039;&#039; 1719&lt;br /&gt;
: A &#039;&#039;successful&#039;&#039; connection looks like:&lt;br /&gt;
 Trying 146.139.x.y...&lt;br /&gt;
 Connected to clicense1.cnm.anl.gov.&lt;br /&gt;
 Escape character is &#039;^]&#039;.&lt;br /&gt;
:: Do not enter any data. Instead,  close each connection by hitting &amp;lt;code&amp;gt;Ctrl&amp;lt;/code&amp;gt;&amp;lt;code&amp;gt;]&amp;lt;/code&amp;gt; (closing square bracket), followed by &amp;lt;code&amp;gt;Ctrl&amp;lt;/code&amp;gt;&amp;lt;code&amp;gt;D&amp;lt;/code&amp;gt;.&lt;br /&gt;
: A &#039;&#039;failed&#039;&#039; connection gives one of these errors:&lt;br /&gt;
 telnet: connect to address 146.139.x.y: Operation timed out&lt;br /&gt;
: or:&lt;br /&gt;
 telnet: connect to address 146.139.x.y: Connection refused&lt;br /&gt;
:: In these cases, ask that your IP firewall configuration be reviewed and changed.&lt;br /&gt;
&lt;br /&gt;
== License configuration when outside CNM – requires SSH Tunneling ==&lt;br /&gt;
This section documents how to run COMSOL from a network location outside CNM.&lt;br /&gt;
&lt;br /&gt;
As a one-time preparation step, two items must be configured:&lt;br /&gt;
* The license host that COMSOL is to contact, and&lt;br /&gt;
* An SSH connection that will allow your machine to access the COMSOL license server inside CNM&#039;s network.&lt;br /&gt;
&lt;br /&gt;
To then &#039;&#039;run&#039;&#039; the COMSOL application, the configured SSH connection must be up and kept running for the entire time that you run the COMSOL. When you exit COMSOL and wish to start it again, you can keep the SSH connection running, it will be re-used for the next COMSOL run.&lt;br /&gt;
&lt;br /&gt;
=== Configure COMSOL ===&lt;br /&gt;
The following needs to be done just once, typically during COMSOL installation:&lt;br /&gt;
&lt;br /&gt;
In the COMSOL Installer, or in COMSOL Preferences, enter:&lt;br /&gt;
* &#039;&#039;&#039;License format:&#039;&#039;&#039; Floating Network License (FNL), &amp;quot;Port number and Hostname&amp;quot;&lt;br /&gt;
:: &amp;quot;Three-server redundancy&amp;quot; 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.&lt;br /&gt;
* &#039;&#039;&#039;Server:&#039;&#039;&#039; &amp;lt;code&amp;gt;127.0.0.1&amp;lt;/code&amp;gt;&lt;br /&gt;
:: Do not use &amp;quot;localhost&amp;quot;, as COMSOL interprets this incorrectly to mean that your machine &#039;&#039;is&#039;&#039; a license server.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Port:&#039;&#039;&#039; &amp;lt;code&amp;gt;1718&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
Or place a license file with this content:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;make&amp;quot;&amp;gt;&lt;br /&gt;
SERVER 127.0.0.1 ANY 1718&lt;br /&gt;
USE_SERVER&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
//--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Establish connection to CNM license server ===&lt;br /&gt;
This step needs to be done prior to running COMSOL in your desktop session:&lt;br /&gt;
# Connect to &amp;lt;code&amp;gt;mega&amp;lt;/code&amp;gt; with the following ssh command:&lt;br /&gt;
 ssh  -L 1718:&#039;&#039;&#039;clicense1&#039;&#039;&#039;:1718  -L 1719:&#039;&#039;&#039;clicense1&#039;&#039;&#039;:1719  mega.cnm.anl.gov&lt;br /&gt;
# Leave the command running between invocations of COMSOL.&lt;br /&gt;
&lt;br /&gt;
=== Run COMSOL ===&lt;br /&gt;
# Ensure your connection to &amp;quot;mega&amp;quot; is still running. If not, restart it.&lt;br /&gt;
# Start the COMSOL application.&lt;br /&gt;
&lt;br /&gt;
=== Troubleshooting ===&lt;br /&gt;
* If you get an error that the number of licenses is &amp;quot;exhausted&amp;quot;, that is confirmation that you correctly reached the license server, though other users are using licenses.&lt;br /&gt;
* 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:&lt;br /&gt;
 ssh  -L 1718:clicense&#039;&#039;&#039;2&#039;&#039;&#039;:1718  -L 1719:clicense&#039;&#039;&#039;2&#039;&#039;&#039;:1719  mega.cnm.anl.gov&lt;br /&gt;
&lt;br /&gt;
== License Troubleshooting ==&lt;br /&gt;
The following are typical error messages.&lt;br /&gt;
=== Could not obtain license for COMSOL Multiphysics GUI ===&lt;br /&gt;
* Error details:&lt;br /&gt;
 License error: -4.&lt;br /&gt;
 &#039;&#039;&#039;Licensed number of users already reached.&#039;&#039;&#039;&lt;br /&gt;
 Feature:       COMSOLGUI&lt;br /&gt;
 License path:  /Users/stern/Applications/COMSOL52a/license/license.dat:&lt;br /&gt;
 FlexNet Licensing error:-4,132&lt;br /&gt;
* Reason: The connection to the license server succeeded, but the license token(s) you requested are in use.&lt;br /&gt;
* Solution: Wait a bit, or [http://carbonmgmt/ganglia/lic.php identify who&#039;s using COMSOL] and politely ask the user when they might be finished with their work.&lt;br /&gt;
&lt;br /&gt;
=== License server machine is down or not responding ===&lt;br /&gt;
* Error details:&lt;br /&gt;
  License error: -96.&lt;br /&gt;
  See the system administrator about starting the license server system, or&lt;br /&gt;
  make sure you&#039;re referring to the right host (see LM_LICENSE_FILE).&lt;br /&gt;
 Feature:       SERIAL&lt;br /&gt;
 Hostname:      clicense3&lt;br /&gt;
 License path:  /Users/stern/Applications/COMSOL52a/license/license.dat:&lt;br /&gt;
 FlexNet Licensing error:-96,7&lt;br /&gt;
* Reason: The license servers cannot be reached at all. The &amp;lt;code&amp;gt;ping&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;host&amp;lt;/code&amp;gt; tests mentioned above fail.&lt;br /&gt;
* Solution: Review the client license file and DNS lookup domains.&lt;br /&gt;
&lt;br /&gt;
=== License file does not support this version ===&lt;br /&gt;
* Error details:&lt;br /&gt;
  Feature: SERIAL&lt;br /&gt;
 &#039;&#039;&#039;Application version &amp;gt; License version: 5.21 &amp;gt; 3.5&#039;&#039;&#039;&lt;br /&gt;
 License path: /Users/stern/Applications/COMSOL52a/license/license.dat:&lt;br /&gt;
 FlexNet Licensing error:-21,126&lt;br /&gt;
* 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&#039;re connected to.&lt;br /&gt;
* Solution: When using SSH, try &amp;lt;code&amp;gt;clicense2&amp;lt;/code&amp;gt; instead of  &amp;lt;code&amp;gt;clicense1&amp;lt;/code&amp;gt;, or vice versa. Revisit your &amp;lt;code&amp;gt;~/.ssh/config&amp;lt;/code&amp;gt; file or use the alternate command line as shown in the SSH section above.&lt;br /&gt;
&lt;br /&gt;
== Multiple CPU cores ==&lt;br /&gt;
Ways to start multi-core (from http://www.comsol.com/support/knowledgebase/1096/)&lt;br /&gt;
 comsol -np 8&lt;br /&gt;
&lt;br /&gt;
 export COMSOL_NUM_THREADS=8    # automatically provided on &#039;&#039;Carbon&#039;&#039;&lt;br /&gt;
 comsol&lt;br /&gt;
* COMSOL does not benefit from hyperthreading (oversubscribing the physical core count).&lt;br /&gt;
&lt;br /&gt;
== Batch jobs ==&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
 comsol -clustersimple batch -inputfile input.mph -outputfile output.mph &lt;br /&gt;
&lt;br /&gt;
 &amp;lt;strike&amp;gt;comsol –nn 8 mpd boot&lt;br /&gt;
 comsol –nn 8 batch –inputfile in.mph&lt;br /&gt;
 comsol mpd allexit&amp;lt;/strike&amp;gt;&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
* http://www.comsol.com/support/knowledgebase/1001/ .&lt;br /&gt;
* [[Media:HPC 2012-05-16 Comsol parallel usage.pdf]] (Modified from http://www.comsol.com/support/knowledgebase/1001/files/4027/cluster_install_linux_42a.pptx – Appendix slide, PBS)&lt;br /&gt;
* &#039;&#039;&#039;Note:&#039;&#039;&#039; MPD is not supported on Carbon (I patched the main comsol script), and no longer necessary at all in Comsol-4.3.&lt;br /&gt;
&lt;br /&gt;
=== Sample Job file ===&lt;br /&gt;
See:&lt;br /&gt;
 $COMSOL_HOME/sample.job&lt;br /&gt;
&lt;br /&gt;
== Important COMSOL Support Articles ==&lt;br /&gt;
* Toplevel suport page: https://www.comsol.com/support&lt;br /&gt;
&lt;br /&gt;
=== KB Articles ===&lt;br /&gt;
* [https://www.comsol.com/support/knowledgebase/1001 Running COMSOL® in parallel on clusters]&lt;br /&gt;
* [https://www.comsol.com/support/knowledgebase/1250 Running parametric sweeps, batch sweeps, and cluster sweeps from the command line]&lt;br /&gt;
* [https://www.comsol.com/support/knowledgebase/1255 Reducing the amount of solution data stored in a model]&lt;br /&gt;
* [https://www.comsol.com/support/knowledgebase/830 Handling large models]&lt;br /&gt;
&lt;br /&gt;
=== Blog-style articles ===&lt;br /&gt;
* [https://www.comsol.com/blogs/the-power-of-the-batch-sweep/ The Power of the Batch Sweep]&lt;br /&gt;
* [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]&lt;/div&gt;</summary>
		<author><name>Stern</name></author>
	</entry>
	<entry>
		<id>https://wiki.anl.gov/wiki_cnm/index.php?title=HPC/Applications/comsol&amp;diff=7491</id>
		<title>HPC/Applications/comsol</title>
		<link rel="alternate" type="text/html" href="https://wiki.anl.gov/wiki_cnm/index.php?title=HPC/Applications/comsol&amp;diff=7491"/>
		<updated>2026-02-26T16:58:15Z</updated>

		<summary type="html">&lt;p&gt;Stern: /* License configuration when outside CNM – requires SSH Tunneling */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
The [http://www.comsol.com/products/multiphysics/ &#039;&#039;&#039;COMSOL Multiphysics&#039;&#039;&#039;] application suite&lt;br /&gt;
is available for Mac, Windows, and Linux.&lt;br /&gt;
&lt;br /&gt;
== Access ==&lt;br /&gt;
[[Image:HPC Comsol licensed modules.png|right|450px|thumb|COMSOL features licensed at CNM as of 2024-10.]]&lt;br /&gt;
=== COMSOL Multiphysics ===&lt;br /&gt;
Access to &#039;&#039;&#039;COMSOL Multiphysics&#039;&#039;&#039;, the main application with both a graphical user interface and batch computing capabilities, will be granted &#039;&#039;&#039;&#039;&#039;upon request&#039;&#039;&#039;&#039;&#039;&amp;amp;thinsp;.&lt;br /&gt;
&lt;br /&gt;
You must be:&lt;br /&gt;
* An &#039;&#039;&#039;&#039;&#039;Argonne employee&#039;&#039;&#039;&#039;&#039;&amp;amp;thinsp; in one of the following roles:&lt;br /&gt;
** &#039;&#039;&#039;&#039;&#039;NST staff member&#039;&#039;&#039;&#039;&#039;&amp;amp;thinsp; (including PostDocs, joint appointments, and students at NST).&lt;br /&gt;
** &#039;&#039;&#039;&#039;&#039;CNM Facility User&#039;&#039;&#039;&#039;&#039;&amp;amp;thinsp; (including &#039;&#039;non-NST Argonne employees&#039;&#039;), with an active proposal that has COMSOL in scope. Please see [[HPC/FAQ#Access_and_proposals]].&lt;br /&gt;
&lt;br /&gt;
The set of available COMSOL modules that we have licensed is shown at right.&lt;br /&gt;
&lt;br /&gt;
* The native desktop version can be installed only on &#039;&#039;Argonne-owned&#039;&#039; computers (laptop or desktop). Please contact [mailto:help@anl.gov?Subject=COMSOL%20license%20access%20request CNM support]. Make sure to review [http://www.comsol.com/support/updates/ Product Updates].&lt;br /&gt;
* To run COMSOL on our HPC system &#039;&#039;Carbon&#039;&#039;, as GUI or as batch computing jobs, your proposal must have &#039;&#039;Carbon&#039;&#039; access in scope.&lt;br /&gt;
&lt;br /&gt;
=== COMSOL Server ===&lt;br /&gt;
&#039;&#039;CNM Facility Users&#039;&#039; who are not Argonne employees are not eligible to access&lt;br /&gt;
the full &#039;&#039;&#039;COMSOL Multiphysics&#039;&#039;&#039; product, in compliance with its licensing terms and conditions.&lt;br /&gt;
However, the [https://www.comsol.com/comsol-server &#039;&#039;&#039;COMSOL Server&#039;&#039;&#039;] product offers an alternative&lt;br /&gt;
albeit more narrow means of access.&lt;br /&gt;
&lt;br /&gt;
All users, including &#039;&#039;&#039;&#039;&#039;non-Argonne users&#039;&#039;&#039;&#039;&#039; may be able to run, over a web interface in their browser,&lt;br /&gt;
pre-parameterized &amp;quot;fixed-model&amp;quot; simulations that were made with the &#039;&#039;&#039;COMSOL Application Builder&#039;&#039;&#039; (requires Windows).&lt;br /&gt;
&lt;br /&gt;
To inquire about using COMSOL server applications,&lt;br /&gt;
please contact us.&lt;br /&gt;
&amp;lt;!-- [mailto:cnm_useroffice@anl.gov?Subject=COMSOL%20server%20usage Support]. --&amp;gt;&lt;br /&gt;
We will review possible purchase paths for COMSOL Server, and the &#039;&#039;considerable effort&#039;&#039; likely required by users and the CNM to develop and deploy a COMSOL application.&lt;br /&gt;
&lt;br /&gt;
== Support ==&lt;br /&gt;
* For questions on how to run or start COMSOL:&lt;br /&gt;
*: Submit an [[HPC/Support | &#039;&#039;&#039;IT support request&#039;&#039;&#039;]]&lt;br /&gt;
* For questions related to most COMSOL data or scripts, contact COMSOL support at:&lt;br /&gt;
*: [mailto:support@comsol.com &#039;&#039;&#039;support&#039;&#039;&#039;@comsol.com]&lt;br /&gt;
* &#039;&#039;&#039;Exception:&#039;&#039;&#039; If your support question might contain data that is subject to &#039;&#039;&#039;US Export Control&#039;&#039;&#039; regulations, contact instead:&lt;br /&gt;
*: [mailto:us-export-control@us.comsol.com &#039;&#039;&#039;us-export-control&#039;&#039;&#039;@&#039;&#039;&#039;us&#039;&#039;&#039;.comsol.com]&lt;br /&gt;
&lt;br /&gt;
== The modes to run COMSOL ==&lt;br /&gt;
There are several ways of running COMSOL.&lt;br /&gt;
&lt;br /&gt;
=== Running the desktop application ===&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
# Run on Carbon, display on your desktop using the [http://en.wikipedia.org/wiki/X_Window_System X Window system (X11)].&lt;br /&gt;
#* Requires an &#039;&#039;X11 Server&#039;&#039; application running on your client machine, and SSH X11 forwarding.&lt;br /&gt;
#* The X11 protocol can be slow over LAN.&lt;br /&gt;
# Run on Carbon within a [[HPC/Network Access/Virtual Desktop | virtual desktop environment (VNC)]].&lt;br /&gt;
#* Requires a VNC client on your machine.&lt;br /&gt;
#* It can be confusing where VNC and the app runs.&lt;br /&gt;
#* The virtual desktop presents a (deliberatly) sparse windowing environment – Copy&amp;amp;Paste can be difficult to use.&lt;br /&gt;
# Run on your Argonne-provided computer, checking out Carbon&#039;s license remotely.&lt;br /&gt;
#* Requires a full installation of COMSOL on your desktoo or laptop computer.&lt;br /&gt;
#* 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.&lt;br /&gt;
&lt;br /&gt;
=== Running a batch calculation ===&lt;br /&gt;
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.&lt;br /&gt;
See the [[#Batch jobs|section below]].&lt;br /&gt;
&lt;br /&gt;
== Use with X11 ==&lt;br /&gt;
For casual use, and with [[HPC/Network Access/SSH Tunnel Setup on Linux and MacOS | X11 tunneling to Carbon]] set up, simply add to your &amp;lt;code&amp;gt;~/.bashrc&amp;lt;/code&amp;gt; file on Carbon:&lt;br /&gt;
 module load comsol&lt;br /&gt;
&lt;br /&gt;
Then, from the command line on a Carbon login node, start the COMSOL GUI:&lt;br /&gt;
 comsol &amp;amp;&lt;br /&gt;
&lt;br /&gt;
License configuration is automatic on Carbon.&lt;br /&gt;
&lt;br /&gt;
Comsol will use a number of cores to run calculations multithreaded by default. (On Carbon, COMSOL_NUM_THREADS is set.)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Quit the application&#039;&#039;&#039; as soon as you are done. Only one user can use Comsol at a time.&lt;br /&gt;
&lt;br /&gt;
== Use with VNC ==&lt;br /&gt;
See general  [[HPC/Network Access/Virtual Desktop | instructions on using VNC]], and the COMSOL example therein.&lt;br /&gt;
&lt;br /&gt;
== Native desktop version ==&lt;br /&gt;
&lt;br /&gt;
To get the fastest response from the COMSOL GUI, run a native COMSOL version on your desktop machine or laptop, called &#039;&#039;client machine&#039;&#039; below.&lt;br /&gt;
&lt;br /&gt;
Enter license details either in the COMSOL Setup configuration dialog.&lt;br /&gt;
&lt;br /&gt;
== Native desktop version — License configuration ==&lt;br /&gt;
A client&#039;s COMSOL license needs to be configured depending on how the client reaches CNM network resources. Follow the appropriate section:&lt;br /&gt;
&lt;br /&gt;
* [[#License configuration when inside CNM or on CNM VPN|License configuration when &#039;&#039;&#039;inside CNM&#039;&#039;&#039; or on &#039;&#039;&#039;CNM VPN&#039;&#039;&#039;]]&lt;br /&gt;
: Requires that the user&#039;s machine is logically within the network of CNM/NST, either by a wired/auth WiFi connection in the building or by VPN under a CNM/NST profile.&lt;br /&gt;
* [[#License configuration when outside CNM – requires SSH Tunneling|License configuration when &#039;&#039;&#039;outside CNM&#039;&#039;&#039; – requires SSH Tunneling]]&lt;br /&gt;
: &#039;&#039;Non-NST staff&#039;&#039; usually have a VPN profile that places the machine logically [[#License configuration when outside CNM – requires SSH Tunneling|outside of NST&#039;s network.]]&lt;br /&gt;
&lt;br /&gt;
== License configuration when inside CNM or on CNM VPN ==&lt;br /&gt;
=== &amp;lt;span style=&amp;quot;color:#A00;&amp;quot;&amp;gt;Ensure correct DNS search domains&amp;lt;/span&amp;gt; ===&lt;br /&gt;
* Inspect the client machine&#039;s network configuration.&lt;br /&gt;
* Ensure that &#039;&#039;&#039;two&#039;&#039;&#039; entries are listed as DNS Search Domains for the current network profile:&lt;br /&gt;
 nst.anl.gov&lt;br /&gt;
 cnm.anl.gov&lt;br /&gt;
: (The order of entries does not matter for the purposes considered here.)&lt;br /&gt;
* If the client machine is &#039;&#039;wired to CNM networks&#039;&#039;, the domains are normally provided correctly by DHCP.&lt;br /&gt;
* If the client machine is &#039;&#039;connected over VPN&#039;&#039;, you may need edit the respective network profile.&lt;br /&gt;
:* 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 &amp;quot;Advanced…&amp;quot;. It appears that those changes are being saved and will be activated automatically the next time that this VPN session gets started.&lt;br /&gt;
: [[Image:VNC_add_cnm_to_DNS_1.png|400px]] [[Image:VNC_add_cnm_to_DNS_2.png|400px]]&lt;br /&gt;
:* On Windows or Linux machines, take &#039;&#039;analogous&#039;&#039; steps, using the platform&#039;s own configuration tools.&lt;br /&gt;
&lt;br /&gt;
* Exclude license manager components from client desktop installation. (Those are all handled server-side.)&lt;br /&gt;
&lt;br /&gt;
=== License format ===&lt;br /&gt;
* Floating Network License (FNL), &amp;quot;Three-server redundancy&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== License servers ===&lt;br /&gt;
* On client machines, while running the COMSOL installer or license configuration, specify license servers and ports as follows:&lt;br /&gt;
 1718    clicense1&lt;br /&gt;
 1718    clicense2&lt;br /&gt;
 1718    clicense3&lt;br /&gt;
: &#039;&#039;&#039;Note:&#039;&#039;&#039; Use &#039;&#039;short host names only&#039;&#039;. (Technical Reason: The license must be usable both on Carbon&#039;s internal network as well as on divisional networks).&lt;br /&gt;
 1718    clicense1&amp;lt;strike&amp;gt;.cnm.anl.gov&amp;lt;/strike&amp;gt;&lt;br /&gt;
 1718    clicense2&amp;lt;strike&amp;gt;.cnm.anl.gov&amp;lt;/strike&amp;gt;&lt;br /&gt;
 1718    clicense3&amp;lt;strike&amp;gt;.cnm.anl.gov&amp;lt;/strike&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Advanced:&#039;&#039;&#039; A client machine&#039;s COMSOL license file &amp;lt;code&amp;gt;&amp;amp;lt;COMSOLDIR&amp;amp;gt;/Multiphysics/license/license.dat&amp;lt;/code&amp;gt; should look as follows:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;make&amp;quot;&amp;gt;&lt;br /&gt;
SERVER clicense1 ANY 1718&lt;br /&gt;
SERVER clicense2 ANY 1718&lt;br /&gt;
SERVER clicense3 ANY 1718&lt;br /&gt;
USE_SERVER&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;amp;lt;COMSOLDIR&amp;amp;gt;&amp;lt;/code&amp;gt; is located by default at:&lt;br /&gt;
* &#039;&#039;&#039;Windows&#039;&#039;&#039;: C:\Program files\COMSOL\COMSOL&#039;&#039;nn&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Linux&#039;&#039;&#039;: /usr/local/comsol&#039;&#039;nn&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Mac&#039;&#039;&#039;: /Applications/COMSOL&#039;&#039;nn&#039;&#039;&lt;br /&gt;
(&amp;quot;&#039;&#039;nn&#039;&#039;&amp;quot; is the application&#039;s abbreviated version number.)&lt;br /&gt;
&lt;br /&gt;
=== Network Troubleshooting ===&lt;br /&gt;
When using the license access model descibed here (as opposed to tunneled over SSH), ensure the following:&lt;br /&gt;
* Verify that short host names can be resolved to IP addresses. Either one of the following commands should produce sensible output:&lt;br /&gt;
 host clicense1&lt;br /&gt;
: or:&lt;br /&gt;
 ping -c 3 clicense1&lt;br /&gt;
* Verify that &#039;&#039;both license ports on the same server&#039;&#039; can be reached from your client machine:&lt;br /&gt;
 telnet &#039;&#039;&#039;clicense1&#039;&#039;&#039; 1718&lt;br /&gt;
 telnet &#039;&#039;&#039;clicense1&#039;&#039;&#039; 1719&lt;br /&gt;
: or:&lt;br /&gt;
 telnet &#039;&#039;&#039;clicense2&#039;&#039;&#039; 1718&lt;br /&gt;
 telnet &#039;&#039;&#039;clicense2&#039;&#039;&#039; 1719&lt;br /&gt;
: A &#039;&#039;successful&#039;&#039; connection looks like:&lt;br /&gt;
 Trying 146.139.x.y...&lt;br /&gt;
 Connected to clicense1.cnm.anl.gov.&lt;br /&gt;
 Escape character is &#039;^]&#039;.&lt;br /&gt;
:: Do not enter any data. Instead,  close each connection by hitting &amp;lt;code&amp;gt;Ctrl&amp;lt;/code&amp;gt;&amp;lt;code&amp;gt;]&amp;lt;/code&amp;gt; (closing square bracket), followed by &amp;lt;code&amp;gt;Ctrl&amp;lt;/code&amp;gt;&amp;lt;code&amp;gt;D&amp;lt;/code&amp;gt;.&lt;br /&gt;
: A &#039;&#039;failed&#039;&#039; connection gives one of these errors:&lt;br /&gt;
 telnet: connect to address 146.139.x.y: Operation timed out&lt;br /&gt;
: or:&lt;br /&gt;
 telnet: connect to address 146.139.x.y: Connection refused&lt;br /&gt;
:: In these cases, ask that your IP firewall configuration be reviewed and changed.&lt;br /&gt;
&lt;br /&gt;
== License configuration when outside CNM – requires SSH Tunneling ==&lt;br /&gt;
If you&#039;re comfortable with ssh and tunneling, set up client licensing as follows:&lt;br /&gt;
&lt;br /&gt;
=== Configure COMSOL ===&lt;br /&gt;
The following needs to be done just once, typically during COMSOL installation:&lt;br /&gt;
&lt;br /&gt;
In the COMSOL Installer, or in COMSOL Preferences, enter:&lt;br /&gt;
* &#039;&#039;&#039;License format:&#039;&#039;&#039; Floating Network License (FNL), &amp;quot;Port number and Hostname&amp;quot;&lt;br /&gt;
:: &amp;quot;Three-server redundancy&amp;quot; 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.&lt;br /&gt;
* &#039;&#039;&#039;Server:&#039;&#039;&#039; &amp;lt;code&amp;gt;127.0.0.1&amp;lt;/code&amp;gt;&lt;br /&gt;
:: Do not use &amp;quot;localhost&amp;quot;, as COMSOL interprets this incorrectly to mean that your machine &#039;&#039;is&#039;&#039; a license server.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Port:&#039;&#039;&#039; &amp;lt;code&amp;gt;1718&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
Or place a license file with this content:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;make&amp;quot;&amp;gt;&lt;br /&gt;
SERVER 127.0.0.1 ANY 1718&lt;br /&gt;
USE_SERVER&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
//--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Establish connection to CNM license server ===&lt;br /&gt;
This step needs to be done prior to running COMSOL in your desktop session:&lt;br /&gt;
# Connect to &amp;lt;code&amp;gt;mega&amp;lt;/code&amp;gt; with the following ssh command:&lt;br /&gt;
 ssh  -L 1718:&#039;&#039;&#039;clicense1&#039;&#039;&#039;:1718  -L 1719:&#039;&#039;&#039;clicense1&#039;&#039;&#039;:1719  mega.cnm.anl.gov&lt;br /&gt;
# Leave the command running between invocations of COMSOL.&lt;br /&gt;
&lt;br /&gt;
=== Run COMSOL ===&lt;br /&gt;
# Ensure your connection to &amp;quot;mega&amp;quot; is still running. If not, restart it.&lt;br /&gt;
# Start the COMSOL application.&lt;br /&gt;
&lt;br /&gt;
=== Troubleshooting ===&lt;br /&gt;
* If you get an error that the number of licenses is &amp;quot;exhausted&amp;quot;, that is confirmation that you correctly reached the license server, though other users are using licenses.&lt;br /&gt;
* 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:&lt;br /&gt;
 ssh  -L 1718:clicense&#039;&#039;&#039;2&#039;&#039;&#039;:1718  -L 1719:clicense&#039;&#039;&#039;2&#039;&#039;&#039;:1719  mega.cnm.anl.gov&lt;br /&gt;
&lt;br /&gt;
== License Troubleshooting ==&lt;br /&gt;
The following are typical error messages.&lt;br /&gt;
=== Could not obtain license for COMSOL Multiphysics GUI ===&lt;br /&gt;
* Error details:&lt;br /&gt;
 License error: -4.&lt;br /&gt;
 &#039;&#039;&#039;Licensed number of users already reached.&#039;&#039;&#039;&lt;br /&gt;
 Feature:       COMSOLGUI&lt;br /&gt;
 License path:  /Users/stern/Applications/COMSOL52a/license/license.dat:&lt;br /&gt;
 FlexNet Licensing error:-4,132&lt;br /&gt;
* Reason: The connection to the license server succeeded, but the license token(s) you requested are in use.&lt;br /&gt;
* Solution: Wait a bit, or [http://carbonmgmt/ganglia/lic.php identify who&#039;s using COMSOL] and politely ask the user when they might be finished with their work.&lt;br /&gt;
&lt;br /&gt;
=== License server machine is down or not responding ===&lt;br /&gt;
* Error details:&lt;br /&gt;
  License error: -96.&lt;br /&gt;
  See the system administrator about starting the license server system, or&lt;br /&gt;
  make sure you&#039;re referring to the right host (see LM_LICENSE_FILE).&lt;br /&gt;
 Feature:       SERIAL&lt;br /&gt;
 Hostname:      clicense3&lt;br /&gt;
 License path:  /Users/stern/Applications/COMSOL52a/license/license.dat:&lt;br /&gt;
 FlexNet Licensing error:-96,7&lt;br /&gt;
* Reason: The license servers cannot be reached at all. The &amp;lt;code&amp;gt;ping&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;host&amp;lt;/code&amp;gt; tests mentioned above fail.&lt;br /&gt;
* Solution: Review the client license file and DNS lookup domains.&lt;br /&gt;
&lt;br /&gt;
=== License file does not support this version ===&lt;br /&gt;
* Error details:&lt;br /&gt;
  Feature: SERIAL&lt;br /&gt;
 &#039;&#039;&#039;Application version &amp;gt; License version: 5.21 &amp;gt; 3.5&#039;&#039;&#039;&lt;br /&gt;
 License path: /Users/stern/Applications/COMSOL52a/license/license.dat:&lt;br /&gt;
 FlexNet Licensing error:-21,126&lt;br /&gt;
* 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&#039;re connected to.&lt;br /&gt;
* Solution: When using SSH, try &amp;lt;code&amp;gt;clicense2&amp;lt;/code&amp;gt; instead of  &amp;lt;code&amp;gt;clicense1&amp;lt;/code&amp;gt;, or vice versa. Revisit your &amp;lt;code&amp;gt;~/.ssh/config&amp;lt;/code&amp;gt; file or use the alternate command line as shown in the SSH section above.&lt;br /&gt;
&lt;br /&gt;
== Multiple CPU cores ==&lt;br /&gt;
Ways to start multi-core (from http://www.comsol.com/support/knowledgebase/1096/)&lt;br /&gt;
 comsol -np 8&lt;br /&gt;
&lt;br /&gt;
 export COMSOL_NUM_THREADS=8    # automatically provided on &#039;&#039;Carbon&#039;&#039;&lt;br /&gt;
 comsol&lt;br /&gt;
* COMSOL does not benefit from hyperthreading (oversubscribing the physical core count).&lt;br /&gt;
&lt;br /&gt;
== Batch jobs ==&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
 comsol -clustersimple batch -inputfile input.mph -outputfile output.mph &lt;br /&gt;
&lt;br /&gt;
 &amp;lt;strike&amp;gt;comsol –nn 8 mpd boot&lt;br /&gt;
 comsol –nn 8 batch –inputfile in.mph&lt;br /&gt;
 comsol mpd allexit&amp;lt;/strike&amp;gt;&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
* http://www.comsol.com/support/knowledgebase/1001/ .&lt;br /&gt;
* [[Media:HPC 2012-05-16 Comsol parallel usage.pdf]] (Modified from http://www.comsol.com/support/knowledgebase/1001/files/4027/cluster_install_linux_42a.pptx – Appendix slide, PBS)&lt;br /&gt;
* &#039;&#039;&#039;Note:&#039;&#039;&#039; MPD is not supported on Carbon (I patched the main comsol script), and no longer necessary at all in Comsol-4.3.&lt;br /&gt;
&lt;br /&gt;
=== Sample Job file ===&lt;br /&gt;
See:&lt;br /&gt;
 $COMSOL_HOME/sample.job&lt;br /&gt;
&lt;br /&gt;
== Important COMSOL Support Articles ==&lt;br /&gt;
* Toplevel suport page: https://www.comsol.com/support&lt;br /&gt;
&lt;br /&gt;
=== KB Articles ===&lt;br /&gt;
* [https://www.comsol.com/support/knowledgebase/1001 Running COMSOL® in parallel on clusters]&lt;br /&gt;
* [https://www.comsol.com/support/knowledgebase/1250 Running parametric sweeps, batch sweeps, and cluster sweeps from the command line]&lt;br /&gt;
* [https://www.comsol.com/support/knowledgebase/1255 Reducing the amount of solution data stored in a model]&lt;br /&gt;
* [https://www.comsol.com/support/knowledgebase/830 Handling large models]&lt;br /&gt;
&lt;br /&gt;
=== Blog-style articles ===&lt;br /&gt;
* [https://www.comsol.com/blogs/the-power-of-the-batch-sweep/ The Power of the Batch Sweep]&lt;br /&gt;
* [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]&lt;/div&gt;</summary>
		<author><name>Stern</name></author>
	</entry>
	<entry>
		<id>https://wiki.anl.gov/wiki_cnm/index.php?title=HPC/Applications/comsol&amp;diff=7490</id>
		<title>HPC/Applications/comsol</title>
		<link rel="alternate" type="text/html" href="https://wiki.anl.gov/wiki_cnm/index.php?title=HPC/Applications/comsol&amp;diff=7490"/>
		<updated>2026-02-26T16:57:34Z</updated>

		<summary type="html">&lt;p&gt;Stern: /* License configuration when outside CNM – requires SSH Tunneling */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
The [http://www.comsol.com/products/multiphysics/ &#039;&#039;&#039;COMSOL Multiphysics&#039;&#039;&#039;] application suite&lt;br /&gt;
is available for Mac, Windows, and Linux.&lt;br /&gt;
&lt;br /&gt;
== Access ==&lt;br /&gt;
[[Image:HPC Comsol licensed modules.png|right|450px|thumb|COMSOL features licensed at CNM as of 2024-10.]]&lt;br /&gt;
=== COMSOL Multiphysics ===&lt;br /&gt;
Access to &#039;&#039;&#039;COMSOL Multiphysics&#039;&#039;&#039;, the main application with both a graphical user interface and batch computing capabilities, will be granted &#039;&#039;&#039;&#039;&#039;upon request&#039;&#039;&#039;&#039;&#039;&amp;amp;thinsp;.&lt;br /&gt;
&lt;br /&gt;
You must be:&lt;br /&gt;
* An &#039;&#039;&#039;&#039;&#039;Argonne employee&#039;&#039;&#039;&#039;&#039;&amp;amp;thinsp; in one of the following roles:&lt;br /&gt;
** &#039;&#039;&#039;&#039;&#039;NST staff member&#039;&#039;&#039;&#039;&#039;&amp;amp;thinsp; (including PostDocs, joint appointments, and students at NST).&lt;br /&gt;
** &#039;&#039;&#039;&#039;&#039;CNM Facility User&#039;&#039;&#039;&#039;&#039;&amp;amp;thinsp; (including &#039;&#039;non-NST Argonne employees&#039;&#039;), with an active proposal that has COMSOL in scope. Please see [[HPC/FAQ#Access_and_proposals]].&lt;br /&gt;
&lt;br /&gt;
The set of available COMSOL modules that we have licensed is shown at right.&lt;br /&gt;
&lt;br /&gt;
* The native desktop version can be installed only on &#039;&#039;Argonne-owned&#039;&#039; computers (laptop or desktop). Please contact [mailto:help@anl.gov?Subject=COMSOL%20license%20access%20request CNM support]. Make sure to review [http://www.comsol.com/support/updates/ Product Updates].&lt;br /&gt;
* To run COMSOL on our HPC system &#039;&#039;Carbon&#039;&#039;, as GUI or as batch computing jobs, your proposal must have &#039;&#039;Carbon&#039;&#039; access in scope.&lt;br /&gt;
&lt;br /&gt;
=== COMSOL Server ===&lt;br /&gt;
&#039;&#039;CNM Facility Users&#039;&#039; who are not Argonne employees are not eligible to access&lt;br /&gt;
the full &#039;&#039;&#039;COMSOL Multiphysics&#039;&#039;&#039; product, in compliance with its licensing terms and conditions.&lt;br /&gt;
However, the [https://www.comsol.com/comsol-server &#039;&#039;&#039;COMSOL Server&#039;&#039;&#039;] product offers an alternative&lt;br /&gt;
albeit more narrow means of access.&lt;br /&gt;
&lt;br /&gt;
All users, including &#039;&#039;&#039;&#039;&#039;non-Argonne users&#039;&#039;&#039;&#039;&#039; may be able to run, over a web interface in their browser,&lt;br /&gt;
pre-parameterized &amp;quot;fixed-model&amp;quot; simulations that were made with the &#039;&#039;&#039;COMSOL Application Builder&#039;&#039;&#039; (requires Windows).&lt;br /&gt;
&lt;br /&gt;
To inquire about using COMSOL server applications,&lt;br /&gt;
please contact us.&lt;br /&gt;
&amp;lt;!-- [mailto:cnm_useroffice@anl.gov?Subject=COMSOL%20server%20usage Support]. --&amp;gt;&lt;br /&gt;
We will review possible purchase paths for COMSOL Server, and the &#039;&#039;considerable effort&#039;&#039; likely required by users and the CNM to develop and deploy a COMSOL application.&lt;br /&gt;
&lt;br /&gt;
== Support ==&lt;br /&gt;
* For questions on how to run or start COMSOL:&lt;br /&gt;
*: Submit an [[HPC/Support | &#039;&#039;&#039;IT support request&#039;&#039;&#039;]]&lt;br /&gt;
* For questions related to most COMSOL data or scripts, contact COMSOL support at:&lt;br /&gt;
*: [mailto:support@comsol.com &#039;&#039;&#039;support&#039;&#039;&#039;@comsol.com]&lt;br /&gt;
* &#039;&#039;&#039;Exception:&#039;&#039;&#039; If your support question might contain data that is subject to &#039;&#039;&#039;US Export Control&#039;&#039;&#039; regulations, contact instead:&lt;br /&gt;
*: [mailto:us-export-control@us.comsol.com &#039;&#039;&#039;us-export-control&#039;&#039;&#039;@&#039;&#039;&#039;us&#039;&#039;&#039;.comsol.com]&lt;br /&gt;
&lt;br /&gt;
== The modes to run COMSOL ==&lt;br /&gt;
There are several ways of running COMSOL.&lt;br /&gt;
&lt;br /&gt;
=== Running the desktop application ===&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
# Run on Carbon, display on your desktop using the [http://en.wikipedia.org/wiki/X_Window_System X Window system (X11)].&lt;br /&gt;
#* Requires an &#039;&#039;X11 Server&#039;&#039; application running on your client machine, and SSH X11 forwarding.&lt;br /&gt;
#* The X11 protocol can be slow over LAN.&lt;br /&gt;
# Run on Carbon within a [[HPC/Network Access/Virtual Desktop | virtual desktop environment (VNC)]].&lt;br /&gt;
#* Requires a VNC client on your machine.&lt;br /&gt;
#* It can be confusing where VNC and the app runs.&lt;br /&gt;
#* The virtual desktop presents a (deliberatly) sparse windowing environment – Copy&amp;amp;Paste can be difficult to use.&lt;br /&gt;
# Run on your Argonne-provided computer, checking out Carbon&#039;s license remotely.&lt;br /&gt;
#* Requires a full installation of COMSOL on your desktoo or laptop computer.&lt;br /&gt;
#* 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.&lt;br /&gt;
&lt;br /&gt;
=== Running a batch calculation ===&lt;br /&gt;
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.&lt;br /&gt;
See the [[#Batch jobs|section below]].&lt;br /&gt;
&lt;br /&gt;
== Use with X11 ==&lt;br /&gt;
For casual use, and with [[HPC/Network Access/SSH Tunnel Setup on Linux and MacOS | X11 tunneling to Carbon]] set up, simply add to your &amp;lt;code&amp;gt;~/.bashrc&amp;lt;/code&amp;gt; file on Carbon:&lt;br /&gt;
 module load comsol&lt;br /&gt;
&lt;br /&gt;
Then, from the command line on a Carbon login node, start the COMSOL GUI:&lt;br /&gt;
 comsol &amp;amp;&lt;br /&gt;
&lt;br /&gt;
License configuration is automatic on Carbon.&lt;br /&gt;
&lt;br /&gt;
Comsol will use a number of cores to run calculations multithreaded by default. (On Carbon, COMSOL_NUM_THREADS is set.)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Quit the application&#039;&#039;&#039; as soon as you are done. Only one user can use Comsol at a time.&lt;br /&gt;
&lt;br /&gt;
== Use with VNC ==&lt;br /&gt;
See general  [[HPC/Network Access/Virtual Desktop | instructions on using VNC]], and the COMSOL example therein.&lt;br /&gt;
&lt;br /&gt;
== Native desktop version ==&lt;br /&gt;
&lt;br /&gt;
To get the fastest response from the COMSOL GUI, run a native COMSOL version on your desktop machine or laptop, called &#039;&#039;client machine&#039;&#039; below.&lt;br /&gt;
&lt;br /&gt;
Enter license details either in the COMSOL Setup configuration dialog.&lt;br /&gt;
&lt;br /&gt;
== Native desktop version — License configuration ==&lt;br /&gt;
A client&#039;s COMSOL license needs to be configured depending on how the client reaches CNM network resources. Follow the appropriate section:&lt;br /&gt;
&lt;br /&gt;
* [[#License configuration when inside CNM or on CNM VPN|License configuration when &#039;&#039;&#039;inside CNM&#039;&#039;&#039; or on &#039;&#039;&#039;CNM VPN&#039;&#039;&#039;]]&lt;br /&gt;
: Requires that the user&#039;s machine is logically within the network of CNM/NST, either by a wired/auth WiFi connection in the building or by VPN under a CNM/NST profile.&lt;br /&gt;
* [[#License configuration when outside CNM – requires SSH Tunneling|License configuration when &#039;&#039;&#039;outside CNM&#039;&#039;&#039; – requires SSH Tunneling]]&lt;br /&gt;
: &#039;&#039;Non-NST staff&#039;&#039; usually have a VPN profile that places the machine logically [[#License configuration when outside CNM – requires SSH Tunneling|outside of NST&#039;s network.]]&lt;br /&gt;
&lt;br /&gt;
== License configuration when inside CNM or on CNM VPN ==&lt;br /&gt;
=== &amp;lt;span style=&amp;quot;color:#A00;&amp;quot;&amp;gt;Ensure correct DNS search domains&amp;lt;/span&amp;gt; ===&lt;br /&gt;
* Inspect the client machine&#039;s network configuration.&lt;br /&gt;
* Ensure that &#039;&#039;&#039;two&#039;&#039;&#039; entries are listed as DNS Search Domains for the current network profile:&lt;br /&gt;
 nst.anl.gov&lt;br /&gt;
 cnm.anl.gov&lt;br /&gt;
: (The order of entries does not matter for the purposes considered here.)&lt;br /&gt;
* If the client machine is &#039;&#039;wired to CNM networks&#039;&#039;, the domains are normally provided correctly by DHCP.&lt;br /&gt;
* If the client machine is &#039;&#039;connected over VPN&#039;&#039;, you may need edit the respective network profile.&lt;br /&gt;
:* 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 &amp;quot;Advanced…&amp;quot;. It appears that those changes are being saved and will be activated automatically the next time that this VPN session gets started.&lt;br /&gt;
: [[Image:VNC_add_cnm_to_DNS_1.png|400px]] [[Image:VNC_add_cnm_to_DNS_2.png|400px]]&lt;br /&gt;
:* On Windows or Linux machines, take &#039;&#039;analogous&#039;&#039; steps, using the platform&#039;s own configuration tools.&lt;br /&gt;
&lt;br /&gt;
* Exclude license manager components from client desktop installation. (Those are all handled server-side.)&lt;br /&gt;
&lt;br /&gt;
=== License format ===&lt;br /&gt;
* Floating Network License (FNL), &amp;quot;Three-server redundancy&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== License servers ===&lt;br /&gt;
* On client machines, while running the COMSOL installer or license configuration, specify license servers and ports as follows:&lt;br /&gt;
 1718    clicense1&lt;br /&gt;
 1718    clicense2&lt;br /&gt;
 1718    clicense3&lt;br /&gt;
: &#039;&#039;&#039;Note:&#039;&#039;&#039; Use &#039;&#039;short host names only&#039;&#039;. (Technical Reason: The license must be usable both on Carbon&#039;s internal network as well as on divisional networks).&lt;br /&gt;
 1718    clicense1&amp;lt;strike&amp;gt;.cnm.anl.gov&amp;lt;/strike&amp;gt;&lt;br /&gt;
 1718    clicense2&amp;lt;strike&amp;gt;.cnm.anl.gov&amp;lt;/strike&amp;gt;&lt;br /&gt;
 1718    clicense3&amp;lt;strike&amp;gt;.cnm.anl.gov&amp;lt;/strike&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Advanced:&#039;&#039;&#039; A client machine&#039;s COMSOL license file &amp;lt;code&amp;gt;&amp;amp;lt;COMSOLDIR&amp;amp;gt;/Multiphysics/license/license.dat&amp;lt;/code&amp;gt; should look as follows:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;make&amp;quot;&amp;gt;&lt;br /&gt;
SERVER clicense1 ANY 1718&lt;br /&gt;
SERVER clicense2 ANY 1718&lt;br /&gt;
SERVER clicense3 ANY 1718&lt;br /&gt;
USE_SERVER&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;amp;lt;COMSOLDIR&amp;amp;gt;&amp;lt;/code&amp;gt; is located by default at:&lt;br /&gt;
* &#039;&#039;&#039;Windows&#039;&#039;&#039;: C:\Program files\COMSOL\COMSOL&#039;&#039;nn&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Linux&#039;&#039;&#039;: /usr/local/comsol&#039;&#039;nn&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Mac&#039;&#039;&#039;: /Applications/COMSOL&#039;&#039;nn&#039;&#039;&lt;br /&gt;
(&amp;quot;&#039;&#039;nn&#039;&#039;&amp;quot; is the application&#039;s abbreviated version number.)&lt;br /&gt;
&lt;br /&gt;
=== Network Troubleshooting ===&lt;br /&gt;
When using the license access model descibed here (as opposed to tunneled over SSH), ensure the following:&lt;br /&gt;
* Verify that short host names can be resolved to IP addresses. Either one of the following commands should produce sensible output:&lt;br /&gt;
 host clicense1&lt;br /&gt;
: or:&lt;br /&gt;
 ping -c 3 clicense1&lt;br /&gt;
* Verify that &#039;&#039;both license ports on the same server&#039;&#039; can be reached from your client machine:&lt;br /&gt;
 telnet &#039;&#039;&#039;clicense1&#039;&#039;&#039; 1718&lt;br /&gt;
 telnet &#039;&#039;&#039;clicense1&#039;&#039;&#039; 1719&lt;br /&gt;
: or:&lt;br /&gt;
 telnet &#039;&#039;&#039;clicense2&#039;&#039;&#039; 1718&lt;br /&gt;
 telnet &#039;&#039;&#039;clicense2&#039;&#039;&#039; 1719&lt;br /&gt;
: A &#039;&#039;successful&#039;&#039; connection looks like:&lt;br /&gt;
 Trying 146.139.x.y...&lt;br /&gt;
 Connected to clicense1.cnm.anl.gov.&lt;br /&gt;
 Escape character is &#039;^]&#039;.&lt;br /&gt;
:: Do not enter any data. Instead,  close each connection by hitting &amp;lt;code&amp;gt;Ctrl&amp;lt;/code&amp;gt;&amp;lt;code&amp;gt;]&amp;lt;/code&amp;gt; (closing square bracket), followed by &amp;lt;code&amp;gt;Ctrl&amp;lt;/code&amp;gt;&amp;lt;code&amp;gt;D&amp;lt;/code&amp;gt;.&lt;br /&gt;
: A &#039;&#039;failed&#039;&#039; connection gives one of these errors:&lt;br /&gt;
 telnet: connect to address 146.139.x.y: Operation timed out&lt;br /&gt;
: or:&lt;br /&gt;
 telnet: connect to address 146.139.x.y: Connection refused&lt;br /&gt;
:: In these cases, ask that your IP firewall configuration be reviewed and changed.&lt;br /&gt;
&lt;br /&gt;
== License configuration when outside CNM – requires SSH Tunneling ==&lt;br /&gt;
If you&#039;re comfortable with ssh and tunneling, set up client licensing as follows:&lt;br /&gt;
&lt;br /&gt;
=== Configure COMSOL ===&lt;br /&gt;
The following needs to be done just once, typically during COMSOL installation:&lt;br /&gt;
&lt;br /&gt;
In the COMSOL Installer, or in COMSOL Preferences, enter:&lt;br /&gt;
* &#039;&#039;&#039;License format:&#039;&#039;&#039; Floating Network License (FNL), &amp;quot;Port number and Hostname&amp;quot;&lt;br /&gt;
:: &amp;quot;Three-server redundancy&amp;quot; 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.&lt;br /&gt;
* &#039;&#039;&#039;Server:&#039;&#039;&#039; &amp;lt;code&amp;gt;127.0.0.1&amp;lt;/code&amp;gt;&lt;br /&gt;
:: Do not use &amp;quot;localhost&amp;quot;, as COMSOL interprets this incorrectly to mean that your machine &#039;&#039;is&#039;&#039; a license server.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Port:&#039;&#039;&#039; &amp;lt;code&amp;gt;1718&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
Or place a license file with this content:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;make&amp;quot;&amp;gt;&lt;br /&gt;
SERVER 127.0.0.1 ANY 1718&lt;br /&gt;
USE_SERVER&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
//--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Establish connection to CNM license server ===&lt;br /&gt;
This step needs to be done prior to running COMSOL in your desktop session:&lt;br /&gt;
# Connect to &amp;lt;code&amp;gt;mega&amp;lt;/code&amp;gt; with the following ssh command:&lt;br /&gt;
 ssh  -L 1718:&#039;&#039;&#039;clicense1&#039;&#039;&#039;:1718  -L 1719:&#039;&#039;&#039;clicense1&#039;&#039;&#039;:1719  mega.cnm.anl.gov&lt;br /&gt;
# Leave the command running between invocations of COMSOL.&lt;br /&gt;
&lt;br /&gt;
=== Run COMSOL ===&lt;br /&gt;
# Ensure your connection to &amp;quot;mega&amp;quot; is still running. If not, restart it.&lt;br /&gt;
# Start the COMSOL application.&lt;br /&gt;
#* If you get an error that the number of licenses is &amp;quot;exhausted&amp;quot;, that is confirmation that you correctly reached the license server, though other users are using licenses.&lt;br /&gt;
#* 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:&lt;br /&gt;
 ssh  -L 1718:clicense&#039;&#039;&#039;2&#039;&#039;&#039;:1718  -L 1719:clicense&#039;&#039;&#039;2&#039;&#039;&#039;:1719  mega.cnm.anl.gov&lt;br /&gt;
&lt;br /&gt;
== License Troubleshooting ==&lt;br /&gt;
The following are typical error messages.&lt;br /&gt;
=== Could not obtain license for COMSOL Multiphysics GUI ===&lt;br /&gt;
* Error details:&lt;br /&gt;
 License error: -4.&lt;br /&gt;
 &#039;&#039;&#039;Licensed number of users already reached.&#039;&#039;&#039;&lt;br /&gt;
 Feature:       COMSOLGUI&lt;br /&gt;
 License path:  /Users/stern/Applications/COMSOL52a/license/license.dat:&lt;br /&gt;
 FlexNet Licensing error:-4,132&lt;br /&gt;
* Reason: The connection to the license server succeeded, but the license token(s) you requested are in use.&lt;br /&gt;
* Solution: Wait a bit, or [http://carbonmgmt/ganglia/lic.php identify who&#039;s using COMSOL] and politely ask the user when they might be finished with their work.&lt;br /&gt;
&lt;br /&gt;
=== License server machine is down or not responding ===&lt;br /&gt;
* Error details:&lt;br /&gt;
  License error: -96.&lt;br /&gt;
  See the system administrator about starting the license server system, or&lt;br /&gt;
  make sure you&#039;re referring to the right host (see LM_LICENSE_FILE).&lt;br /&gt;
 Feature:       SERIAL&lt;br /&gt;
 Hostname:      clicense3&lt;br /&gt;
 License path:  /Users/stern/Applications/COMSOL52a/license/license.dat:&lt;br /&gt;
 FlexNet Licensing error:-96,7&lt;br /&gt;
* Reason: The license servers cannot be reached at all. The &amp;lt;code&amp;gt;ping&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;host&amp;lt;/code&amp;gt; tests mentioned above fail.&lt;br /&gt;
* Solution: Review the client license file and DNS lookup domains.&lt;br /&gt;
&lt;br /&gt;
=== License file does not support this version ===&lt;br /&gt;
* Error details:&lt;br /&gt;
  Feature: SERIAL&lt;br /&gt;
 &#039;&#039;&#039;Application version &amp;gt; License version: 5.21 &amp;gt; 3.5&#039;&#039;&#039;&lt;br /&gt;
 License path: /Users/stern/Applications/COMSOL52a/license/license.dat:&lt;br /&gt;
 FlexNet Licensing error:-21,126&lt;br /&gt;
* 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&#039;re connected to.&lt;br /&gt;
* Solution: When using SSH, try &amp;lt;code&amp;gt;clicense2&amp;lt;/code&amp;gt; instead of  &amp;lt;code&amp;gt;clicense1&amp;lt;/code&amp;gt;, or vice versa. Revisit your &amp;lt;code&amp;gt;~/.ssh/config&amp;lt;/code&amp;gt; file or use the alternate command line as shown in the SSH section above.&lt;br /&gt;
&lt;br /&gt;
== Multiple CPU cores ==&lt;br /&gt;
Ways to start multi-core (from http://www.comsol.com/support/knowledgebase/1096/)&lt;br /&gt;
 comsol -np 8&lt;br /&gt;
&lt;br /&gt;
 export COMSOL_NUM_THREADS=8    # automatically provided on &#039;&#039;Carbon&#039;&#039;&lt;br /&gt;
 comsol&lt;br /&gt;
* COMSOL does not benefit from hyperthreading (oversubscribing the physical core count).&lt;br /&gt;
&lt;br /&gt;
== Batch jobs ==&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
 comsol -clustersimple batch -inputfile input.mph -outputfile output.mph &lt;br /&gt;
&lt;br /&gt;
 &amp;lt;strike&amp;gt;comsol –nn 8 mpd boot&lt;br /&gt;
 comsol –nn 8 batch –inputfile in.mph&lt;br /&gt;
 comsol mpd allexit&amp;lt;/strike&amp;gt;&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
* http://www.comsol.com/support/knowledgebase/1001/ .&lt;br /&gt;
* [[Media:HPC 2012-05-16 Comsol parallel usage.pdf]] (Modified from http://www.comsol.com/support/knowledgebase/1001/files/4027/cluster_install_linux_42a.pptx – Appendix slide, PBS)&lt;br /&gt;
* &#039;&#039;&#039;Note:&#039;&#039;&#039; MPD is not supported on Carbon (I patched the main comsol script), and no longer necessary at all in Comsol-4.3.&lt;br /&gt;
&lt;br /&gt;
=== Sample Job file ===&lt;br /&gt;
See:&lt;br /&gt;
 $COMSOL_HOME/sample.job&lt;br /&gt;
&lt;br /&gt;
== Important COMSOL Support Articles ==&lt;br /&gt;
* Toplevel suport page: https://www.comsol.com/support&lt;br /&gt;
&lt;br /&gt;
=== KB Articles ===&lt;br /&gt;
* [https://www.comsol.com/support/knowledgebase/1001 Running COMSOL® in parallel on clusters]&lt;br /&gt;
* [https://www.comsol.com/support/knowledgebase/1250 Running parametric sweeps, batch sweeps, and cluster sweeps from the command line]&lt;br /&gt;
* [https://www.comsol.com/support/knowledgebase/1255 Reducing the amount of solution data stored in a model]&lt;br /&gt;
* [https://www.comsol.com/support/knowledgebase/830 Handling large models]&lt;br /&gt;
&lt;br /&gt;
=== Blog-style articles ===&lt;br /&gt;
* [https://www.comsol.com/blogs/the-power-of-the-batch-sweep/ The Power of the Batch Sweep]&lt;br /&gt;
* [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]&lt;/div&gt;</summary>
		<author><name>Stern</name></author>
	</entry>
	<entry>
		<id>https://wiki.anl.gov/wiki_cnm/index.php?title=HPC/Applications/comsol&amp;diff=7489</id>
		<title>HPC/Applications/comsol</title>
		<link rel="alternate" type="text/html" href="https://wiki.anl.gov/wiki_cnm/index.php?title=HPC/Applications/comsol&amp;diff=7489"/>
		<updated>2026-02-26T16:56:17Z</updated>

		<summary type="html">&lt;p&gt;Stern: /* License configuration when outside CNM – requires SSH Tunneling */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
The [http://www.comsol.com/products/multiphysics/ &#039;&#039;&#039;COMSOL Multiphysics&#039;&#039;&#039;] application suite&lt;br /&gt;
is available for Mac, Windows, and Linux.&lt;br /&gt;
&lt;br /&gt;
== Access ==&lt;br /&gt;
[[Image:HPC Comsol licensed modules.png|right|450px|thumb|COMSOL features licensed at CNM as of 2024-10.]]&lt;br /&gt;
=== COMSOL Multiphysics ===&lt;br /&gt;
Access to &#039;&#039;&#039;COMSOL Multiphysics&#039;&#039;&#039;, the main application with both a graphical user interface and batch computing capabilities, will be granted &#039;&#039;&#039;&#039;&#039;upon request&#039;&#039;&#039;&#039;&#039;&amp;amp;thinsp;.&lt;br /&gt;
&lt;br /&gt;
You must be:&lt;br /&gt;
* An &#039;&#039;&#039;&#039;&#039;Argonne employee&#039;&#039;&#039;&#039;&#039;&amp;amp;thinsp; in one of the following roles:&lt;br /&gt;
** &#039;&#039;&#039;&#039;&#039;NST staff member&#039;&#039;&#039;&#039;&#039;&amp;amp;thinsp; (including PostDocs, joint appointments, and students at NST).&lt;br /&gt;
** &#039;&#039;&#039;&#039;&#039;CNM Facility User&#039;&#039;&#039;&#039;&#039;&amp;amp;thinsp; (including &#039;&#039;non-NST Argonne employees&#039;&#039;), with an active proposal that has COMSOL in scope. Please see [[HPC/FAQ#Access_and_proposals]].&lt;br /&gt;
&lt;br /&gt;
The set of available COMSOL modules that we have licensed is shown at right.&lt;br /&gt;
&lt;br /&gt;
* The native desktop version can be installed only on &#039;&#039;Argonne-owned&#039;&#039; computers (laptop or desktop). Please contact [mailto:help@anl.gov?Subject=COMSOL%20license%20access%20request CNM support]. Make sure to review [http://www.comsol.com/support/updates/ Product Updates].&lt;br /&gt;
* To run COMSOL on our HPC system &#039;&#039;Carbon&#039;&#039;, as GUI or as batch computing jobs, your proposal must have &#039;&#039;Carbon&#039;&#039; access in scope.&lt;br /&gt;
&lt;br /&gt;
=== COMSOL Server ===&lt;br /&gt;
&#039;&#039;CNM Facility Users&#039;&#039; who are not Argonne employees are not eligible to access&lt;br /&gt;
the full &#039;&#039;&#039;COMSOL Multiphysics&#039;&#039;&#039; product, in compliance with its licensing terms and conditions.&lt;br /&gt;
However, the [https://www.comsol.com/comsol-server &#039;&#039;&#039;COMSOL Server&#039;&#039;&#039;] product offers an alternative&lt;br /&gt;
albeit more narrow means of access.&lt;br /&gt;
&lt;br /&gt;
All users, including &#039;&#039;&#039;&#039;&#039;non-Argonne users&#039;&#039;&#039;&#039;&#039; may be able to run, over a web interface in their browser,&lt;br /&gt;
pre-parameterized &amp;quot;fixed-model&amp;quot; simulations that were made with the &#039;&#039;&#039;COMSOL Application Builder&#039;&#039;&#039; (requires Windows).&lt;br /&gt;
&lt;br /&gt;
To inquire about using COMSOL server applications,&lt;br /&gt;
please contact us.&lt;br /&gt;
&amp;lt;!-- [mailto:cnm_useroffice@anl.gov?Subject=COMSOL%20server%20usage Support]. --&amp;gt;&lt;br /&gt;
We will review possible purchase paths for COMSOL Server, and the &#039;&#039;considerable effort&#039;&#039; likely required by users and the CNM to develop and deploy a COMSOL application.&lt;br /&gt;
&lt;br /&gt;
== Support ==&lt;br /&gt;
* For questions on how to run or start COMSOL:&lt;br /&gt;
*: Submit an [[HPC/Support | &#039;&#039;&#039;IT support request&#039;&#039;&#039;]]&lt;br /&gt;
* For questions related to most COMSOL data or scripts, contact COMSOL support at:&lt;br /&gt;
*: [mailto:support@comsol.com &#039;&#039;&#039;support&#039;&#039;&#039;@comsol.com]&lt;br /&gt;
* &#039;&#039;&#039;Exception:&#039;&#039;&#039; If your support question might contain data that is subject to &#039;&#039;&#039;US Export Control&#039;&#039;&#039; regulations, contact instead:&lt;br /&gt;
*: [mailto:us-export-control@us.comsol.com &#039;&#039;&#039;us-export-control&#039;&#039;&#039;@&#039;&#039;&#039;us&#039;&#039;&#039;.comsol.com]&lt;br /&gt;
&lt;br /&gt;
== The modes to run COMSOL ==&lt;br /&gt;
There are several ways of running COMSOL.&lt;br /&gt;
&lt;br /&gt;
=== Running the desktop application ===&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
# Run on Carbon, display on your desktop using the [http://en.wikipedia.org/wiki/X_Window_System X Window system (X11)].&lt;br /&gt;
#* Requires an &#039;&#039;X11 Server&#039;&#039; application running on your client machine, and SSH X11 forwarding.&lt;br /&gt;
#* The X11 protocol can be slow over LAN.&lt;br /&gt;
# Run on Carbon within a [[HPC/Network Access/Virtual Desktop | virtual desktop environment (VNC)]].&lt;br /&gt;
#* Requires a VNC client on your machine.&lt;br /&gt;
#* It can be confusing where VNC and the app runs.&lt;br /&gt;
#* The virtual desktop presents a (deliberatly) sparse windowing environment – Copy&amp;amp;Paste can be difficult to use.&lt;br /&gt;
# Run on your Argonne-provided computer, checking out Carbon&#039;s license remotely.&lt;br /&gt;
#* Requires a full installation of COMSOL on your desktoo or laptop computer.&lt;br /&gt;
#* 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.&lt;br /&gt;
&lt;br /&gt;
=== Running a batch calculation ===&lt;br /&gt;
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.&lt;br /&gt;
See the [[#Batch jobs|section below]].&lt;br /&gt;
&lt;br /&gt;
== Use with X11 ==&lt;br /&gt;
For casual use, and with [[HPC/Network Access/SSH Tunnel Setup on Linux and MacOS | X11 tunneling to Carbon]] set up, simply add to your &amp;lt;code&amp;gt;~/.bashrc&amp;lt;/code&amp;gt; file on Carbon:&lt;br /&gt;
 module load comsol&lt;br /&gt;
&lt;br /&gt;
Then, from the command line on a Carbon login node, start the COMSOL GUI:&lt;br /&gt;
 comsol &amp;amp;&lt;br /&gt;
&lt;br /&gt;
License configuration is automatic on Carbon.&lt;br /&gt;
&lt;br /&gt;
Comsol will use a number of cores to run calculations multithreaded by default. (On Carbon, COMSOL_NUM_THREADS is set.)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Quit the application&#039;&#039;&#039; as soon as you are done. Only one user can use Comsol at a time.&lt;br /&gt;
&lt;br /&gt;
== Use with VNC ==&lt;br /&gt;
See general  [[HPC/Network Access/Virtual Desktop | instructions on using VNC]], and the COMSOL example therein.&lt;br /&gt;
&lt;br /&gt;
== Native desktop version ==&lt;br /&gt;
&lt;br /&gt;
To get the fastest response from the COMSOL GUI, run a native COMSOL version on your desktop machine or laptop, called &#039;&#039;client machine&#039;&#039; below.&lt;br /&gt;
&lt;br /&gt;
Enter license details either in the COMSOL Setup configuration dialog.&lt;br /&gt;
&lt;br /&gt;
== Native desktop version — License configuration ==&lt;br /&gt;
A client&#039;s COMSOL license needs to be configured depending on how the client reaches CNM network resources. Follow the appropriate section:&lt;br /&gt;
&lt;br /&gt;
* [[#License configuration when inside CNM or on CNM VPN|License configuration when &#039;&#039;&#039;inside CNM&#039;&#039;&#039; or on &#039;&#039;&#039;CNM VPN&#039;&#039;&#039;]]&lt;br /&gt;
: Requires that the user&#039;s machine is logically within the network of CNM/NST, either by a wired/auth WiFi connection in the building or by VPN under a CNM/NST profile.&lt;br /&gt;
* [[#License configuration when outside CNM – requires SSH Tunneling|License configuration when &#039;&#039;&#039;outside CNM&#039;&#039;&#039; – requires SSH Tunneling]]&lt;br /&gt;
: &#039;&#039;Non-NST staff&#039;&#039; usually have a VPN profile that places the machine logically [[#License configuration when outside CNM – requires SSH Tunneling|outside of NST&#039;s network.]]&lt;br /&gt;
&lt;br /&gt;
== License configuration when inside CNM or on CNM VPN ==&lt;br /&gt;
=== &amp;lt;span style=&amp;quot;color:#A00;&amp;quot;&amp;gt;Ensure correct DNS search domains&amp;lt;/span&amp;gt; ===&lt;br /&gt;
* Inspect the client machine&#039;s network configuration.&lt;br /&gt;
* Ensure that &#039;&#039;&#039;two&#039;&#039;&#039; entries are listed as DNS Search Domains for the current network profile:&lt;br /&gt;
 nst.anl.gov&lt;br /&gt;
 cnm.anl.gov&lt;br /&gt;
: (The order of entries does not matter for the purposes considered here.)&lt;br /&gt;
* If the client machine is &#039;&#039;wired to CNM networks&#039;&#039;, the domains are normally provided correctly by DHCP.&lt;br /&gt;
* If the client machine is &#039;&#039;connected over VPN&#039;&#039;, you may need edit the respective network profile.&lt;br /&gt;
:* 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 &amp;quot;Advanced…&amp;quot;. It appears that those changes are being saved and will be activated automatically the next time that this VPN session gets started.&lt;br /&gt;
: [[Image:VNC_add_cnm_to_DNS_1.png|400px]] [[Image:VNC_add_cnm_to_DNS_2.png|400px]]&lt;br /&gt;
:* On Windows or Linux machines, take &#039;&#039;analogous&#039;&#039; steps, using the platform&#039;s own configuration tools.&lt;br /&gt;
&lt;br /&gt;
* Exclude license manager components from client desktop installation. (Those are all handled server-side.)&lt;br /&gt;
&lt;br /&gt;
=== License format ===&lt;br /&gt;
* Floating Network License (FNL), &amp;quot;Three-server redundancy&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== License servers ===&lt;br /&gt;
* On client machines, while running the COMSOL installer or license configuration, specify license servers and ports as follows:&lt;br /&gt;
 1718    clicense1&lt;br /&gt;
 1718    clicense2&lt;br /&gt;
 1718    clicense3&lt;br /&gt;
: &#039;&#039;&#039;Note:&#039;&#039;&#039; Use &#039;&#039;short host names only&#039;&#039;. (Technical Reason: The license must be usable both on Carbon&#039;s internal network as well as on divisional networks).&lt;br /&gt;
 1718    clicense1&amp;lt;strike&amp;gt;.cnm.anl.gov&amp;lt;/strike&amp;gt;&lt;br /&gt;
 1718    clicense2&amp;lt;strike&amp;gt;.cnm.anl.gov&amp;lt;/strike&amp;gt;&lt;br /&gt;
 1718    clicense3&amp;lt;strike&amp;gt;.cnm.anl.gov&amp;lt;/strike&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Advanced:&#039;&#039;&#039; A client machine&#039;s COMSOL license file &amp;lt;code&amp;gt;&amp;amp;lt;COMSOLDIR&amp;amp;gt;/Multiphysics/license/license.dat&amp;lt;/code&amp;gt; should look as follows:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;make&amp;quot;&amp;gt;&lt;br /&gt;
SERVER clicense1 ANY 1718&lt;br /&gt;
SERVER clicense2 ANY 1718&lt;br /&gt;
SERVER clicense3 ANY 1718&lt;br /&gt;
USE_SERVER&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;amp;lt;COMSOLDIR&amp;amp;gt;&amp;lt;/code&amp;gt; is located by default at:&lt;br /&gt;
* &#039;&#039;&#039;Windows&#039;&#039;&#039;: C:\Program files\COMSOL\COMSOL&#039;&#039;nn&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Linux&#039;&#039;&#039;: /usr/local/comsol&#039;&#039;nn&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Mac&#039;&#039;&#039;: /Applications/COMSOL&#039;&#039;nn&#039;&#039;&lt;br /&gt;
(&amp;quot;&#039;&#039;nn&#039;&#039;&amp;quot; is the application&#039;s abbreviated version number.)&lt;br /&gt;
&lt;br /&gt;
=== Network Troubleshooting ===&lt;br /&gt;
When using the license access model descibed here (as opposed to tunneled over SSH), ensure the following:&lt;br /&gt;
* Verify that short host names can be resolved to IP addresses. Either one of the following commands should produce sensible output:&lt;br /&gt;
 host clicense1&lt;br /&gt;
: or:&lt;br /&gt;
 ping -c 3 clicense1&lt;br /&gt;
* Verify that &#039;&#039;both license ports on the same server&#039;&#039; can be reached from your client machine:&lt;br /&gt;
 telnet &#039;&#039;&#039;clicense1&#039;&#039;&#039; 1718&lt;br /&gt;
 telnet &#039;&#039;&#039;clicense1&#039;&#039;&#039; 1719&lt;br /&gt;
: or:&lt;br /&gt;
 telnet &#039;&#039;&#039;clicense2&#039;&#039;&#039; 1718&lt;br /&gt;
 telnet &#039;&#039;&#039;clicense2&#039;&#039;&#039; 1719&lt;br /&gt;
: A &#039;&#039;successful&#039;&#039; connection looks like:&lt;br /&gt;
 Trying 146.139.x.y...&lt;br /&gt;
 Connected to clicense1.cnm.anl.gov.&lt;br /&gt;
 Escape character is &#039;^]&#039;.&lt;br /&gt;
:: Do not enter any data. Instead,  close each connection by hitting &amp;lt;code&amp;gt;Ctrl&amp;lt;/code&amp;gt;&amp;lt;code&amp;gt;]&amp;lt;/code&amp;gt; (closing square bracket), followed by &amp;lt;code&amp;gt;Ctrl&amp;lt;/code&amp;gt;&amp;lt;code&amp;gt;D&amp;lt;/code&amp;gt;.&lt;br /&gt;
: A &#039;&#039;failed&#039;&#039; connection gives one of these errors:&lt;br /&gt;
 telnet: connect to address 146.139.x.y: Operation timed out&lt;br /&gt;
: or:&lt;br /&gt;
 telnet: connect to address 146.139.x.y: Connection refused&lt;br /&gt;
:: In these cases, ask that your IP firewall configuration be reviewed and changed.&lt;br /&gt;
&lt;br /&gt;
== License configuration when outside CNM – requires SSH Tunneling ==&lt;br /&gt;
If you&#039;re comfortable with ssh and tunneling, set up client licensing as follows:&lt;br /&gt;
&lt;br /&gt;
=== Configure COMSOL ===&lt;br /&gt;
The following needs to be done just once, typically during COMSOL installation:&lt;br /&gt;
&lt;br /&gt;
In the COMSOL Installer, or in COMSOL Preferences, enter:&lt;br /&gt;
* &#039;&#039;&#039;License format:&#039;&#039;&#039; Floating Network License (FNL), &amp;quot;Port number and Hostname&amp;quot;&lt;br /&gt;
:: &amp;quot;Three-server redundancy&amp;quot; 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.&lt;br /&gt;
* &#039;&#039;&#039;Server:&#039;&#039;&#039; &amp;lt;code&amp;gt;127.0.0.1&amp;lt;/code&amp;gt;&lt;br /&gt;
:: Do not use &amp;quot;localhost&amp;quot;, as COMSOL interprets this incorrectly to mean that your machine &#039;&#039;is&#039;&#039; a license server.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Port:&#039;&#039;&#039; &amp;lt;code&amp;gt;1718&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
Or place a license file with this content:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;make&amp;quot;&amp;gt;&lt;br /&gt;
SERVER 127.0.0.1 ANY 1718&lt;br /&gt;
USE_SERVER&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
//--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Establish connection to CNM license server ===&lt;br /&gt;
This step needs to be done prior to running COMSOL in your desktop session:&lt;br /&gt;
* Connect to &amp;lt;code&amp;gt;mega&amp;lt;/code&amp;gt; with the following ssh command:&lt;br /&gt;
 ssh  -L 1718:&#039;&#039;&#039;clicense1&#039;&#039;&#039;:1718  -L 1719:&#039;&#039;&#039;clicense1&#039;&#039;&#039;:1719  mega.cnm.anl.gov&lt;br /&gt;
* Leave the command running between invocations of COMSOL.&lt;br /&gt;
&lt;br /&gt;
=== Run COMSOL when outside CNM ===&lt;br /&gt;
* Ensure your connection to &amp;quot;mega&amp;quot; is still running. If not, restart it.&lt;br /&gt;
* Start the COMSOL application.&lt;br /&gt;
&lt;br /&gt;
** If you get an error that the number of licenses is &amp;quot;exhausted&amp;quot;, that is confirmation that you correctly reached the license server, though other users are using licenses.&lt;br /&gt;
** 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:&lt;br /&gt;
 ssh  -L 1718:clicense&#039;&#039;&#039;2&#039;&#039;&#039;:1718  -L 1719:clicense&#039;&#039;&#039;2&#039;&#039;&#039;:1719  mega.cnm.anl.gov&lt;br /&gt;
&lt;br /&gt;
== License Troubleshooting ==&lt;br /&gt;
The following are typical error messages.&lt;br /&gt;
=== Could not obtain license for COMSOL Multiphysics GUI ===&lt;br /&gt;
* Error details:&lt;br /&gt;
 License error: -4.&lt;br /&gt;
 &#039;&#039;&#039;Licensed number of users already reached.&#039;&#039;&#039;&lt;br /&gt;
 Feature:       COMSOLGUI&lt;br /&gt;
 License path:  /Users/stern/Applications/COMSOL52a/license/license.dat:&lt;br /&gt;
 FlexNet Licensing error:-4,132&lt;br /&gt;
* Reason: The connection to the license server succeeded, but the license token(s) you requested are in use.&lt;br /&gt;
* Solution: Wait a bit, or [http://carbonmgmt/ganglia/lic.php identify who&#039;s using COMSOL] and politely ask the user when they might be finished with their work.&lt;br /&gt;
&lt;br /&gt;
=== License server machine is down or not responding ===&lt;br /&gt;
* Error details:&lt;br /&gt;
  License error: -96.&lt;br /&gt;
  See the system administrator about starting the license server system, or&lt;br /&gt;
  make sure you&#039;re referring to the right host (see LM_LICENSE_FILE).&lt;br /&gt;
 Feature:       SERIAL&lt;br /&gt;
 Hostname:      clicense3&lt;br /&gt;
 License path:  /Users/stern/Applications/COMSOL52a/license/license.dat:&lt;br /&gt;
 FlexNet Licensing error:-96,7&lt;br /&gt;
* Reason: The license servers cannot be reached at all. The &amp;lt;code&amp;gt;ping&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;host&amp;lt;/code&amp;gt; tests mentioned above fail.&lt;br /&gt;
* Solution: Review the client license file and DNS lookup domains.&lt;br /&gt;
&lt;br /&gt;
=== License file does not support this version ===&lt;br /&gt;
* Error details:&lt;br /&gt;
  Feature: SERIAL&lt;br /&gt;
 &#039;&#039;&#039;Application version &amp;gt; License version: 5.21 &amp;gt; 3.5&#039;&#039;&#039;&lt;br /&gt;
 License path: /Users/stern/Applications/COMSOL52a/license/license.dat:&lt;br /&gt;
 FlexNet Licensing error:-21,126&lt;br /&gt;
* 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&#039;re connected to.&lt;br /&gt;
* Solution: When using SSH, try &amp;lt;code&amp;gt;clicense2&amp;lt;/code&amp;gt; instead of  &amp;lt;code&amp;gt;clicense1&amp;lt;/code&amp;gt;, or vice versa. Revisit your &amp;lt;code&amp;gt;~/.ssh/config&amp;lt;/code&amp;gt; file or use the alternate command line as shown in the SSH section above.&lt;br /&gt;
&lt;br /&gt;
== Multiple CPU cores ==&lt;br /&gt;
Ways to start multi-core (from http://www.comsol.com/support/knowledgebase/1096/)&lt;br /&gt;
 comsol -np 8&lt;br /&gt;
&lt;br /&gt;
 export COMSOL_NUM_THREADS=8    # automatically provided on &#039;&#039;Carbon&#039;&#039;&lt;br /&gt;
 comsol&lt;br /&gt;
* COMSOL does not benefit from hyperthreading (oversubscribing the physical core count).&lt;br /&gt;
&lt;br /&gt;
== Batch jobs ==&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
 comsol -clustersimple batch -inputfile input.mph -outputfile output.mph &lt;br /&gt;
&lt;br /&gt;
 &amp;lt;strike&amp;gt;comsol –nn 8 mpd boot&lt;br /&gt;
 comsol –nn 8 batch –inputfile in.mph&lt;br /&gt;
 comsol mpd allexit&amp;lt;/strike&amp;gt;&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
* http://www.comsol.com/support/knowledgebase/1001/ .&lt;br /&gt;
* [[Media:HPC 2012-05-16 Comsol parallel usage.pdf]] (Modified from http://www.comsol.com/support/knowledgebase/1001/files/4027/cluster_install_linux_42a.pptx – Appendix slide, PBS)&lt;br /&gt;
* &#039;&#039;&#039;Note:&#039;&#039;&#039; MPD is not supported on Carbon (I patched the main comsol script), and no longer necessary at all in Comsol-4.3.&lt;br /&gt;
&lt;br /&gt;
=== Sample Job file ===&lt;br /&gt;
See:&lt;br /&gt;
 $COMSOL_HOME/sample.job&lt;br /&gt;
&lt;br /&gt;
== Important COMSOL Support Articles ==&lt;br /&gt;
* Toplevel suport page: https://www.comsol.com/support&lt;br /&gt;
&lt;br /&gt;
=== KB Articles ===&lt;br /&gt;
* [https://www.comsol.com/support/knowledgebase/1001 Running COMSOL® in parallel on clusters]&lt;br /&gt;
* [https://www.comsol.com/support/knowledgebase/1250 Running parametric sweeps, batch sweeps, and cluster sweeps from the command line]&lt;br /&gt;
* [https://www.comsol.com/support/knowledgebase/1255 Reducing the amount of solution data stored in a model]&lt;br /&gt;
* [https://www.comsol.com/support/knowledgebase/830 Handling large models]&lt;br /&gt;
&lt;br /&gt;
=== Blog-style articles ===&lt;br /&gt;
* [https://www.comsol.com/blogs/the-power-of-the-batch-sweep/ The Power of the Batch Sweep]&lt;br /&gt;
* [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]&lt;/div&gt;</summary>
		<author><name>Stern</name></author>
	</entry>
	<entry>
		<id>https://wiki.anl.gov/wiki_cnm/index.php?title=HPC/Applications/comsol&amp;diff=7488</id>
		<title>HPC/Applications/comsol</title>
		<link rel="alternate" type="text/html" href="https://wiki.anl.gov/wiki_cnm/index.php?title=HPC/Applications/comsol&amp;diff=7488"/>
		<updated>2026-02-26T16:54:55Z</updated>

		<summary type="html">&lt;p&gt;Stern: /* License configuration when inside CNM or on CNM VPN */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
The [http://www.comsol.com/products/multiphysics/ &#039;&#039;&#039;COMSOL Multiphysics&#039;&#039;&#039;] application suite&lt;br /&gt;
is available for Mac, Windows, and Linux.&lt;br /&gt;
&lt;br /&gt;
== Access ==&lt;br /&gt;
[[Image:HPC Comsol licensed modules.png|right|450px|thumb|COMSOL features licensed at CNM as of 2024-10.]]&lt;br /&gt;
=== COMSOL Multiphysics ===&lt;br /&gt;
Access to &#039;&#039;&#039;COMSOL Multiphysics&#039;&#039;&#039;, the main application with both a graphical user interface and batch computing capabilities, will be granted &#039;&#039;&#039;&#039;&#039;upon request&#039;&#039;&#039;&#039;&#039;&amp;amp;thinsp;.&lt;br /&gt;
&lt;br /&gt;
You must be:&lt;br /&gt;
* An &#039;&#039;&#039;&#039;&#039;Argonne employee&#039;&#039;&#039;&#039;&#039;&amp;amp;thinsp; in one of the following roles:&lt;br /&gt;
** &#039;&#039;&#039;&#039;&#039;NST staff member&#039;&#039;&#039;&#039;&#039;&amp;amp;thinsp; (including PostDocs, joint appointments, and students at NST).&lt;br /&gt;
** &#039;&#039;&#039;&#039;&#039;CNM Facility User&#039;&#039;&#039;&#039;&#039;&amp;amp;thinsp; (including &#039;&#039;non-NST Argonne employees&#039;&#039;), with an active proposal that has COMSOL in scope. Please see [[HPC/FAQ#Access_and_proposals]].&lt;br /&gt;
&lt;br /&gt;
The set of available COMSOL modules that we have licensed is shown at right.&lt;br /&gt;
&lt;br /&gt;
* The native desktop version can be installed only on &#039;&#039;Argonne-owned&#039;&#039; computers (laptop or desktop). Please contact [mailto:help@anl.gov?Subject=COMSOL%20license%20access%20request CNM support]. Make sure to review [http://www.comsol.com/support/updates/ Product Updates].&lt;br /&gt;
* To run COMSOL on our HPC system &#039;&#039;Carbon&#039;&#039;, as GUI or as batch computing jobs, your proposal must have &#039;&#039;Carbon&#039;&#039; access in scope.&lt;br /&gt;
&lt;br /&gt;
=== COMSOL Server ===&lt;br /&gt;
&#039;&#039;CNM Facility Users&#039;&#039; who are not Argonne employees are not eligible to access&lt;br /&gt;
the full &#039;&#039;&#039;COMSOL Multiphysics&#039;&#039;&#039; product, in compliance with its licensing terms and conditions.&lt;br /&gt;
However, the [https://www.comsol.com/comsol-server &#039;&#039;&#039;COMSOL Server&#039;&#039;&#039;] product offers an alternative&lt;br /&gt;
albeit more narrow means of access.&lt;br /&gt;
&lt;br /&gt;
All users, including &#039;&#039;&#039;&#039;&#039;non-Argonne users&#039;&#039;&#039;&#039;&#039; may be able to run, over a web interface in their browser,&lt;br /&gt;
pre-parameterized &amp;quot;fixed-model&amp;quot; simulations that were made with the &#039;&#039;&#039;COMSOL Application Builder&#039;&#039;&#039; (requires Windows).&lt;br /&gt;
&lt;br /&gt;
To inquire about using COMSOL server applications,&lt;br /&gt;
please contact us.&lt;br /&gt;
&amp;lt;!-- [mailto:cnm_useroffice@anl.gov?Subject=COMSOL%20server%20usage Support]. --&amp;gt;&lt;br /&gt;
We will review possible purchase paths for COMSOL Server, and the &#039;&#039;considerable effort&#039;&#039; likely required by users and the CNM to develop and deploy a COMSOL application.&lt;br /&gt;
&lt;br /&gt;
== Support ==&lt;br /&gt;
* For questions on how to run or start COMSOL:&lt;br /&gt;
*: Submit an [[HPC/Support | &#039;&#039;&#039;IT support request&#039;&#039;&#039;]]&lt;br /&gt;
* For questions related to most COMSOL data or scripts, contact COMSOL support at:&lt;br /&gt;
*: [mailto:support@comsol.com &#039;&#039;&#039;support&#039;&#039;&#039;@comsol.com]&lt;br /&gt;
* &#039;&#039;&#039;Exception:&#039;&#039;&#039; If your support question might contain data that is subject to &#039;&#039;&#039;US Export Control&#039;&#039;&#039; regulations, contact instead:&lt;br /&gt;
*: [mailto:us-export-control@us.comsol.com &#039;&#039;&#039;us-export-control&#039;&#039;&#039;@&#039;&#039;&#039;us&#039;&#039;&#039;.comsol.com]&lt;br /&gt;
&lt;br /&gt;
== The modes to run COMSOL ==&lt;br /&gt;
There are several ways of running COMSOL.&lt;br /&gt;
&lt;br /&gt;
=== Running the desktop application ===&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
# Run on Carbon, display on your desktop using the [http://en.wikipedia.org/wiki/X_Window_System X Window system (X11)].&lt;br /&gt;
#* Requires an &#039;&#039;X11 Server&#039;&#039; application running on your client machine, and SSH X11 forwarding.&lt;br /&gt;
#* The X11 protocol can be slow over LAN.&lt;br /&gt;
# Run on Carbon within a [[HPC/Network Access/Virtual Desktop | virtual desktop environment (VNC)]].&lt;br /&gt;
#* Requires a VNC client on your machine.&lt;br /&gt;
#* It can be confusing where VNC and the app runs.&lt;br /&gt;
#* The virtual desktop presents a (deliberatly) sparse windowing environment – Copy&amp;amp;Paste can be difficult to use.&lt;br /&gt;
# Run on your Argonne-provided computer, checking out Carbon&#039;s license remotely.&lt;br /&gt;
#* Requires a full installation of COMSOL on your desktoo or laptop computer.&lt;br /&gt;
#* 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.&lt;br /&gt;
&lt;br /&gt;
=== Running a batch calculation ===&lt;br /&gt;
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.&lt;br /&gt;
See the [[#Batch jobs|section below]].&lt;br /&gt;
&lt;br /&gt;
== Use with X11 ==&lt;br /&gt;
For casual use, and with [[HPC/Network Access/SSH Tunnel Setup on Linux and MacOS | X11 tunneling to Carbon]] set up, simply add to your &amp;lt;code&amp;gt;~/.bashrc&amp;lt;/code&amp;gt; file on Carbon:&lt;br /&gt;
 module load comsol&lt;br /&gt;
&lt;br /&gt;
Then, from the command line on a Carbon login node, start the COMSOL GUI:&lt;br /&gt;
 comsol &amp;amp;&lt;br /&gt;
&lt;br /&gt;
License configuration is automatic on Carbon.&lt;br /&gt;
&lt;br /&gt;
Comsol will use a number of cores to run calculations multithreaded by default. (On Carbon, COMSOL_NUM_THREADS is set.)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Quit the application&#039;&#039;&#039; as soon as you are done. Only one user can use Comsol at a time.&lt;br /&gt;
&lt;br /&gt;
== Use with VNC ==&lt;br /&gt;
See general  [[HPC/Network Access/Virtual Desktop | instructions on using VNC]], and the COMSOL example therein.&lt;br /&gt;
&lt;br /&gt;
== Native desktop version ==&lt;br /&gt;
&lt;br /&gt;
To get the fastest response from the COMSOL GUI, run a native COMSOL version on your desktop machine or laptop, called &#039;&#039;client machine&#039;&#039; below.&lt;br /&gt;
&lt;br /&gt;
Enter license details either in the COMSOL Setup configuration dialog.&lt;br /&gt;
&lt;br /&gt;
== Native desktop version — License configuration ==&lt;br /&gt;
A client&#039;s COMSOL license needs to be configured depending on how the client reaches CNM network resources. Follow the appropriate section:&lt;br /&gt;
&lt;br /&gt;
* [[#License configuration when inside CNM or on CNM VPN|License configuration when &#039;&#039;&#039;inside CNM&#039;&#039;&#039; or on &#039;&#039;&#039;CNM VPN&#039;&#039;&#039;]]&lt;br /&gt;
: Requires that the user&#039;s machine is logically within the network of CNM/NST, either by a wired/auth WiFi connection in the building or by VPN under a CNM/NST profile.&lt;br /&gt;
* [[#License configuration when outside CNM – requires SSH Tunneling|License configuration when &#039;&#039;&#039;outside CNM&#039;&#039;&#039; – requires SSH Tunneling]]&lt;br /&gt;
: &#039;&#039;Non-NST staff&#039;&#039; usually have a VPN profile that places the machine logically [[#License configuration when outside CNM – requires SSH Tunneling|outside of NST&#039;s network.]]&lt;br /&gt;
&lt;br /&gt;
== License configuration when inside CNM or on CNM VPN ==&lt;br /&gt;
=== &amp;lt;span style=&amp;quot;color:#A00;&amp;quot;&amp;gt;Ensure correct DNS search domains&amp;lt;/span&amp;gt; ===&lt;br /&gt;
* Inspect the client machine&#039;s network configuration.&lt;br /&gt;
* Ensure that &#039;&#039;&#039;two&#039;&#039;&#039; entries are listed as DNS Search Domains for the current network profile:&lt;br /&gt;
 nst.anl.gov&lt;br /&gt;
 cnm.anl.gov&lt;br /&gt;
: (The order of entries does not matter for the purposes considered here.)&lt;br /&gt;
* If the client machine is &#039;&#039;wired to CNM networks&#039;&#039;, the domains are normally provided correctly by DHCP.&lt;br /&gt;
* If the client machine is &#039;&#039;connected over VPN&#039;&#039;, you may need edit the respective network profile.&lt;br /&gt;
:* 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 &amp;quot;Advanced…&amp;quot;. It appears that those changes are being saved and will be activated automatically the next time that this VPN session gets started.&lt;br /&gt;
: [[Image:VNC_add_cnm_to_DNS_1.png|400px]] [[Image:VNC_add_cnm_to_DNS_2.png|400px]]&lt;br /&gt;
:* On Windows or Linux machines, take &#039;&#039;analogous&#039;&#039; steps, using the platform&#039;s own configuration tools.&lt;br /&gt;
&lt;br /&gt;
* Exclude license manager components from client desktop installation. (Those are all handled server-side.)&lt;br /&gt;
&lt;br /&gt;
=== License format ===&lt;br /&gt;
* Floating Network License (FNL), &amp;quot;Three-server redundancy&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== License servers ===&lt;br /&gt;
* On client machines, while running the COMSOL installer or license configuration, specify license servers and ports as follows:&lt;br /&gt;
 1718    clicense1&lt;br /&gt;
 1718    clicense2&lt;br /&gt;
 1718    clicense3&lt;br /&gt;
: &#039;&#039;&#039;Note:&#039;&#039;&#039; Use &#039;&#039;short host names only&#039;&#039;. (Technical Reason: The license must be usable both on Carbon&#039;s internal network as well as on divisional networks).&lt;br /&gt;
 1718    clicense1&amp;lt;strike&amp;gt;.cnm.anl.gov&amp;lt;/strike&amp;gt;&lt;br /&gt;
 1718    clicense2&amp;lt;strike&amp;gt;.cnm.anl.gov&amp;lt;/strike&amp;gt;&lt;br /&gt;
 1718    clicense3&amp;lt;strike&amp;gt;.cnm.anl.gov&amp;lt;/strike&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Advanced:&#039;&#039;&#039; A client machine&#039;s COMSOL license file &amp;lt;code&amp;gt;&amp;amp;lt;COMSOLDIR&amp;amp;gt;/Multiphysics/license/license.dat&amp;lt;/code&amp;gt; should look as follows:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;make&amp;quot;&amp;gt;&lt;br /&gt;
SERVER clicense1 ANY 1718&lt;br /&gt;
SERVER clicense2 ANY 1718&lt;br /&gt;
SERVER clicense3 ANY 1718&lt;br /&gt;
USE_SERVER&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;amp;lt;COMSOLDIR&amp;amp;gt;&amp;lt;/code&amp;gt; is located by default at:&lt;br /&gt;
* &#039;&#039;&#039;Windows&#039;&#039;&#039;: C:\Program files\COMSOL\COMSOL&#039;&#039;nn&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Linux&#039;&#039;&#039;: /usr/local/comsol&#039;&#039;nn&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Mac&#039;&#039;&#039;: /Applications/COMSOL&#039;&#039;nn&#039;&#039;&lt;br /&gt;
(&amp;quot;&#039;&#039;nn&#039;&#039;&amp;quot; is the application&#039;s abbreviated version number.)&lt;br /&gt;
&lt;br /&gt;
=== Network Troubleshooting ===&lt;br /&gt;
When using the license access model descibed here (as opposed to tunneled over SSH), ensure the following:&lt;br /&gt;
* Verify that short host names can be resolved to IP addresses. Either one of the following commands should produce sensible output:&lt;br /&gt;
 host clicense1&lt;br /&gt;
: or:&lt;br /&gt;
 ping -c 3 clicense1&lt;br /&gt;
* Verify that &#039;&#039;both license ports on the same server&#039;&#039; can be reached from your client machine:&lt;br /&gt;
 telnet &#039;&#039;&#039;clicense1&#039;&#039;&#039; 1718&lt;br /&gt;
 telnet &#039;&#039;&#039;clicense1&#039;&#039;&#039; 1719&lt;br /&gt;
: or:&lt;br /&gt;
 telnet &#039;&#039;&#039;clicense2&#039;&#039;&#039; 1718&lt;br /&gt;
 telnet &#039;&#039;&#039;clicense2&#039;&#039;&#039; 1719&lt;br /&gt;
: A &#039;&#039;successful&#039;&#039; connection looks like:&lt;br /&gt;
 Trying 146.139.x.y...&lt;br /&gt;
 Connected to clicense1.cnm.anl.gov.&lt;br /&gt;
 Escape character is &#039;^]&#039;.&lt;br /&gt;
:: Do not enter any data. Instead,  close each connection by hitting &amp;lt;code&amp;gt;Ctrl&amp;lt;/code&amp;gt;&amp;lt;code&amp;gt;]&amp;lt;/code&amp;gt; (closing square bracket), followed by &amp;lt;code&amp;gt;Ctrl&amp;lt;/code&amp;gt;&amp;lt;code&amp;gt;D&amp;lt;/code&amp;gt;.&lt;br /&gt;
: A &#039;&#039;failed&#039;&#039; connection gives one of these errors:&lt;br /&gt;
 telnet: connect to address 146.139.x.y: Operation timed out&lt;br /&gt;
: or:&lt;br /&gt;
 telnet: connect to address 146.139.x.y: Connection refused&lt;br /&gt;
:: In these cases, ask that your IP firewall configuration be reviewed and changed.&lt;br /&gt;
&lt;br /&gt;
=== License configuration when outside CNM – requires SSH Tunneling ===&lt;br /&gt;
If you&#039;re comfortable with ssh and tunneling, set up client licensing as follows:&lt;br /&gt;
&lt;br /&gt;
==== Configure COMSOL ====&lt;br /&gt;
The following needs to be done just once, typically during COMSOL installation:&lt;br /&gt;
&lt;br /&gt;
In the COMSOL Installer, or in COMSOL Preferences, enter:&lt;br /&gt;
* &#039;&#039;&#039;License format:&#039;&#039;&#039; Floating Network License (FNL), &amp;quot;Port number and Hostname&amp;quot;&lt;br /&gt;
:: &amp;quot;Three-server redundancy&amp;quot; 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.&lt;br /&gt;
* &#039;&#039;&#039;Server:&#039;&#039;&#039; &amp;lt;code&amp;gt;127.0.0.1&amp;lt;/code&amp;gt;&lt;br /&gt;
:: Do not use &amp;quot;localhost&amp;quot;, as COMSOL interprets this incorrectly to mean that your machine &#039;&#039;is&#039;&#039; a license server.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Port:&#039;&#039;&#039; &amp;lt;code&amp;gt;1718&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
Or place a license file with this content:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;make&amp;quot;&amp;gt;&lt;br /&gt;
SERVER 127.0.0.1 ANY 1718&lt;br /&gt;
USE_SERVER&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
//--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Provide server connection ====&lt;br /&gt;
This step needs to be done prior to running COMSOL in your desktop session:&lt;br /&gt;
* Connect to &amp;lt;code&amp;gt;mega&amp;lt;/code&amp;gt; with the following ssh command:&lt;br /&gt;
 ssh  -L 1718:&#039;&#039;&#039;clicense1&#039;&#039;&#039;:1718  -L 1719:&#039;&#039;&#039;clicense1&#039;&#039;&#039;:1719  mega.cnm.anl.gov&lt;br /&gt;
* Leave the command running between invocations of COMSOL.&lt;br /&gt;
&lt;br /&gt;
==== Run COMSOL ====&lt;br /&gt;
* Ensure your connection to &amp;quot;mega&amp;quot; is still running. If not, restart it.&lt;br /&gt;
* Start the COMSOL application.&lt;br /&gt;
&lt;br /&gt;
** If you get an error that the number of licenses is &amp;quot;exhausted&amp;quot;, that is confirmation that you correctly reached the license server, though other users are using licenses.&lt;br /&gt;
** 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:&lt;br /&gt;
 ssh  -L 1718:clicense&#039;&#039;&#039;2&#039;&#039;&#039;:1718  -L 1719:clicense&#039;&#039;&#039;2&#039;&#039;&#039;:1719  mega.cnm.anl.gov&lt;br /&gt;
&lt;br /&gt;
== License Troubleshooting ==&lt;br /&gt;
The following are typical error messages.&lt;br /&gt;
=== Could not obtain license for COMSOL Multiphysics GUI ===&lt;br /&gt;
* Error details:&lt;br /&gt;
 License error: -4.&lt;br /&gt;
 &#039;&#039;&#039;Licensed number of users already reached.&#039;&#039;&#039;&lt;br /&gt;
 Feature:       COMSOLGUI&lt;br /&gt;
 License path:  /Users/stern/Applications/COMSOL52a/license/license.dat:&lt;br /&gt;
 FlexNet Licensing error:-4,132&lt;br /&gt;
* Reason: The connection to the license server succeeded, but the license token(s) you requested are in use.&lt;br /&gt;
* Solution: Wait a bit, or [http://carbonmgmt/ganglia/lic.php identify who&#039;s using COMSOL] and politely ask the user when they might be finished with their work.&lt;br /&gt;
&lt;br /&gt;
=== License server machine is down or not responding ===&lt;br /&gt;
* Error details:&lt;br /&gt;
  License error: -96.&lt;br /&gt;
  See the system administrator about starting the license server system, or&lt;br /&gt;
  make sure you&#039;re referring to the right host (see LM_LICENSE_FILE).&lt;br /&gt;
 Feature:       SERIAL&lt;br /&gt;
 Hostname:      clicense3&lt;br /&gt;
 License path:  /Users/stern/Applications/COMSOL52a/license/license.dat:&lt;br /&gt;
 FlexNet Licensing error:-96,7&lt;br /&gt;
* Reason: The license servers cannot be reached at all. The &amp;lt;code&amp;gt;ping&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;host&amp;lt;/code&amp;gt; tests mentioned above fail.&lt;br /&gt;
* Solution: Review the client license file and DNS lookup domains.&lt;br /&gt;
&lt;br /&gt;
=== License file does not support this version ===&lt;br /&gt;
* Error details:&lt;br /&gt;
  Feature: SERIAL&lt;br /&gt;
 &#039;&#039;&#039;Application version &amp;gt; License version: 5.21 &amp;gt; 3.5&#039;&#039;&#039;&lt;br /&gt;
 License path: /Users/stern/Applications/COMSOL52a/license/license.dat:&lt;br /&gt;
 FlexNet Licensing error:-21,126&lt;br /&gt;
* 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&#039;re connected to.&lt;br /&gt;
* Solution: When using SSH, try &amp;lt;code&amp;gt;clicense2&amp;lt;/code&amp;gt; instead of  &amp;lt;code&amp;gt;clicense1&amp;lt;/code&amp;gt;, or vice versa. Revisit your &amp;lt;code&amp;gt;~/.ssh/config&amp;lt;/code&amp;gt; file or use the alternate command line as shown in the SSH section above.&lt;br /&gt;
&lt;br /&gt;
== Multiple CPU cores ==&lt;br /&gt;
Ways to start multi-core (from http://www.comsol.com/support/knowledgebase/1096/)&lt;br /&gt;
 comsol -np 8&lt;br /&gt;
&lt;br /&gt;
 export COMSOL_NUM_THREADS=8    # automatically provided on &#039;&#039;Carbon&#039;&#039;&lt;br /&gt;
 comsol&lt;br /&gt;
* COMSOL does not benefit from hyperthreading (oversubscribing the physical core count).&lt;br /&gt;
&lt;br /&gt;
== Batch jobs ==&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
 comsol -clustersimple batch -inputfile input.mph -outputfile output.mph &lt;br /&gt;
&lt;br /&gt;
 &amp;lt;strike&amp;gt;comsol –nn 8 mpd boot&lt;br /&gt;
 comsol –nn 8 batch –inputfile in.mph&lt;br /&gt;
 comsol mpd allexit&amp;lt;/strike&amp;gt;&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
* http://www.comsol.com/support/knowledgebase/1001/ .&lt;br /&gt;
* [[Media:HPC 2012-05-16 Comsol parallel usage.pdf]] (Modified from http://www.comsol.com/support/knowledgebase/1001/files/4027/cluster_install_linux_42a.pptx – Appendix slide, PBS)&lt;br /&gt;
* &#039;&#039;&#039;Note:&#039;&#039;&#039; MPD is not supported on Carbon (I patched the main comsol script), and no longer necessary at all in Comsol-4.3.&lt;br /&gt;
&lt;br /&gt;
=== Sample Job file ===&lt;br /&gt;
See:&lt;br /&gt;
 $COMSOL_HOME/sample.job&lt;br /&gt;
&lt;br /&gt;
== Important COMSOL Support Articles ==&lt;br /&gt;
* Toplevel suport page: https://www.comsol.com/support&lt;br /&gt;
&lt;br /&gt;
=== KB Articles ===&lt;br /&gt;
* [https://www.comsol.com/support/knowledgebase/1001 Running COMSOL® in parallel on clusters]&lt;br /&gt;
* [https://www.comsol.com/support/knowledgebase/1250 Running parametric sweeps, batch sweeps, and cluster sweeps from the command line]&lt;br /&gt;
* [https://www.comsol.com/support/knowledgebase/1255 Reducing the amount of solution data stored in a model]&lt;br /&gt;
* [https://www.comsol.com/support/knowledgebase/830 Handling large models]&lt;br /&gt;
&lt;br /&gt;
=== Blog-style articles ===&lt;br /&gt;
* [https://www.comsol.com/blogs/the-power-of-the-batch-sweep/ The Power of the Batch Sweep]&lt;br /&gt;
* [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]&lt;/div&gt;</summary>
		<author><name>Stern</name></author>
	</entry>
	<entry>
		<id>https://wiki.anl.gov/wiki_cnm/index.php?title=HPC/Submitting_and_Managing_Jobs&amp;diff=7487</id>
		<title>HPC/Submitting and Managing Jobs</title>
		<link rel="alternate" type="text/html" href="https://wiki.anl.gov/wiki_cnm/index.php?title=HPC/Submitting_and_Managing_Jobs&amp;diff=7487"/>
		<updated>2026-02-17T20:45:29Z</updated>

		<summary type="html">&lt;p&gt;Stern: /* Inspecting stuck jobs */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Image:HPC job flow.png|right|400px|thumb|Processing flow of a typical job.]]&lt;br /&gt;
__TOC__&lt;br /&gt;
== Introduction ==&lt;br /&gt;
To accept and run jobs, Carbon uses the [http://en.wikipedia.org/wiki/TORQUE_Resource_Manager Torque Resource Manager],&lt;br /&gt;
which is a variant of [http://en.wikipedia.org/wiki/Portable_Batch_System PBS].&lt;br /&gt;
A separate software component called a [http://en.wikipedia.org/wiki/Job_scheduler &#039;&#039;scheduler&#039;&#039;] chooses the nodes and the start time for jobs according to the job parameters, resource availability, and configuration. Carbon uses the [http://www.adaptivecomputing.com/resources/docs/mwm/6-1-9/help.htm Moab Workload Manager] as scheduler. The resources used by each job (primarily the CPU time) are tracked and managed by the&lt;br /&gt;
[http://www.adaptivecomputing.com/resources/docs/gold/index.php Gold Allocation Manager].&lt;br /&gt;
&lt;br /&gt;
=== Job processing ===&lt;br /&gt;
A job consists of a [[#Job Script|job script]] and applications called therein. The figure at the top shows schematically how a typical job is processed.&lt;br /&gt;
Unless otherwise told, Torque will execute the job script on your behalf on the first node allocated by Moab,&lt;br /&gt;
in your &amp;lt;code&amp;gt;$HOME&amp;lt;/code&amp;gt; directory, and typically using your login shell. It is the &#039;&#039;script&#039;s responsibility&#039;&#039; to:&lt;br /&gt;
* Change to a suitable working directory.&lt;br /&gt;
* Recognize and use the other nodes of the job.&lt;br /&gt;
** This is generally done by directing an [http://en.wikipedia.org/wiki/Message_Passing_Interface MPI] program to start on the nodes listed in the job&#039;s &amp;lt;code&amp;gt;$PBS_NODEFILE&amp;lt;/code&amp;gt;.&lt;br /&gt;
** A job is perfectly free to run more than one program, such as several MPI programs in sequence.&lt;br /&gt;
* Set or propagate environment variables as needed to other nodes.&lt;br /&gt;
&lt;br /&gt;
=== Environment variables ===&lt;br /&gt;
The handling of environment variables across the cores and nodes that a job uses varies with the capabilities and configuration choices of the various MPI implementations.&lt;br /&gt;
&amp;lt;!-- It is recommended not to rely on defaults, but rather to make expectations and requirements explicit. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Variables usually are &#039;&#039;&#039;propagated core-to-core&#039;&#039;&#039; for all processes on the first node.&lt;br /&gt;
* Variables usually are &#039;&#039;&#039;not propagated node-to-node.&#039;&#039;&#039;&lt;br /&gt;
; Consequences:&lt;br /&gt;
* You must [[HPC/Software/Module Setup | &#039;&#039;&#039;configure modules and $PATH&#039;&#039;&#039;]] in your &amp;lt;code&amp;gt;$HOME/.bashrc&amp;lt;/code&amp;gt; file to help mpirun and other mechanisms locate your programs on each compute node. Otherwise mpirun will fail as soon as more than one node is involved, either by not finding the binary itself or some of its required shared libraries, or more insidiously, using different shared libraries.&lt;br /&gt;
* Both the variable &amp;lt;code&amp;gt;$PBS_NODEFILE&amp;lt;/code&amp;gt; and the file it points to are only available on the first node.&lt;br /&gt;
* To propagate (export) environment variables, use mpirun/mpiexec. However, there is no standard or quasi-standard across MPI flavors.&lt;br /&gt;
** [http://www.open-mpi.org/doc/v1.4/man1/mpirun.1.php#sect17 OpenMPI&#039;s mpirun] selectively exports some variables and supports the &amp;lt;code&amp;gt;-x&amp;lt;/code&amp;gt; flag to export additional variables.&lt;br /&gt;
** Intel&#039;s mpiexec/mpiexec.hydra offer &amp;lt;code&amp;gt;-envlist &#039;&#039;NAME,NAME,...&#039;&#039;&amp;lt;/code&amp;gt; instead. See Sec. 2.4 in the &#039;&#039;Reference Manual&#039;&#039; at [http://software.intel.com/en-us/articles/intel-mpi-library-documentation/].&lt;br /&gt;
&lt;br /&gt;
See also: [[HPC/Directories|directory layout]].&lt;br /&gt;
&lt;br /&gt;
== Submitting jobs ==&lt;br /&gt;
=== Job Script ===&lt;br /&gt;
A job is described to Torque by a &#039;&#039;job script,&#039;&#039; which in most cases is a shell script containing directives for Torque.&lt;br /&gt;
* [[HPC/Submitting and Managing Jobs/Example Job Script | &#039;&#039;&#039;Example Job Script&#039;&#039;&#039;]].&lt;br /&gt;
&lt;br /&gt;
=== Submission ===&lt;br /&gt;
To submit a job, use Torque&#039;s [http://www.adaptivecomputing.com/resources/docs/torque/4-1-4/Content/topics/commands/qsub.htm qsub] command on a login node.&lt;br /&gt;
  qsub [-A accountname] [options] &#039;&#039;jobfile&#039;&#039;&lt;br /&gt;
To review qsub operation and options, consult the following:&lt;br /&gt;
  man qsub&lt;br /&gt;
  qsub --help&lt;br /&gt;
&lt;br /&gt;
; Advanced usage:&lt;br /&gt;
* You &#039;&#039;can&#039;&#039; submit follow-up jobs from within a parent job script while it runs on a compute node, but it may be better to leverage [http://www.adaptivecomputing.com/resources/docs/torque/4-1-4/Content/topics/commands/qsub.htm#W job dependencies.]&lt;br /&gt;
* [http://www.adaptivecomputing.com/resources/docs/torque/4-1-4/Content/topics/2-jobs/requestingRes.htm Requesting Resources]&lt;br /&gt;
* Alternatively, use Moab&#039;s [http://www.adaptivecomputing.com/resources/docs/mwm/6-1-9/Content/commands/msub.html msub] command.&lt;br /&gt;
&lt;br /&gt;
=== Queues ===&lt;br /&gt;
See [[HPC/Submitting and Managing Jobs/Queues and Policies | Queues and Policies]].&lt;br /&gt;
&lt;br /&gt;
== Checking job status ==&lt;br /&gt;
Query your jobs using commands similar to those on other HPC clusters.&lt;br /&gt;
You can use either [http://www.adaptivecomputing.com/resources/docs/torque/4-1-4/Content/topics/12-appendices/commandsOverview.htm Torque commands]&lt;br /&gt;
or [http://www.adaptivecomputing.com/resources/docs/mwm/6-1-9/Content/a.gcommandoverview.html Moab commands].&lt;br /&gt;
Both access the same information, but through different routes, and offer different display styles.&lt;br /&gt;
&lt;br /&gt;
* To get the regular status output:&lt;br /&gt;
 [http://www.adaptivecomputing.com/resources/docs/torque/4-1-4/Content/topics/commands/qstat.htm qstat] [-u $USER]&lt;br /&gt;
 [http://www.adaptivecomputing.com/resources/docs/mwm/6-1-9/Content/commands/showq.html showq] [-u $USER]&lt;br /&gt;
* To get an &#039;&#039;alternate&#039;&#039; format (e.g. showing job names):&lt;br /&gt;
 qstat -a [-u $USER]&lt;br /&gt;
 showq -n [-u $USER]&lt;br /&gt;
: Option &amp;lt;code&amp;gt;-u $USER&amp;lt;/code&amp;gt; shows only your jobs. You can literally type &amp;lt;code&amp;gt;$USER&amp;lt;/code&amp;gt; instead of your user name.&lt;br /&gt;
* To get &#039;&#039;full&#039;&#039; job status information such as submit arguments and run directories, and do not wrap long lines (&amp;quot;-1&amp;quot; is the digit &amp;quot;one&amp;quot;):&lt;br /&gt;
 qstat -f [&#039;&#039;jobnum&#039;&#039;] [-1]&lt;br /&gt;
&lt;br /&gt;
== Inspecting stuck jobs ==&lt;br /&gt;
To diagnose problems with &amp;quot;stuck&amp;quot; jobs, use &amp;lt;code&amp;gt;qstat -s&amp;lt;/code&amp;gt;, or simply Moab&#039;s&lt;br /&gt;
[http://docs.adaptivecomputing.com/9-1-3/suite/help.htm#topics/moabWorkloadManager/moabCommands/commands/checkjob.html checkjob] command. The last few lines of output give &#039;&#039;past events&#039;&#039; of the job and its current status.&lt;br /&gt;
 qstat -s &#039;&#039;jobnum&#039;&#039;&lt;br /&gt;
 checkjob -v &#039;&#039;jobnum&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To get estimates on when your job might start:&lt;br /&gt;
 showstart &#039;&#039;jobnum&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Inspecting running jobs ==&lt;br /&gt;
&lt;br /&gt;
=== Peeking at job output files ===&lt;br /&gt;
Each job has associated stdin and stderr streams which are gathered on its first node and are copied back only at job end time, according to the &amp;lt;code&amp;gt;#PBS&amp;lt;/code&amp;gt; directives -e, -o, or -j [eo|oe]. If the user does explicitly capture any output in the script (using shell redirections &amp;lt;code&amp;gt;&amp;quot;&amp;amp;gt;&amp;quot;&amp;lt;/code&amp;gt;) it can be difficult to assess a job&#039;s progress.&lt;br /&gt;
&lt;br /&gt;
To inspect these streams &#039;&#039;while the job is running&#039;&#039;, and also to review a job&#039;s script, use the &amp;lt;code&amp;gt;qpeek&amp;lt;/code&amp;gt; command:&lt;br /&gt;
 qpeek &#039;&#039;jobnum&#039;&#039;&lt;br /&gt;
 qpeek -eo &#039;&#039;jobnum&#039;&#039;&lt;br /&gt;
 qpeek -s &#039;&#039;jobnum&#039;&#039;&lt;br /&gt;
Read its manual page for full documentation:&lt;br /&gt;
 qpeek --man&lt;br /&gt;
This command is a Carbon re-implementation of a Torque &amp;quot;contrib&amp;quot; script.&lt;br /&gt;
&lt;br /&gt;
To inspect a job&#039;s processes running on its compute nodes:&lt;br /&gt;
 qpeek -p &#039;&#039;jobnum&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Which nodes does a running job use? ===&lt;br /&gt;
 qstat -n [-1] &#039;&#039;jobnum&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Changing job resources after submission ==&lt;br /&gt;
&amp;lt;!-- http://www.adaptivecomputing.com/resources/docs/torque/4-1-4/Content/topics/commands/qalter.htm --&amp;gt;&lt;br /&gt;
Use &amp;lt;code&amp;gt;qalter&amp;lt;/code&amp;gt; to modify attributes of a job.&lt;br /&gt;
Only attributes specified on the command line will be changed.&lt;br /&gt;
If any of the specified attributes cannot  be modified for any reason, &#039;&#039;none&#039;&#039; of that job&#039;s attributes will be modified.&lt;br /&gt;
 qalter [-l &#039;&#039;resource&#039;&#039;] […] &#039;&#039;jobnumber&#039;&#039; …&lt;br /&gt;
 qalter -A &#039;&#039;accountspec&#039;&#039; &#039;&#039;jobnumber&#039;&#039; …&lt;br /&gt;
* Most attributes can be changed only &#039;&#039;before&#039;&#039; the job starts. Others, notably&lt;br /&gt;
&amp;lt;!-- http://www.adaptivecomputing.com/resources/docs/torque/4-1-4/Content/topics/commands/qsub.htm#-m --&amp;gt; mail options and &amp;lt;!-- [http://www.adaptivecomputing.com/resources/docs/torque/4-1-4/Content/topics/commands/qsub.htm#-W --&amp;gt; job dependencies can be meaningfully adjusted after start.&lt;br /&gt;
&lt;br /&gt;
; Advanced usage:&lt;br /&gt;
* &#039;&#039;Extending&#039;&#039; the &amp;lt;code&amp;gt;walltime&amp;lt;/code&amp;gt; resource of an already running job requires Torque administrator permission. You yourself can extend prior to running, and shorten always.  &#039;&#039;&#039;Warning:&#039;&#039;&#039; In either case, the new &amp;lt;code&amp;gt;walltime&amp;lt;/code&amp;gt; limit will be measured from start, not as remaining time. If a new walltime limit is shorter than the elapsed time, the job will be killed right away.&lt;br /&gt;
* You cannot modify the job script itself after submission. You will have to remove and resubmit the job.&lt;br /&gt;
Contact me ([[User:Stern|stern]]) to arrange for interventions.&lt;br /&gt;
&lt;br /&gt;
== Canceling (removing) jobs ==&lt;br /&gt;
To retract a queued job or kill an already running job:&lt;br /&gt;
  qdel &#039;&#039;jobnumber&#039;&#039;&lt;br /&gt;
&amp;lt;!-- http://www.adaptivecomputing.com/resources/docs/torque/4-1-4/Content/topics/12-appendices/prologueAndEpliogueScripts.htm --&amp;gt;&lt;br /&gt;
Torque epilogue scripts will immediately remove remaining user processes and user files from the used compute nodes upon job termination, be it natural or after qdel.&lt;br /&gt;
&lt;br /&gt;
== Declaring that a job requires licenses ==&lt;br /&gt;
A job that is to run software that requires a commercial license must declare such to the job scheduler (software that decides when and on which nodes the job could start).&lt;br /&gt;
The job scheduler monitors known licenses for availability, and so will know which and how many licenses are available at any given time.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; License availability checks do not happen instantaneously but rather by polling, roughly once every minute.&lt;br /&gt;
: This means that if you or another user happen to start a license-consuming application after the last check but before the relevant newly started job tries to access the same license, that job will terminate with a license failure.&lt;br /&gt;
&lt;br /&gt;
=== One license type ===&lt;br /&gt;
To request a single license token of a single type, use a &amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; (&amp;quot;general resource&amp;quot;) directive:&lt;br /&gt;
 #PBS -l &#039;&#039;&#039;gres&#039;&#039;&#039;=&#039;&#039;license_name&#039;&#039;&lt;br /&gt;
To request several tokens of a type, place either a &amp;lt;code&amp;gt;:&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;+&amp;lt;/code&amp;gt; as separator, followed by the number of tokens required:&lt;br /&gt;
 #PBS -l &#039;&#039;&#039;gres&#039;&#039;&#039;=&#039;&#039;license_name:count&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For compatibility, the resource type &amp;lt;code&amp;gt;software&amp;lt;/code&amp;gt; is accepted, but &#039;&#039;not for multiple types&#039;&#039; of licenses.&lt;br /&gt;
 #PBS -l &#039;&#039;&#039;software&#039;&#039;&#039;=&#039;&#039;license_name&#039;&#039;&lt;br /&gt;
 #or&lt;br /&gt;
 #PBS -l &#039;&#039;&#039;software&#039;&#039;&#039;=&#039;&#039;license_name:count&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Several license types ===&lt;br /&gt;
To request several different licenses, use &amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; with list of license tokens and their optional counts separated by &amp;lt;code&amp;gt;&amp;lt;font color=&amp;quot;#1A1&amp;quot;&amp;gt;&#039;&#039;&#039;%&#039;&#039;&#039;&amp;lt;/font&amp;gt;&amp;lt;/code&amp;gt;:&lt;br /&gt;
 #PBS -l gres=&#039;&#039;license1_name&#039;&#039;&amp;lt;font color=&amp;quot;#1A1&amp;quot;&amp;gt;&#039;&#039;&#039;%&#039;&#039;&#039;&amp;lt;/font&amp;gt;&#039;&#039;license2_name&#039;&#039;&lt;br /&gt;
 #PBS -l gres=&#039;&#039;license1_name:count1&#039;&#039;&amp;lt;font color=&amp;quot;#1A1&amp;quot;&amp;gt;&#039;&#039;&#039;%&#039;&#039;&#039;&amp;lt;/font&amp;gt;&#039;&#039;license2_name&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;software&amp;lt;/code&amp;gt; resource &#039;&#039;cannot&#039;&#039; request multiple license types.&lt;br /&gt;
(If several &amp;lt;code&amp;gt;software&amp;lt;/code&amp;gt; resources are requested, only the &#039;&#039;last one&#039;&#039; would be active.)&lt;br /&gt;
&lt;br /&gt;
== Interactive node access ==&lt;br /&gt;
There are two ways to interactively access nodes:&lt;br /&gt;
* Requesting an interactive job&lt;br /&gt;
 qsub -I [-l nodes=…]&lt;br /&gt;
: This is a special Torque job submission that will wait for the requested nodes to become available, and then you will be dropped into a login shell on the first core of the first node. $PBS_NODEFILE is set as in regular (non-interactive) jobs.&lt;br /&gt;
* Side-access a node that already runs a job, such as to debug or inspect running processes or node-local files.&lt;br /&gt;
: You can use &amp;lt;code&amp;gt;ssh&amp;lt;/code&amp;gt; to interactively access any compute node on which a job of yours is running (use &amp;lt;code&amp;gt;qsub -n &#039;&#039;jobnum&#039;&#039;&amp;lt;/code&amp;gt; to find out the node names). As soon as a node no longer runs at least &#039;&#039;one&#039;&#039; of your jobs, your ssh session to that node will be terminated. You may find the following commands helpful:&lt;br /&gt;
 /usr/sbin/lsof -u $USER&lt;br /&gt;
 /usr/sbin/lsof -c &#039;&#039;command_name&#039;&#039;&lt;br /&gt;
 /usr/sbin/lsof -p &#039;&#039;pid&#039;&#039;&lt;br /&gt;
: - &#039;&#039;&#039;l&#039;&#039;&#039;i&#039;&#039;&#039;s&#039;&#039;&#039;t &#039;&#039;&#039;o&#039;&#039;&#039;pen &#039;&#039;&#039;f&#039;&#039;&#039;iles; [http://linux.die.net/man/8/lsof man page.]&lt;br /&gt;
 ps -fu $USER&lt;br /&gt;
: - list your own processes.&lt;br /&gt;
 psuser&lt;br /&gt;
: - a Carbon-specific wrapper for [http://linux.die.net/man/1/ps ps] to list user-only processes (yours and other regular users&#039;, excluding system processes).&lt;br /&gt;
&lt;br /&gt;
== Job notification mails ==&lt;br /&gt;
You can request a notification message to be sent to you when a job begins, ends, or aborts. The message is rather terse and looks like this:&lt;br /&gt;
 &#039;&#039;&#039;Subject:&#039;&#039;&#039; PBS Job 281399.sched1.carboncluster&lt;br /&gt;
 &lt;br /&gt;
 PBS Job Id: 281399.sched1.carboncluster&lt;br /&gt;
 Job Name:   test.job&lt;br /&gt;
 Exec host:  n103/0&lt;br /&gt;
 Execution terminated&lt;br /&gt;
 Exit_status=0&lt;br /&gt;
 resources_used.cput=00:03:00&lt;br /&gt;
 resources_used.mem=123kb&lt;br /&gt;
 resources_used.vmem=240kb&lt;br /&gt;
 resources_used.walltime=00:03:04&lt;br /&gt;
&lt;br /&gt;
In the above, Exit_status=0 reflects the shell exit status, where 0 means success.&lt;br /&gt;
&lt;br /&gt;
The following means your job was terminated because it ran beyond its allocated walltime:&lt;br /&gt;
 Exit_status=271&lt;br /&gt;
: The shell exit status is this number mod 256, in this case &amp;lt;code&amp;gt;271 % 256 = 15&amp;lt;/code&amp;gt;, corresonding to &amp;lt;code&amp;gt;SIGTERM&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Recording where a job ran ==&lt;br /&gt;
The [[#Job notification mails]] explained above do not include $PBS_O_WORKDIR. You will have to arrange for yourself to record that information.&lt;br /&gt;
One way to do that would be to simply record all job numbers and their working directories at the beginning of each job:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#PBS -l nodes=…&lt;br /&gt;
#PBS -l walltime=…&lt;br /&gt;
#PBS -m bea&lt;br /&gt;
&lt;br /&gt;
cd $PBS_O_WORKDIR&lt;br /&gt;
echo $PBS_JOBID $PWD &amp;gt;&amp;gt; $HOME/jobdirs&lt;br /&gt;
&lt;br /&gt;
…&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
To query a job&#039;s directory, run:&lt;br /&gt;
 grep &#039;&#039;jobnumber&#039;&#039; ~/jobdirs&lt;br /&gt;
&lt;br /&gt;
== Sending mail while a job is running ==&lt;br /&gt;
It may be useful to have a job automatically &amp;quot;phone home&amp;quot; sometime after it started.&lt;br /&gt;
This can be accomplished at job submission time by arranging a mail to be sent, using a few added commands in the job script.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#PBS …&lt;br /&gt;
&lt;br /&gt;
cd $PBS_O_WORKDIR&lt;br /&gt;
&lt;br /&gt;
# arrange notification mail&lt;br /&gt;
(&lt;br /&gt;
    sleep 600	# time offset parameter, in seconds&lt;br /&gt;
    tail -20 somefile.out | mailx -s &amp;quot;$PBS_JOBID: partial log&amp;quot; $USER&lt;br /&gt;
) &amp;amp;&lt;br /&gt;
&lt;br /&gt;
# main work here&lt;br /&gt;
…&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Explanation: &lt;br /&gt;
* The commands inside &amp;lt;code&amp;gt;( … ) &amp;amp;&amp;lt;/code&amp;gt; run in a background track aside the main work.&lt;br /&gt;
* The first command, &amp;lt;code&amp;gt;sleep&amp;lt;/code&amp;gt;, delays further action (in this track only) by the specified time in seconds.&lt;br /&gt;
** To emphasize minutes, write &amp;lt;code&amp;gt;sleep $(( 10 * 60 ))&amp;lt;/code&amp;gt; .&lt;br /&gt;
** To set the time relative to the walltime limit, leverage the &amp;lt;code&amp;gt;$PBS_WALLTIME&amp;lt;/code&amp;gt; variable, e.g. as in &amp;lt;code&amp;gt;sleep $(( PBS_WALLTIME - ( &#039;&#039;minutes&#039;&#039; * 60 ) )).&amp;lt;/code&amp;gt;&lt;br /&gt;
* The &amp;lt;code&amp;gt;tail&amp;lt;/code&amp;gt; command is a stand-in for any inspection command you might want to run. An even simpler command could be &amp;lt;code&amp;gt;ls -lt&amp;lt;/code&amp;gt;. You could also use several commands enclosed by parentheses, &amp;lt;code&amp;gt;( cmd1; cmd2; ... )&amp;lt;/code&amp;gt;, to construct a more elaborate mail body.&lt;br /&gt;
* The &amp;lt;code&amp;gt;mailx&amp;lt;/code&amp;gt; command, following the pipe symbol &amp;lt;code&amp;gt;|&amp;lt;/code&amp;gt;, reads the output of your inspection command and sends you a mail with the subject specified by the &amp;lt;code&amp;gt;-s&amp;lt;/code&amp;gt; option.&lt;br /&gt;
* If the main part of the job finishes before the pre-mail sleep is over no mail will be sent.&lt;br /&gt;
&lt;br /&gt;
Note: The Moab scheduler also supports [http://www.adaptivecomputing.com/resources/docs/mwm/6-1-9/Content/topics/triggers/triggersIndex.html triggers], but they run in a different environment, not on an allocated node.&lt;br /&gt;
&lt;br /&gt;
[[Category:HPC|Getting Started]]&lt;/div&gt;</summary>
		<author><name>Stern</name></author>
	</entry>
	<entry>
		<id>https://wiki.anl.gov/wiki_cnm/index.php?title=HPC/Submitting_and_Managing_Jobs&amp;diff=7486</id>
		<title>HPC/Submitting and Managing Jobs</title>
		<link rel="alternate" type="text/html" href="https://wiki.anl.gov/wiki_cnm/index.php?title=HPC/Submitting_and_Managing_Jobs&amp;diff=7486"/>
		<updated>2026-02-17T20:44:42Z</updated>

		<summary type="html">&lt;p&gt;Stern: /* Inspecting stuck jobs */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Image:HPC job flow.png|right|400px|thumb|Processing flow of a typical job.]]&lt;br /&gt;
__TOC__&lt;br /&gt;
== Introduction ==&lt;br /&gt;
To accept and run jobs, Carbon uses the [http://en.wikipedia.org/wiki/TORQUE_Resource_Manager Torque Resource Manager],&lt;br /&gt;
which is a variant of [http://en.wikipedia.org/wiki/Portable_Batch_System PBS].&lt;br /&gt;
A separate software component called a [http://en.wikipedia.org/wiki/Job_scheduler &#039;&#039;scheduler&#039;&#039;] chooses the nodes and the start time for jobs according to the job parameters, resource availability, and configuration. Carbon uses the [http://www.adaptivecomputing.com/resources/docs/mwm/6-1-9/help.htm Moab Workload Manager] as scheduler. The resources used by each job (primarily the CPU time) are tracked and managed by the&lt;br /&gt;
[http://www.adaptivecomputing.com/resources/docs/gold/index.php Gold Allocation Manager].&lt;br /&gt;
&lt;br /&gt;
=== Job processing ===&lt;br /&gt;
A job consists of a [[#Job Script|job script]] and applications called therein. The figure at the top shows schematically how a typical job is processed.&lt;br /&gt;
Unless otherwise told, Torque will execute the job script on your behalf on the first node allocated by Moab,&lt;br /&gt;
in your &amp;lt;code&amp;gt;$HOME&amp;lt;/code&amp;gt; directory, and typically using your login shell. It is the &#039;&#039;script&#039;s responsibility&#039;&#039; to:&lt;br /&gt;
* Change to a suitable working directory.&lt;br /&gt;
* Recognize and use the other nodes of the job.&lt;br /&gt;
** This is generally done by directing an [http://en.wikipedia.org/wiki/Message_Passing_Interface MPI] program to start on the nodes listed in the job&#039;s &amp;lt;code&amp;gt;$PBS_NODEFILE&amp;lt;/code&amp;gt;.&lt;br /&gt;
** A job is perfectly free to run more than one program, such as several MPI programs in sequence.&lt;br /&gt;
* Set or propagate environment variables as needed to other nodes.&lt;br /&gt;
&lt;br /&gt;
=== Environment variables ===&lt;br /&gt;
The handling of environment variables across the cores and nodes that a job uses varies with the capabilities and configuration choices of the various MPI implementations.&lt;br /&gt;
&amp;lt;!-- It is recommended not to rely on defaults, but rather to make expectations and requirements explicit. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Variables usually are &#039;&#039;&#039;propagated core-to-core&#039;&#039;&#039; for all processes on the first node.&lt;br /&gt;
* Variables usually are &#039;&#039;&#039;not propagated node-to-node.&#039;&#039;&#039;&lt;br /&gt;
; Consequences:&lt;br /&gt;
* You must [[HPC/Software/Module Setup | &#039;&#039;&#039;configure modules and $PATH&#039;&#039;&#039;]] in your &amp;lt;code&amp;gt;$HOME/.bashrc&amp;lt;/code&amp;gt; file to help mpirun and other mechanisms locate your programs on each compute node. Otherwise mpirun will fail as soon as more than one node is involved, either by not finding the binary itself or some of its required shared libraries, or more insidiously, using different shared libraries.&lt;br /&gt;
* Both the variable &amp;lt;code&amp;gt;$PBS_NODEFILE&amp;lt;/code&amp;gt; and the file it points to are only available on the first node.&lt;br /&gt;
* To propagate (export) environment variables, use mpirun/mpiexec. However, there is no standard or quasi-standard across MPI flavors.&lt;br /&gt;
** [http://www.open-mpi.org/doc/v1.4/man1/mpirun.1.php#sect17 OpenMPI&#039;s mpirun] selectively exports some variables and supports the &amp;lt;code&amp;gt;-x&amp;lt;/code&amp;gt; flag to export additional variables.&lt;br /&gt;
** Intel&#039;s mpiexec/mpiexec.hydra offer &amp;lt;code&amp;gt;-envlist &#039;&#039;NAME,NAME,...&#039;&#039;&amp;lt;/code&amp;gt; instead. See Sec. 2.4 in the &#039;&#039;Reference Manual&#039;&#039; at [http://software.intel.com/en-us/articles/intel-mpi-library-documentation/].&lt;br /&gt;
&lt;br /&gt;
See also: [[HPC/Directories|directory layout]].&lt;br /&gt;
&lt;br /&gt;
== Submitting jobs ==&lt;br /&gt;
=== Job Script ===&lt;br /&gt;
A job is described to Torque by a &#039;&#039;job script,&#039;&#039; which in most cases is a shell script containing directives for Torque.&lt;br /&gt;
* [[HPC/Submitting and Managing Jobs/Example Job Script | &#039;&#039;&#039;Example Job Script&#039;&#039;&#039;]].&lt;br /&gt;
&lt;br /&gt;
=== Submission ===&lt;br /&gt;
To submit a job, use Torque&#039;s [http://www.adaptivecomputing.com/resources/docs/torque/4-1-4/Content/topics/commands/qsub.htm qsub] command on a login node.&lt;br /&gt;
  qsub [-A accountname] [options] &#039;&#039;jobfile&#039;&#039;&lt;br /&gt;
To review qsub operation and options, consult the following:&lt;br /&gt;
  man qsub&lt;br /&gt;
  qsub --help&lt;br /&gt;
&lt;br /&gt;
; Advanced usage:&lt;br /&gt;
* You &#039;&#039;can&#039;&#039; submit follow-up jobs from within a parent job script while it runs on a compute node, but it may be better to leverage [http://www.adaptivecomputing.com/resources/docs/torque/4-1-4/Content/topics/commands/qsub.htm#W job dependencies.]&lt;br /&gt;
* [http://www.adaptivecomputing.com/resources/docs/torque/4-1-4/Content/topics/2-jobs/requestingRes.htm Requesting Resources]&lt;br /&gt;
* Alternatively, use Moab&#039;s [http://www.adaptivecomputing.com/resources/docs/mwm/6-1-9/Content/commands/msub.html msub] command.&lt;br /&gt;
&lt;br /&gt;
=== Queues ===&lt;br /&gt;
See [[HPC/Submitting and Managing Jobs/Queues and Policies | Queues and Policies]].&lt;br /&gt;
&lt;br /&gt;
== Checking job status ==&lt;br /&gt;
Query your jobs using commands similar to those on other HPC clusters.&lt;br /&gt;
You can use either [http://www.adaptivecomputing.com/resources/docs/torque/4-1-4/Content/topics/12-appendices/commandsOverview.htm Torque commands]&lt;br /&gt;
or [http://www.adaptivecomputing.com/resources/docs/mwm/6-1-9/Content/a.gcommandoverview.html Moab commands].&lt;br /&gt;
Both access the same information, but through different routes, and offer different display styles.&lt;br /&gt;
&lt;br /&gt;
* To get the regular status output:&lt;br /&gt;
 [http://www.adaptivecomputing.com/resources/docs/torque/4-1-4/Content/topics/commands/qstat.htm qstat] [-u $USER]&lt;br /&gt;
 [http://www.adaptivecomputing.com/resources/docs/mwm/6-1-9/Content/commands/showq.html showq] [-u $USER]&lt;br /&gt;
* To get an &#039;&#039;alternate&#039;&#039; format (e.g. showing job names):&lt;br /&gt;
 qstat -a [-u $USER]&lt;br /&gt;
 showq -n [-u $USER]&lt;br /&gt;
: Option &amp;lt;code&amp;gt;-u $USER&amp;lt;/code&amp;gt; shows only your jobs. You can literally type &amp;lt;code&amp;gt;$USER&amp;lt;/code&amp;gt; instead of your user name.&lt;br /&gt;
* To get &#039;&#039;full&#039;&#039; job status information such as submit arguments and run directories, and do not wrap long lines (&amp;quot;-1&amp;quot; is the digit &amp;quot;one&amp;quot;):&lt;br /&gt;
 qstat -f [&#039;&#039;jobnum&#039;&#039;] [-1]&lt;br /&gt;
&lt;br /&gt;
== Inspecting stuck jobs ==&lt;br /&gt;
To diagnose problems with &amp;quot;stuck&amp;quot; jobs, use &amp;lt;code&amp;gt;qstat -s&amp;lt;/code&amp;gt;, or simply Moab&#039;s&lt;br /&gt;
[http://docs.adaptivecomputing.com/9-1-3/suite/help.htm#topics/moabWorkloadManager/moabCommands/commands/checkjob.html checkjob] command. The last few lines of output give &#039;&#039;past events&#039;&#039; of the job and its current status.&lt;br /&gt;
 qstat -s &#039;&#039;jobnum&#039;&#039;&lt;br /&gt;
 checkjob -v &#039;&#039;jobnum&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To get estimates on when your job might start:&lt;br /&gt;
 showstart [-e all] &#039;&#039;jobnum&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Inspecting running jobs ==&lt;br /&gt;
&lt;br /&gt;
=== Peeking at job output files ===&lt;br /&gt;
Each job has associated stdin and stderr streams which are gathered on its first node and are copied back only at job end time, according to the &amp;lt;code&amp;gt;#PBS&amp;lt;/code&amp;gt; directives -e, -o, or -j [eo|oe]. If the user does explicitly capture any output in the script (using shell redirections &amp;lt;code&amp;gt;&amp;quot;&amp;amp;gt;&amp;quot;&amp;lt;/code&amp;gt;) it can be difficult to assess a job&#039;s progress.&lt;br /&gt;
&lt;br /&gt;
To inspect these streams &#039;&#039;while the job is running&#039;&#039;, and also to review a job&#039;s script, use the &amp;lt;code&amp;gt;qpeek&amp;lt;/code&amp;gt; command:&lt;br /&gt;
 qpeek &#039;&#039;jobnum&#039;&#039;&lt;br /&gt;
 qpeek -eo &#039;&#039;jobnum&#039;&#039;&lt;br /&gt;
 qpeek -s &#039;&#039;jobnum&#039;&#039;&lt;br /&gt;
Read its manual page for full documentation:&lt;br /&gt;
 qpeek --man&lt;br /&gt;
This command is a Carbon re-implementation of a Torque &amp;quot;contrib&amp;quot; script.&lt;br /&gt;
&lt;br /&gt;
To inspect a job&#039;s processes running on its compute nodes:&lt;br /&gt;
 qpeek -p &#039;&#039;jobnum&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Which nodes does a running job use? ===&lt;br /&gt;
 qstat -n [-1] &#039;&#039;jobnum&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Changing job resources after submission ==&lt;br /&gt;
&amp;lt;!-- http://www.adaptivecomputing.com/resources/docs/torque/4-1-4/Content/topics/commands/qalter.htm --&amp;gt;&lt;br /&gt;
Use &amp;lt;code&amp;gt;qalter&amp;lt;/code&amp;gt; to modify attributes of a job.&lt;br /&gt;
Only attributes specified on the command line will be changed.&lt;br /&gt;
If any of the specified attributes cannot  be modified for any reason, &#039;&#039;none&#039;&#039; of that job&#039;s attributes will be modified.&lt;br /&gt;
 qalter [-l &#039;&#039;resource&#039;&#039;] […] &#039;&#039;jobnumber&#039;&#039; …&lt;br /&gt;
 qalter -A &#039;&#039;accountspec&#039;&#039; &#039;&#039;jobnumber&#039;&#039; …&lt;br /&gt;
* Most attributes can be changed only &#039;&#039;before&#039;&#039; the job starts. Others, notably&lt;br /&gt;
&amp;lt;!-- http://www.adaptivecomputing.com/resources/docs/torque/4-1-4/Content/topics/commands/qsub.htm#-m --&amp;gt; mail options and &amp;lt;!-- [http://www.adaptivecomputing.com/resources/docs/torque/4-1-4/Content/topics/commands/qsub.htm#-W --&amp;gt; job dependencies can be meaningfully adjusted after start.&lt;br /&gt;
&lt;br /&gt;
; Advanced usage:&lt;br /&gt;
* &#039;&#039;Extending&#039;&#039; the &amp;lt;code&amp;gt;walltime&amp;lt;/code&amp;gt; resource of an already running job requires Torque administrator permission. You yourself can extend prior to running, and shorten always.  &#039;&#039;&#039;Warning:&#039;&#039;&#039; In either case, the new &amp;lt;code&amp;gt;walltime&amp;lt;/code&amp;gt; limit will be measured from start, not as remaining time. If a new walltime limit is shorter than the elapsed time, the job will be killed right away.&lt;br /&gt;
* You cannot modify the job script itself after submission. You will have to remove and resubmit the job.&lt;br /&gt;
Contact me ([[User:Stern|stern]]) to arrange for interventions.&lt;br /&gt;
&lt;br /&gt;
== Canceling (removing) jobs ==&lt;br /&gt;
To retract a queued job or kill an already running job:&lt;br /&gt;
  qdel &#039;&#039;jobnumber&#039;&#039;&lt;br /&gt;
&amp;lt;!-- http://www.adaptivecomputing.com/resources/docs/torque/4-1-4/Content/topics/12-appendices/prologueAndEpliogueScripts.htm --&amp;gt;&lt;br /&gt;
Torque epilogue scripts will immediately remove remaining user processes and user files from the used compute nodes upon job termination, be it natural or after qdel.&lt;br /&gt;
&lt;br /&gt;
== Declaring that a job requires licenses ==&lt;br /&gt;
A job that is to run software that requires a commercial license must declare such to the job scheduler (software that decides when and on which nodes the job could start).&lt;br /&gt;
The job scheduler monitors known licenses for availability, and so will know which and how many licenses are available at any given time.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; License availability checks do not happen instantaneously but rather by polling, roughly once every minute.&lt;br /&gt;
: This means that if you or another user happen to start a license-consuming application after the last check but before the relevant newly started job tries to access the same license, that job will terminate with a license failure.&lt;br /&gt;
&lt;br /&gt;
=== One license type ===&lt;br /&gt;
To request a single license token of a single type, use a &amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; (&amp;quot;general resource&amp;quot;) directive:&lt;br /&gt;
 #PBS -l &#039;&#039;&#039;gres&#039;&#039;&#039;=&#039;&#039;license_name&#039;&#039;&lt;br /&gt;
To request several tokens of a type, place either a &amp;lt;code&amp;gt;:&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;+&amp;lt;/code&amp;gt; as separator, followed by the number of tokens required:&lt;br /&gt;
 #PBS -l &#039;&#039;&#039;gres&#039;&#039;&#039;=&#039;&#039;license_name:count&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For compatibility, the resource type &amp;lt;code&amp;gt;software&amp;lt;/code&amp;gt; is accepted, but &#039;&#039;not for multiple types&#039;&#039; of licenses.&lt;br /&gt;
 #PBS -l &#039;&#039;&#039;software&#039;&#039;&#039;=&#039;&#039;license_name&#039;&#039;&lt;br /&gt;
 #or&lt;br /&gt;
 #PBS -l &#039;&#039;&#039;software&#039;&#039;&#039;=&#039;&#039;license_name:count&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Several license types ===&lt;br /&gt;
To request several different licenses, use &amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; with list of license tokens and their optional counts separated by &amp;lt;code&amp;gt;&amp;lt;font color=&amp;quot;#1A1&amp;quot;&amp;gt;&#039;&#039;&#039;%&#039;&#039;&#039;&amp;lt;/font&amp;gt;&amp;lt;/code&amp;gt;:&lt;br /&gt;
 #PBS -l gres=&#039;&#039;license1_name&#039;&#039;&amp;lt;font color=&amp;quot;#1A1&amp;quot;&amp;gt;&#039;&#039;&#039;%&#039;&#039;&#039;&amp;lt;/font&amp;gt;&#039;&#039;license2_name&#039;&#039;&lt;br /&gt;
 #PBS -l gres=&#039;&#039;license1_name:count1&#039;&#039;&amp;lt;font color=&amp;quot;#1A1&amp;quot;&amp;gt;&#039;&#039;&#039;%&#039;&#039;&#039;&amp;lt;/font&amp;gt;&#039;&#039;license2_name&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;software&amp;lt;/code&amp;gt; resource &#039;&#039;cannot&#039;&#039; request multiple license types.&lt;br /&gt;
(If several &amp;lt;code&amp;gt;software&amp;lt;/code&amp;gt; resources are requested, only the &#039;&#039;last one&#039;&#039; would be active.)&lt;br /&gt;
&lt;br /&gt;
== Interactive node access ==&lt;br /&gt;
There are two ways to interactively access nodes:&lt;br /&gt;
* Requesting an interactive job&lt;br /&gt;
 qsub -I [-l nodes=…]&lt;br /&gt;
: This is a special Torque job submission that will wait for the requested nodes to become available, and then you will be dropped into a login shell on the first core of the first node. $PBS_NODEFILE is set as in regular (non-interactive) jobs.&lt;br /&gt;
* Side-access a node that already runs a job, such as to debug or inspect running processes or node-local files.&lt;br /&gt;
: You can use &amp;lt;code&amp;gt;ssh&amp;lt;/code&amp;gt; to interactively access any compute node on which a job of yours is running (use &amp;lt;code&amp;gt;qsub -n &#039;&#039;jobnum&#039;&#039;&amp;lt;/code&amp;gt; to find out the node names). As soon as a node no longer runs at least &#039;&#039;one&#039;&#039; of your jobs, your ssh session to that node will be terminated. You may find the following commands helpful:&lt;br /&gt;
 /usr/sbin/lsof -u $USER&lt;br /&gt;
 /usr/sbin/lsof -c &#039;&#039;command_name&#039;&#039;&lt;br /&gt;
 /usr/sbin/lsof -p &#039;&#039;pid&#039;&#039;&lt;br /&gt;
: - &#039;&#039;&#039;l&#039;&#039;&#039;i&#039;&#039;&#039;s&#039;&#039;&#039;t &#039;&#039;&#039;o&#039;&#039;&#039;pen &#039;&#039;&#039;f&#039;&#039;&#039;iles; [http://linux.die.net/man/8/lsof man page.]&lt;br /&gt;
 ps -fu $USER&lt;br /&gt;
: - list your own processes.&lt;br /&gt;
 psuser&lt;br /&gt;
: - a Carbon-specific wrapper for [http://linux.die.net/man/1/ps ps] to list user-only processes (yours and other regular users&#039;, excluding system processes).&lt;br /&gt;
&lt;br /&gt;
== Job notification mails ==&lt;br /&gt;
You can request a notification message to be sent to you when a job begins, ends, or aborts. The message is rather terse and looks like this:&lt;br /&gt;
 &#039;&#039;&#039;Subject:&#039;&#039;&#039; PBS Job 281399.sched1.carboncluster&lt;br /&gt;
 &lt;br /&gt;
 PBS Job Id: 281399.sched1.carboncluster&lt;br /&gt;
 Job Name:   test.job&lt;br /&gt;
 Exec host:  n103/0&lt;br /&gt;
 Execution terminated&lt;br /&gt;
 Exit_status=0&lt;br /&gt;
 resources_used.cput=00:03:00&lt;br /&gt;
 resources_used.mem=123kb&lt;br /&gt;
 resources_used.vmem=240kb&lt;br /&gt;
 resources_used.walltime=00:03:04&lt;br /&gt;
&lt;br /&gt;
In the above, Exit_status=0 reflects the shell exit status, where 0 means success.&lt;br /&gt;
&lt;br /&gt;
The following means your job was terminated because it ran beyond its allocated walltime:&lt;br /&gt;
 Exit_status=271&lt;br /&gt;
: The shell exit status is this number mod 256, in this case &amp;lt;code&amp;gt;271 % 256 = 15&amp;lt;/code&amp;gt;, corresonding to &amp;lt;code&amp;gt;SIGTERM&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Recording where a job ran ==&lt;br /&gt;
The [[#Job notification mails]] explained above do not include $PBS_O_WORKDIR. You will have to arrange for yourself to record that information.&lt;br /&gt;
One way to do that would be to simply record all job numbers and their working directories at the beginning of each job:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#PBS -l nodes=…&lt;br /&gt;
#PBS -l walltime=…&lt;br /&gt;
#PBS -m bea&lt;br /&gt;
&lt;br /&gt;
cd $PBS_O_WORKDIR&lt;br /&gt;
echo $PBS_JOBID $PWD &amp;gt;&amp;gt; $HOME/jobdirs&lt;br /&gt;
&lt;br /&gt;
…&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
To query a job&#039;s directory, run:&lt;br /&gt;
 grep &#039;&#039;jobnumber&#039;&#039; ~/jobdirs&lt;br /&gt;
&lt;br /&gt;
== Sending mail while a job is running ==&lt;br /&gt;
It may be useful to have a job automatically &amp;quot;phone home&amp;quot; sometime after it started.&lt;br /&gt;
This can be accomplished at job submission time by arranging a mail to be sent, using a few added commands in the job script.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#PBS …&lt;br /&gt;
&lt;br /&gt;
cd $PBS_O_WORKDIR&lt;br /&gt;
&lt;br /&gt;
# arrange notification mail&lt;br /&gt;
(&lt;br /&gt;
    sleep 600	# time offset parameter, in seconds&lt;br /&gt;
    tail -20 somefile.out | mailx -s &amp;quot;$PBS_JOBID: partial log&amp;quot; $USER&lt;br /&gt;
) &amp;amp;&lt;br /&gt;
&lt;br /&gt;
# main work here&lt;br /&gt;
…&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Explanation: &lt;br /&gt;
* The commands inside &amp;lt;code&amp;gt;( … ) &amp;amp;&amp;lt;/code&amp;gt; run in a background track aside the main work.&lt;br /&gt;
* The first command, &amp;lt;code&amp;gt;sleep&amp;lt;/code&amp;gt;, delays further action (in this track only) by the specified time in seconds.&lt;br /&gt;
** To emphasize minutes, write &amp;lt;code&amp;gt;sleep $(( 10 * 60 ))&amp;lt;/code&amp;gt; .&lt;br /&gt;
** To set the time relative to the walltime limit, leverage the &amp;lt;code&amp;gt;$PBS_WALLTIME&amp;lt;/code&amp;gt; variable, e.g. as in &amp;lt;code&amp;gt;sleep $(( PBS_WALLTIME - ( &#039;&#039;minutes&#039;&#039; * 60 ) )).&amp;lt;/code&amp;gt;&lt;br /&gt;
* The &amp;lt;code&amp;gt;tail&amp;lt;/code&amp;gt; command is a stand-in for any inspection command you might want to run. An even simpler command could be &amp;lt;code&amp;gt;ls -lt&amp;lt;/code&amp;gt;. You could also use several commands enclosed by parentheses, &amp;lt;code&amp;gt;( cmd1; cmd2; ... )&amp;lt;/code&amp;gt;, to construct a more elaborate mail body.&lt;br /&gt;
* The &amp;lt;code&amp;gt;mailx&amp;lt;/code&amp;gt; command, following the pipe symbol &amp;lt;code&amp;gt;|&amp;lt;/code&amp;gt;, reads the output of your inspection command and sends you a mail with the subject specified by the &amp;lt;code&amp;gt;-s&amp;lt;/code&amp;gt; option.&lt;br /&gt;
* If the main part of the job finishes before the pre-mail sleep is over no mail will be sent.&lt;br /&gt;
&lt;br /&gt;
Note: The Moab scheduler also supports [http://www.adaptivecomputing.com/resources/docs/mwm/6-1-9/Content/topics/triggers/triggersIndex.html triggers], but they run in a different environment, not on an allocated node.&lt;br /&gt;
&lt;br /&gt;
[[Category:HPC|Getting Started]]&lt;/div&gt;</summary>
		<author><name>Stern</name></author>
	</entry>
	<entry>
		<id>https://wiki.anl.gov/wiki_cnm/index.php?title=HPC/Submitting_and_Managing_Jobs&amp;diff=7485</id>
		<title>HPC/Submitting and Managing Jobs</title>
		<link rel="alternate" type="text/html" href="https://wiki.anl.gov/wiki_cnm/index.php?title=HPC/Submitting_and_Managing_Jobs&amp;diff=7485"/>
		<updated>2026-02-17T20:44:12Z</updated>

		<summary type="html">&lt;p&gt;Stern: /* Inspecting stuck jobs */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Image:HPC job flow.png|right|400px|thumb|Processing flow of a typical job.]]&lt;br /&gt;
__TOC__&lt;br /&gt;
== Introduction ==&lt;br /&gt;
To accept and run jobs, Carbon uses the [http://en.wikipedia.org/wiki/TORQUE_Resource_Manager Torque Resource Manager],&lt;br /&gt;
which is a variant of [http://en.wikipedia.org/wiki/Portable_Batch_System PBS].&lt;br /&gt;
A separate software component called a [http://en.wikipedia.org/wiki/Job_scheduler &#039;&#039;scheduler&#039;&#039;] chooses the nodes and the start time for jobs according to the job parameters, resource availability, and configuration. Carbon uses the [http://www.adaptivecomputing.com/resources/docs/mwm/6-1-9/help.htm Moab Workload Manager] as scheduler. The resources used by each job (primarily the CPU time) are tracked and managed by the&lt;br /&gt;
[http://www.adaptivecomputing.com/resources/docs/gold/index.php Gold Allocation Manager].&lt;br /&gt;
&lt;br /&gt;
=== Job processing ===&lt;br /&gt;
A job consists of a [[#Job Script|job script]] and applications called therein. The figure at the top shows schematically how a typical job is processed.&lt;br /&gt;
Unless otherwise told, Torque will execute the job script on your behalf on the first node allocated by Moab,&lt;br /&gt;
in your &amp;lt;code&amp;gt;$HOME&amp;lt;/code&amp;gt; directory, and typically using your login shell. It is the &#039;&#039;script&#039;s responsibility&#039;&#039; to:&lt;br /&gt;
* Change to a suitable working directory.&lt;br /&gt;
* Recognize and use the other nodes of the job.&lt;br /&gt;
** This is generally done by directing an [http://en.wikipedia.org/wiki/Message_Passing_Interface MPI] program to start on the nodes listed in the job&#039;s &amp;lt;code&amp;gt;$PBS_NODEFILE&amp;lt;/code&amp;gt;.&lt;br /&gt;
** A job is perfectly free to run more than one program, such as several MPI programs in sequence.&lt;br /&gt;
* Set or propagate environment variables as needed to other nodes.&lt;br /&gt;
&lt;br /&gt;
=== Environment variables ===&lt;br /&gt;
The handling of environment variables across the cores and nodes that a job uses varies with the capabilities and configuration choices of the various MPI implementations.&lt;br /&gt;
&amp;lt;!-- It is recommended not to rely on defaults, but rather to make expectations and requirements explicit. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Variables usually are &#039;&#039;&#039;propagated core-to-core&#039;&#039;&#039; for all processes on the first node.&lt;br /&gt;
* Variables usually are &#039;&#039;&#039;not propagated node-to-node.&#039;&#039;&#039;&lt;br /&gt;
; Consequences:&lt;br /&gt;
* You must [[HPC/Software/Module Setup | &#039;&#039;&#039;configure modules and $PATH&#039;&#039;&#039;]] in your &amp;lt;code&amp;gt;$HOME/.bashrc&amp;lt;/code&amp;gt; file to help mpirun and other mechanisms locate your programs on each compute node. Otherwise mpirun will fail as soon as more than one node is involved, either by not finding the binary itself or some of its required shared libraries, or more insidiously, using different shared libraries.&lt;br /&gt;
* Both the variable &amp;lt;code&amp;gt;$PBS_NODEFILE&amp;lt;/code&amp;gt; and the file it points to are only available on the first node.&lt;br /&gt;
* To propagate (export) environment variables, use mpirun/mpiexec. However, there is no standard or quasi-standard across MPI flavors.&lt;br /&gt;
** [http://www.open-mpi.org/doc/v1.4/man1/mpirun.1.php#sect17 OpenMPI&#039;s mpirun] selectively exports some variables and supports the &amp;lt;code&amp;gt;-x&amp;lt;/code&amp;gt; flag to export additional variables.&lt;br /&gt;
** Intel&#039;s mpiexec/mpiexec.hydra offer &amp;lt;code&amp;gt;-envlist &#039;&#039;NAME,NAME,...&#039;&#039;&amp;lt;/code&amp;gt; instead. See Sec. 2.4 in the &#039;&#039;Reference Manual&#039;&#039; at [http://software.intel.com/en-us/articles/intel-mpi-library-documentation/].&lt;br /&gt;
&lt;br /&gt;
See also: [[HPC/Directories|directory layout]].&lt;br /&gt;
&lt;br /&gt;
== Submitting jobs ==&lt;br /&gt;
=== Job Script ===&lt;br /&gt;
A job is described to Torque by a &#039;&#039;job script,&#039;&#039; which in most cases is a shell script containing directives for Torque.&lt;br /&gt;
* [[HPC/Submitting and Managing Jobs/Example Job Script | &#039;&#039;&#039;Example Job Script&#039;&#039;&#039;]].&lt;br /&gt;
&lt;br /&gt;
=== Submission ===&lt;br /&gt;
To submit a job, use Torque&#039;s [http://www.adaptivecomputing.com/resources/docs/torque/4-1-4/Content/topics/commands/qsub.htm qsub] command on a login node.&lt;br /&gt;
  qsub [-A accountname] [options] &#039;&#039;jobfile&#039;&#039;&lt;br /&gt;
To review qsub operation and options, consult the following:&lt;br /&gt;
  man qsub&lt;br /&gt;
  qsub --help&lt;br /&gt;
&lt;br /&gt;
; Advanced usage:&lt;br /&gt;
* You &#039;&#039;can&#039;&#039; submit follow-up jobs from within a parent job script while it runs on a compute node, but it may be better to leverage [http://www.adaptivecomputing.com/resources/docs/torque/4-1-4/Content/topics/commands/qsub.htm#W job dependencies.]&lt;br /&gt;
* [http://www.adaptivecomputing.com/resources/docs/torque/4-1-4/Content/topics/2-jobs/requestingRes.htm Requesting Resources]&lt;br /&gt;
* Alternatively, use Moab&#039;s [http://www.adaptivecomputing.com/resources/docs/mwm/6-1-9/Content/commands/msub.html msub] command.&lt;br /&gt;
&lt;br /&gt;
=== Queues ===&lt;br /&gt;
See [[HPC/Submitting and Managing Jobs/Queues and Policies | Queues and Policies]].&lt;br /&gt;
&lt;br /&gt;
== Checking job status ==&lt;br /&gt;
Query your jobs using commands similar to those on other HPC clusters.&lt;br /&gt;
You can use either [http://www.adaptivecomputing.com/resources/docs/torque/4-1-4/Content/topics/12-appendices/commandsOverview.htm Torque commands]&lt;br /&gt;
or [http://www.adaptivecomputing.com/resources/docs/mwm/6-1-9/Content/a.gcommandoverview.html Moab commands].&lt;br /&gt;
Both access the same information, but through different routes, and offer different display styles.&lt;br /&gt;
&lt;br /&gt;
* To get the regular status output:&lt;br /&gt;
 [http://www.adaptivecomputing.com/resources/docs/torque/4-1-4/Content/topics/commands/qstat.htm qstat] [-u $USER]&lt;br /&gt;
 [http://www.adaptivecomputing.com/resources/docs/mwm/6-1-9/Content/commands/showq.html showq] [-u $USER]&lt;br /&gt;
* To get an &#039;&#039;alternate&#039;&#039; format (e.g. showing job names):&lt;br /&gt;
 qstat -a [-u $USER]&lt;br /&gt;
 showq -n [-u $USER]&lt;br /&gt;
: Option &amp;lt;code&amp;gt;-u $USER&amp;lt;/code&amp;gt; shows only your jobs. You can literally type &amp;lt;code&amp;gt;$USER&amp;lt;/code&amp;gt; instead of your user name.&lt;br /&gt;
* To get &#039;&#039;full&#039;&#039; job status information such as submit arguments and run directories, and do not wrap long lines (&amp;quot;-1&amp;quot; is the digit &amp;quot;one&amp;quot;):&lt;br /&gt;
 qstat -f [&#039;&#039;jobnum&#039;&#039;] [-1]&lt;br /&gt;
&lt;br /&gt;
== Inspecting stuck jobs ==&lt;br /&gt;
To diagnose problems with &amp;quot;stuck&amp;quot; jobs, use &amp;lt;code&amp;gt;qstat -s&amp;lt;/code&amp;gt;, or simply Moab&#039;s&lt;br /&gt;
[http://docs.adaptivecomputing.com/9-1-3/suite/help.htm#topics/moabWorkloadManager/moabCommands/commands/checkjob.html?Highlight=checkjob checkjob] command. The last few lines of output give &#039;&#039;past events&#039;&#039; of the job and its current status.&lt;br /&gt;
 qstat -s &#039;&#039;jobnum&#039;&#039;&lt;br /&gt;
 checkjob -v &#039;&#039;jobnum&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To get estimates on when your job might start:&lt;br /&gt;
 showstart [-e all] &#039;&#039;jobnum&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Inspecting running jobs ==&lt;br /&gt;
&lt;br /&gt;
=== Peeking at job output files ===&lt;br /&gt;
Each job has associated stdin and stderr streams which are gathered on its first node and are copied back only at job end time, according to the &amp;lt;code&amp;gt;#PBS&amp;lt;/code&amp;gt; directives -e, -o, or -j [eo|oe]. If the user does explicitly capture any output in the script (using shell redirections &amp;lt;code&amp;gt;&amp;quot;&amp;amp;gt;&amp;quot;&amp;lt;/code&amp;gt;) it can be difficult to assess a job&#039;s progress.&lt;br /&gt;
&lt;br /&gt;
To inspect these streams &#039;&#039;while the job is running&#039;&#039;, and also to review a job&#039;s script, use the &amp;lt;code&amp;gt;qpeek&amp;lt;/code&amp;gt; command:&lt;br /&gt;
 qpeek &#039;&#039;jobnum&#039;&#039;&lt;br /&gt;
 qpeek -eo &#039;&#039;jobnum&#039;&#039;&lt;br /&gt;
 qpeek -s &#039;&#039;jobnum&#039;&#039;&lt;br /&gt;
Read its manual page for full documentation:&lt;br /&gt;
 qpeek --man&lt;br /&gt;
This command is a Carbon re-implementation of a Torque &amp;quot;contrib&amp;quot; script.&lt;br /&gt;
&lt;br /&gt;
To inspect a job&#039;s processes running on its compute nodes:&lt;br /&gt;
 qpeek -p &#039;&#039;jobnum&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Which nodes does a running job use? ===&lt;br /&gt;
 qstat -n [-1] &#039;&#039;jobnum&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Changing job resources after submission ==&lt;br /&gt;
&amp;lt;!-- http://www.adaptivecomputing.com/resources/docs/torque/4-1-4/Content/topics/commands/qalter.htm --&amp;gt;&lt;br /&gt;
Use &amp;lt;code&amp;gt;qalter&amp;lt;/code&amp;gt; to modify attributes of a job.&lt;br /&gt;
Only attributes specified on the command line will be changed.&lt;br /&gt;
If any of the specified attributes cannot  be modified for any reason, &#039;&#039;none&#039;&#039; of that job&#039;s attributes will be modified.&lt;br /&gt;
 qalter [-l &#039;&#039;resource&#039;&#039;] […] &#039;&#039;jobnumber&#039;&#039; …&lt;br /&gt;
 qalter -A &#039;&#039;accountspec&#039;&#039; &#039;&#039;jobnumber&#039;&#039; …&lt;br /&gt;
* Most attributes can be changed only &#039;&#039;before&#039;&#039; the job starts. Others, notably&lt;br /&gt;
&amp;lt;!-- http://www.adaptivecomputing.com/resources/docs/torque/4-1-4/Content/topics/commands/qsub.htm#-m --&amp;gt; mail options and &amp;lt;!-- [http://www.adaptivecomputing.com/resources/docs/torque/4-1-4/Content/topics/commands/qsub.htm#-W --&amp;gt; job dependencies can be meaningfully adjusted after start.&lt;br /&gt;
&lt;br /&gt;
; Advanced usage:&lt;br /&gt;
* &#039;&#039;Extending&#039;&#039; the &amp;lt;code&amp;gt;walltime&amp;lt;/code&amp;gt; resource of an already running job requires Torque administrator permission. You yourself can extend prior to running, and shorten always.  &#039;&#039;&#039;Warning:&#039;&#039;&#039; In either case, the new &amp;lt;code&amp;gt;walltime&amp;lt;/code&amp;gt; limit will be measured from start, not as remaining time. If a new walltime limit is shorter than the elapsed time, the job will be killed right away.&lt;br /&gt;
* You cannot modify the job script itself after submission. You will have to remove and resubmit the job.&lt;br /&gt;
Contact me ([[User:Stern|stern]]) to arrange for interventions.&lt;br /&gt;
&lt;br /&gt;
== Canceling (removing) jobs ==&lt;br /&gt;
To retract a queued job or kill an already running job:&lt;br /&gt;
  qdel &#039;&#039;jobnumber&#039;&#039;&lt;br /&gt;
&amp;lt;!-- http://www.adaptivecomputing.com/resources/docs/torque/4-1-4/Content/topics/12-appendices/prologueAndEpliogueScripts.htm --&amp;gt;&lt;br /&gt;
Torque epilogue scripts will immediately remove remaining user processes and user files from the used compute nodes upon job termination, be it natural or after qdel.&lt;br /&gt;
&lt;br /&gt;
== Declaring that a job requires licenses ==&lt;br /&gt;
A job that is to run software that requires a commercial license must declare such to the job scheduler (software that decides when and on which nodes the job could start).&lt;br /&gt;
The job scheduler monitors known licenses for availability, and so will know which and how many licenses are available at any given time.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; License availability checks do not happen instantaneously but rather by polling, roughly once every minute.&lt;br /&gt;
: This means that if you or another user happen to start a license-consuming application after the last check but before the relevant newly started job tries to access the same license, that job will terminate with a license failure.&lt;br /&gt;
&lt;br /&gt;
=== One license type ===&lt;br /&gt;
To request a single license token of a single type, use a &amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; (&amp;quot;general resource&amp;quot;) directive:&lt;br /&gt;
 #PBS -l &#039;&#039;&#039;gres&#039;&#039;&#039;=&#039;&#039;license_name&#039;&#039;&lt;br /&gt;
To request several tokens of a type, place either a &amp;lt;code&amp;gt;:&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;+&amp;lt;/code&amp;gt; as separator, followed by the number of tokens required:&lt;br /&gt;
 #PBS -l &#039;&#039;&#039;gres&#039;&#039;&#039;=&#039;&#039;license_name:count&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For compatibility, the resource type &amp;lt;code&amp;gt;software&amp;lt;/code&amp;gt; is accepted, but &#039;&#039;not for multiple types&#039;&#039; of licenses.&lt;br /&gt;
 #PBS -l &#039;&#039;&#039;software&#039;&#039;&#039;=&#039;&#039;license_name&#039;&#039;&lt;br /&gt;
 #or&lt;br /&gt;
 #PBS -l &#039;&#039;&#039;software&#039;&#039;&#039;=&#039;&#039;license_name:count&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Several license types ===&lt;br /&gt;
To request several different licenses, use &amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; with list of license tokens and their optional counts separated by &amp;lt;code&amp;gt;&amp;lt;font color=&amp;quot;#1A1&amp;quot;&amp;gt;&#039;&#039;&#039;%&#039;&#039;&#039;&amp;lt;/font&amp;gt;&amp;lt;/code&amp;gt;:&lt;br /&gt;
 #PBS -l gres=&#039;&#039;license1_name&#039;&#039;&amp;lt;font color=&amp;quot;#1A1&amp;quot;&amp;gt;&#039;&#039;&#039;%&#039;&#039;&#039;&amp;lt;/font&amp;gt;&#039;&#039;license2_name&#039;&#039;&lt;br /&gt;
 #PBS -l gres=&#039;&#039;license1_name:count1&#039;&#039;&amp;lt;font color=&amp;quot;#1A1&amp;quot;&amp;gt;&#039;&#039;&#039;%&#039;&#039;&#039;&amp;lt;/font&amp;gt;&#039;&#039;license2_name&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;software&amp;lt;/code&amp;gt; resource &#039;&#039;cannot&#039;&#039; request multiple license types.&lt;br /&gt;
(If several &amp;lt;code&amp;gt;software&amp;lt;/code&amp;gt; resources are requested, only the &#039;&#039;last one&#039;&#039; would be active.)&lt;br /&gt;
&lt;br /&gt;
== Interactive node access ==&lt;br /&gt;
There are two ways to interactively access nodes:&lt;br /&gt;
* Requesting an interactive job&lt;br /&gt;
 qsub -I [-l nodes=…]&lt;br /&gt;
: This is a special Torque job submission that will wait for the requested nodes to become available, and then you will be dropped into a login shell on the first core of the first node. $PBS_NODEFILE is set as in regular (non-interactive) jobs.&lt;br /&gt;
* Side-access a node that already runs a job, such as to debug or inspect running processes or node-local files.&lt;br /&gt;
: You can use &amp;lt;code&amp;gt;ssh&amp;lt;/code&amp;gt; to interactively access any compute node on which a job of yours is running (use &amp;lt;code&amp;gt;qsub -n &#039;&#039;jobnum&#039;&#039;&amp;lt;/code&amp;gt; to find out the node names). As soon as a node no longer runs at least &#039;&#039;one&#039;&#039; of your jobs, your ssh session to that node will be terminated. You may find the following commands helpful:&lt;br /&gt;
 /usr/sbin/lsof -u $USER&lt;br /&gt;
 /usr/sbin/lsof -c &#039;&#039;command_name&#039;&#039;&lt;br /&gt;
 /usr/sbin/lsof -p &#039;&#039;pid&#039;&#039;&lt;br /&gt;
: - &#039;&#039;&#039;l&#039;&#039;&#039;i&#039;&#039;&#039;s&#039;&#039;&#039;t &#039;&#039;&#039;o&#039;&#039;&#039;pen &#039;&#039;&#039;f&#039;&#039;&#039;iles; [http://linux.die.net/man/8/lsof man page.]&lt;br /&gt;
 ps -fu $USER&lt;br /&gt;
: - list your own processes.&lt;br /&gt;
 psuser&lt;br /&gt;
: - a Carbon-specific wrapper for [http://linux.die.net/man/1/ps ps] to list user-only processes (yours and other regular users&#039;, excluding system processes).&lt;br /&gt;
&lt;br /&gt;
== Job notification mails ==&lt;br /&gt;
You can request a notification message to be sent to you when a job begins, ends, or aborts. The message is rather terse and looks like this:&lt;br /&gt;
 &#039;&#039;&#039;Subject:&#039;&#039;&#039; PBS Job 281399.sched1.carboncluster&lt;br /&gt;
 &lt;br /&gt;
 PBS Job Id: 281399.sched1.carboncluster&lt;br /&gt;
 Job Name:   test.job&lt;br /&gt;
 Exec host:  n103/0&lt;br /&gt;
 Execution terminated&lt;br /&gt;
 Exit_status=0&lt;br /&gt;
 resources_used.cput=00:03:00&lt;br /&gt;
 resources_used.mem=123kb&lt;br /&gt;
 resources_used.vmem=240kb&lt;br /&gt;
 resources_used.walltime=00:03:04&lt;br /&gt;
&lt;br /&gt;
In the above, Exit_status=0 reflects the shell exit status, where 0 means success.&lt;br /&gt;
&lt;br /&gt;
The following means your job was terminated because it ran beyond its allocated walltime:&lt;br /&gt;
 Exit_status=271&lt;br /&gt;
: The shell exit status is this number mod 256, in this case &amp;lt;code&amp;gt;271 % 256 = 15&amp;lt;/code&amp;gt;, corresonding to &amp;lt;code&amp;gt;SIGTERM&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Recording where a job ran ==&lt;br /&gt;
The [[#Job notification mails]] explained above do not include $PBS_O_WORKDIR. You will have to arrange for yourself to record that information.&lt;br /&gt;
One way to do that would be to simply record all job numbers and their working directories at the beginning of each job:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#PBS -l nodes=…&lt;br /&gt;
#PBS -l walltime=…&lt;br /&gt;
#PBS -m bea&lt;br /&gt;
&lt;br /&gt;
cd $PBS_O_WORKDIR&lt;br /&gt;
echo $PBS_JOBID $PWD &amp;gt;&amp;gt; $HOME/jobdirs&lt;br /&gt;
&lt;br /&gt;
…&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
To query a job&#039;s directory, run:&lt;br /&gt;
 grep &#039;&#039;jobnumber&#039;&#039; ~/jobdirs&lt;br /&gt;
&lt;br /&gt;
== Sending mail while a job is running ==&lt;br /&gt;
It may be useful to have a job automatically &amp;quot;phone home&amp;quot; sometime after it started.&lt;br /&gt;
This can be accomplished at job submission time by arranging a mail to be sent, using a few added commands in the job script.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#PBS …&lt;br /&gt;
&lt;br /&gt;
cd $PBS_O_WORKDIR&lt;br /&gt;
&lt;br /&gt;
# arrange notification mail&lt;br /&gt;
(&lt;br /&gt;
    sleep 600	# time offset parameter, in seconds&lt;br /&gt;
    tail -20 somefile.out | mailx -s &amp;quot;$PBS_JOBID: partial log&amp;quot; $USER&lt;br /&gt;
) &amp;amp;&lt;br /&gt;
&lt;br /&gt;
# main work here&lt;br /&gt;
…&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Explanation: &lt;br /&gt;
* The commands inside &amp;lt;code&amp;gt;( … ) &amp;amp;&amp;lt;/code&amp;gt; run in a background track aside the main work.&lt;br /&gt;
* The first command, &amp;lt;code&amp;gt;sleep&amp;lt;/code&amp;gt;, delays further action (in this track only) by the specified time in seconds.&lt;br /&gt;
** To emphasize minutes, write &amp;lt;code&amp;gt;sleep $(( 10 * 60 ))&amp;lt;/code&amp;gt; .&lt;br /&gt;
** To set the time relative to the walltime limit, leverage the &amp;lt;code&amp;gt;$PBS_WALLTIME&amp;lt;/code&amp;gt; variable, e.g. as in &amp;lt;code&amp;gt;sleep $(( PBS_WALLTIME - ( &#039;&#039;minutes&#039;&#039; * 60 ) )).&amp;lt;/code&amp;gt;&lt;br /&gt;
* The &amp;lt;code&amp;gt;tail&amp;lt;/code&amp;gt; command is a stand-in for any inspection command you might want to run. An even simpler command could be &amp;lt;code&amp;gt;ls -lt&amp;lt;/code&amp;gt;. You could also use several commands enclosed by parentheses, &amp;lt;code&amp;gt;( cmd1; cmd2; ... )&amp;lt;/code&amp;gt;, to construct a more elaborate mail body.&lt;br /&gt;
* The &amp;lt;code&amp;gt;mailx&amp;lt;/code&amp;gt; command, following the pipe symbol &amp;lt;code&amp;gt;|&amp;lt;/code&amp;gt;, reads the output of your inspection command and sends you a mail with the subject specified by the &amp;lt;code&amp;gt;-s&amp;lt;/code&amp;gt; option.&lt;br /&gt;
* If the main part of the job finishes before the pre-mail sleep is over no mail will be sent.&lt;br /&gt;
&lt;br /&gt;
Note: The Moab scheduler also supports [http://www.adaptivecomputing.com/resources/docs/mwm/6-1-9/Content/topics/triggers/triggersIndex.html triggers], but they run in a different environment, not on an allocated node.&lt;br /&gt;
&lt;br /&gt;
[[Category:HPC|Getting Started]]&lt;/div&gt;</summary>
		<author><name>Stern</name></author>
	</entry>
	<entry>
		<id>https://wiki.anl.gov/wiki_cnm/index.php?title=HPC/Submitting_and_Managing_Jobs&amp;diff=7484</id>
		<title>HPC/Submitting and Managing Jobs</title>
		<link rel="alternate" type="text/html" href="https://wiki.anl.gov/wiki_cnm/index.php?title=HPC/Submitting_and_Managing_Jobs&amp;diff=7484"/>
		<updated>2026-02-17T20:40:49Z</updated>

		<summary type="html">&lt;p&gt;Stern: /* Inspecting &amp;quot;stuck&amp;quot; jobs */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Image:HPC job flow.png|right|400px|thumb|Processing flow of a typical job.]]&lt;br /&gt;
__TOC__&lt;br /&gt;
== Introduction ==&lt;br /&gt;
To accept and run jobs, Carbon uses the [http://en.wikipedia.org/wiki/TORQUE_Resource_Manager Torque Resource Manager],&lt;br /&gt;
which is a variant of [http://en.wikipedia.org/wiki/Portable_Batch_System PBS].&lt;br /&gt;
A separate software component called a [http://en.wikipedia.org/wiki/Job_scheduler &#039;&#039;scheduler&#039;&#039;] chooses the nodes and the start time for jobs according to the job parameters, resource availability, and configuration. Carbon uses the [http://www.adaptivecomputing.com/resources/docs/mwm/6-1-9/help.htm Moab Workload Manager] as scheduler. The resources used by each job (primarily the CPU time) are tracked and managed by the&lt;br /&gt;
[http://www.adaptivecomputing.com/resources/docs/gold/index.php Gold Allocation Manager].&lt;br /&gt;
&lt;br /&gt;
=== Job processing ===&lt;br /&gt;
A job consists of a [[#Job Script|job script]] and applications called therein. The figure at the top shows schematically how a typical job is processed.&lt;br /&gt;
Unless otherwise told, Torque will execute the job script on your behalf on the first node allocated by Moab,&lt;br /&gt;
in your &amp;lt;code&amp;gt;$HOME&amp;lt;/code&amp;gt; directory, and typically using your login shell. It is the &#039;&#039;script&#039;s responsibility&#039;&#039; to:&lt;br /&gt;
* Change to a suitable working directory.&lt;br /&gt;
* Recognize and use the other nodes of the job.&lt;br /&gt;
** This is generally done by directing an [http://en.wikipedia.org/wiki/Message_Passing_Interface MPI] program to start on the nodes listed in the job&#039;s &amp;lt;code&amp;gt;$PBS_NODEFILE&amp;lt;/code&amp;gt;.&lt;br /&gt;
** A job is perfectly free to run more than one program, such as several MPI programs in sequence.&lt;br /&gt;
* Set or propagate environment variables as needed to other nodes.&lt;br /&gt;
&lt;br /&gt;
=== Environment variables ===&lt;br /&gt;
The handling of environment variables across the cores and nodes that a job uses varies with the capabilities and configuration choices of the various MPI implementations.&lt;br /&gt;
&amp;lt;!-- It is recommended not to rely on defaults, but rather to make expectations and requirements explicit. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Variables usually are &#039;&#039;&#039;propagated core-to-core&#039;&#039;&#039; for all processes on the first node.&lt;br /&gt;
* Variables usually are &#039;&#039;&#039;not propagated node-to-node.&#039;&#039;&#039;&lt;br /&gt;
; Consequences:&lt;br /&gt;
* You must [[HPC/Software/Module Setup | &#039;&#039;&#039;configure modules and $PATH&#039;&#039;&#039;]] in your &amp;lt;code&amp;gt;$HOME/.bashrc&amp;lt;/code&amp;gt; file to help mpirun and other mechanisms locate your programs on each compute node. Otherwise mpirun will fail as soon as more than one node is involved, either by not finding the binary itself or some of its required shared libraries, or more insidiously, using different shared libraries.&lt;br /&gt;
* Both the variable &amp;lt;code&amp;gt;$PBS_NODEFILE&amp;lt;/code&amp;gt; and the file it points to are only available on the first node.&lt;br /&gt;
* To propagate (export) environment variables, use mpirun/mpiexec. However, there is no standard or quasi-standard across MPI flavors.&lt;br /&gt;
** [http://www.open-mpi.org/doc/v1.4/man1/mpirun.1.php#sect17 OpenMPI&#039;s mpirun] selectively exports some variables and supports the &amp;lt;code&amp;gt;-x&amp;lt;/code&amp;gt; flag to export additional variables.&lt;br /&gt;
** Intel&#039;s mpiexec/mpiexec.hydra offer &amp;lt;code&amp;gt;-envlist &#039;&#039;NAME,NAME,...&#039;&#039;&amp;lt;/code&amp;gt; instead. See Sec. 2.4 in the &#039;&#039;Reference Manual&#039;&#039; at [http://software.intel.com/en-us/articles/intel-mpi-library-documentation/].&lt;br /&gt;
&lt;br /&gt;
See also: [[HPC/Directories|directory layout]].&lt;br /&gt;
&lt;br /&gt;
== Submitting jobs ==&lt;br /&gt;
=== Job Script ===&lt;br /&gt;
A job is described to Torque by a &#039;&#039;job script,&#039;&#039; which in most cases is a shell script containing directives for Torque.&lt;br /&gt;
* [[HPC/Submitting and Managing Jobs/Example Job Script | &#039;&#039;&#039;Example Job Script&#039;&#039;&#039;]].&lt;br /&gt;
&lt;br /&gt;
=== Submission ===&lt;br /&gt;
To submit a job, use Torque&#039;s [http://www.adaptivecomputing.com/resources/docs/torque/4-1-4/Content/topics/commands/qsub.htm qsub] command on a login node.&lt;br /&gt;
  qsub [-A accountname] [options] &#039;&#039;jobfile&#039;&#039;&lt;br /&gt;
To review qsub operation and options, consult the following:&lt;br /&gt;
  man qsub&lt;br /&gt;
  qsub --help&lt;br /&gt;
&lt;br /&gt;
; Advanced usage:&lt;br /&gt;
* You &#039;&#039;can&#039;&#039; submit follow-up jobs from within a parent job script while it runs on a compute node, but it may be better to leverage [http://www.adaptivecomputing.com/resources/docs/torque/4-1-4/Content/topics/commands/qsub.htm#W job dependencies.]&lt;br /&gt;
* [http://www.adaptivecomputing.com/resources/docs/torque/4-1-4/Content/topics/2-jobs/requestingRes.htm Requesting Resources]&lt;br /&gt;
* Alternatively, use Moab&#039;s [http://www.adaptivecomputing.com/resources/docs/mwm/6-1-9/Content/commands/msub.html msub] command.&lt;br /&gt;
&lt;br /&gt;
=== Queues ===&lt;br /&gt;
See [[HPC/Submitting and Managing Jobs/Queues and Policies | Queues and Policies]].&lt;br /&gt;
&lt;br /&gt;
== Checking job status ==&lt;br /&gt;
Query your jobs using commands similar to those on other HPC clusters.&lt;br /&gt;
You can use either [http://www.adaptivecomputing.com/resources/docs/torque/4-1-4/Content/topics/12-appendices/commandsOverview.htm Torque commands]&lt;br /&gt;
or [http://www.adaptivecomputing.com/resources/docs/mwm/6-1-9/Content/a.gcommandoverview.html Moab commands].&lt;br /&gt;
Both access the same information, but through different routes, and offer different display styles.&lt;br /&gt;
&lt;br /&gt;
* To get the regular status output:&lt;br /&gt;
 [http://www.adaptivecomputing.com/resources/docs/torque/4-1-4/Content/topics/commands/qstat.htm qstat] [-u $USER]&lt;br /&gt;
 [http://www.adaptivecomputing.com/resources/docs/mwm/6-1-9/Content/commands/showq.html showq] [-u $USER]&lt;br /&gt;
* To get an &#039;&#039;alternate&#039;&#039; format (e.g. showing job names):&lt;br /&gt;
 qstat -a [-u $USER]&lt;br /&gt;
 showq -n [-u $USER]&lt;br /&gt;
: Option &amp;lt;code&amp;gt;-u $USER&amp;lt;/code&amp;gt; shows only your jobs. You can literally type &amp;lt;code&amp;gt;$USER&amp;lt;/code&amp;gt; instead of your user name.&lt;br /&gt;
* To get &#039;&#039;full&#039;&#039; job status information such as submit arguments and run directories, and do not wrap long lines (&amp;quot;-1&amp;quot; is the digit &amp;quot;one&amp;quot;):&lt;br /&gt;
 qstat -f [&#039;&#039;jobnum&#039;&#039;] [-1]&lt;br /&gt;
&lt;br /&gt;
== Inspecting stuck jobs ==&lt;br /&gt;
To diagnose problems with &amp;quot;stuck&amp;quot; jobs, use &amp;lt;code&amp;gt;qstat -s&amp;lt;/code&amp;gt;, or simply Moab&#039;s [http://www.adaptivecomputing.com/resources/docs/mwm/6-1-9/Content/commands/checkjob.html checkjob] command. The last few lines of output give &#039;&#039;past events&#039;&#039; of the job and its current status.&lt;br /&gt;
 qstat -s &#039;&#039;jobnum&#039;&#039;&lt;br /&gt;
 checkjob -v &#039;&#039;jobnum&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To get estimates on when your job might start:&lt;br /&gt;
 showstart [-e all] &#039;&#039;jobnum&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Inspecting running jobs ==&lt;br /&gt;
&lt;br /&gt;
=== Peeking at job output files ===&lt;br /&gt;
Each job has associated stdin and stderr streams which are gathered on its first node and are copied back only at job end time, according to the &amp;lt;code&amp;gt;#PBS&amp;lt;/code&amp;gt; directives -e, -o, or -j [eo|oe]. If the user does explicitly capture any output in the script (using shell redirections &amp;lt;code&amp;gt;&amp;quot;&amp;amp;gt;&amp;quot;&amp;lt;/code&amp;gt;) it can be difficult to assess a job&#039;s progress.&lt;br /&gt;
&lt;br /&gt;
To inspect these streams &#039;&#039;while the job is running&#039;&#039;, and also to review a job&#039;s script, use the &amp;lt;code&amp;gt;qpeek&amp;lt;/code&amp;gt; command:&lt;br /&gt;
 qpeek &#039;&#039;jobnum&#039;&#039;&lt;br /&gt;
 qpeek -eo &#039;&#039;jobnum&#039;&#039;&lt;br /&gt;
 qpeek -s &#039;&#039;jobnum&#039;&#039;&lt;br /&gt;
Read its manual page for full documentation:&lt;br /&gt;
 qpeek --man&lt;br /&gt;
This command is a Carbon re-implementation of a Torque &amp;quot;contrib&amp;quot; script.&lt;br /&gt;
&lt;br /&gt;
To inspect a job&#039;s processes running on its compute nodes:&lt;br /&gt;
 qpeek -p &#039;&#039;jobnum&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Which nodes does a running job use? ===&lt;br /&gt;
 qstat -n [-1] &#039;&#039;jobnum&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Changing job resources after submission ==&lt;br /&gt;
&amp;lt;!-- http://www.adaptivecomputing.com/resources/docs/torque/4-1-4/Content/topics/commands/qalter.htm --&amp;gt;&lt;br /&gt;
Use &amp;lt;code&amp;gt;qalter&amp;lt;/code&amp;gt; to modify attributes of a job.&lt;br /&gt;
Only attributes specified on the command line will be changed.&lt;br /&gt;
If any of the specified attributes cannot  be modified for any reason, &#039;&#039;none&#039;&#039; of that job&#039;s attributes will be modified.&lt;br /&gt;
 qalter [-l &#039;&#039;resource&#039;&#039;] […] &#039;&#039;jobnumber&#039;&#039; …&lt;br /&gt;
 qalter -A &#039;&#039;accountspec&#039;&#039; &#039;&#039;jobnumber&#039;&#039; …&lt;br /&gt;
* Most attributes can be changed only &#039;&#039;before&#039;&#039; the job starts. Others, notably&lt;br /&gt;
&amp;lt;!-- http://www.adaptivecomputing.com/resources/docs/torque/4-1-4/Content/topics/commands/qsub.htm#-m --&amp;gt; mail options and &amp;lt;!-- [http://www.adaptivecomputing.com/resources/docs/torque/4-1-4/Content/topics/commands/qsub.htm#-W --&amp;gt; job dependencies can be meaningfully adjusted after start.&lt;br /&gt;
&lt;br /&gt;
; Advanced usage:&lt;br /&gt;
* &#039;&#039;Extending&#039;&#039; the &amp;lt;code&amp;gt;walltime&amp;lt;/code&amp;gt; resource of an already running job requires Torque administrator permission. You yourself can extend prior to running, and shorten always.  &#039;&#039;&#039;Warning:&#039;&#039;&#039; In either case, the new &amp;lt;code&amp;gt;walltime&amp;lt;/code&amp;gt; limit will be measured from start, not as remaining time. If a new walltime limit is shorter than the elapsed time, the job will be killed right away.&lt;br /&gt;
* You cannot modify the job script itself after submission. You will have to remove and resubmit the job.&lt;br /&gt;
Contact me ([[User:Stern|stern]]) to arrange for interventions.&lt;br /&gt;
&lt;br /&gt;
== Canceling (removing) jobs ==&lt;br /&gt;
To retract a queued job or kill an already running job:&lt;br /&gt;
  qdel &#039;&#039;jobnumber&#039;&#039;&lt;br /&gt;
&amp;lt;!-- http://www.adaptivecomputing.com/resources/docs/torque/4-1-4/Content/topics/12-appendices/prologueAndEpliogueScripts.htm --&amp;gt;&lt;br /&gt;
Torque epilogue scripts will immediately remove remaining user processes and user files from the used compute nodes upon job termination, be it natural or after qdel.&lt;br /&gt;
&lt;br /&gt;
== Declaring that a job requires licenses ==&lt;br /&gt;
A job that is to run software that requires a commercial license must declare such to the job scheduler (software that decides when and on which nodes the job could start).&lt;br /&gt;
The job scheduler monitors known licenses for availability, and so will know which and how many licenses are available at any given time.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; License availability checks do not happen instantaneously but rather by polling, roughly once every minute.&lt;br /&gt;
: This means that if you or another user happen to start a license-consuming application after the last check but before the relevant newly started job tries to access the same license, that job will terminate with a license failure.&lt;br /&gt;
&lt;br /&gt;
=== One license type ===&lt;br /&gt;
To request a single license token of a single type, use a &amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; (&amp;quot;general resource&amp;quot;) directive:&lt;br /&gt;
 #PBS -l &#039;&#039;&#039;gres&#039;&#039;&#039;=&#039;&#039;license_name&#039;&#039;&lt;br /&gt;
To request several tokens of a type, place either a &amp;lt;code&amp;gt;:&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;+&amp;lt;/code&amp;gt; as separator, followed by the number of tokens required:&lt;br /&gt;
 #PBS -l &#039;&#039;&#039;gres&#039;&#039;&#039;=&#039;&#039;license_name:count&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For compatibility, the resource type &amp;lt;code&amp;gt;software&amp;lt;/code&amp;gt; is accepted, but &#039;&#039;not for multiple types&#039;&#039; of licenses.&lt;br /&gt;
 #PBS -l &#039;&#039;&#039;software&#039;&#039;&#039;=&#039;&#039;license_name&#039;&#039;&lt;br /&gt;
 #or&lt;br /&gt;
 #PBS -l &#039;&#039;&#039;software&#039;&#039;&#039;=&#039;&#039;license_name:count&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Several license types ===&lt;br /&gt;
To request several different licenses, use &amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; with list of license tokens and their optional counts separated by &amp;lt;code&amp;gt;&amp;lt;font color=&amp;quot;#1A1&amp;quot;&amp;gt;&#039;&#039;&#039;%&#039;&#039;&#039;&amp;lt;/font&amp;gt;&amp;lt;/code&amp;gt;:&lt;br /&gt;
 #PBS -l gres=&#039;&#039;license1_name&#039;&#039;&amp;lt;font color=&amp;quot;#1A1&amp;quot;&amp;gt;&#039;&#039;&#039;%&#039;&#039;&#039;&amp;lt;/font&amp;gt;&#039;&#039;license2_name&#039;&#039;&lt;br /&gt;
 #PBS -l gres=&#039;&#039;license1_name:count1&#039;&#039;&amp;lt;font color=&amp;quot;#1A1&amp;quot;&amp;gt;&#039;&#039;&#039;%&#039;&#039;&#039;&amp;lt;/font&amp;gt;&#039;&#039;license2_name&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;software&amp;lt;/code&amp;gt; resource &#039;&#039;cannot&#039;&#039; request multiple license types.&lt;br /&gt;
(If several &amp;lt;code&amp;gt;software&amp;lt;/code&amp;gt; resources are requested, only the &#039;&#039;last one&#039;&#039; would be active.)&lt;br /&gt;
&lt;br /&gt;
== Interactive node access ==&lt;br /&gt;
There are two ways to interactively access nodes:&lt;br /&gt;
* Requesting an interactive job&lt;br /&gt;
 qsub -I [-l nodes=…]&lt;br /&gt;
: This is a special Torque job submission that will wait for the requested nodes to become available, and then you will be dropped into a login shell on the first core of the first node. $PBS_NODEFILE is set as in regular (non-interactive) jobs.&lt;br /&gt;
* Side-access a node that already runs a job, such as to debug or inspect running processes or node-local files.&lt;br /&gt;
: You can use &amp;lt;code&amp;gt;ssh&amp;lt;/code&amp;gt; to interactively access any compute node on which a job of yours is running (use &amp;lt;code&amp;gt;qsub -n &#039;&#039;jobnum&#039;&#039;&amp;lt;/code&amp;gt; to find out the node names). As soon as a node no longer runs at least &#039;&#039;one&#039;&#039; of your jobs, your ssh session to that node will be terminated. You may find the following commands helpful:&lt;br /&gt;
 /usr/sbin/lsof -u $USER&lt;br /&gt;
 /usr/sbin/lsof -c &#039;&#039;command_name&#039;&#039;&lt;br /&gt;
 /usr/sbin/lsof -p &#039;&#039;pid&#039;&#039;&lt;br /&gt;
: - &#039;&#039;&#039;l&#039;&#039;&#039;i&#039;&#039;&#039;s&#039;&#039;&#039;t &#039;&#039;&#039;o&#039;&#039;&#039;pen &#039;&#039;&#039;f&#039;&#039;&#039;iles; [http://linux.die.net/man/8/lsof man page.]&lt;br /&gt;
 ps -fu $USER&lt;br /&gt;
: - list your own processes.&lt;br /&gt;
 psuser&lt;br /&gt;
: - a Carbon-specific wrapper for [http://linux.die.net/man/1/ps ps] to list user-only processes (yours and other regular users&#039;, excluding system processes).&lt;br /&gt;
&lt;br /&gt;
== Job notification mails ==&lt;br /&gt;
You can request a notification message to be sent to you when a job begins, ends, or aborts. The message is rather terse and looks like this:&lt;br /&gt;
 &#039;&#039;&#039;Subject:&#039;&#039;&#039; PBS Job 281399.sched1.carboncluster&lt;br /&gt;
 &lt;br /&gt;
 PBS Job Id: 281399.sched1.carboncluster&lt;br /&gt;
 Job Name:   test.job&lt;br /&gt;
 Exec host:  n103/0&lt;br /&gt;
 Execution terminated&lt;br /&gt;
 Exit_status=0&lt;br /&gt;
 resources_used.cput=00:03:00&lt;br /&gt;
 resources_used.mem=123kb&lt;br /&gt;
 resources_used.vmem=240kb&lt;br /&gt;
 resources_used.walltime=00:03:04&lt;br /&gt;
&lt;br /&gt;
In the above, Exit_status=0 reflects the shell exit status, where 0 means success.&lt;br /&gt;
&lt;br /&gt;
The following means your job was terminated because it ran beyond its allocated walltime:&lt;br /&gt;
 Exit_status=271&lt;br /&gt;
: The shell exit status is this number mod 256, in this case &amp;lt;code&amp;gt;271 % 256 = 15&amp;lt;/code&amp;gt;, corresonding to &amp;lt;code&amp;gt;SIGTERM&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Recording where a job ran ==&lt;br /&gt;
The [[#Job notification mails]] explained above do not include $PBS_O_WORKDIR. You will have to arrange for yourself to record that information.&lt;br /&gt;
One way to do that would be to simply record all job numbers and their working directories at the beginning of each job:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#PBS -l nodes=…&lt;br /&gt;
#PBS -l walltime=…&lt;br /&gt;
#PBS -m bea&lt;br /&gt;
&lt;br /&gt;
cd $PBS_O_WORKDIR&lt;br /&gt;
echo $PBS_JOBID $PWD &amp;gt;&amp;gt; $HOME/jobdirs&lt;br /&gt;
&lt;br /&gt;
…&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
To query a job&#039;s directory, run:&lt;br /&gt;
 grep &#039;&#039;jobnumber&#039;&#039; ~/jobdirs&lt;br /&gt;
&lt;br /&gt;
== Sending mail while a job is running ==&lt;br /&gt;
It may be useful to have a job automatically &amp;quot;phone home&amp;quot; sometime after it started.&lt;br /&gt;
This can be accomplished at job submission time by arranging a mail to be sent, using a few added commands in the job script.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#PBS …&lt;br /&gt;
&lt;br /&gt;
cd $PBS_O_WORKDIR&lt;br /&gt;
&lt;br /&gt;
# arrange notification mail&lt;br /&gt;
(&lt;br /&gt;
    sleep 600	# time offset parameter, in seconds&lt;br /&gt;
    tail -20 somefile.out | mailx -s &amp;quot;$PBS_JOBID: partial log&amp;quot; $USER&lt;br /&gt;
) &amp;amp;&lt;br /&gt;
&lt;br /&gt;
# main work here&lt;br /&gt;
…&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Explanation: &lt;br /&gt;
* The commands inside &amp;lt;code&amp;gt;( … ) &amp;amp;&amp;lt;/code&amp;gt; run in a background track aside the main work.&lt;br /&gt;
* The first command, &amp;lt;code&amp;gt;sleep&amp;lt;/code&amp;gt;, delays further action (in this track only) by the specified time in seconds.&lt;br /&gt;
** To emphasize minutes, write &amp;lt;code&amp;gt;sleep $(( 10 * 60 ))&amp;lt;/code&amp;gt; .&lt;br /&gt;
** To set the time relative to the walltime limit, leverage the &amp;lt;code&amp;gt;$PBS_WALLTIME&amp;lt;/code&amp;gt; variable, e.g. as in &amp;lt;code&amp;gt;sleep $(( PBS_WALLTIME - ( &#039;&#039;minutes&#039;&#039; * 60 ) )).&amp;lt;/code&amp;gt;&lt;br /&gt;
* The &amp;lt;code&amp;gt;tail&amp;lt;/code&amp;gt; command is a stand-in for any inspection command you might want to run. An even simpler command could be &amp;lt;code&amp;gt;ls -lt&amp;lt;/code&amp;gt;. You could also use several commands enclosed by parentheses, &amp;lt;code&amp;gt;( cmd1; cmd2; ... )&amp;lt;/code&amp;gt;, to construct a more elaborate mail body.&lt;br /&gt;
* The &amp;lt;code&amp;gt;mailx&amp;lt;/code&amp;gt; command, following the pipe symbol &amp;lt;code&amp;gt;|&amp;lt;/code&amp;gt;, reads the output of your inspection command and sends you a mail with the subject specified by the &amp;lt;code&amp;gt;-s&amp;lt;/code&amp;gt; option.&lt;br /&gt;
* If the main part of the job finishes before the pre-mail sleep is over no mail will be sent.&lt;br /&gt;
&lt;br /&gt;
Note: The Moab scheduler also supports [http://www.adaptivecomputing.com/resources/docs/mwm/6-1-9/Content/topics/triggers/triggersIndex.html triggers], but they run in a different environment, not on an allocated node.&lt;br /&gt;
&lt;br /&gt;
[[Category:HPC|Getting Started]]&lt;/div&gt;</summary>
		<author><name>Stern</name></author>
	</entry>
	<entry>
		<id>https://wiki.anl.gov/wiki_cnm/index.php?title=HPC/Submitting_and_Managing_Jobs&amp;diff=7483</id>
		<title>HPC/Submitting and Managing Jobs</title>
		<link rel="alternate" type="text/html" href="https://wiki.anl.gov/wiki_cnm/index.php?title=HPC/Submitting_and_Managing_Jobs&amp;diff=7483"/>
		<updated>2026-02-17T20:40:19Z</updated>

		<summary type="html">&lt;p&gt;Stern: /* Submitting and managing jobs */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Image:HPC job flow.png|right|400px|thumb|Processing flow of a typical job.]]&lt;br /&gt;
__TOC__&lt;br /&gt;
== Introduction ==&lt;br /&gt;
To accept and run jobs, Carbon uses the [http://en.wikipedia.org/wiki/TORQUE_Resource_Manager Torque Resource Manager],&lt;br /&gt;
which is a variant of [http://en.wikipedia.org/wiki/Portable_Batch_System PBS].&lt;br /&gt;
A separate software component called a [http://en.wikipedia.org/wiki/Job_scheduler &#039;&#039;scheduler&#039;&#039;] chooses the nodes and the start time for jobs according to the job parameters, resource availability, and configuration. Carbon uses the [http://www.adaptivecomputing.com/resources/docs/mwm/6-1-9/help.htm Moab Workload Manager] as scheduler. The resources used by each job (primarily the CPU time) are tracked and managed by the&lt;br /&gt;
[http://www.adaptivecomputing.com/resources/docs/gold/index.php Gold Allocation Manager].&lt;br /&gt;
&lt;br /&gt;
=== Job processing ===&lt;br /&gt;
A job consists of a [[#Job Script|job script]] and applications called therein. The figure at the top shows schematically how a typical job is processed.&lt;br /&gt;
Unless otherwise told, Torque will execute the job script on your behalf on the first node allocated by Moab,&lt;br /&gt;
in your &amp;lt;code&amp;gt;$HOME&amp;lt;/code&amp;gt; directory, and typically using your login shell. It is the &#039;&#039;script&#039;s responsibility&#039;&#039; to:&lt;br /&gt;
* Change to a suitable working directory.&lt;br /&gt;
* Recognize and use the other nodes of the job.&lt;br /&gt;
** This is generally done by directing an [http://en.wikipedia.org/wiki/Message_Passing_Interface MPI] program to start on the nodes listed in the job&#039;s &amp;lt;code&amp;gt;$PBS_NODEFILE&amp;lt;/code&amp;gt;.&lt;br /&gt;
** A job is perfectly free to run more than one program, such as several MPI programs in sequence.&lt;br /&gt;
* Set or propagate environment variables as needed to other nodes.&lt;br /&gt;
&lt;br /&gt;
=== Environment variables ===&lt;br /&gt;
The handling of environment variables across the cores and nodes that a job uses varies with the capabilities and configuration choices of the various MPI implementations.&lt;br /&gt;
&amp;lt;!-- It is recommended not to rely on defaults, but rather to make expectations and requirements explicit. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Variables usually are &#039;&#039;&#039;propagated core-to-core&#039;&#039;&#039; for all processes on the first node.&lt;br /&gt;
* Variables usually are &#039;&#039;&#039;not propagated node-to-node.&#039;&#039;&#039;&lt;br /&gt;
; Consequences:&lt;br /&gt;
* You must [[HPC/Software/Module Setup | &#039;&#039;&#039;configure modules and $PATH&#039;&#039;&#039;]] in your &amp;lt;code&amp;gt;$HOME/.bashrc&amp;lt;/code&amp;gt; file to help mpirun and other mechanisms locate your programs on each compute node. Otherwise mpirun will fail as soon as more than one node is involved, either by not finding the binary itself or some of its required shared libraries, or more insidiously, using different shared libraries.&lt;br /&gt;
* Both the variable &amp;lt;code&amp;gt;$PBS_NODEFILE&amp;lt;/code&amp;gt; and the file it points to are only available on the first node.&lt;br /&gt;
* To propagate (export) environment variables, use mpirun/mpiexec. However, there is no standard or quasi-standard across MPI flavors.&lt;br /&gt;
** [http://www.open-mpi.org/doc/v1.4/man1/mpirun.1.php#sect17 OpenMPI&#039;s mpirun] selectively exports some variables and supports the &amp;lt;code&amp;gt;-x&amp;lt;/code&amp;gt; flag to export additional variables.&lt;br /&gt;
** Intel&#039;s mpiexec/mpiexec.hydra offer &amp;lt;code&amp;gt;-envlist &#039;&#039;NAME,NAME,...&#039;&#039;&amp;lt;/code&amp;gt; instead. See Sec. 2.4 in the &#039;&#039;Reference Manual&#039;&#039; at [http://software.intel.com/en-us/articles/intel-mpi-library-documentation/].&lt;br /&gt;
&lt;br /&gt;
See also: [[HPC/Directories|directory layout]].&lt;br /&gt;
&lt;br /&gt;
== Submitting jobs ==&lt;br /&gt;
=== Job Script ===&lt;br /&gt;
A job is described to Torque by a &#039;&#039;job script,&#039;&#039; which in most cases is a shell script containing directives for Torque.&lt;br /&gt;
* [[HPC/Submitting and Managing Jobs/Example Job Script | &#039;&#039;&#039;Example Job Script&#039;&#039;&#039;]].&lt;br /&gt;
&lt;br /&gt;
=== Submission ===&lt;br /&gt;
To submit a job, use Torque&#039;s [http://www.adaptivecomputing.com/resources/docs/torque/4-1-4/Content/topics/commands/qsub.htm qsub] command on a login node.&lt;br /&gt;
  qsub [-A accountname] [options] &#039;&#039;jobfile&#039;&#039;&lt;br /&gt;
To review qsub operation and options, consult the following:&lt;br /&gt;
  man qsub&lt;br /&gt;
  qsub --help&lt;br /&gt;
&lt;br /&gt;
; Advanced usage:&lt;br /&gt;
* You &#039;&#039;can&#039;&#039; submit follow-up jobs from within a parent job script while it runs on a compute node, but it may be better to leverage [http://www.adaptivecomputing.com/resources/docs/torque/4-1-4/Content/topics/commands/qsub.htm#W job dependencies.]&lt;br /&gt;
* [http://www.adaptivecomputing.com/resources/docs/torque/4-1-4/Content/topics/2-jobs/requestingRes.htm Requesting Resources]&lt;br /&gt;
* Alternatively, use Moab&#039;s [http://www.adaptivecomputing.com/resources/docs/mwm/6-1-9/Content/commands/msub.html msub] command.&lt;br /&gt;
&lt;br /&gt;
=== Queues ===&lt;br /&gt;
See [[HPC/Submitting and Managing Jobs/Queues and Policies | Queues and Policies]].&lt;br /&gt;
&lt;br /&gt;
== Checking job status ==&lt;br /&gt;
Query your jobs using commands similar to those on other HPC clusters.&lt;br /&gt;
You can use either [http://www.adaptivecomputing.com/resources/docs/torque/4-1-4/Content/topics/12-appendices/commandsOverview.htm Torque commands]&lt;br /&gt;
or [http://www.adaptivecomputing.com/resources/docs/mwm/6-1-9/Content/a.gcommandoverview.html Moab commands].&lt;br /&gt;
Both access the same information, but through different routes, and offer different display styles.&lt;br /&gt;
&lt;br /&gt;
* To get the regular status output:&lt;br /&gt;
 [http://www.adaptivecomputing.com/resources/docs/torque/4-1-4/Content/topics/commands/qstat.htm qstat] [-u $USER]&lt;br /&gt;
 [http://www.adaptivecomputing.com/resources/docs/mwm/6-1-9/Content/commands/showq.html showq] [-u $USER]&lt;br /&gt;
* To get an &#039;&#039;alternate&#039;&#039; format (e.g. showing job names):&lt;br /&gt;
 qstat -a [-u $USER]&lt;br /&gt;
 showq -n [-u $USER]&lt;br /&gt;
: Option &amp;lt;code&amp;gt;-u $USER&amp;lt;/code&amp;gt; shows only your jobs. You can literally type &amp;lt;code&amp;gt;$USER&amp;lt;/code&amp;gt; instead of your user name.&lt;br /&gt;
* To get &#039;&#039;full&#039;&#039; job status information such as submit arguments and run directories, and do not wrap long lines (&amp;quot;-1&amp;quot; is the digit &amp;quot;one&amp;quot;):&lt;br /&gt;
 qstat -f [&#039;&#039;jobnum&#039;&#039;] [-1]&lt;br /&gt;
&lt;br /&gt;
== Inspecting &amp;quot;stuck&amp;quot; jobs ==&lt;br /&gt;
To diagnose problems with &amp;quot;stuck&amp;quot; jobs, use &amp;lt;code&amp;gt;qstat -s&amp;lt;/code&amp;gt;, or simply Moab&#039;s [http://www.adaptivecomputing.com/resources/docs/mwm/6-1-9/Content/commands/checkjob.html checkjob] command. The last few lines of output give &#039;&#039;past events&#039;&#039; of the job and its current status.&lt;br /&gt;
 qstat -s &#039;&#039;jobnum&#039;&#039;&lt;br /&gt;
 checkjob -v &#039;&#039;jobnum&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To get estimates on when your job might start:&lt;br /&gt;
 showstart [-e all] &#039;&#039;jobnum&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Inspecting running jobs ==&lt;br /&gt;
&lt;br /&gt;
=== Peeking at job output files ===&lt;br /&gt;
Each job has associated stdin and stderr streams which are gathered on its first node and are copied back only at job end time, according to the &amp;lt;code&amp;gt;#PBS&amp;lt;/code&amp;gt; directives -e, -o, or -j [eo|oe]. If the user does explicitly capture any output in the script (using shell redirections &amp;lt;code&amp;gt;&amp;quot;&amp;amp;gt;&amp;quot;&amp;lt;/code&amp;gt;) it can be difficult to assess a job&#039;s progress.&lt;br /&gt;
&lt;br /&gt;
To inspect these streams &#039;&#039;while the job is running&#039;&#039;, and also to review a job&#039;s script, use the &amp;lt;code&amp;gt;qpeek&amp;lt;/code&amp;gt; command:&lt;br /&gt;
 qpeek &#039;&#039;jobnum&#039;&#039;&lt;br /&gt;
 qpeek -eo &#039;&#039;jobnum&#039;&#039;&lt;br /&gt;
 qpeek -s &#039;&#039;jobnum&#039;&#039;&lt;br /&gt;
Read its manual page for full documentation:&lt;br /&gt;
 qpeek --man&lt;br /&gt;
This command is a Carbon re-implementation of a Torque &amp;quot;contrib&amp;quot; script.&lt;br /&gt;
&lt;br /&gt;
To inspect a job&#039;s processes running on its compute nodes:&lt;br /&gt;
 qpeek -p &#039;&#039;jobnum&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Which nodes does a running job use? ===&lt;br /&gt;
 qstat -n [-1] &#039;&#039;jobnum&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Changing job resources after submission ==&lt;br /&gt;
&amp;lt;!-- http://www.adaptivecomputing.com/resources/docs/torque/4-1-4/Content/topics/commands/qalter.htm --&amp;gt;&lt;br /&gt;
Use &amp;lt;code&amp;gt;qalter&amp;lt;/code&amp;gt; to modify attributes of a job.&lt;br /&gt;
Only attributes specified on the command line will be changed.&lt;br /&gt;
If any of the specified attributes cannot  be modified for any reason, &#039;&#039;none&#039;&#039; of that job&#039;s attributes will be modified.&lt;br /&gt;
 qalter [-l &#039;&#039;resource&#039;&#039;] […] &#039;&#039;jobnumber&#039;&#039; …&lt;br /&gt;
 qalter -A &#039;&#039;accountspec&#039;&#039; &#039;&#039;jobnumber&#039;&#039; …&lt;br /&gt;
* Most attributes can be changed only &#039;&#039;before&#039;&#039; the job starts. Others, notably&lt;br /&gt;
&amp;lt;!-- http://www.adaptivecomputing.com/resources/docs/torque/4-1-4/Content/topics/commands/qsub.htm#-m --&amp;gt; mail options and &amp;lt;!-- [http://www.adaptivecomputing.com/resources/docs/torque/4-1-4/Content/topics/commands/qsub.htm#-W --&amp;gt; job dependencies can be meaningfully adjusted after start.&lt;br /&gt;
&lt;br /&gt;
; Advanced usage:&lt;br /&gt;
* &#039;&#039;Extending&#039;&#039; the &amp;lt;code&amp;gt;walltime&amp;lt;/code&amp;gt; resource of an already running job requires Torque administrator permission. You yourself can extend prior to running, and shorten always.  &#039;&#039;&#039;Warning:&#039;&#039;&#039; In either case, the new &amp;lt;code&amp;gt;walltime&amp;lt;/code&amp;gt; limit will be measured from start, not as remaining time. If a new walltime limit is shorter than the elapsed time, the job will be killed right away.&lt;br /&gt;
* You cannot modify the job script itself after submission. You will have to remove and resubmit the job.&lt;br /&gt;
Contact me ([[User:Stern|stern]]) to arrange for interventions.&lt;br /&gt;
&lt;br /&gt;
== Canceling (removing) jobs ==&lt;br /&gt;
To retract a queued job or kill an already running job:&lt;br /&gt;
  qdel &#039;&#039;jobnumber&#039;&#039;&lt;br /&gt;
&amp;lt;!-- http://www.adaptivecomputing.com/resources/docs/torque/4-1-4/Content/topics/12-appendices/prologueAndEpliogueScripts.htm --&amp;gt;&lt;br /&gt;
Torque epilogue scripts will immediately remove remaining user processes and user files from the used compute nodes upon job termination, be it natural or after qdel.&lt;br /&gt;
&lt;br /&gt;
== Declaring that a job requires licenses ==&lt;br /&gt;
A job that is to run software that requires a commercial license must declare such to the job scheduler (software that decides when and on which nodes the job could start).&lt;br /&gt;
The job scheduler monitors known licenses for availability, and so will know which and how many licenses are available at any given time.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; License availability checks do not happen instantaneously but rather by polling, roughly once every minute.&lt;br /&gt;
: This means that if you or another user happen to start a license-consuming application after the last check but before the relevant newly started job tries to access the same license, that job will terminate with a license failure.&lt;br /&gt;
&lt;br /&gt;
=== One license type ===&lt;br /&gt;
To request a single license token of a single type, use a &amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; (&amp;quot;general resource&amp;quot;) directive:&lt;br /&gt;
 #PBS -l &#039;&#039;&#039;gres&#039;&#039;&#039;=&#039;&#039;license_name&#039;&#039;&lt;br /&gt;
To request several tokens of a type, place either a &amp;lt;code&amp;gt;:&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;+&amp;lt;/code&amp;gt; as separator, followed by the number of tokens required:&lt;br /&gt;
 #PBS -l &#039;&#039;&#039;gres&#039;&#039;&#039;=&#039;&#039;license_name:count&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For compatibility, the resource type &amp;lt;code&amp;gt;software&amp;lt;/code&amp;gt; is accepted, but &#039;&#039;not for multiple types&#039;&#039; of licenses.&lt;br /&gt;
 #PBS -l &#039;&#039;&#039;software&#039;&#039;&#039;=&#039;&#039;license_name&#039;&#039;&lt;br /&gt;
 #or&lt;br /&gt;
 #PBS -l &#039;&#039;&#039;software&#039;&#039;&#039;=&#039;&#039;license_name:count&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Several license types ===&lt;br /&gt;
To request several different licenses, use &amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; with list of license tokens and their optional counts separated by &amp;lt;code&amp;gt;&amp;lt;font color=&amp;quot;#1A1&amp;quot;&amp;gt;&#039;&#039;&#039;%&#039;&#039;&#039;&amp;lt;/font&amp;gt;&amp;lt;/code&amp;gt;:&lt;br /&gt;
 #PBS -l gres=&#039;&#039;license1_name&#039;&#039;&amp;lt;font color=&amp;quot;#1A1&amp;quot;&amp;gt;&#039;&#039;&#039;%&#039;&#039;&#039;&amp;lt;/font&amp;gt;&#039;&#039;license2_name&#039;&#039;&lt;br /&gt;
 #PBS -l gres=&#039;&#039;license1_name:count1&#039;&#039;&amp;lt;font color=&amp;quot;#1A1&amp;quot;&amp;gt;&#039;&#039;&#039;%&#039;&#039;&#039;&amp;lt;/font&amp;gt;&#039;&#039;license2_name&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;software&amp;lt;/code&amp;gt; resource &#039;&#039;cannot&#039;&#039; request multiple license types.&lt;br /&gt;
(If several &amp;lt;code&amp;gt;software&amp;lt;/code&amp;gt; resources are requested, only the &#039;&#039;last one&#039;&#039; would be active.)&lt;br /&gt;
&lt;br /&gt;
== Interactive node access ==&lt;br /&gt;
There are two ways to interactively access nodes:&lt;br /&gt;
* Requesting an interactive job&lt;br /&gt;
 qsub -I [-l nodes=…]&lt;br /&gt;
: This is a special Torque job submission that will wait for the requested nodes to become available, and then you will be dropped into a login shell on the first core of the first node. $PBS_NODEFILE is set as in regular (non-interactive) jobs.&lt;br /&gt;
* Side-access a node that already runs a job, such as to debug or inspect running processes or node-local files.&lt;br /&gt;
: You can use &amp;lt;code&amp;gt;ssh&amp;lt;/code&amp;gt; to interactively access any compute node on which a job of yours is running (use &amp;lt;code&amp;gt;qsub -n &#039;&#039;jobnum&#039;&#039;&amp;lt;/code&amp;gt; to find out the node names). As soon as a node no longer runs at least &#039;&#039;one&#039;&#039; of your jobs, your ssh session to that node will be terminated. You may find the following commands helpful:&lt;br /&gt;
 /usr/sbin/lsof -u $USER&lt;br /&gt;
 /usr/sbin/lsof -c &#039;&#039;command_name&#039;&#039;&lt;br /&gt;
 /usr/sbin/lsof -p &#039;&#039;pid&#039;&#039;&lt;br /&gt;
: - &#039;&#039;&#039;l&#039;&#039;&#039;i&#039;&#039;&#039;s&#039;&#039;&#039;t &#039;&#039;&#039;o&#039;&#039;&#039;pen &#039;&#039;&#039;f&#039;&#039;&#039;iles; [http://linux.die.net/man/8/lsof man page.]&lt;br /&gt;
 ps -fu $USER&lt;br /&gt;
: - list your own processes.&lt;br /&gt;
 psuser&lt;br /&gt;
: - a Carbon-specific wrapper for [http://linux.die.net/man/1/ps ps] to list user-only processes (yours and other regular users&#039;, excluding system processes).&lt;br /&gt;
&lt;br /&gt;
== Job notification mails ==&lt;br /&gt;
You can request a notification message to be sent to you when a job begins, ends, or aborts. The message is rather terse and looks like this:&lt;br /&gt;
 &#039;&#039;&#039;Subject:&#039;&#039;&#039; PBS Job 281399.sched1.carboncluster&lt;br /&gt;
 &lt;br /&gt;
 PBS Job Id: 281399.sched1.carboncluster&lt;br /&gt;
 Job Name:   test.job&lt;br /&gt;
 Exec host:  n103/0&lt;br /&gt;
 Execution terminated&lt;br /&gt;
 Exit_status=0&lt;br /&gt;
 resources_used.cput=00:03:00&lt;br /&gt;
 resources_used.mem=123kb&lt;br /&gt;
 resources_used.vmem=240kb&lt;br /&gt;
 resources_used.walltime=00:03:04&lt;br /&gt;
&lt;br /&gt;
In the above, Exit_status=0 reflects the shell exit status, where 0 means success.&lt;br /&gt;
&lt;br /&gt;
The following means your job was terminated because it ran beyond its allocated walltime:&lt;br /&gt;
 Exit_status=271&lt;br /&gt;
: The shell exit status is this number mod 256, in this case &amp;lt;code&amp;gt;271 % 256 = 15&amp;lt;/code&amp;gt;, corresonding to &amp;lt;code&amp;gt;SIGTERM&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Recording where a job ran ==&lt;br /&gt;
The [[#Job notification mails]] explained above do not include $PBS_O_WORKDIR. You will have to arrange for yourself to record that information.&lt;br /&gt;
One way to do that would be to simply record all job numbers and their working directories at the beginning of each job:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#PBS -l nodes=…&lt;br /&gt;
#PBS -l walltime=…&lt;br /&gt;
#PBS -m bea&lt;br /&gt;
&lt;br /&gt;
cd $PBS_O_WORKDIR&lt;br /&gt;
echo $PBS_JOBID $PWD &amp;gt;&amp;gt; $HOME/jobdirs&lt;br /&gt;
&lt;br /&gt;
…&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
To query a job&#039;s directory, run:&lt;br /&gt;
 grep &#039;&#039;jobnumber&#039;&#039; ~/jobdirs&lt;br /&gt;
&lt;br /&gt;
== Sending mail while a job is running ==&lt;br /&gt;
It may be useful to have a job automatically &amp;quot;phone home&amp;quot; sometime after it started.&lt;br /&gt;
This can be accomplished at job submission time by arranging a mail to be sent, using a few added commands in the job script.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#PBS …&lt;br /&gt;
&lt;br /&gt;
cd $PBS_O_WORKDIR&lt;br /&gt;
&lt;br /&gt;
# arrange notification mail&lt;br /&gt;
(&lt;br /&gt;
    sleep 600	# time offset parameter, in seconds&lt;br /&gt;
    tail -20 somefile.out | mailx -s &amp;quot;$PBS_JOBID: partial log&amp;quot; $USER&lt;br /&gt;
) &amp;amp;&lt;br /&gt;
&lt;br /&gt;
# main work here&lt;br /&gt;
…&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Explanation: &lt;br /&gt;
* The commands inside &amp;lt;code&amp;gt;( … ) &amp;amp;&amp;lt;/code&amp;gt; run in a background track aside the main work.&lt;br /&gt;
* The first command, &amp;lt;code&amp;gt;sleep&amp;lt;/code&amp;gt;, delays further action (in this track only) by the specified time in seconds.&lt;br /&gt;
** To emphasize minutes, write &amp;lt;code&amp;gt;sleep $(( 10 * 60 ))&amp;lt;/code&amp;gt; .&lt;br /&gt;
** To set the time relative to the walltime limit, leverage the &amp;lt;code&amp;gt;$PBS_WALLTIME&amp;lt;/code&amp;gt; variable, e.g. as in &amp;lt;code&amp;gt;sleep $(( PBS_WALLTIME - ( &#039;&#039;minutes&#039;&#039; * 60 ) )).&amp;lt;/code&amp;gt;&lt;br /&gt;
* The &amp;lt;code&amp;gt;tail&amp;lt;/code&amp;gt; command is a stand-in for any inspection command you might want to run. An even simpler command could be &amp;lt;code&amp;gt;ls -lt&amp;lt;/code&amp;gt;. You could also use several commands enclosed by parentheses, &amp;lt;code&amp;gt;( cmd1; cmd2; ... )&amp;lt;/code&amp;gt;, to construct a more elaborate mail body.&lt;br /&gt;
* The &amp;lt;code&amp;gt;mailx&amp;lt;/code&amp;gt; command, following the pipe symbol &amp;lt;code&amp;gt;|&amp;lt;/code&amp;gt;, reads the output of your inspection command and sends you a mail with the subject specified by the &amp;lt;code&amp;gt;-s&amp;lt;/code&amp;gt; option.&lt;br /&gt;
* If the main part of the job finishes before the pre-mail sleep is over no mail will be sent.&lt;br /&gt;
&lt;br /&gt;
Note: The Moab scheduler also supports [http://www.adaptivecomputing.com/resources/docs/mwm/6-1-9/Content/topics/triggers/triggersIndex.html triggers], but they run in a different environment, not on an allocated node.&lt;br /&gt;
&lt;br /&gt;
[[Category:HPC|Getting Started]]&lt;/div&gt;</summary>
		<author><name>Stern</name></author>
	</entry>
	<entry>
		<id>https://wiki.anl.gov/wiki_cnm/index.php?title=HPC/Submitting_and_Managing_Jobs&amp;diff=7482</id>
		<title>HPC/Submitting and Managing Jobs</title>
		<link rel="alternate" type="text/html" href="https://wiki.anl.gov/wiki_cnm/index.php?title=HPC/Submitting_and_Managing_Jobs&amp;diff=7482"/>
		<updated>2026-02-17T20:35:44Z</updated>

		<summary type="html">&lt;p&gt;Stern: /* Submitting and managing jobs */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Image:HPC job flow.png|right|400px|thumb|Processing flow of a typical job.]]&lt;br /&gt;
__TOC__&lt;br /&gt;
== Introduction ==&lt;br /&gt;
To accept and run jobs, Carbon uses the [http://en.wikipedia.org/wiki/TORQUE_Resource_Manager Torque Resource Manager],&lt;br /&gt;
which is a variant of [http://en.wikipedia.org/wiki/Portable_Batch_System PBS].&lt;br /&gt;
A separate software component called a [http://en.wikipedia.org/wiki/Job_scheduler &#039;&#039;scheduler&#039;&#039;] chooses the nodes and the start time for jobs according to the job parameters, resource availability, and configuration. Carbon uses the [http://www.adaptivecomputing.com/resources/docs/mwm/6-1-9/help.htm Moab Workload Manager] as scheduler. The resources used by each job (primarily the CPU time) are tracked and managed by the&lt;br /&gt;
[http://www.adaptivecomputing.com/resources/docs/gold/index.php Gold Allocation Manager].&lt;br /&gt;
&lt;br /&gt;
=== Job processing ===&lt;br /&gt;
A job consists of a [[#Job Script|job script]] and applications called therein. The figure at the top shows schematically how a typical job is processed.&lt;br /&gt;
Unless otherwise told, Torque will execute the job script on your behalf on the first node allocated by Moab,&lt;br /&gt;
in your &amp;lt;code&amp;gt;$HOME&amp;lt;/code&amp;gt; directory, and typically using your login shell. It is the &#039;&#039;script&#039;s responsibility&#039;&#039; to:&lt;br /&gt;
* Change to a suitable working directory.&lt;br /&gt;
* Recognize and use the other nodes of the job.&lt;br /&gt;
** This is generally done by directing an [http://en.wikipedia.org/wiki/Message_Passing_Interface MPI] program to start on the nodes listed in the job&#039;s &amp;lt;code&amp;gt;$PBS_NODEFILE&amp;lt;/code&amp;gt;.&lt;br /&gt;
** A job is perfectly free to run more than one program, such as several MPI programs in sequence.&lt;br /&gt;
* Set or propagate environment variables as needed to other nodes.&lt;br /&gt;
&lt;br /&gt;
=== Environment variables ===&lt;br /&gt;
The handling of environment variables across the cores and nodes that a job uses varies with the capabilities and configuration choices of the various MPI implementations.&lt;br /&gt;
&amp;lt;!-- It is recommended not to rely on defaults, but rather to make expectations and requirements explicit. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Variables usually are &#039;&#039;&#039;propagated core-to-core&#039;&#039;&#039; for all processes on the first node.&lt;br /&gt;
* Variables usually are &#039;&#039;&#039;not propagated node-to-node.&#039;&#039;&#039;&lt;br /&gt;
; Consequences:&lt;br /&gt;
* You must [[HPC/Software/Module Setup | &#039;&#039;&#039;configure modules and $PATH&#039;&#039;&#039;]] in your &amp;lt;code&amp;gt;$HOME/.bashrc&amp;lt;/code&amp;gt; file to help mpirun and other mechanisms locate your programs on each compute node. Otherwise mpirun will fail as soon as more than one node is involved, either by not finding the binary itself or some of its required shared libraries, or more insidiously, using different shared libraries.&lt;br /&gt;
* Both the variable &amp;lt;code&amp;gt;$PBS_NODEFILE&amp;lt;/code&amp;gt; and the file it points to are only available on the first node.&lt;br /&gt;
* To propagate (export) environment variables, use mpirun/mpiexec. However, there is no standard or quasi-standard across MPI flavors.&lt;br /&gt;
** [http://www.open-mpi.org/doc/v1.4/man1/mpirun.1.php#sect17 OpenMPI&#039;s mpirun] selectively exports some variables and supports the &amp;lt;code&amp;gt;-x&amp;lt;/code&amp;gt; flag to export additional variables.&lt;br /&gt;
** Intel&#039;s mpiexec/mpiexec.hydra offer &amp;lt;code&amp;gt;-envlist &#039;&#039;NAME,NAME,...&#039;&#039;&amp;lt;/code&amp;gt; instead. See Sec. 2.4 in the &#039;&#039;Reference Manual&#039;&#039; at [http://software.intel.com/en-us/articles/intel-mpi-library-documentation/].&lt;br /&gt;
&lt;br /&gt;
See also: [[HPC/Directories|directory layout]].&lt;br /&gt;
&lt;br /&gt;
== Submitting and managing jobs ==&lt;br /&gt;
=== Job Script ===&lt;br /&gt;
A job is described to Torque by a &#039;&#039;job script,&#039;&#039; which in most cases is a shell script containing directives for Torque.&lt;br /&gt;
* [[HPC/Submitting and Managing Jobs/Example Job Script | &#039;&#039;&#039;Example Job Script&#039;&#039;&#039;]].&lt;br /&gt;
&lt;br /&gt;
=== Submission ===&lt;br /&gt;
To submit a job, use Torque&#039;s [http://www.adaptivecomputing.com/resources/docs/torque/4-1-4/Content/topics/commands/qsub.htm qsub] command on a login node.&lt;br /&gt;
  qsub [-A accountname] [options] &#039;&#039;jobfile&#039;&#039;&lt;br /&gt;
To review qsub operation and options, consult the following:&lt;br /&gt;
  man qsub&lt;br /&gt;
  qsub --help&lt;br /&gt;
&lt;br /&gt;
; Advanced usage:&lt;br /&gt;
* You &#039;&#039;can&#039;&#039; submit follow-up jobs from within a parent job script while it runs on a compute node, but it may be better to leverage [http://www.adaptivecomputing.com/resources/docs/torque/4-1-4/Content/topics/commands/qsub.htm#W job dependencies.]&lt;br /&gt;
* [http://www.adaptivecomputing.com/resources/docs/torque/4-1-4/Content/topics/2-jobs/requestingRes.htm Requesting Resources]&lt;br /&gt;
* Alternatively, use Moab&#039;s [http://www.adaptivecomputing.com/resources/docs/mwm/6-1-9/Content/commands/msub.html msub] command.&lt;br /&gt;
&lt;br /&gt;
=== Queues ===&lt;br /&gt;
See [[HPC/Submitting and Managing Jobs/Queues and Policies | Queues and Policies]].&lt;br /&gt;
&lt;br /&gt;
=== Checking job status ===&lt;br /&gt;
Query your jobs using commands similar to those on other HPC clusters.&lt;br /&gt;
You can use either [http://www.adaptivecomputing.com/resources/docs/torque/4-1-4/Content/topics/12-appendices/commandsOverview.htm Torque commands]&lt;br /&gt;
or [http://www.adaptivecomputing.com/resources/docs/mwm/6-1-9/Content/a.gcommandoverview.html Moab commands].&lt;br /&gt;
Both access the same information, but through different routes, and offer different display styles.&lt;br /&gt;
&lt;br /&gt;
* To get the regular status output:&lt;br /&gt;
 [http://www.adaptivecomputing.com/resources/docs/torque/4-1-4/Content/topics/commands/qstat.htm qstat] [-u $USER]&lt;br /&gt;
 [http://www.adaptivecomputing.com/resources/docs/mwm/6-1-9/Content/commands/showq.html showq] [-u $USER]&lt;br /&gt;
* To get an &#039;&#039;alternate&#039;&#039; format (e.g. showing job names):&lt;br /&gt;
 qstat -a [-u $USER]&lt;br /&gt;
 showq -n [-u $USER]&lt;br /&gt;
: Option &amp;lt;code&amp;gt;-u $USER&amp;lt;/code&amp;gt; shows only your jobs. You can literally type &amp;lt;code&amp;gt;$USER&amp;lt;/code&amp;gt; instead of your user name.&lt;br /&gt;
* To get &#039;&#039;full&#039;&#039; job status information such as submit arguments and run directories, and do not wrap long lines (&amp;quot;-1&amp;quot; is the digit &amp;quot;one&amp;quot;):&lt;br /&gt;
 qstat -f [&#039;&#039;jobnum&#039;&#039;] [-1]&lt;br /&gt;
&lt;br /&gt;
=== Inspect stuck jobs ===&lt;br /&gt;
To diagnose problems with &amp;quot;stuck&amp;quot; jobs, use &amp;lt;code&amp;gt;qstat -s&amp;lt;/code&amp;gt;, or simply Moab&#039;s [http://www.adaptivecomputing.com/resources/docs/mwm/6-1-9/Content/commands/checkjob.html checkjob] command. The last few lines of output give &#039;&#039;past events&#039;&#039; of the job and its current status.&lt;br /&gt;
 qstat -s &#039;&#039;jobnum&#039;&#039;&lt;br /&gt;
 checkjob -v &#039;&#039;jobnum&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To get estimates on when your job might start:&lt;br /&gt;
 showstart [-e all] &#039;&#039;jobnum&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Inspect running jobs ===&lt;br /&gt;
==== Peeking at job output files ====&lt;br /&gt;
Each job has associated stdin and stderr streams which are gathered on its first node and are copied back only at job end time, according to the &amp;lt;code&amp;gt;#PBS&amp;lt;/code&amp;gt; directives -e, -o, or -j [eo|oe]. If the user does explicitly capture any output in the script (using shell redirections &amp;lt;code&amp;gt;&amp;quot;&amp;amp;gt;&amp;quot;&amp;lt;/code&amp;gt;) it can be difficult to assess a job&#039;s progress.&lt;br /&gt;
&lt;br /&gt;
To inspect these streams &#039;&#039;while the job is running&#039;&#039;, and also to review a job&#039;s script, use the &amp;lt;code&amp;gt;qpeek&amp;lt;/code&amp;gt; command:&lt;br /&gt;
 qpeek &#039;&#039;jobnum&#039;&#039;&lt;br /&gt;
 qpeek -eo &#039;&#039;jobnum&#039;&#039;&lt;br /&gt;
 qpeek -s &#039;&#039;jobnum&#039;&#039;&lt;br /&gt;
Read its manual page for full documentation:&lt;br /&gt;
 qpeek --man&lt;br /&gt;
This command is a Carbon re-implementation of a Torque &amp;quot;contrib&amp;quot; script.&lt;br /&gt;
&lt;br /&gt;
To inspect a job&#039;s processes running on its compute nodes:&lt;br /&gt;
 qpeek -p &#039;&#039;jobnum&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==== Which nodes does a running job use? ====&lt;br /&gt;
 qstat -n [-1] &#039;&#039;jobnum&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Changing jobs after submission ===&lt;br /&gt;
Use &amp;lt;code&amp;gt;[http://www.adaptivecomputing.com/resources/docs/torque/4-1-4/Content/topics/commands/qalter.htm qalter]&amp;lt;/code&amp;gt; to modify attributes of a job.&lt;br /&gt;
Only attributes specified on the command line will be changed.&lt;br /&gt;
If any of the specified attributes cannot  be modified for any reason, &#039;&#039;none&#039;&#039; of that job&#039;s attributes will be modified.&lt;br /&gt;
 qalter [-l &#039;&#039;resource&#039;&#039;] […] &#039;&#039;jobnumber&#039;&#039; …&lt;br /&gt;
 qalter -A &#039;&#039;accountspec&#039;&#039; &#039;&#039;jobnumber&#039;&#039; …&lt;br /&gt;
* Most attributes can be changed only &#039;&#039;before&#039;&#039; the job starts. Others, notably [http://www.adaptivecomputing.com/resources/docs/torque/4-1-4/Content/topics/commands/qsub.htm#-m mail options] and [http://www.adaptivecomputing.com/resources/docs/torque/4-1-4/Content/topics/commands/qsub.htm#-W job dependencies] can be meaningfully adjusted after start.&lt;br /&gt;
&lt;br /&gt;
; Advanced usage:&lt;br /&gt;
* &#039;&#039;Extending&#039;&#039; the &amp;lt;code&amp;gt;walltime&amp;lt;/code&amp;gt; resource of an already running job requires Torque administrator permission. You yourself can extend prior to running, and shorten always.  &#039;&#039;&#039;Warning:&#039;&#039;&#039; In either case, the new &amp;lt;code&amp;gt;walltime&amp;lt;/code&amp;gt; limit will be measured from start, not as remaining time. If a new walltime limit is shorter than the elapsed time, the job will be killed right away.&lt;br /&gt;
* You cannot modify the job script itself after submission. You will have to remove and resubmit the job.&lt;br /&gt;
Contact me ([[User:Stern|stern]]) to arrange for interventions.&lt;br /&gt;
&lt;br /&gt;
=== Removing jobs ===&lt;br /&gt;
To retract a queued job or kill an already running job:&lt;br /&gt;
  qdel &#039;&#039;jobnumber&#039;&#039;&lt;br /&gt;
[http://www.adaptivecomputing.com/resources/docs/torque/4-1-4/Content/topics/12-appendices/prologueAndEpliogueScripts.htm Torque epilogue scripts] will immediately remove remaining user processes and user files from the used compute nodes upon job termination, be it natural or after qdel.&lt;br /&gt;
&lt;br /&gt;
== Declaring that a job requires licenses ==&lt;br /&gt;
A job that is to run software that requires a commercial license must declare such to the job scheduler (software that decides when and on which nodes the job could start).&lt;br /&gt;
The job scheduler monitors known licenses for availability, and so will know which and how many licenses are available at any given time.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; License availability checks do not happen instantaneously but rather by polling, roughly once every minute.&lt;br /&gt;
: This means that if you or another user happen to start a license-consuming application after the last check but before the relevant newly started job tries to access the same license, that job will terminate with a license failure.&lt;br /&gt;
&lt;br /&gt;
=== One license type ===&lt;br /&gt;
To request a single license token of a single type, use a &amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; (&amp;quot;general resource&amp;quot;) directive:&lt;br /&gt;
 #PBS -l &#039;&#039;&#039;gres&#039;&#039;&#039;=&#039;&#039;license_name&#039;&#039;&lt;br /&gt;
To request several tokens of a type, place either a &amp;lt;code&amp;gt;:&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;+&amp;lt;/code&amp;gt; as separator, followed by the number of tokens required:&lt;br /&gt;
 #PBS -l &#039;&#039;&#039;gres&#039;&#039;&#039;=&#039;&#039;license_name:count&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For compatibility, the resource type &amp;lt;code&amp;gt;software&amp;lt;/code&amp;gt; is accepted, but &#039;&#039;not for multiple types&#039;&#039; of licenses.&lt;br /&gt;
 #PBS -l &#039;&#039;&#039;software&#039;&#039;&#039;=&#039;&#039;license_name&#039;&#039;&lt;br /&gt;
 #or&lt;br /&gt;
 #PBS -l &#039;&#039;&#039;software&#039;&#039;&#039;=&#039;&#039;license_name:count&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Several license types ===&lt;br /&gt;
To request several different licenses, use &amp;lt;code&amp;gt;gres&amp;lt;/code&amp;gt; with list of license tokens and their optional counts separated by &amp;lt;code&amp;gt;&amp;lt;font color=&amp;quot;#1A1&amp;quot;&amp;gt;&#039;&#039;&#039;%&#039;&#039;&#039;&amp;lt;/font&amp;gt;&amp;lt;/code&amp;gt;:&lt;br /&gt;
 #PBS -l gres=&#039;&#039;license1_name&#039;&#039;&amp;lt;font color=&amp;quot;#1A1&amp;quot;&amp;gt;&#039;&#039;&#039;%&#039;&#039;&#039;&amp;lt;/font&amp;gt;&#039;&#039;license2_name&#039;&#039;&lt;br /&gt;
 #PBS -l gres=&#039;&#039;license1_name:count1&#039;&#039;&amp;lt;font color=&amp;quot;#1A1&amp;quot;&amp;gt;&#039;&#039;&#039;%&#039;&#039;&#039;&amp;lt;/font&amp;gt;&#039;&#039;license2_name&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;software&amp;lt;/code&amp;gt; resource &#039;&#039;cannot&#039;&#039; request multiple license types.&lt;br /&gt;
(If several &amp;lt;code&amp;gt;software&amp;lt;/code&amp;gt; resources are requested, only the &#039;&#039;last one&#039;&#039; would be active.)&lt;br /&gt;
&lt;br /&gt;
== Interactive node access ==&lt;br /&gt;
There are two ways to interactively access nodes:&lt;br /&gt;
* Requesting an interactive job&lt;br /&gt;
 qsub -I [-l nodes=…]&lt;br /&gt;
: This is a special Torque job submission that will wait for the requested nodes to become available, and then you will be dropped into a login shell on the first core of the first node. $PBS_NODEFILE is set as in regular (non-interactive) jobs.&lt;br /&gt;
* Side-access a node that already runs a job, such as to debug or inspect running processes or node-local files.&lt;br /&gt;
: You can use &amp;lt;code&amp;gt;ssh&amp;lt;/code&amp;gt; to interactively access any compute node on which a job of yours is running (use &amp;lt;code&amp;gt;qsub -n &#039;&#039;jobnum&#039;&#039;&amp;lt;/code&amp;gt; to find out the node names). As soon as a node no longer runs at least &#039;&#039;one&#039;&#039; of your jobs, your ssh session to that node will be terminated. You may find the following commands helpful:&lt;br /&gt;
 /usr/sbin/lsof -u $USER&lt;br /&gt;
 /usr/sbin/lsof -c &#039;&#039;command_name&#039;&#039;&lt;br /&gt;
 /usr/sbin/lsof -p &#039;&#039;pid&#039;&#039;&lt;br /&gt;
: - &#039;&#039;&#039;l&#039;&#039;&#039;i&#039;&#039;&#039;s&#039;&#039;&#039;t &#039;&#039;&#039;o&#039;&#039;&#039;pen &#039;&#039;&#039;f&#039;&#039;&#039;iles; [http://linux.die.net/man/8/lsof man page.]&lt;br /&gt;
 ps -fu $USER&lt;br /&gt;
: - list your own processes.&lt;br /&gt;
 psuser&lt;br /&gt;
: - a Carbon-specific wrapper for [http://linux.die.net/man/1/ps ps] to list user-only processes (yours and other regular users&#039;, excluding system processes).&lt;br /&gt;
&lt;br /&gt;
== Job notification mails ==&lt;br /&gt;
You can request a notification message to be sent to you when a job begins, ends, or aborts. The message is rather terse and looks like this:&lt;br /&gt;
 &#039;&#039;&#039;Subject:&#039;&#039;&#039; PBS Job 281399.sched1.carboncluster&lt;br /&gt;
 &lt;br /&gt;
 PBS Job Id: 281399.sched1.carboncluster&lt;br /&gt;
 Job Name:   test.job&lt;br /&gt;
 Exec host:  n103/0&lt;br /&gt;
 Execution terminated&lt;br /&gt;
 Exit_status=0&lt;br /&gt;
 resources_used.cput=00:03:00&lt;br /&gt;
 resources_used.mem=123kb&lt;br /&gt;
 resources_used.vmem=240kb&lt;br /&gt;
 resources_used.walltime=00:03:04&lt;br /&gt;
&lt;br /&gt;
In the above, Exit_status=0 reflects the shell exit status, where 0 means success.&lt;br /&gt;
&lt;br /&gt;
The following means your job was terminated because it ran beyond its allocated walltime:&lt;br /&gt;
 Exit_status=271&lt;br /&gt;
: The shell exit status is this number mod 256, in this case &amp;lt;code&amp;gt;271 % 256 = 15&amp;lt;/code&amp;gt;, corresonding to &amp;lt;code&amp;gt;SIGTERM&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Recording where a job ran ==&lt;br /&gt;
The [[#Job notification mails]] explained above do not include $PBS_O_WORKDIR. You will have to arrange for yourself to record that information.&lt;br /&gt;
One way to do that would be to simply record all job numbers and their working directories at the beginning of each job:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#PBS -l nodes=…&lt;br /&gt;
#PBS -l walltime=…&lt;br /&gt;
#PBS -m bea&lt;br /&gt;
&lt;br /&gt;
cd $PBS_O_WORKDIR&lt;br /&gt;
echo $PBS_JOBID $PWD &amp;gt;&amp;gt; $HOME/jobdirs&lt;br /&gt;
&lt;br /&gt;
…&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
To query a job&#039;s directory, run:&lt;br /&gt;
 grep &#039;&#039;jobnumber&#039;&#039; ~/jobdirs&lt;br /&gt;
&lt;br /&gt;
== Sending mail while a job is running ==&lt;br /&gt;
It may be useful to have a job automatically &amp;quot;phone home&amp;quot; sometime after it started.&lt;br /&gt;
This can be accomplished at job submission time by arranging a mail to be sent, using a few added commands in the job script.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#PBS …&lt;br /&gt;
&lt;br /&gt;
cd $PBS_O_WORKDIR&lt;br /&gt;
&lt;br /&gt;
# arrange notification mail&lt;br /&gt;
(&lt;br /&gt;
    sleep 600	# time offset parameter, in seconds&lt;br /&gt;
    tail -20 somefile.out | mailx -s &amp;quot;$PBS_JOBID: partial log&amp;quot; $USER&lt;br /&gt;
) &amp;amp;&lt;br /&gt;
&lt;br /&gt;
# main work here&lt;br /&gt;
…&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Explanation: &lt;br /&gt;
* The commands inside &amp;lt;code&amp;gt;( … ) &amp;amp;&amp;lt;/code&amp;gt; run in a background track aside the main work.&lt;br /&gt;
* The first command, &amp;lt;code&amp;gt;sleep&amp;lt;/code&amp;gt;, delays further action (in this track only) by the specified time in seconds.&lt;br /&gt;
** To emphasize minutes, write &amp;lt;code&amp;gt;sleep $(( 10 * 60 ))&amp;lt;/code&amp;gt; .&lt;br /&gt;
** To set the time relative to the walltime limit, leverage the &amp;lt;code&amp;gt;$PBS_WALLTIME&amp;lt;/code&amp;gt; variable, e.g. as in &amp;lt;code&amp;gt;sleep $(( PBS_WALLTIME - ( &#039;&#039;minutes&#039;&#039; * 60 ) )).&amp;lt;/code&amp;gt;&lt;br /&gt;
* The &amp;lt;code&amp;gt;tail&amp;lt;/code&amp;gt; command is a stand-in for any inspection command you might want to run. An even simpler command could be &amp;lt;code&amp;gt;ls -lt&amp;lt;/code&amp;gt;. You could also use several commands enclosed by parentheses, &amp;lt;code&amp;gt;( cmd1; cmd2; ... )&amp;lt;/code&amp;gt;, to construct a more elaborate mail body.&lt;br /&gt;
* The &amp;lt;code&amp;gt;mailx&amp;lt;/code&amp;gt; command, following the pipe symbol &amp;lt;code&amp;gt;|&amp;lt;/code&amp;gt;, reads the output of your inspection command and sends you a mail with the subject specified by the &amp;lt;code&amp;gt;-s&amp;lt;/code&amp;gt; option.&lt;br /&gt;
* If the main part of the job finishes before the pre-mail sleep is over no mail will be sent.&lt;br /&gt;
&lt;br /&gt;
Note: The Moab scheduler also supports [http://www.adaptivecomputing.com/resources/docs/mwm/6-1-9/Content/topics/triggers/triggersIndex.html triggers], but they run in a different environment, not on an allocated node.&lt;br /&gt;
&lt;br /&gt;
[[Category:HPC|Getting Started]]&lt;/div&gt;</summary>
		<author><name>Stern</name></author>
	</entry>
	<entry>
		<id>https://wiki.anl.gov/wiki_cnm/index.php?title=HPC/Applications/comsol&amp;diff=7481</id>
		<title>HPC/Applications/comsol</title>
		<link rel="alternate" type="text/html" href="https://wiki.anl.gov/wiki_cnm/index.php?title=HPC/Applications/comsol&amp;diff=7481"/>
		<updated>2026-02-04T23:30:39Z</updated>

		<summary type="html">&lt;p&gt;Stern: /* The modes to run COMSOL */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
The [http://www.comsol.com/products/multiphysics/ &#039;&#039;&#039;COMSOL Multiphysics&#039;&#039;&#039;] application suite&lt;br /&gt;
is available for Mac, Windows, and Linux.&lt;br /&gt;
&lt;br /&gt;
== Access ==&lt;br /&gt;
[[Image:HPC Comsol licensed modules.png|right|450px|thumb|COMSOL features licensed at CNM as of 2024-10.]]&lt;br /&gt;
=== COMSOL Multiphysics ===&lt;br /&gt;
Access to &#039;&#039;&#039;COMSOL Multiphysics&#039;&#039;&#039;, the main application with both a graphical user interface and batch computing capabilities, will be granted &#039;&#039;&#039;&#039;&#039;upon request&#039;&#039;&#039;&#039;&#039;&amp;amp;thinsp;.&lt;br /&gt;
&lt;br /&gt;
You must be:&lt;br /&gt;
* An &#039;&#039;&#039;&#039;&#039;Argonne employee&#039;&#039;&#039;&#039;&#039;&amp;amp;thinsp; in one of the following roles:&lt;br /&gt;
** &#039;&#039;&#039;&#039;&#039;NST staff member&#039;&#039;&#039;&#039;&#039;&amp;amp;thinsp; (including PostDocs, joint appointments, and students at NST).&lt;br /&gt;
** &#039;&#039;&#039;&#039;&#039;CNM Facility User&#039;&#039;&#039;&#039;&#039;&amp;amp;thinsp; (including &#039;&#039;non-NST Argonne employees&#039;&#039;), with an active proposal that has COMSOL in scope. Please see [[HPC/FAQ#Access_and_proposals]].&lt;br /&gt;
&lt;br /&gt;
The set of available COMSOL modules that we have licensed is shown at right.&lt;br /&gt;
&lt;br /&gt;
* The native desktop version can be installed only on &#039;&#039;Argonne-owned&#039;&#039; computers (laptop or desktop). Please contact [mailto:help@anl.gov?Subject=COMSOL%20license%20access%20request CNM support]. Make sure to review [http://www.comsol.com/support/updates/ Product Updates].&lt;br /&gt;
* To run COMSOL on our HPC system &#039;&#039;Carbon&#039;&#039;, as GUI or as batch computing jobs, your proposal must have &#039;&#039;Carbon&#039;&#039; access in scope.&lt;br /&gt;
&lt;br /&gt;
=== COMSOL Server ===&lt;br /&gt;
&#039;&#039;CNM Facility Users&#039;&#039; who are not Argonne employees are not eligible to access&lt;br /&gt;
the full &#039;&#039;&#039;COMSOL Multiphysics&#039;&#039;&#039; product, in compliance with its licensing terms and conditions.&lt;br /&gt;
However, the [https://www.comsol.com/comsol-server &#039;&#039;&#039;COMSOL Server&#039;&#039;&#039;] product offers an alternative&lt;br /&gt;
albeit more narrow means of access.&lt;br /&gt;
&lt;br /&gt;
All users, including &#039;&#039;&#039;&#039;&#039;non-Argonne users&#039;&#039;&#039;&#039;&#039; may be able to run, over a web interface in their browser,&lt;br /&gt;
pre-parameterized &amp;quot;fixed-model&amp;quot; simulations that were made with the &#039;&#039;&#039;COMSOL Application Builder&#039;&#039;&#039; (requires Windows).&lt;br /&gt;
&lt;br /&gt;
To inquire about using COMSOL server applications,&lt;br /&gt;
please contact us.&lt;br /&gt;
&amp;lt;!-- [mailto:cnm_useroffice@anl.gov?Subject=COMSOL%20server%20usage Support]. --&amp;gt;&lt;br /&gt;
We will review possible purchase paths for COMSOL Server, and the &#039;&#039;considerable effort&#039;&#039; likely required by users and the CNM to develop and deploy a COMSOL application.&lt;br /&gt;
&lt;br /&gt;
== Support ==&lt;br /&gt;
* For questions on how to run or start COMSOL:&lt;br /&gt;
*: Submit an [[HPC/Support | &#039;&#039;&#039;IT support request&#039;&#039;&#039;]]&lt;br /&gt;
* For questions related to most COMSOL data or scripts, contact COMSOL support at:&lt;br /&gt;
*: [mailto:support@comsol.com &#039;&#039;&#039;support&#039;&#039;&#039;@comsol.com]&lt;br /&gt;
* &#039;&#039;&#039;Exception:&#039;&#039;&#039; If your support question might contain data that is subject to &#039;&#039;&#039;US Export Control&#039;&#039;&#039; regulations, contact instead:&lt;br /&gt;
*: [mailto:us-export-control@us.comsol.com &#039;&#039;&#039;us-export-control&#039;&#039;&#039;@&#039;&#039;&#039;us&#039;&#039;&#039;.comsol.com]&lt;br /&gt;
&lt;br /&gt;
== The modes to run COMSOL ==&lt;br /&gt;
There are several ways of running COMSOL.&lt;br /&gt;
&lt;br /&gt;
=== Running the desktop application ===&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
# Run on Carbon, display on your desktop using the [http://en.wikipedia.org/wiki/X_Window_System X Window system (X11)].&lt;br /&gt;
#* Requires an &#039;&#039;X11 Server&#039;&#039; application running on your client machine, and SSH X11 forwarding.&lt;br /&gt;
#* The X11 protocol can be slow over LAN.&lt;br /&gt;
# Run on Carbon within a [[HPC/Network Access/Virtual Desktop | virtual desktop environment (VNC)]].&lt;br /&gt;
#* Requires a VNC client on your machine.&lt;br /&gt;
#* It can be confusing where VNC and the app runs.&lt;br /&gt;
#* The virtual desktop presents a (deliberatly) sparse windowing environment – Copy&amp;amp;Paste can be difficult to use.&lt;br /&gt;
# Run on your Argonne-provided computer, checking out Carbon&#039;s license remotely.&lt;br /&gt;
#* Requires a full installation of COMSOL on your desktoo or laptop computer.&lt;br /&gt;
#* 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.&lt;br /&gt;
&lt;br /&gt;
=== Running a batch calculation ===&lt;br /&gt;
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.&lt;br /&gt;
See the [[#Batch jobs|section below]].&lt;br /&gt;
&lt;br /&gt;
== Use with X11 ==&lt;br /&gt;
For casual use, and with [[HPC/Network Access/SSH Tunnel Setup on Linux and MacOS | X11 tunneling to Carbon]] set up, simply add to your &amp;lt;code&amp;gt;~/.bashrc&amp;lt;/code&amp;gt; file on Carbon:&lt;br /&gt;
 module load comsol&lt;br /&gt;
&lt;br /&gt;
Then, from the command line on a Carbon login node, start the COMSOL GUI:&lt;br /&gt;
 comsol &amp;amp;&lt;br /&gt;
&lt;br /&gt;
License configuration is automatic on Carbon.&lt;br /&gt;
&lt;br /&gt;
Comsol will use a number of cores to run calculations multithreaded by default. (On Carbon, COMSOL_NUM_THREADS is set.)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Quit the application&#039;&#039;&#039; as soon as you are done. Only one user can use Comsol at a time.&lt;br /&gt;
&lt;br /&gt;
== Use with VNC ==&lt;br /&gt;
See general  [[HPC/Network Access/Virtual Desktop | instructions on using VNC]], and the COMSOL example therein.&lt;br /&gt;
&lt;br /&gt;
== Native desktop version ==&lt;br /&gt;
&lt;br /&gt;
To get the fastest response from the COMSOL GUI, run a native COMSOL version on your desktop machine or laptop, called &#039;&#039;client machine&#039;&#039; below.&lt;br /&gt;
&lt;br /&gt;
Enter license details either in the COMSOL Setup configuration dialog.&lt;br /&gt;
&lt;br /&gt;
== Native desktop version — License configuration ==&lt;br /&gt;
A client&#039;s COMSOL license needs to be configured depending on how the client reaches CNM network resources. Follow the appropriate section:&lt;br /&gt;
&lt;br /&gt;
* [[#License configuration when inside CNM or on CNM VPN|License configuration when &#039;&#039;&#039;inside CNM&#039;&#039;&#039; or on &#039;&#039;&#039;CNM VPN&#039;&#039;&#039;]]&lt;br /&gt;
: Requires that the user&#039;s machine is logically within the network of CNM/NST, either by a wired/auth WiFi connection in the building or by VPN under a CNM/NST profile.&lt;br /&gt;
* [[#License configuration when outside CNM – requires SSH Tunneling|License configuration when &#039;&#039;&#039;outside CNM&#039;&#039;&#039; – requires SSH Tunneling]]&lt;br /&gt;
: &#039;&#039;Non-NST staff&#039;&#039; usually have a VPN profile that places the machine logically [[#License configuration when outside CNM – requires SSH Tunneling|outside of NST&#039;s network.]]&lt;br /&gt;
&lt;br /&gt;
=== License configuration when inside CNM or on CNM VPN ===&lt;br /&gt;
==== &amp;lt;span style=&amp;quot;color:#A00;&amp;quot;&amp;gt;Ensure correct DNS search domains&amp;lt;/span&amp;gt; ====&lt;br /&gt;
* Inspect the client machine&#039;s network configuration.&lt;br /&gt;
* Ensure that &#039;&#039;&#039;two&#039;&#039;&#039; entries are listed as DNS Search Domains for the current network profile:&lt;br /&gt;
 nst.anl.gov&lt;br /&gt;
 cnm.anl.gov&lt;br /&gt;
: (The order of entries does not matter for the purposes considered here.)&lt;br /&gt;
* If the client machine is &#039;&#039;wired to CNM networks&#039;&#039;, the domains are normally provided correctly by DHCP.&lt;br /&gt;
* If the client machine is &#039;&#039;connected over VPN&#039;&#039;, you may need edit the respective network profile.&lt;br /&gt;
:* 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 &amp;quot;Advanced…&amp;quot;. It appears that those changes are being saved and will be activated automatically the next time that this VPN session gets started.&lt;br /&gt;
: [[Image:VNC_add_cnm_to_DNS_1.png|400px]] [[Image:VNC_add_cnm_to_DNS_2.png|400px]]&lt;br /&gt;
:* On Windows or Linux machines, take &#039;&#039;analogous&#039;&#039; steps, using the platform&#039;s own configuration tools.&lt;br /&gt;
&lt;br /&gt;
* Exclude license manager components from client desktop installation. (Those are all handled server-side.)&lt;br /&gt;
&lt;br /&gt;
==== License format ====&lt;br /&gt;
* Floating Network License (FNL), &amp;quot;Three-server redundancy&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==== License servers ====&lt;br /&gt;
* On client machines, while running the COMSOL installer or license configuration, specify license servers and ports as follows:&lt;br /&gt;
 1718    clicense1&lt;br /&gt;
 1718    clicense2&lt;br /&gt;
 1718    clicense3&lt;br /&gt;
: &#039;&#039;&#039;Note:&#039;&#039;&#039; Use &#039;&#039;short host names only&#039;&#039;. (Technical Reason: The license must be usable both on Carbon&#039;s internal network as well as on divisional networks).&lt;br /&gt;
 1718    clicense1&amp;lt;strike&amp;gt;.cnm.anl.gov&amp;lt;/strike&amp;gt;&lt;br /&gt;
 1718    clicense2&amp;lt;strike&amp;gt;.cnm.anl.gov&amp;lt;/strike&amp;gt;&lt;br /&gt;
 1718    clicense3&amp;lt;strike&amp;gt;.cnm.anl.gov&amp;lt;/strike&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Advanced:&#039;&#039;&#039; A client machine&#039;s COMSOL license file &amp;lt;code&amp;gt;&amp;amp;lt;COMSOLDIR&amp;amp;gt;/Multiphysics/license/license.dat&amp;lt;/code&amp;gt; should look as follows:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;make&amp;quot;&amp;gt;&lt;br /&gt;
SERVER clicense1 ANY 1718&lt;br /&gt;
SERVER clicense2 ANY 1718&lt;br /&gt;
SERVER clicense3 ANY 1718&lt;br /&gt;
USE_SERVER&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;amp;lt;COMSOLDIR&amp;amp;gt;&amp;lt;/code&amp;gt; is located by default at:&lt;br /&gt;
* &#039;&#039;&#039;Windows&#039;&#039;&#039;: C:\Program files\COMSOL\COMSOL&#039;&#039;nn&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Linux&#039;&#039;&#039;: /usr/local/comsol&#039;&#039;nn&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Mac&#039;&#039;&#039;: /Applications/COMSOL&#039;&#039;nn&#039;&#039;&lt;br /&gt;
(&amp;quot;&#039;&#039;nn&#039;&#039;&amp;quot; is the application&#039;s abbreviated version number.)&lt;br /&gt;
&lt;br /&gt;
==== Network Troubleshooting ====&lt;br /&gt;
When using the license access model descibed here (as opposed to tunneled over SSH), ensure the following:&lt;br /&gt;
* Verify that short host names can be resolved to IP addresses. Either one of the following commands should produce sensible output:&lt;br /&gt;
 host clicense1&lt;br /&gt;
: or:&lt;br /&gt;
 ping -c 3 clicense1&lt;br /&gt;
* Verify that &#039;&#039;both license ports on the same server&#039;&#039; can be reached from your client machine:&lt;br /&gt;
 telnet &#039;&#039;&#039;clicense1&#039;&#039;&#039; 1718&lt;br /&gt;
 telnet &#039;&#039;&#039;clicense1&#039;&#039;&#039; 1719&lt;br /&gt;
: or:&lt;br /&gt;
 telnet &#039;&#039;&#039;clicense2&#039;&#039;&#039; 1718&lt;br /&gt;
 telnet &#039;&#039;&#039;clicense2&#039;&#039;&#039; 1719&lt;br /&gt;
: A &#039;&#039;successful&#039;&#039; connection looks like:&lt;br /&gt;
 Trying 146.139.x.y...&lt;br /&gt;
 Connected to clicense1.cnm.anl.gov.&lt;br /&gt;
 Escape character is &#039;^]&#039;.&lt;br /&gt;
:: Do not enter any data. Instead,  close each connection by hitting &amp;lt;code&amp;gt;Ctrl&amp;lt;/code&amp;gt;&amp;lt;code&amp;gt;]&amp;lt;/code&amp;gt; (closing square bracket), followed by &amp;lt;code&amp;gt;Ctrl&amp;lt;/code&amp;gt;&amp;lt;code&amp;gt;D&amp;lt;/code&amp;gt;.&lt;br /&gt;
: A &#039;&#039;failed&#039;&#039; connection gives one of these errors:&lt;br /&gt;
 telnet: connect to address 146.139.x.y: Operation timed out&lt;br /&gt;
: or:&lt;br /&gt;
 telnet: connect to address 146.139.x.y: Connection refused&lt;br /&gt;
:: In these cases, ask that your IP firewall configuration be reviewed and changed.&lt;br /&gt;
&lt;br /&gt;
=== License configuration when outside CNM – requires SSH Tunneling ===&lt;br /&gt;
If you&#039;re comfortable with ssh and tunneling, set up client licensing as follows:&lt;br /&gt;
&lt;br /&gt;
==== Configure COMSOL ====&lt;br /&gt;
The following needs to be done just once, typically during COMSOL installation:&lt;br /&gt;
&lt;br /&gt;
In the COMSOL Installer, or in COMSOL Preferences, enter:&lt;br /&gt;
* &#039;&#039;&#039;License format:&#039;&#039;&#039; Floating Network License (FNL), &amp;quot;Port number and Hostname&amp;quot;&lt;br /&gt;
:: &amp;quot;Three-server redundancy&amp;quot; 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.&lt;br /&gt;
* &#039;&#039;&#039;Server:&#039;&#039;&#039; &amp;lt;code&amp;gt;127.0.0.1&amp;lt;/code&amp;gt;&lt;br /&gt;
:: Do not use &amp;quot;localhost&amp;quot;, as COMSOL interprets this incorrectly to mean that your machine &#039;&#039;is&#039;&#039; a license server.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Port:&#039;&#039;&#039; &amp;lt;code&amp;gt;1718&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
Or place a license file with this content:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;make&amp;quot;&amp;gt;&lt;br /&gt;
SERVER 127.0.0.1 ANY 1718&lt;br /&gt;
USE_SERVER&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
//--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Provide server connection ====&lt;br /&gt;
This step needs to be done prior to running COMSOL in your desktop session:&lt;br /&gt;
* Connect to &amp;lt;code&amp;gt;mega&amp;lt;/code&amp;gt; with the following ssh command:&lt;br /&gt;
 ssh  -L 1718:&#039;&#039;&#039;clicense1&#039;&#039;&#039;:1718  -L 1719:&#039;&#039;&#039;clicense1&#039;&#039;&#039;:1719  mega.cnm.anl.gov&lt;br /&gt;
* Leave the command running between invocations of COMSOL.&lt;br /&gt;
&lt;br /&gt;
==== Run COMSOL ====&lt;br /&gt;
* Ensure your connection to &amp;quot;mega&amp;quot; is still running. If not, restart it.&lt;br /&gt;
* Start the COMSOL application.&lt;br /&gt;
&lt;br /&gt;
** If you get an error that the number of licenses is &amp;quot;exhausted&amp;quot;, that is confirmation that you correctly reached the license server, though other users are using licenses.&lt;br /&gt;
** 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:&lt;br /&gt;
 ssh  -L 1718:clicense&#039;&#039;&#039;2&#039;&#039;&#039;:1718  -L 1719:clicense&#039;&#039;&#039;2&#039;&#039;&#039;:1719  mega.cnm.anl.gov&lt;br /&gt;
&lt;br /&gt;
== License Troubleshooting ==&lt;br /&gt;
The following are typical error messages.&lt;br /&gt;
=== Could not obtain license for COMSOL Multiphysics GUI ===&lt;br /&gt;
* Error details:&lt;br /&gt;
 License error: -4.&lt;br /&gt;
 &#039;&#039;&#039;Licensed number of users already reached.&#039;&#039;&#039;&lt;br /&gt;
 Feature:       COMSOLGUI&lt;br /&gt;
 License path:  /Users/stern/Applications/COMSOL52a/license/license.dat:&lt;br /&gt;
 FlexNet Licensing error:-4,132&lt;br /&gt;
* Reason: The connection to the license server succeeded, but the license token(s) you requested are in use.&lt;br /&gt;
* Solution: Wait a bit, or [http://carbonmgmt/ganglia/lic.php identify who&#039;s using COMSOL] and politely ask the user when they might be finished with their work.&lt;br /&gt;
&lt;br /&gt;
=== License server machine is down or not responding ===&lt;br /&gt;
* Error details:&lt;br /&gt;
  License error: -96.&lt;br /&gt;
  See the system administrator about starting the license server system, or&lt;br /&gt;
  make sure you&#039;re referring to the right host (see LM_LICENSE_FILE).&lt;br /&gt;
 Feature:       SERIAL&lt;br /&gt;
 Hostname:      clicense3&lt;br /&gt;
 License path:  /Users/stern/Applications/COMSOL52a/license/license.dat:&lt;br /&gt;
 FlexNet Licensing error:-96,7&lt;br /&gt;
* Reason: The license servers cannot be reached at all. The &amp;lt;code&amp;gt;ping&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;host&amp;lt;/code&amp;gt; tests mentioned above fail.&lt;br /&gt;
* Solution: Review the client license file and DNS lookup domains.&lt;br /&gt;
&lt;br /&gt;
=== License file does not support this version ===&lt;br /&gt;
* Error details:&lt;br /&gt;
  Feature: SERIAL&lt;br /&gt;
 &#039;&#039;&#039;Application version &amp;gt; License version: 5.21 &amp;gt; 3.5&#039;&#039;&#039;&lt;br /&gt;
 License path: /Users/stern/Applications/COMSOL52a/license/license.dat:&lt;br /&gt;
 FlexNet Licensing error:-21,126&lt;br /&gt;
* 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&#039;re connected to.&lt;br /&gt;
* Solution: When using SSH, try &amp;lt;code&amp;gt;clicense2&amp;lt;/code&amp;gt; instead of  &amp;lt;code&amp;gt;clicense1&amp;lt;/code&amp;gt;, or vice versa. Revisit your &amp;lt;code&amp;gt;~/.ssh/config&amp;lt;/code&amp;gt; file or use the alternate command line as shown in the SSH section above.&lt;br /&gt;
&lt;br /&gt;
== Multiple CPU cores ==&lt;br /&gt;
Ways to start multi-core (from http://www.comsol.com/support/knowledgebase/1096/)&lt;br /&gt;
 comsol -np 8&lt;br /&gt;
&lt;br /&gt;
 export COMSOL_NUM_THREADS=8    # automatically provided on &#039;&#039;Carbon&#039;&#039;&lt;br /&gt;
 comsol&lt;br /&gt;
* COMSOL does not benefit from hyperthreading (oversubscribing the physical core count).&lt;br /&gt;
&lt;br /&gt;
== Batch jobs ==&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
 comsol -clustersimple batch -inputfile input.mph -outputfile output.mph &lt;br /&gt;
&lt;br /&gt;
 &amp;lt;strike&amp;gt;comsol –nn 8 mpd boot&lt;br /&gt;
 comsol –nn 8 batch –inputfile in.mph&lt;br /&gt;
 comsol mpd allexit&amp;lt;/strike&amp;gt;&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
* http://www.comsol.com/support/knowledgebase/1001/ .&lt;br /&gt;
* [[Media:HPC 2012-05-16 Comsol parallel usage.pdf]] (Modified from http://www.comsol.com/support/knowledgebase/1001/files/4027/cluster_install_linux_42a.pptx – Appendix slide, PBS)&lt;br /&gt;
* &#039;&#039;&#039;Note:&#039;&#039;&#039; MPD is not supported on Carbon (I patched the main comsol script), and no longer necessary at all in Comsol-4.3.&lt;br /&gt;
&lt;br /&gt;
=== Sample Job file ===&lt;br /&gt;
See:&lt;br /&gt;
 $COMSOL_HOME/sample.job&lt;br /&gt;
&lt;br /&gt;
== Important COMSOL Support Articles ==&lt;br /&gt;
* Toplevel suport page: https://www.comsol.com/support&lt;br /&gt;
&lt;br /&gt;
=== KB Articles ===&lt;br /&gt;
* [https://www.comsol.com/support/knowledgebase/1001 Running COMSOL® in parallel on clusters]&lt;br /&gt;
* [https://www.comsol.com/support/knowledgebase/1250 Running parametric sweeps, batch sweeps, and cluster sweeps from the command line]&lt;br /&gt;
* [https://www.comsol.com/support/knowledgebase/1255 Reducing the amount of solution data stored in a model]&lt;br /&gt;
* [https://www.comsol.com/support/knowledgebase/830 Handling large models]&lt;br /&gt;
&lt;br /&gt;
=== Blog-style articles ===&lt;br /&gt;
* [https://www.comsol.com/blogs/the-power-of-the-batch-sweep/ The Power of the Batch Sweep]&lt;br /&gt;
* [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]&lt;/div&gt;</summary>
		<author><name>Stern</name></author>
	</entry>
	<entry>
		<id>https://wiki.anl.gov/wiki_cnm/index.php?title=HPC/Applications/comsol&amp;diff=7480</id>
		<title>HPC/Applications/comsol</title>
		<link rel="alternate" type="text/html" href="https://wiki.anl.gov/wiki_cnm/index.php?title=HPC/Applications/comsol&amp;diff=7480"/>
		<updated>2025-10-03T15:30:45Z</updated>

		<summary type="html">&lt;p&gt;Stern: /* Native desktop version — License configuration */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
The [http://www.comsol.com/products/multiphysics/ &#039;&#039;&#039;COMSOL Multiphysics&#039;&#039;&#039;] application suite&lt;br /&gt;
is available for Mac, Windows, and Linux.&lt;br /&gt;
&lt;br /&gt;
== Access ==&lt;br /&gt;
[[Image:HPC Comsol licensed modules.png|right|450px|thumb|COMSOL features licensed at CNM as of 2024-10.]]&lt;br /&gt;
=== COMSOL Multiphysics ===&lt;br /&gt;
Access to &#039;&#039;&#039;COMSOL Multiphysics&#039;&#039;&#039;, the main application with both a graphical user interface and batch computing capabilities, will be granted &#039;&#039;&#039;&#039;&#039;upon request&#039;&#039;&#039;&#039;&#039;&amp;amp;thinsp;.&lt;br /&gt;
&lt;br /&gt;
You must be:&lt;br /&gt;
* An &#039;&#039;&#039;&#039;&#039;Argonne employee&#039;&#039;&#039;&#039;&#039;&amp;amp;thinsp; in one of the following roles:&lt;br /&gt;
** &#039;&#039;&#039;&#039;&#039;NST staff member&#039;&#039;&#039;&#039;&#039;&amp;amp;thinsp; (including PostDocs, joint appointments, and students at NST).&lt;br /&gt;
** &#039;&#039;&#039;&#039;&#039;CNM Facility User&#039;&#039;&#039;&#039;&#039;&amp;amp;thinsp; (including &#039;&#039;non-NST Argonne employees&#039;&#039;), with an active proposal that has COMSOL in scope. Please see [[HPC/FAQ#Access_and_proposals]].&lt;br /&gt;
&lt;br /&gt;
The set of available COMSOL modules that we have licensed is shown at right.&lt;br /&gt;
&lt;br /&gt;
* The native desktop version can be installed only on &#039;&#039;Argonne-owned&#039;&#039; computers (laptop or desktop). Please contact [mailto:help@anl.gov?Subject=COMSOL%20license%20access%20request CNM support]. Make sure to review [http://www.comsol.com/support/updates/ Product Updates].&lt;br /&gt;
* To run COMSOL on our HPC system &#039;&#039;Carbon&#039;&#039;, as GUI or as batch computing jobs, your proposal must have &#039;&#039;Carbon&#039;&#039; access in scope.&lt;br /&gt;
&lt;br /&gt;
=== COMSOL Server ===&lt;br /&gt;
&#039;&#039;CNM Facility Users&#039;&#039; who are not Argonne employees are not eligible to access&lt;br /&gt;
the full &#039;&#039;&#039;COMSOL Multiphysics&#039;&#039;&#039; product, in compliance with its licensing terms and conditions.&lt;br /&gt;
However, the [https://www.comsol.com/comsol-server &#039;&#039;&#039;COMSOL Server&#039;&#039;&#039;] product offers an alternative&lt;br /&gt;
albeit more narrow means of access.&lt;br /&gt;
&lt;br /&gt;
All users, including &#039;&#039;&#039;&#039;&#039;non-Argonne users&#039;&#039;&#039;&#039;&#039; may be able to run, over a web interface in their browser,&lt;br /&gt;
pre-parameterized &amp;quot;fixed-model&amp;quot; simulations that were made with the &#039;&#039;&#039;COMSOL Application Builder&#039;&#039;&#039; (requires Windows).&lt;br /&gt;
&lt;br /&gt;
To inquire about using COMSOL server applications,&lt;br /&gt;
please contact us.&lt;br /&gt;
&amp;lt;!-- [mailto:cnm_useroffice@anl.gov?Subject=COMSOL%20server%20usage Support]. --&amp;gt;&lt;br /&gt;
We will review possible purchase paths for COMSOL Server, and the &#039;&#039;considerable effort&#039;&#039; likely required by users and the CNM to develop and deploy a COMSOL application.&lt;br /&gt;
&lt;br /&gt;
== Support ==&lt;br /&gt;
* For questions on how to run or start COMSOL:&lt;br /&gt;
*: Submit an [[HPC/Support | &#039;&#039;&#039;IT support request&#039;&#039;&#039;]]&lt;br /&gt;
* For questions related to most COMSOL data or scripts, contact COMSOL support at:&lt;br /&gt;
*: [mailto:support@comsol.com &#039;&#039;&#039;support&#039;&#039;&#039;@comsol.com]&lt;br /&gt;
* &#039;&#039;&#039;Exception:&#039;&#039;&#039; If your support question might contain data that is subject to &#039;&#039;&#039;US Export Control&#039;&#039;&#039; regulations, contact instead:&lt;br /&gt;
*: [mailto:us-export-control@us.comsol.com &#039;&#039;&#039;us-export-control&#039;&#039;&#039;@&#039;&#039;&#039;us&#039;&#039;&#039;.comsol.com]&lt;br /&gt;
&lt;br /&gt;
== The modes to run COMSOL ==&lt;br /&gt;
There are several ways of running COMSOL.&lt;br /&gt;
&lt;br /&gt;
=== Running the desktop application ===&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
# Run on Carbon, display on your desktop using the [http://en.wikipedia.org/wiki/X_Window_System X Window system (X11)].&lt;br /&gt;
#* Requires an &#039;&#039;X11 Server&#039;&#039; application running on your client machine, and SSH X11 forwarding.&lt;br /&gt;
#* The X11 protocol can be slow over LAN.&lt;br /&gt;
# Run on Carbon within a [[HPC/Network Access/Virtual Desktop | virtual desktop environment (VNC)]].&lt;br /&gt;
#* Requires a VNC client on your machine.&lt;br /&gt;
#* It can be confusing where VNC and the app runs.&lt;br /&gt;
#* The virtual desktop presents a (deliberatly) sparse windowing environment – Copy&amp;amp;Paste can be difficult to use.&lt;br /&gt;
# Run on your own computer, remotely checking out Carbon&#039;s license.&lt;br /&gt;
#* Requires a full installation of COMSOL on your desktoo or laptop computer.&lt;br /&gt;
#* 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.&lt;br /&gt;
&lt;br /&gt;
=== Running a batch calculation ===&lt;br /&gt;
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.&lt;br /&gt;
See the [[#Batch jobs|section below]].&lt;br /&gt;
&lt;br /&gt;
== Use with X11 ==&lt;br /&gt;
For casual use, and with [[HPC/Network Access/SSH Tunnel Setup on Linux and MacOS | X11 tunneling to Carbon]] set up, simply add to your &amp;lt;code&amp;gt;~/.bashrc&amp;lt;/code&amp;gt; file on Carbon:&lt;br /&gt;
 module load comsol&lt;br /&gt;
&lt;br /&gt;
Then, from the command line on a Carbon login node, start the COMSOL GUI:&lt;br /&gt;
 comsol &amp;amp;&lt;br /&gt;
&lt;br /&gt;
License configuration is automatic on Carbon.&lt;br /&gt;
&lt;br /&gt;
Comsol will use a number of cores to run calculations multithreaded by default. (On Carbon, COMSOL_NUM_THREADS is set.)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Quit the application&#039;&#039;&#039; as soon as you are done. Only one user can use Comsol at a time.&lt;br /&gt;
&lt;br /&gt;
== Use with VNC ==&lt;br /&gt;
See general  [[HPC/Network Access/Virtual Desktop | instructions on using VNC]], and the COMSOL example therein.&lt;br /&gt;
&lt;br /&gt;
== Native desktop version ==&lt;br /&gt;
&lt;br /&gt;
To get the fastest response from the COMSOL GUI, run a native COMSOL version on your desktop machine or laptop, called &#039;&#039;client machine&#039;&#039; below.&lt;br /&gt;
&lt;br /&gt;
Enter license details either in the COMSOL Setup configuration dialog.&lt;br /&gt;
&lt;br /&gt;
== Native desktop version — License configuration ==&lt;br /&gt;
A client&#039;s COMSOL license needs to be configured depending on how the client reaches CNM network resources. Follow the appropriate section:&lt;br /&gt;
&lt;br /&gt;
* [[#License configuration when inside CNM or on CNM VPN|License configuration when &#039;&#039;&#039;inside CNM&#039;&#039;&#039; or on &#039;&#039;&#039;CNM VPN&#039;&#039;&#039;]]&lt;br /&gt;
: Requires that the user&#039;s machine is logically within the network of CNM/NST, either by a wired/auth WiFi connection in the building or by VPN under a CNM/NST profile.&lt;br /&gt;
* [[#License configuration when outside CNM – requires SSH Tunneling|License configuration when &#039;&#039;&#039;outside CNM&#039;&#039;&#039; – requires SSH Tunneling]]&lt;br /&gt;
: &#039;&#039;Non-NST staff&#039;&#039; usually have a VPN profile that places the machine logically [[#License configuration when outside CNM – requires SSH Tunneling|outside of NST&#039;s network.]]&lt;br /&gt;
&lt;br /&gt;
=== License configuration when inside CNM or on CNM VPN ===&lt;br /&gt;
==== &amp;lt;span style=&amp;quot;color:#A00;&amp;quot;&amp;gt;Ensure correct DNS search domains&amp;lt;/span&amp;gt; ====&lt;br /&gt;
* Inspect the client machine&#039;s network configuration.&lt;br /&gt;
* Ensure that &#039;&#039;&#039;two&#039;&#039;&#039; entries are listed as DNS Search Domains for the current network profile:&lt;br /&gt;
 nst.anl.gov&lt;br /&gt;
 cnm.anl.gov&lt;br /&gt;
: (The order of entries does not matter for the purposes considered here.)&lt;br /&gt;
* If the client machine is &#039;&#039;wired to CNM networks&#039;&#039;, the domains are normally provided correctly by DHCP.&lt;br /&gt;
* If the client machine is &#039;&#039;connected over VPN&#039;&#039;, you may need edit the respective network profile.&lt;br /&gt;
:* 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 &amp;quot;Advanced…&amp;quot;. It appears that those changes are being saved and will be activated automatically the next time that this VPN session gets started.&lt;br /&gt;
: [[Image:VNC_add_cnm_to_DNS_1.png|400px]] [[Image:VNC_add_cnm_to_DNS_2.png|400px]]&lt;br /&gt;
:* On Windows or Linux machines, take &#039;&#039;analogous&#039;&#039; steps, using the platform&#039;s own configuration tools.&lt;br /&gt;
&lt;br /&gt;
* Exclude license manager components from client desktop installation. (Those are all handled server-side.)&lt;br /&gt;
&lt;br /&gt;
==== License format ====&lt;br /&gt;
* Floating Network License (FNL), &amp;quot;Three-server redundancy&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==== License servers ====&lt;br /&gt;
* On client machines, while running the COMSOL installer or license configuration, specify license servers and ports as follows:&lt;br /&gt;
 1718    clicense1&lt;br /&gt;
 1718    clicense2&lt;br /&gt;
 1718    clicense3&lt;br /&gt;
: &#039;&#039;&#039;Note:&#039;&#039;&#039; Use &#039;&#039;short host names only&#039;&#039;. (Technical Reason: The license must be usable both on Carbon&#039;s internal network as well as on divisional networks).&lt;br /&gt;
 1718    clicense1&amp;lt;strike&amp;gt;.cnm.anl.gov&amp;lt;/strike&amp;gt;&lt;br /&gt;
 1718    clicense2&amp;lt;strike&amp;gt;.cnm.anl.gov&amp;lt;/strike&amp;gt;&lt;br /&gt;
 1718    clicense3&amp;lt;strike&amp;gt;.cnm.anl.gov&amp;lt;/strike&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Advanced:&#039;&#039;&#039; A client machine&#039;s COMSOL license file &amp;lt;code&amp;gt;&amp;amp;lt;COMSOLDIR&amp;amp;gt;/Multiphysics/license/license.dat&amp;lt;/code&amp;gt; should look as follows:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;make&amp;quot;&amp;gt;&lt;br /&gt;
SERVER clicense1 ANY 1718&lt;br /&gt;
SERVER clicense2 ANY 1718&lt;br /&gt;
SERVER clicense3 ANY 1718&lt;br /&gt;
USE_SERVER&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;amp;lt;COMSOLDIR&amp;amp;gt;&amp;lt;/code&amp;gt; is located by default at:&lt;br /&gt;
* &#039;&#039;&#039;Windows&#039;&#039;&#039;: C:\Program files\COMSOL\COMSOL&#039;&#039;nn&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Linux&#039;&#039;&#039;: /usr/local/comsol&#039;&#039;nn&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Mac&#039;&#039;&#039;: /Applications/COMSOL&#039;&#039;nn&#039;&#039;&lt;br /&gt;
(&amp;quot;&#039;&#039;nn&#039;&#039;&amp;quot; is the application&#039;s abbreviated version number.)&lt;br /&gt;
&lt;br /&gt;
==== Network Troubleshooting ====&lt;br /&gt;
When using the license access model descibed here (as opposed to tunneled over SSH), ensure the following:&lt;br /&gt;
* Verify that short host names can be resolved to IP addresses. Either one of the following commands should produce sensible output:&lt;br /&gt;
 host clicense1&lt;br /&gt;
: or:&lt;br /&gt;
 ping -c 3 clicense1&lt;br /&gt;
* Verify that &#039;&#039;both license ports on the same server&#039;&#039; can be reached from your client machine:&lt;br /&gt;
 telnet &#039;&#039;&#039;clicense1&#039;&#039;&#039; 1718&lt;br /&gt;
 telnet &#039;&#039;&#039;clicense1&#039;&#039;&#039; 1719&lt;br /&gt;
: or:&lt;br /&gt;
 telnet &#039;&#039;&#039;clicense2&#039;&#039;&#039; 1718&lt;br /&gt;
 telnet &#039;&#039;&#039;clicense2&#039;&#039;&#039; 1719&lt;br /&gt;
: A &#039;&#039;successful&#039;&#039; connection looks like:&lt;br /&gt;
 Trying 146.139.x.y...&lt;br /&gt;
 Connected to clicense1.cnm.anl.gov.&lt;br /&gt;
 Escape character is &#039;^]&#039;.&lt;br /&gt;
:: Do not enter any data. Instead,  close each connection by hitting &amp;lt;code&amp;gt;Ctrl&amp;lt;/code&amp;gt;&amp;lt;code&amp;gt;]&amp;lt;/code&amp;gt; (closing square bracket), followed by &amp;lt;code&amp;gt;Ctrl&amp;lt;/code&amp;gt;&amp;lt;code&amp;gt;D&amp;lt;/code&amp;gt;.&lt;br /&gt;
: A &#039;&#039;failed&#039;&#039; connection gives one of these errors:&lt;br /&gt;
 telnet: connect to address 146.139.x.y: Operation timed out&lt;br /&gt;
: or:&lt;br /&gt;
 telnet: connect to address 146.139.x.y: Connection refused&lt;br /&gt;
:: In these cases, ask that your IP firewall configuration be reviewed and changed.&lt;br /&gt;
&lt;br /&gt;
=== License configuration when outside CNM – requires SSH Tunneling ===&lt;br /&gt;
If you&#039;re comfortable with ssh and tunneling, set up client licensing as follows:&lt;br /&gt;
&lt;br /&gt;
==== Configure COMSOL ====&lt;br /&gt;
The following needs to be done just once, typically during COMSOL installation:&lt;br /&gt;
&lt;br /&gt;
In the COMSOL Installer, or in COMSOL Preferences, enter:&lt;br /&gt;
* &#039;&#039;&#039;License format:&#039;&#039;&#039; Floating Network License (FNL), &amp;quot;Port number and Hostname&amp;quot;&lt;br /&gt;
:: &amp;quot;Three-server redundancy&amp;quot; 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.&lt;br /&gt;
* &#039;&#039;&#039;Server:&#039;&#039;&#039; &amp;lt;code&amp;gt;127.0.0.1&amp;lt;/code&amp;gt;&lt;br /&gt;
:: Do not use &amp;quot;localhost&amp;quot;, as COMSOL interprets this incorrectly to mean that your machine &#039;&#039;is&#039;&#039; a license server.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Port:&#039;&#039;&#039; &amp;lt;code&amp;gt;1718&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
Or place a license file with this content:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;make&amp;quot;&amp;gt;&lt;br /&gt;
SERVER 127.0.0.1 ANY 1718&lt;br /&gt;
USE_SERVER&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
//--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Provide server connection ====&lt;br /&gt;
This step needs to be done prior to running COMSOL in your desktop session:&lt;br /&gt;
* Connect to &amp;lt;code&amp;gt;mega&amp;lt;/code&amp;gt; with the following ssh command:&lt;br /&gt;
 ssh  -L 1718:&#039;&#039;&#039;clicense1&#039;&#039;&#039;:1718  -L 1719:&#039;&#039;&#039;clicense1&#039;&#039;&#039;:1719  mega.cnm.anl.gov&lt;br /&gt;
* Leave the command running between invocations of COMSOL.&lt;br /&gt;
&lt;br /&gt;
==== Run COMSOL ====&lt;br /&gt;
* Ensure your connection to &amp;quot;mega&amp;quot; is still running. If not, restart it.&lt;br /&gt;
* Start the COMSOL application.&lt;br /&gt;
&lt;br /&gt;
** If you get an error that the number of licenses is &amp;quot;exhausted&amp;quot;, that is confirmation that you correctly reached the license server, though other users are using licenses.&lt;br /&gt;
** 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:&lt;br /&gt;
 ssh  -L 1718:clicense&#039;&#039;&#039;2&#039;&#039;&#039;:1718  -L 1719:clicense&#039;&#039;&#039;2&#039;&#039;&#039;:1719  mega.cnm.anl.gov&lt;br /&gt;
&lt;br /&gt;
== License Troubleshooting ==&lt;br /&gt;
The following are typical error messages.&lt;br /&gt;
=== Could not obtain license for COMSOL Multiphysics GUI ===&lt;br /&gt;
* Error details:&lt;br /&gt;
 License error: -4.&lt;br /&gt;
 &#039;&#039;&#039;Licensed number of users already reached.&#039;&#039;&#039;&lt;br /&gt;
 Feature:       COMSOLGUI&lt;br /&gt;
 License path:  /Users/stern/Applications/COMSOL52a/license/license.dat:&lt;br /&gt;
 FlexNet Licensing error:-4,132&lt;br /&gt;
* Reason: The connection to the license server succeeded, but the license token(s) you requested are in use.&lt;br /&gt;
* Solution: Wait a bit, or [http://carbonmgmt/ganglia/lic.php identify who&#039;s using COMSOL] and politely ask the user when they might be finished with their work.&lt;br /&gt;
&lt;br /&gt;
=== License server machine is down or not responding ===&lt;br /&gt;
* Error details:&lt;br /&gt;
  License error: -96.&lt;br /&gt;
  See the system administrator about starting the license server system, or&lt;br /&gt;
  make sure you&#039;re referring to the right host (see LM_LICENSE_FILE).&lt;br /&gt;
 Feature:       SERIAL&lt;br /&gt;
 Hostname:      clicense3&lt;br /&gt;
 License path:  /Users/stern/Applications/COMSOL52a/license/license.dat:&lt;br /&gt;
 FlexNet Licensing error:-96,7&lt;br /&gt;
* Reason: The license servers cannot be reached at all. The &amp;lt;code&amp;gt;ping&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;host&amp;lt;/code&amp;gt; tests mentioned above fail.&lt;br /&gt;
* Solution: Review the client license file and DNS lookup domains.&lt;br /&gt;
&lt;br /&gt;
=== License file does not support this version ===&lt;br /&gt;
* Error details:&lt;br /&gt;
  Feature: SERIAL&lt;br /&gt;
 &#039;&#039;&#039;Application version &amp;gt; License version: 5.21 &amp;gt; 3.5&#039;&#039;&#039;&lt;br /&gt;
 License path: /Users/stern/Applications/COMSOL52a/license/license.dat:&lt;br /&gt;
 FlexNet Licensing error:-21,126&lt;br /&gt;
* 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&#039;re connected to.&lt;br /&gt;
* Solution: When using SSH, try &amp;lt;code&amp;gt;clicense2&amp;lt;/code&amp;gt; instead of  &amp;lt;code&amp;gt;clicense1&amp;lt;/code&amp;gt;, or vice versa. Revisit your &amp;lt;code&amp;gt;~/.ssh/config&amp;lt;/code&amp;gt; file or use the alternate command line as shown in the SSH section above.&lt;br /&gt;
&lt;br /&gt;
== Multiple CPU cores ==&lt;br /&gt;
Ways to start multi-core (from http://www.comsol.com/support/knowledgebase/1096/)&lt;br /&gt;
 comsol -np 8&lt;br /&gt;
&lt;br /&gt;
 export COMSOL_NUM_THREADS=8    # automatically provided on &#039;&#039;Carbon&#039;&#039;&lt;br /&gt;
 comsol&lt;br /&gt;
* COMSOL does not benefit from hyperthreading (oversubscribing the physical core count).&lt;br /&gt;
&lt;br /&gt;
== Batch jobs ==&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
 comsol -clustersimple batch -inputfile input.mph -outputfile output.mph &lt;br /&gt;
&lt;br /&gt;
 &amp;lt;strike&amp;gt;comsol –nn 8 mpd boot&lt;br /&gt;
 comsol –nn 8 batch –inputfile in.mph&lt;br /&gt;
 comsol mpd allexit&amp;lt;/strike&amp;gt;&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
* http://www.comsol.com/support/knowledgebase/1001/ .&lt;br /&gt;
* [[Media:HPC 2012-05-16 Comsol parallel usage.pdf]] (Modified from http://www.comsol.com/support/knowledgebase/1001/files/4027/cluster_install_linux_42a.pptx – Appendix slide, PBS)&lt;br /&gt;
* &#039;&#039;&#039;Note:&#039;&#039;&#039; MPD is not supported on Carbon (I patched the main comsol script), and no longer necessary at all in Comsol-4.3.&lt;br /&gt;
&lt;br /&gt;
=== Sample Job file ===&lt;br /&gt;
See:&lt;br /&gt;
 $COMSOL_HOME/sample.job&lt;br /&gt;
&lt;br /&gt;
== Important COMSOL Support Articles ==&lt;br /&gt;
* Toplevel suport page: https://www.comsol.com/support&lt;br /&gt;
&lt;br /&gt;
=== KB Articles ===&lt;br /&gt;
* [https://www.comsol.com/support/knowledgebase/1001 Running COMSOL® in parallel on clusters]&lt;br /&gt;
* [https://www.comsol.com/support/knowledgebase/1250 Running parametric sweeps, batch sweeps, and cluster sweeps from the command line]&lt;br /&gt;
* [https://www.comsol.com/support/knowledgebase/1255 Reducing the amount of solution data stored in a model]&lt;br /&gt;
* [https://www.comsol.com/support/knowledgebase/830 Handling large models]&lt;br /&gt;
&lt;br /&gt;
=== Blog-style articles ===&lt;br /&gt;
* [https://www.comsol.com/blogs/the-power-of-the-batch-sweep/ The Power of the Batch Sweep]&lt;br /&gt;
* [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]&lt;/div&gt;</summary>
		<author><name>Stern</name></author>
	</entry>
	<entry>
		<id>https://wiki.anl.gov/wiki_cnm/index.php?title=HPC/Applications/comsol&amp;diff=7479</id>
		<title>HPC/Applications/comsol</title>
		<link rel="alternate" type="text/html" href="https://wiki.anl.gov/wiki_cnm/index.php?title=HPC/Applications/comsol&amp;diff=7479"/>
		<updated>2025-10-03T15:29:12Z</updated>

		<summary type="html">&lt;p&gt;Stern: /* Native desktop version — License configuration */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
The [http://www.comsol.com/products/multiphysics/ &#039;&#039;&#039;COMSOL Multiphysics&#039;&#039;&#039;] application suite&lt;br /&gt;
is available for Mac, Windows, and Linux.&lt;br /&gt;
&lt;br /&gt;
== Access ==&lt;br /&gt;
[[Image:HPC Comsol licensed modules.png|right|450px|thumb|COMSOL features licensed at CNM as of 2024-10.]]&lt;br /&gt;
=== COMSOL Multiphysics ===&lt;br /&gt;
Access to &#039;&#039;&#039;COMSOL Multiphysics&#039;&#039;&#039;, the main application with both a graphical user interface and batch computing capabilities, will be granted &#039;&#039;&#039;&#039;&#039;upon request&#039;&#039;&#039;&#039;&#039;&amp;amp;thinsp;.&lt;br /&gt;
&lt;br /&gt;
You must be:&lt;br /&gt;
* An &#039;&#039;&#039;&#039;&#039;Argonne employee&#039;&#039;&#039;&#039;&#039;&amp;amp;thinsp; in one of the following roles:&lt;br /&gt;
** &#039;&#039;&#039;&#039;&#039;NST staff member&#039;&#039;&#039;&#039;&#039;&amp;amp;thinsp; (including PostDocs, joint appointments, and students at NST).&lt;br /&gt;
** &#039;&#039;&#039;&#039;&#039;CNM Facility User&#039;&#039;&#039;&#039;&#039;&amp;amp;thinsp; (including &#039;&#039;non-NST Argonne employees&#039;&#039;), with an active proposal that has COMSOL in scope. Please see [[HPC/FAQ#Access_and_proposals]].&lt;br /&gt;
&lt;br /&gt;
The set of available COMSOL modules that we have licensed is shown at right.&lt;br /&gt;
&lt;br /&gt;
* The native desktop version can be installed only on &#039;&#039;Argonne-owned&#039;&#039; computers (laptop or desktop). Please contact [mailto:help@anl.gov?Subject=COMSOL%20license%20access%20request CNM support]. Make sure to review [http://www.comsol.com/support/updates/ Product Updates].&lt;br /&gt;
* To run COMSOL on our HPC system &#039;&#039;Carbon&#039;&#039;, as GUI or as batch computing jobs, your proposal must have &#039;&#039;Carbon&#039;&#039; access in scope.&lt;br /&gt;
&lt;br /&gt;
=== COMSOL Server ===&lt;br /&gt;
&#039;&#039;CNM Facility Users&#039;&#039; who are not Argonne employees are not eligible to access&lt;br /&gt;
the full &#039;&#039;&#039;COMSOL Multiphysics&#039;&#039;&#039; product, in compliance with its licensing terms and conditions.&lt;br /&gt;
However, the [https://www.comsol.com/comsol-server &#039;&#039;&#039;COMSOL Server&#039;&#039;&#039;] product offers an alternative&lt;br /&gt;
albeit more narrow means of access.&lt;br /&gt;
&lt;br /&gt;
All users, including &#039;&#039;&#039;&#039;&#039;non-Argonne users&#039;&#039;&#039;&#039;&#039; may be able to run, over a web interface in their browser,&lt;br /&gt;
pre-parameterized &amp;quot;fixed-model&amp;quot; simulations that were made with the &#039;&#039;&#039;COMSOL Application Builder&#039;&#039;&#039; (requires Windows).&lt;br /&gt;
&lt;br /&gt;
To inquire about using COMSOL server applications,&lt;br /&gt;
please contact us.&lt;br /&gt;
&amp;lt;!-- [mailto:cnm_useroffice@anl.gov?Subject=COMSOL%20server%20usage Support]. --&amp;gt;&lt;br /&gt;
We will review possible purchase paths for COMSOL Server, and the &#039;&#039;considerable effort&#039;&#039; likely required by users and the CNM to develop and deploy a COMSOL application.&lt;br /&gt;
&lt;br /&gt;
== Support ==&lt;br /&gt;
* For questions on how to run or start COMSOL:&lt;br /&gt;
*: Submit an [[HPC/Support | &#039;&#039;&#039;IT support request&#039;&#039;&#039;]]&lt;br /&gt;
* For questions related to most COMSOL data or scripts, contact COMSOL support at:&lt;br /&gt;
*: [mailto:support@comsol.com &#039;&#039;&#039;support&#039;&#039;&#039;@comsol.com]&lt;br /&gt;
* &#039;&#039;&#039;Exception:&#039;&#039;&#039; If your support question might contain data that is subject to &#039;&#039;&#039;US Export Control&#039;&#039;&#039; regulations, contact instead:&lt;br /&gt;
*: [mailto:us-export-control@us.comsol.com &#039;&#039;&#039;us-export-control&#039;&#039;&#039;@&#039;&#039;&#039;us&#039;&#039;&#039;.comsol.com]&lt;br /&gt;
&lt;br /&gt;
== The modes to run COMSOL ==&lt;br /&gt;
There are several ways of running COMSOL.&lt;br /&gt;
&lt;br /&gt;
=== Running the desktop application ===&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
# Run on Carbon, display on your desktop using the [http://en.wikipedia.org/wiki/X_Window_System X Window system (X11)].&lt;br /&gt;
#* Requires an &#039;&#039;X11 Server&#039;&#039; application running on your client machine, and SSH X11 forwarding.&lt;br /&gt;
#* The X11 protocol can be slow over LAN.&lt;br /&gt;
# Run on Carbon within a [[HPC/Network Access/Virtual Desktop | virtual desktop environment (VNC)]].&lt;br /&gt;
#* Requires a VNC client on your machine.&lt;br /&gt;
#* It can be confusing where VNC and the app runs.&lt;br /&gt;
#* The virtual desktop presents a (deliberatly) sparse windowing environment – Copy&amp;amp;Paste can be difficult to use.&lt;br /&gt;
# Run on your own computer, remotely checking out Carbon&#039;s license.&lt;br /&gt;
#* Requires a full installation of COMSOL on your desktoo or laptop computer.&lt;br /&gt;
#* 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.&lt;br /&gt;
&lt;br /&gt;
=== Running a batch calculation ===&lt;br /&gt;
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.&lt;br /&gt;
See the [[#Batch jobs|section below]].&lt;br /&gt;
&lt;br /&gt;
== Use with X11 ==&lt;br /&gt;
For casual use, and with [[HPC/Network Access/SSH Tunnel Setup on Linux and MacOS | X11 tunneling to Carbon]] set up, simply add to your &amp;lt;code&amp;gt;~/.bashrc&amp;lt;/code&amp;gt; file on Carbon:&lt;br /&gt;
 module load comsol&lt;br /&gt;
&lt;br /&gt;
Then, from the command line on a Carbon login node, start the COMSOL GUI:&lt;br /&gt;
 comsol &amp;amp;&lt;br /&gt;
&lt;br /&gt;
License configuration is automatic on Carbon.&lt;br /&gt;
&lt;br /&gt;
Comsol will use a number of cores to run calculations multithreaded by default. (On Carbon, COMSOL_NUM_THREADS is set.)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Quit the application&#039;&#039;&#039; as soon as you are done. Only one user can use Comsol at a time.&lt;br /&gt;
&lt;br /&gt;
== Use with VNC ==&lt;br /&gt;
See general  [[HPC/Network Access/Virtual Desktop | instructions on using VNC]], and the COMSOL example therein.&lt;br /&gt;
&lt;br /&gt;
== Native desktop version ==&lt;br /&gt;
&lt;br /&gt;
To get the fastest response from the COMSOL GUI, run a native COMSOL version on your desktop machine or laptop, called &#039;&#039;client machine&#039;&#039; below.&lt;br /&gt;
&lt;br /&gt;
Enter license details either in the COMSOL Setup configuration dialog.&lt;br /&gt;
&lt;br /&gt;
== Native desktop version — License configuration ==&lt;br /&gt;
A client&#039;s COMSOL license needs to be configured depending on how the client reaches CNM network resources. Follow the appropriate section:&lt;br /&gt;
&lt;br /&gt;
* [[#License configuration when inside CNM or on CNM VPN|License configuration when &#039;&#039;&#039;inside CNM&#039;&#039;&#039; or on &#039;&#039;&#039;CNM VPN&#039;&#039;&#039;]]&lt;br /&gt;
* [[#License configuration when outside CNM – requires SSH Tunneling|License configuration when &#039;&#039;&#039;outside CNM&#039;&#039;&#039; – requires SSH Tunneling]]&lt;br /&gt;
&lt;br /&gt;
=== License configuration when inside CNM or on CNM VPN ===&lt;br /&gt;
Requires that the user&#039;s machine is logically within the network of CNM/NST, either by a wired/auth WiFi connection in the building or by VPN under a CNM/NST profile.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Non-NST staff&#039;&#039; usually have a VPN profile that places the machine logically [[#License configuration when outside CNM – requires SSH Tunneling|outside of NST&#039;s network.]]&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;span style=&amp;quot;color:#A00;&amp;quot;&amp;gt;Ensure correct DNS search domains&amp;lt;/span&amp;gt; ====&lt;br /&gt;
* Inspect the client machine&#039;s network configuration.&lt;br /&gt;
* Ensure that &#039;&#039;&#039;two&#039;&#039;&#039; entries are listed as DNS Search Domains for the current network profile:&lt;br /&gt;
 nst.anl.gov&lt;br /&gt;
 cnm.anl.gov&lt;br /&gt;
: (The order of entries does not matter for the purposes considered here.)&lt;br /&gt;
* If the client machine is &#039;&#039;wired to CNM networks&#039;&#039;, the domains are normally provided correctly by DHCP.&lt;br /&gt;
* If the client machine is &#039;&#039;connected over VPN&#039;&#039;, you may need edit the respective network profile.&lt;br /&gt;
:* 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 &amp;quot;Advanced…&amp;quot;. It appears that those changes are being saved and will be activated automatically the next time that this VPN session gets started.&lt;br /&gt;
: [[Image:VNC_add_cnm_to_DNS_1.png|400px]] [[Image:VNC_add_cnm_to_DNS_2.png|400px]]&lt;br /&gt;
:* On Windows or Linux machines, take &#039;&#039;analogous&#039;&#039; steps, using the platform&#039;s own configuration tools.&lt;br /&gt;
&lt;br /&gt;
* Exclude license manager components from client desktop installation. (Those are all handled server-side.)&lt;br /&gt;
&lt;br /&gt;
==== License format ====&lt;br /&gt;
* Floating Network License (FNL), &amp;quot;Three-server redundancy&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==== License servers ====&lt;br /&gt;
* On client machines, while running the COMSOL installer or license configuration, specify license servers and ports as follows:&lt;br /&gt;
 1718    clicense1&lt;br /&gt;
 1718    clicense2&lt;br /&gt;
 1718    clicense3&lt;br /&gt;
: &#039;&#039;&#039;Note:&#039;&#039;&#039; Use &#039;&#039;short host names only&#039;&#039;. (Technical Reason: The license must be usable both on Carbon&#039;s internal network as well as on divisional networks).&lt;br /&gt;
 1718    clicense1&amp;lt;strike&amp;gt;.cnm.anl.gov&amp;lt;/strike&amp;gt;&lt;br /&gt;
 1718    clicense2&amp;lt;strike&amp;gt;.cnm.anl.gov&amp;lt;/strike&amp;gt;&lt;br /&gt;
 1718    clicense3&amp;lt;strike&amp;gt;.cnm.anl.gov&amp;lt;/strike&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Advanced:&#039;&#039;&#039; A client machine&#039;s COMSOL license file &amp;lt;code&amp;gt;&amp;amp;lt;COMSOLDIR&amp;amp;gt;/Multiphysics/license/license.dat&amp;lt;/code&amp;gt; should look as follows:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;make&amp;quot;&amp;gt;&lt;br /&gt;
SERVER clicense1 ANY 1718&lt;br /&gt;
SERVER clicense2 ANY 1718&lt;br /&gt;
SERVER clicense3 ANY 1718&lt;br /&gt;
USE_SERVER&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;amp;lt;COMSOLDIR&amp;amp;gt;&amp;lt;/code&amp;gt; is located by default at:&lt;br /&gt;
* &#039;&#039;&#039;Windows&#039;&#039;&#039;: C:\Program files\COMSOL\COMSOL&#039;&#039;nn&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Linux&#039;&#039;&#039;: /usr/local/comsol&#039;&#039;nn&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Mac&#039;&#039;&#039;: /Applications/COMSOL&#039;&#039;nn&#039;&#039;&lt;br /&gt;
(&amp;quot;&#039;&#039;nn&#039;&#039;&amp;quot; is the application&#039;s abbreviated version number.)&lt;br /&gt;
&lt;br /&gt;
==== Network Troubleshooting ====&lt;br /&gt;
When using the license access model descibed here (as opposed to tunneled over SSH), ensure the following:&lt;br /&gt;
* Verify that short host names can be resolved to IP addresses. Either one of the following commands should produce sensible output:&lt;br /&gt;
 host clicense1&lt;br /&gt;
: or:&lt;br /&gt;
 ping -c 3 clicense1&lt;br /&gt;
* Verify that &#039;&#039;both license ports on the same server&#039;&#039; can be reached from your client machine:&lt;br /&gt;
 telnet &#039;&#039;&#039;clicense1&#039;&#039;&#039; 1718&lt;br /&gt;
 telnet &#039;&#039;&#039;clicense1&#039;&#039;&#039; 1719&lt;br /&gt;
: or:&lt;br /&gt;
 telnet &#039;&#039;&#039;clicense2&#039;&#039;&#039; 1718&lt;br /&gt;
 telnet &#039;&#039;&#039;clicense2&#039;&#039;&#039; 1719&lt;br /&gt;
: A &#039;&#039;successful&#039;&#039; connection looks like:&lt;br /&gt;
 Trying 146.139.x.y...&lt;br /&gt;
 Connected to clicense1.cnm.anl.gov.&lt;br /&gt;
 Escape character is &#039;^]&#039;.&lt;br /&gt;
:: Do not enter any data. Instead,  close each connection by hitting &amp;lt;code&amp;gt;Ctrl&amp;lt;/code&amp;gt;&amp;lt;code&amp;gt;]&amp;lt;/code&amp;gt; (closing square bracket), followed by &amp;lt;code&amp;gt;Ctrl&amp;lt;/code&amp;gt;&amp;lt;code&amp;gt;D&amp;lt;/code&amp;gt;.&lt;br /&gt;
: A &#039;&#039;failed&#039;&#039; connection gives one of these errors:&lt;br /&gt;
 telnet: connect to address 146.139.x.y: Operation timed out&lt;br /&gt;
: or:&lt;br /&gt;
 telnet: connect to address 146.139.x.y: Connection refused&lt;br /&gt;
:: In these cases, ask that your IP firewall configuration be reviewed and changed.&lt;br /&gt;
&lt;br /&gt;
=== License configuration when outside CNM – requires SSH Tunneling ===&lt;br /&gt;
If you&#039;re comfortable with ssh and tunneling, set up client licensing as follows:&lt;br /&gt;
&lt;br /&gt;
==== Configure COMSOL ====&lt;br /&gt;
The following needs to be done just once, typically during COMSOL installation:&lt;br /&gt;
&lt;br /&gt;
In the COMSOL Installer, or in COMSOL Preferences, enter:&lt;br /&gt;
* &#039;&#039;&#039;License format:&#039;&#039;&#039; Floating Network License (FNL), &amp;quot;Port number and Hostname&amp;quot;&lt;br /&gt;
:: &amp;quot;Three-server redundancy&amp;quot; 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.&lt;br /&gt;
* &#039;&#039;&#039;Server:&#039;&#039;&#039; &amp;lt;code&amp;gt;127.0.0.1&amp;lt;/code&amp;gt;&lt;br /&gt;
:: Do not use &amp;quot;localhost&amp;quot;, as COMSOL interprets this incorrectly to mean that your machine &#039;&#039;is&#039;&#039; a license server.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Port:&#039;&#039;&#039; &amp;lt;code&amp;gt;1718&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
Or place a license file with this content:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;make&amp;quot;&amp;gt;&lt;br /&gt;
SERVER 127.0.0.1 ANY 1718&lt;br /&gt;
USE_SERVER&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
//--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Provide server connection ====&lt;br /&gt;
This step needs to be done prior to running COMSOL in your desktop session:&lt;br /&gt;
* Connect to &amp;lt;code&amp;gt;mega&amp;lt;/code&amp;gt; with the following ssh command:&lt;br /&gt;
 ssh  -L 1718:&#039;&#039;&#039;clicense1&#039;&#039;&#039;:1718  -L 1719:&#039;&#039;&#039;clicense1&#039;&#039;&#039;:1719  mega.cnm.anl.gov&lt;br /&gt;
* Leave the command running between invocations of COMSOL.&lt;br /&gt;
&lt;br /&gt;
==== Run COMSOL ====&lt;br /&gt;
* Ensure your connection to &amp;quot;mega&amp;quot; is still running. If not, restart it.&lt;br /&gt;
* Start the COMSOL application.&lt;br /&gt;
&lt;br /&gt;
** If you get an error that the number of licenses is &amp;quot;exhausted&amp;quot;, that is confirmation that you correctly reached the license server, though other users are using licenses.&lt;br /&gt;
** 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:&lt;br /&gt;
 ssh  -L 1718:clicense&#039;&#039;&#039;2&#039;&#039;&#039;:1718  -L 1719:clicense&#039;&#039;&#039;2&#039;&#039;&#039;:1719  mega.cnm.anl.gov&lt;br /&gt;
&lt;br /&gt;
== License Troubleshooting ==&lt;br /&gt;
The following are typical error messages.&lt;br /&gt;
=== Could not obtain license for COMSOL Multiphysics GUI ===&lt;br /&gt;
* Error details:&lt;br /&gt;
 License error: -4.&lt;br /&gt;
 &#039;&#039;&#039;Licensed number of users already reached.&#039;&#039;&#039;&lt;br /&gt;
 Feature:       COMSOLGUI&lt;br /&gt;
 License path:  /Users/stern/Applications/COMSOL52a/license/license.dat:&lt;br /&gt;
 FlexNet Licensing error:-4,132&lt;br /&gt;
* Reason: The connection to the license server succeeded, but the license token(s) you requested are in use.&lt;br /&gt;
* Solution: Wait a bit, or [http://carbonmgmt/ganglia/lic.php identify who&#039;s using COMSOL] and politely ask the user when they might be finished with their work.&lt;br /&gt;
&lt;br /&gt;
=== License server machine is down or not responding ===&lt;br /&gt;
* Error details:&lt;br /&gt;
  License error: -96.&lt;br /&gt;
  See the system administrator about starting the license server system, or&lt;br /&gt;
  make sure you&#039;re referring to the right host (see LM_LICENSE_FILE).&lt;br /&gt;
 Feature:       SERIAL&lt;br /&gt;
 Hostname:      clicense3&lt;br /&gt;
 License path:  /Users/stern/Applications/COMSOL52a/license/license.dat:&lt;br /&gt;
 FlexNet Licensing error:-96,7&lt;br /&gt;
* Reason: The license servers cannot be reached at all. The &amp;lt;code&amp;gt;ping&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;host&amp;lt;/code&amp;gt; tests mentioned above fail.&lt;br /&gt;
* Solution: Review the client license file and DNS lookup domains.&lt;br /&gt;
&lt;br /&gt;
=== License file does not support this version ===&lt;br /&gt;
* Error details:&lt;br /&gt;
  Feature: SERIAL&lt;br /&gt;
 &#039;&#039;&#039;Application version &amp;gt; License version: 5.21 &amp;gt; 3.5&#039;&#039;&#039;&lt;br /&gt;
 License path: /Users/stern/Applications/COMSOL52a/license/license.dat:&lt;br /&gt;
 FlexNet Licensing error:-21,126&lt;br /&gt;
* 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&#039;re connected to.&lt;br /&gt;
* Solution: When using SSH, try &amp;lt;code&amp;gt;clicense2&amp;lt;/code&amp;gt; instead of  &amp;lt;code&amp;gt;clicense1&amp;lt;/code&amp;gt;, or vice versa. Revisit your &amp;lt;code&amp;gt;~/.ssh/config&amp;lt;/code&amp;gt; file or use the alternate command line as shown in the SSH section above.&lt;br /&gt;
&lt;br /&gt;
== Multiple CPU cores ==&lt;br /&gt;
Ways to start multi-core (from http://www.comsol.com/support/knowledgebase/1096/)&lt;br /&gt;
 comsol -np 8&lt;br /&gt;
&lt;br /&gt;
 export COMSOL_NUM_THREADS=8    # automatically provided on &#039;&#039;Carbon&#039;&#039;&lt;br /&gt;
 comsol&lt;br /&gt;
* COMSOL does not benefit from hyperthreading (oversubscribing the physical core count).&lt;br /&gt;
&lt;br /&gt;
== Batch jobs ==&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
 comsol -clustersimple batch -inputfile input.mph -outputfile output.mph &lt;br /&gt;
&lt;br /&gt;
 &amp;lt;strike&amp;gt;comsol –nn 8 mpd boot&lt;br /&gt;
 comsol –nn 8 batch –inputfile in.mph&lt;br /&gt;
 comsol mpd allexit&amp;lt;/strike&amp;gt;&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
* http://www.comsol.com/support/knowledgebase/1001/ .&lt;br /&gt;
* [[Media:HPC 2012-05-16 Comsol parallel usage.pdf]] (Modified from http://www.comsol.com/support/knowledgebase/1001/files/4027/cluster_install_linux_42a.pptx – Appendix slide, PBS)&lt;br /&gt;
* &#039;&#039;&#039;Note:&#039;&#039;&#039; MPD is not supported on Carbon (I patched the main comsol script), and no longer necessary at all in Comsol-4.3.&lt;br /&gt;
&lt;br /&gt;
=== Sample Job file ===&lt;br /&gt;
See:&lt;br /&gt;
 $COMSOL_HOME/sample.job&lt;br /&gt;
&lt;br /&gt;
== Important COMSOL Support Articles ==&lt;br /&gt;
* Toplevel suport page: https://www.comsol.com/support&lt;br /&gt;
&lt;br /&gt;
=== KB Articles ===&lt;br /&gt;
* [https://www.comsol.com/support/knowledgebase/1001 Running COMSOL® in parallel on clusters]&lt;br /&gt;
* [https://www.comsol.com/support/knowledgebase/1250 Running parametric sweeps, batch sweeps, and cluster sweeps from the command line]&lt;br /&gt;
* [https://www.comsol.com/support/knowledgebase/1255 Reducing the amount of solution data stored in a model]&lt;br /&gt;
* [https://www.comsol.com/support/knowledgebase/830 Handling large models]&lt;br /&gt;
&lt;br /&gt;
=== Blog-style articles ===&lt;br /&gt;
* [https://www.comsol.com/blogs/the-power-of-the-batch-sweep/ The Power of the Batch Sweep]&lt;br /&gt;
* [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]&lt;/div&gt;</summary>
		<author><name>Stern</name></author>
	</entry>
	<entry>
		<id>https://wiki.anl.gov/wiki_cnm/index.php?title=HPC/Applications/comsol&amp;diff=7478</id>
		<title>HPC/Applications/comsol</title>
		<link rel="alternate" type="text/html" href="https://wiki.anl.gov/wiki_cnm/index.php?title=HPC/Applications/comsol&amp;diff=7478"/>
		<updated>2025-10-03T15:21:31Z</updated>

		<summary type="html">&lt;p&gt;Stern: /* Native desktop version — License configuration */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
The [http://www.comsol.com/products/multiphysics/ &#039;&#039;&#039;COMSOL Multiphysics&#039;&#039;&#039;] application suite&lt;br /&gt;
is available for Mac, Windows, and Linux.&lt;br /&gt;
&lt;br /&gt;
== Access ==&lt;br /&gt;
[[Image:HPC Comsol licensed modules.png|right|450px|thumb|COMSOL features licensed at CNM as of 2024-10.]]&lt;br /&gt;
=== COMSOL Multiphysics ===&lt;br /&gt;
Access to &#039;&#039;&#039;COMSOL Multiphysics&#039;&#039;&#039;, the main application with both a graphical user interface and batch computing capabilities, will be granted &#039;&#039;&#039;&#039;&#039;upon request&#039;&#039;&#039;&#039;&#039;&amp;amp;thinsp;.&lt;br /&gt;
&lt;br /&gt;
You must be:&lt;br /&gt;
* An &#039;&#039;&#039;&#039;&#039;Argonne employee&#039;&#039;&#039;&#039;&#039;&amp;amp;thinsp; in one of the following roles:&lt;br /&gt;
** &#039;&#039;&#039;&#039;&#039;NST staff member&#039;&#039;&#039;&#039;&#039;&amp;amp;thinsp; (including PostDocs, joint appointments, and students at NST).&lt;br /&gt;
** &#039;&#039;&#039;&#039;&#039;CNM Facility User&#039;&#039;&#039;&#039;&#039;&amp;amp;thinsp; (including &#039;&#039;non-NST Argonne employees&#039;&#039;), with an active proposal that has COMSOL in scope. Please see [[HPC/FAQ#Access_and_proposals]].&lt;br /&gt;
&lt;br /&gt;
The set of available COMSOL modules that we have licensed is shown at right.&lt;br /&gt;
&lt;br /&gt;
* The native desktop version can be installed only on &#039;&#039;Argonne-owned&#039;&#039; computers (laptop or desktop). Please contact [mailto:help@anl.gov?Subject=COMSOL%20license%20access%20request CNM support]. Make sure to review [http://www.comsol.com/support/updates/ Product Updates].&lt;br /&gt;
* To run COMSOL on our HPC system &#039;&#039;Carbon&#039;&#039;, as GUI or as batch computing jobs, your proposal must have &#039;&#039;Carbon&#039;&#039; access in scope.&lt;br /&gt;
&lt;br /&gt;
=== COMSOL Server ===&lt;br /&gt;
&#039;&#039;CNM Facility Users&#039;&#039; who are not Argonne employees are not eligible to access&lt;br /&gt;
the full &#039;&#039;&#039;COMSOL Multiphysics&#039;&#039;&#039; product, in compliance with its licensing terms and conditions.&lt;br /&gt;
However, the [https://www.comsol.com/comsol-server &#039;&#039;&#039;COMSOL Server&#039;&#039;&#039;] product offers an alternative&lt;br /&gt;
albeit more narrow means of access.&lt;br /&gt;
&lt;br /&gt;
All users, including &#039;&#039;&#039;&#039;&#039;non-Argonne users&#039;&#039;&#039;&#039;&#039; may be able to run, over a web interface in their browser,&lt;br /&gt;
pre-parameterized &amp;quot;fixed-model&amp;quot; simulations that were made with the &#039;&#039;&#039;COMSOL Application Builder&#039;&#039;&#039; (requires Windows).&lt;br /&gt;
&lt;br /&gt;
To inquire about using COMSOL server applications,&lt;br /&gt;
please contact us.&lt;br /&gt;
&amp;lt;!-- [mailto:cnm_useroffice@anl.gov?Subject=COMSOL%20server%20usage Support]. --&amp;gt;&lt;br /&gt;
We will review possible purchase paths for COMSOL Server, and the &#039;&#039;considerable effort&#039;&#039; likely required by users and the CNM to develop and deploy a COMSOL application.&lt;br /&gt;
&lt;br /&gt;
== Support ==&lt;br /&gt;
* For questions on how to run or start COMSOL:&lt;br /&gt;
*: Submit an [[HPC/Support | &#039;&#039;&#039;IT support request&#039;&#039;&#039;]]&lt;br /&gt;
* For questions related to most COMSOL data or scripts, contact COMSOL support at:&lt;br /&gt;
*: [mailto:support@comsol.com &#039;&#039;&#039;support&#039;&#039;&#039;@comsol.com]&lt;br /&gt;
* &#039;&#039;&#039;Exception:&#039;&#039;&#039; If your support question might contain data that is subject to &#039;&#039;&#039;US Export Control&#039;&#039;&#039; regulations, contact instead:&lt;br /&gt;
*: [mailto:us-export-control@us.comsol.com &#039;&#039;&#039;us-export-control&#039;&#039;&#039;@&#039;&#039;&#039;us&#039;&#039;&#039;.comsol.com]&lt;br /&gt;
&lt;br /&gt;
== The modes to run COMSOL ==&lt;br /&gt;
There are several ways of running COMSOL.&lt;br /&gt;
&lt;br /&gt;
=== Running the desktop application ===&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
# Run on Carbon, display on your desktop using the [http://en.wikipedia.org/wiki/X_Window_System X Window system (X11)].&lt;br /&gt;
#* Requires an &#039;&#039;X11 Server&#039;&#039; application running on your client machine, and SSH X11 forwarding.&lt;br /&gt;
#* The X11 protocol can be slow over LAN.&lt;br /&gt;
# Run on Carbon within a [[HPC/Network Access/Virtual Desktop | virtual desktop environment (VNC)]].&lt;br /&gt;
#* Requires a VNC client on your machine.&lt;br /&gt;
#* It can be confusing where VNC and the app runs.&lt;br /&gt;
#* The virtual desktop presents a (deliberatly) sparse windowing environment – Copy&amp;amp;Paste can be difficult to use.&lt;br /&gt;
# Run on your own computer, remotely checking out Carbon&#039;s license.&lt;br /&gt;
#* Requires a full installation of COMSOL on your desktoo or laptop computer.&lt;br /&gt;
#* 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.&lt;br /&gt;
&lt;br /&gt;
=== Running a batch calculation ===&lt;br /&gt;
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.&lt;br /&gt;
See the [[#Batch jobs|section below]].&lt;br /&gt;
&lt;br /&gt;
== Use with X11 ==&lt;br /&gt;
For casual use, and with [[HPC/Network Access/SSH Tunnel Setup on Linux and MacOS | X11 tunneling to Carbon]] set up, simply add to your &amp;lt;code&amp;gt;~/.bashrc&amp;lt;/code&amp;gt; file on Carbon:&lt;br /&gt;
 module load comsol&lt;br /&gt;
&lt;br /&gt;
Then, from the command line on a Carbon login node, start the COMSOL GUI:&lt;br /&gt;
 comsol &amp;amp;&lt;br /&gt;
&lt;br /&gt;
License configuration is automatic on Carbon.&lt;br /&gt;
&lt;br /&gt;
Comsol will use a number of cores to run calculations multithreaded by default. (On Carbon, COMSOL_NUM_THREADS is set.)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Quit the application&#039;&#039;&#039; as soon as you are done. Only one user can use Comsol at a time.&lt;br /&gt;
&lt;br /&gt;
== Use with VNC ==&lt;br /&gt;
See general  [[HPC/Network Access/Virtual Desktop | instructions on using VNC]], and the COMSOL example therein.&lt;br /&gt;
&lt;br /&gt;
== Native desktop version ==&lt;br /&gt;
&lt;br /&gt;
To get the fastest response from the COMSOL GUI, run a native COMSOL version on your desktop machine or laptop, called &#039;&#039;client machine&#039;&#039; below.&lt;br /&gt;
&lt;br /&gt;
Enter license details either in the COMSOL Setup configuration dialog.&lt;br /&gt;
&lt;br /&gt;
== Native desktop version — License configuration ==&lt;br /&gt;
A client&#039;s COMSOL license needs to be configured depending on how the client reaches CNM network resources. Follow the appropriate section:&lt;br /&gt;
&lt;br /&gt;
* [[#License configuration when inside CNM or on VPN under a CNM/NST staff member|License configuration when &#039;&#039;&#039;inside CNM&#039;&#039;&#039; or on &#039;&#039;&#039;VPN&#039;&#039;&#039; under a &#039;&#039;&#039;CNM/NST staff member&#039;&#039;&#039;]]&lt;br /&gt;
* [[#License configuration when outside CNM – requires SSH Tunneling|License configuration when &#039;&#039;&#039;outside CNM&#039;&#039;&#039; – requires SSH Tunneling]]&lt;br /&gt;
&lt;br /&gt;
=== License configuration when inside CNM or on VPN under a CNM/NST staff member ===&lt;br /&gt;
==== &amp;lt;span style=&amp;quot;color:#A00;&amp;quot;&amp;gt;Ensure correct DNS search domains&amp;lt;/span&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
* Inspect the client machine&#039;s network configuration.&lt;br /&gt;
* Ensure that &#039;&#039;&#039;two&#039;&#039;&#039; entries are listed as DNS Search Domains for the current network profile:&lt;br /&gt;
 nst.anl.gov&lt;br /&gt;
 cnm.anl.gov&lt;br /&gt;
: (The order of entries does not matter for the purposes considered here.)&lt;br /&gt;
* If the client machine is &#039;&#039;wired to CNM networks&#039;&#039;, the domains are normally provided correctly by DHCP.&lt;br /&gt;
* If the client machine is &#039;&#039;connected over VPN&#039;&#039;, you may need edit the respective network profile.&lt;br /&gt;
:* 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 &amp;quot;Advanced…&amp;quot;. It appears that those changes are being saved and will be activated automatically the next time that this VPN session gets started.&lt;br /&gt;
: [[Image:VNC_add_cnm_to_DNS_1.png|400px]] [[Image:VNC_add_cnm_to_DNS_2.png|400px]]&lt;br /&gt;
:* On Windows or Linux machines, take &#039;&#039;analogous&#039;&#039; steps, using the platform&#039;s own configuration tools.&lt;br /&gt;
&lt;br /&gt;
* Exclude license manager components from client desktop installation. (Those are all handled server-side.)&lt;br /&gt;
&lt;br /&gt;
==== License format ====&lt;br /&gt;
* Floating Network License (FNL), &amp;quot;Three-server redundancy&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==== License servers ====&lt;br /&gt;
* On client machines, while running the COMSOL installer or license configuration, specify license servers and ports as follows:&lt;br /&gt;
 1718    clicense1&lt;br /&gt;
 1718    clicense2&lt;br /&gt;
 1718    clicense3&lt;br /&gt;
: &#039;&#039;&#039;Note:&#039;&#039;&#039; Use &#039;&#039;short host names only&#039;&#039;. (Technical Reason: The license must be usable both on Carbon&#039;s internal network as well as on divisional networks).&lt;br /&gt;
 1718    clicense1&amp;lt;strike&amp;gt;.cnm.anl.gov&amp;lt;/strike&amp;gt;&lt;br /&gt;
 1718    clicense2&amp;lt;strike&amp;gt;.cnm.anl.gov&amp;lt;/strike&amp;gt;&lt;br /&gt;
 1718    clicense3&amp;lt;strike&amp;gt;.cnm.anl.gov&amp;lt;/strike&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Advanced:&#039;&#039;&#039; A client machine&#039;s COMSOL license file &amp;lt;code&amp;gt;&amp;amp;lt;COMSOLDIR&amp;amp;gt;/Multiphysics/license/license.dat&amp;lt;/code&amp;gt; should look as follows:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;make&amp;quot;&amp;gt;&lt;br /&gt;
SERVER clicense1 ANY 1718&lt;br /&gt;
SERVER clicense2 ANY 1718&lt;br /&gt;
SERVER clicense3 ANY 1718&lt;br /&gt;
USE_SERVER&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;amp;lt;COMSOLDIR&amp;amp;gt;&amp;lt;/code&amp;gt; is located by default at:&lt;br /&gt;
* &#039;&#039;&#039;Windows&#039;&#039;&#039;: C:\Program files\COMSOL\COMSOL&#039;&#039;nn&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Linux&#039;&#039;&#039;: /usr/local/comsol&#039;&#039;nn&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Mac&#039;&#039;&#039;: /Applications/COMSOL&#039;&#039;nn&#039;&#039;&lt;br /&gt;
(&amp;quot;&#039;&#039;nn&#039;&#039;&amp;quot; is the application&#039;s abbreviated version number.)&lt;br /&gt;
&lt;br /&gt;
==== Network Troubleshooting ====&lt;br /&gt;
When using the license access model descibed here (as opposed to tunneled over SSH), ensure the following:&lt;br /&gt;
* Verify that short host names can be resolved to IP addresses. Either one of the following commands should produce sensible output:&lt;br /&gt;
 host clicense1&lt;br /&gt;
: or:&lt;br /&gt;
 ping -c 3 clicense1&lt;br /&gt;
* Verify that &#039;&#039;both license ports on the same server&#039;&#039; can be reached from your client machine:&lt;br /&gt;
 telnet &#039;&#039;&#039;clicense1&#039;&#039;&#039; 1718&lt;br /&gt;
 telnet &#039;&#039;&#039;clicense1&#039;&#039;&#039; 1719&lt;br /&gt;
: or:&lt;br /&gt;
 telnet &#039;&#039;&#039;clicense2&#039;&#039;&#039; 1718&lt;br /&gt;
 telnet &#039;&#039;&#039;clicense2&#039;&#039;&#039; 1719&lt;br /&gt;
: A &#039;&#039;successful&#039;&#039; connection looks like:&lt;br /&gt;
 Trying 146.139.x.y...&lt;br /&gt;
 Connected to clicense1.cnm.anl.gov.&lt;br /&gt;
 Escape character is &#039;^]&#039;.&lt;br /&gt;
:: Do not enter any data. Instead,  close each connection by hitting &amp;lt;code&amp;gt;Ctrl&amp;lt;/code&amp;gt;&amp;lt;code&amp;gt;]&amp;lt;/code&amp;gt; (closing square bracket), followed by &amp;lt;code&amp;gt;Ctrl&amp;lt;/code&amp;gt;&amp;lt;code&amp;gt;D&amp;lt;/code&amp;gt;.&lt;br /&gt;
: A &#039;&#039;failed&#039;&#039; connection gives one of these errors:&lt;br /&gt;
 telnet: connect to address 146.139.x.y: Operation timed out&lt;br /&gt;
: or:&lt;br /&gt;
 telnet: connect to address 146.139.x.y: Connection refused&lt;br /&gt;
:: In these cases, ask that your IP firewall configuration be reviewed and changed.&lt;br /&gt;
&lt;br /&gt;
=== License configuration when outside CNM – requires SSH Tunneling ===&lt;br /&gt;
If you&#039;re comfortable with ssh and tunneling, set up client licensing as follows:&lt;br /&gt;
&lt;br /&gt;
==== Configure COMSOL ====&lt;br /&gt;
The following needs to be done just once, typically during COMSOL installation:&lt;br /&gt;
&lt;br /&gt;
In the COMSOL Installer, or in COMSOL Preferences, enter:&lt;br /&gt;
* &#039;&#039;&#039;License format:&#039;&#039;&#039; Floating Network License (FNL), &amp;quot;Port number and Hostname&amp;quot;&lt;br /&gt;
:: &amp;quot;Three-server redundancy&amp;quot; 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.&lt;br /&gt;
* &#039;&#039;&#039;Server:&#039;&#039;&#039; &amp;lt;code&amp;gt;127.0.0.1&amp;lt;/code&amp;gt;&lt;br /&gt;
:: Do not use &amp;quot;localhost&amp;quot;, as COMSOL interprets this incorrectly to mean that your machine &#039;&#039;is&#039;&#039; a license server.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Port:&#039;&#039;&#039; &amp;lt;code&amp;gt;1718&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
Or place a license file with this content:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;make&amp;quot;&amp;gt;&lt;br /&gt;
SERVER 127.0.0.1 ANY 1718&lt;br /&gt;
USE_SERVER&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
//--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Provide server connection ====&lt;br /&gt;
This step needs to be done prior to running COMSOL in your desktop session:&lt;br /&gt;
* Connect to &amp;lt;code&amp;gt;mega&amp;lt;/code&amp;gt; with the following ssh command:&lt;br /&gt;
 ssh  -L 1718:&#039;&#039;&#039;clicense1&#039;&#039;&#039;:1718  -L 1719:&#039;&#039;&#039;clicense1&#039;&#039;&#039;:1719  mega.cnm.anl.gov&lt;br /&gt;
* Leave the command running between invocations of COMSOL.&lt;br /&gt;
&lt;br /&gt;
==== Run COMSOL ====&lt;br /&gt;
* Ensure your connection to &amp;quot;mega&amp;quot; is still running. If not, restart it.&lt;br /&gt;
* Start the COMSOL application.&lt;br /&gt;
&lt;br /&gt;
** If you get an error that the number of licenses is &amp;quot;exhausted&amp;quot;, that is confirmation that you correctly reached the license server, though other users are using licenses.&lt;br /&gt;
** 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:&lt;br /&gt;
 ssh  -L 1718:clicense&#039;&#039;&#039;2&#039;&#039;&#039;:1718  -L 1719:clicense&#039;&#039;&#039;2&#039;&#039;&#039;:1719  mega.cnm.anl.gov&lt;br /&gt;
&lt;br /&gt;
== License Troubleshooting ==&lt;br /&gt;
The following are typical error messages.&lt;br /&gt;
=== Could not obtain license for COMSOL Multiphysics GUI ===&lt;br /&gt;
* Error details:&lt;br /&gt;
 License error: -4.&lt;br /&gt;
 &#039;&#039;&#039;Licensed number of users already reached.&#039;&#039;&#039;&lt;br /&gt;
 Feature:       COMSOLGUI&lt;br /&gt;
 License path:  /Users/stern/Applications/COMSOL52a/license/license.dat:&lt;br /&gt;
 FlexNet Licensing error:-4,132&lt;br /&gt;
* Reason: The connection to the license server succeeded, but the license token(s) you requested are in use.&lt;br /&gt;
* Solution: Wait a bit, or [http://carbonmgmt/ganglia/lic.php identify who&#039;s using COMSOL] and politely ask the user when they might be finished with their work.&lt;br /&gt;
&lt;br /&gt;
=== License server machine is down or not responding ===&lt;br /&gt;
* Error details:&lt;br /&gt;
  License error: -96.&lt;br /&gt;
  See the system administrator about starting the license server system, or&lt;br /&gt;
  make sure you&#039;re referring to the right host (see LM_LICENSE_FILE).&lt;br /&gt;
 Feature:       SERIAL&lt;br /&gt;
 Hostname:      clicense3&lt;br /&gt;
 License path:  /Users/stern/Applications/COMSOL52a/license/license.dat:&lt;br /&gt;
 FlexNet Licensing error:-96,7&lt;br /&gt;
* Reason: The license servers cannot be reached at all. The &amp;lt;code&amp;gt;ping&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;host&amp;lt;/code&amp;gt; tests mentioned above fail.&lt;br /&gt;
* Solution: Review the client license file and DNS lookup domains.&lt;br /&gt;
&lt;br /&gt;
=== License file does not support this version ===&lt;br /&gt;
* Error details:&lt;br /&gt;
  Feature: SERIAL&lt;br /&gt;
 &#039;&#039;&#039;Application version &amp;gt; License version: 5.21 &amp;gt; 3.5&#039;&#039;&#039;&lt;br /&gt;
 License path: /Users/stern/Applications/COMSOL52a/license/license.dat:&lt;br /&gt;
 FlexNet Licensing error:-21,126&lt;br /&gt;
* 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&#039;re connected to.&lt;br /&gt;
* Solution: When using SSH, try &amp;lt;code&amp;gt;clicense2&amp;lt;/code&amp;gt; instead of  &amp;lt;code&amp;gt;clicense1&amp;lt;/code&amp;gt;, or vice versa. Revisit your &amp;lt;code&amp;gt;~/.ssh/config&amp;lt;/code&amp;gt; file or use the alternate command line as shown in the SSH section above.&lt;br /&gt;
&lt;br /&gt;
== Multiple CPU cores ==&lt;br /&gt;
Ways to start multi-core (from http://www.comsol.com/support/knowledgebase/1096/)&lt;br /&gt;
 comsol -np 8&lt;br /&gt;
&lt;br /&gt;
 export COMSOL_NUM_THREADS=8    # automatically provided on &#039;&#039;Carbon&#039;&#039;&lt;br /&gt;
 comsol&lt;br /&gt;
* COMSOL does not benefit from hyperthreading (oversubscribing the physical core count).&lt;br /&gt;
&lt;br /&gt;
== Batch jobs ==&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
 comsol -clustersimple batch -inputfile input.mph -outputfile output.mph &lt;br /&gt;
&lt;br /&gt;
 &amp;lt;strike&amp;gt;comsol –nn 8 mpd boot&lt;br /&gt;
 comsol –nn 8 batch –inputfile in.mph&lt;br /&gt;
 comsol mpd allexit&amp;lt;/strike&amp;gt;&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
* http://www.comsol.com/support/knowledgebase/1001/ .&lt;br /&gt;
* [[Media:HPC 2012-05-16 Comsol parallel usage.pdf]] (Modified from http://www.comsol.com/support/knowledgebase/1001/files/4027/cluster_install_linux_42a.pptx – Appendix slide, PBS)&lt;br /&gt;
* &#039;&#039;&#039;Note:&#039;&#039;&#039; MPD is not supported on Carbon (I patched the main comsol script), and no longer necessary at all in Comsol-4.3.&lt;br /&gt;
&lt;br /&gt;
=== Sample Job file ===&lt;br /&gt;
See:&lt;br /&gt;
 $COMSOL_HOME/sample.job&lt;br /&gt;
&lt;br /&gt;
== Important COMSOL Support Articles ==&lt;br /&gt;
* Toplevel suport page: https://www.comsol.com/support&lt;br /&gt;
&lt;br /&gt;
=== KB Articles ===&lt;br /&gt;
* [https://www.comsol.com/support/knowledgebase/1001 Running COMSOL® in parallel on clusters]&lt;br /&gt;
* [https://www.comsol.com/support/knowledgebase/1250 Running parametric sweeps, batch sweeps, and cluster sweeps from the command line]&lt;br /&gt;
* [https://www.comsol.com/support/knowledgebase/1255 Reducing the amount of solution data stored in a model]&lt;br /&gt;
* [https://www.comsol.com/support/knowledgebase/830 Handling large models]&lt;br /&gt;
&lt;br /&gt;
=== Blog-style articles ===&lt;br /&gt;
* [https://www.comsol.com/blogs/the-power-of-the-batch-sweep/ The Power of the Batch Sweep]&lt;br /&gt;
* [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]&lt;/div&gt;</summary>
		<author><name>Stern</name></author>
	</entry>
	<entry>
		<id>https://wiki.anl.gov/wiki_cnm/index.php?title=HPC/Applications/comsol&amp;diff=7477</id>
		<title>HPC/Applications/comsol</title>
		<link rel="alternate" type="text/html" href="https://wiki.anl.gov/wiki_cnm/index.php?title=HPC/Applications/comsol&amp;diff=7477"/>
		<updated>2025-10-03T15:14:18Z</updated>

		<summary type="html">&lt;p&gt;Stern: /* License servers */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
The [http://www.comsol.com/products/multiphysics/ &#039;&#039;&#039;COMSOL Multiphysics&#039;&#039;&#039;] application suite&lt;br /&gt;
is available for Mac, Windows, and Linux.&lt;br /&gt;
&lt;br /&gt;
== Access ==&lt;br /&gt;
[[Image:HPC Comsol licensed modules.png|right|450px|thumb|COMSOL features licensed at CNM as of 2024-10.]]&lt;br /&gt;
=== COMSOL Multiphysics ===&lt;br /&gt;
Access to &#039;&#039;&#039;COMSOL Multiphysics&#039;&#039;&#039;, the main application with both a graphical user interface and batch computing capabilities, will be granted &#039;&#039;&#039;&#039;&#039;upon request&#039;&#039;&#039;&#039;&#039;&amp;amp;thinsp;.&lt;br /&gt;
&lt;br /&gt;
You must be:&lt;br /&gt;
* An &#039;&#039;&#039;&#039;&#039;Argonne employee&#039;&#039;&#039;&#039;&#039;&amp;amp;thinsp; in one of the following roles:&lt;br /&gt;
** &#039;&#039;&#039;&#039;&#039;NST staff member&#039;&#039;&#039;&#039;&#039;&amp;amp;thinsp; (including PostDocs, joint appointments, and students at NST).&lt;br /&gt;
** &#039;&#039;&#039;&#039;&#039;CNM Facility User&#039;&#039;&#039;&#039;&#039;&amp;amp;thinsp; (including &#039;&#039;non-NST Argonne employees&#039;&#039;), with an active proposal that has COMSOL in scope. Please see [[HPC/FAQ#Access_and_proposals]].&lt;br /&gt;
&lt;br /&gt;
The set of available COMSOL modules that we have licensed is shown at right.&lt;br /&gt;
&lt;br /&gt;
* The native desktop version can be installed only on &#039;&#039;Argonne-owned&#039;&#039; computers (laptop or desktop). Please contact [mailto:help@anl.gov?Subject=COMSOL%20license%20access%20request CNM support]. Make sure to review [http://www.comsol.com/support/updates/ Product Updates].&lt;br /&gt;
* To run COMSOL on our HPC system &#039;&#039;Carbon&#039;&#039;, as GUI or as batch computing jobs, your proposal must have &#039;&#039;Carbon&#039;&#039; access in scope.&lt;br /&gt;
&lt;br /&gt;
=== COMSOL Server ===&lt;br /&gt;
&#039;&#039;CNM Facility Users&#039;&#039; who are not Argonne employees are not eligible to access&lt;br /&gt;
the full &#039;&#039;&#039;COMSOL Multiphysics&#039;&#039;&#039; product, in compliance with its licensing terms and conditions.&lt;br /&gt;
However, the [https://www.comsol.com/comsol-server &#039;&#039;&#039;COMSOL Server&#039;&#039;&#039;] product offers an alternative&lt;br /&gt;
albeit more narrow means of access.&lt;br /&gt;
&lt;br /&gt;
All users, including &#039;&#039;&#039;&#039;&#039;non-Argonne users&#039;&#039;&#039;&#039;&#039; may be able to run, over a web interface in their browser,&lt;br /&gt;
pre-parameterized &amp;quot;fixed-model&amp;quot; simulations that were made with the &#039;&#039;&#039;COMSOL Application Builder&#039;&#039;&#039; (requires Windows).&lt;br /&gt;
&lt;br /&gt;
To inquire about using COMSOL server applications,&lt;br /&gt;
please contact us.&lt;br /&gt;
&amp;lt;!-- [mailto:cnm_useroffice@anl.gov?Subject=COMSOL%20server%20usage Support]. --&amp;gt;&lt;br /&gt;
We will review possible purchase paths for COMSOL Server, and the &#039;&#039;considerable effort&#039;&#039; likely required by users and the CNM to develop and deploy a COMSOL application.&lt;br /&gt;
&lt;br /&gt;
== Support ==&lt;br /&gt;
* For questions on how to run or start COMSOL:&lt;br /&gt;
*: Submit an [[HPC/Support | &#039;&#039;&#039;IT support request&#039;&#039;&#039;]]&lt;br /&gt;
* For questions related to most COMSOL data or scripts, contact COMSOL support at:&lt;br /&gt;
*: [mailto:support@comsol.com &#039;&#039;&#039;support&#039;&#039;&#039;@comsol.com]&lt;br /&gt;
* &#039;&#039;&#039;Exception:&#039;&#039;&#039; If your support question might contain data that is subject to &#039;&#039;&#039;US Export Control&#039;&#039;&#039; regulations, contact instead:&lt;br /&gt;
*: [mailto:us-export-control@us.comsol.com &#039;&#039;&#039;us-export-control&#039;&#039;&#039;@&#039;&#039;&#039;us&#039;&#039;&#039;.comsol.com]&lt;br /&gt;
&lt;br /&gt;
== The modes to run COMSOL ==&lt;br /&gt;
There are several ways of running COMSOL.&lt;br /&gt;
&lt;br /&gt;
=== Running the desktop application ===&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
# Run on Carbon, display on your desktop using the [http://en.wikipedia.org/wiki/X_Window_System X Window system (X11)].&lt;br /&gt;
#* Requires an &#039;&#039;X11 Server&#039;&#039; application running on your client machine, and SSH X11 forwarding.&lt;br /&gt;
#* The X11 protocol can be slow over LAN.&lt;br /&gt;
# Run on Carbon within a [[HPC/Network Access/Virtual Desktop | virtual desktop environment (VNC)]].&lt;br /&gt;
#* Requires a VNC client on your machine.&lt;br /&gt;
#* It can be confusing where VNC and the app runs.&lt;br /&gt;
#* The virtual desktop presents a (deliberatly) sparse windowing environment – Copy&amp;amp;Paste can be difficult to use.&lt;br /&gt;
# Run on your own computer, remotely checking out Carbon&#039;s license.&lt;br /&gt;
#* Requires a full installation of COMSOL on your desktoo or laptop computer.&lt;br /&gt;
#* 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.&lt;br /&gt;
&lt;br /&gt;
=== Running a batch calculation ===&lt;br /&gt;
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.&lt;br /&gt;
See the [[#Batch jobs|section below]].&lt;br /&gt;
&lt;br /&gt;
== Use with X11 ==&lt;br /&gt;
For casual use, and with [[HPC/Network Access/SSH Tunnel Setup on Linux and MacOS | X11 tunneling to Carbon]] set up, simply add to your &amp;lt;code&amp;gt;~/.bashrc&amp;lt;/code&amp;gt; file on Carbon:&lt;br /&gt;
 module load comsol&lt;br /&gt;
&lt;br /&gt;
Then, from the command line on a Carbon login node, start the COMSOL GUI:&lt;br /&gt;
 comsol &amp;amp;&lt;br /&gt;
&lt;br /&gt;
License configuration is automatic on Carbon.&lt;br /&gt;
&lt;br /&gt;
Comsol will use a number of cores to run calculations multithreaded by default. (On Carbon, COMSOL_NUM_THREADS is set.)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Quit the application&#039;&#039;&#039; as soon as you are done. Only one user can use Comsol at a time.&lt;br /&gt;
&lt;br /&gt;
== Use with VNC ==&lt;br /&gt;
See general  [[HPC/Network Access/Virtual Desktop | instructions on using VNC]], and the COMSOL example therein.&lt;br /&gt;
&lt;br /&gt;
== Native desktop version ==&lt;br /&gt;
&lt;br /&gt;
To get the fastest response from the COMSOL GUI, run a native COMSOL version on your desktop machine or laptop, called &#039;&#039;client machine&#039;&#039; below.&lt;br /&gt;
&lt;br /&gt;
Enter license details either in the COMSOL Setup configuration dialog.&lt;br /&gt;
&lt;br /&gt;
== Native desktop version — License configuration ==&lt;br /&gt;
A client&#039;s COMSOL license needs to be configured depending on how the client reaches CNM network resources. Follow the appropriate section:&lt;br /&gt;
* [[#License configuration when inside CNM or using VPN]]&lt;br /&gt;
* [[#License configuration when outside CNM and using SSH Tunneling]]&lt;br /&gt;
&lt;br /&gt;
=== License configuration when inside CNM or using VPN ===&lt;br /&gt;
==== &amp;lt;span style=&amp;quot;color:#A00;&amp;quot;&amp;gt;Ensure correct DNS search domains&amp;lt;/span&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
* Inspect the client machine&#039;s network configuration.&lt;br /&gt;
* Ensure that &#039;&#039;&#039;two&#039;&#039;&#039; entries are listed as DNS Search Domains for the current network profile:&lt;br /&gt;
 nst.anl.gov&lt;br /&gt;
 cnm.anl.gov&lt;br /&gt;
: (The order of entries does not matter for the purposes considered here.)&lt;br /&gt;
* If the client machine is &#039;&#039;wired to CNM networks&#039;&#039;, the domains are normally provided correctly by DHCP.&lt;br /&gt;
* If the client machine is &#039;&#039;connected over VPN&#039;&#039;, you may need edit the respective network profile.&lt;br /&gt;
:* 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 &amp;quot;Advanced…&amp;quot;. It appears that those changes are being saved and will be activated automatically the next time that this VPN session gets started.&lt;br /&gt;
: [[Image:VNC_add_cnm_to_DNS_1.png|400px]] [[Image:VNC_add_cnm_to_DNS_2.png|400px]]&lt;br /&gt;
:* On Windows or Linux machines, take &#039;&#039;analogous&#039;&#039; steps, using the platform&#039;s own configuration tools.&lt;br /&gt;
&lt;br /&gt;
* Exclude license manager components from client desktop installation. (Those are all handled server-side.)&lt;br /&gt;
&lt;br /&gt;
==== License format ====&lt;br /&gt;
* Floating Network License (FNL), &amp;quot;Three-server redundancy&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==== License servers ====&lt;br /&gt;
* On client machines, while running the COMSOL installer or license configuration, specify license servers and ports as follows:&lt;br /&gt;
 1718    clicense1&lt;br /&gt;
 1718    clicense2&lt;br /&gt;
 1718    clicense3&lt;br /&gt;
: &#039;&#039;&#039;Note:&#039;&#039;&#039; Use &#039;&#039;short host names only&#039;&#039;. (Technical Reason: The license must be usable both on Carbon&#039;s internal network as well as on divisional networks).&lt;br /&gt;
 1718    clicense1&amp;lt;strike&amp;gt;.cnm.anl.gov&amp;lt;/strike&amp;gt;&lt;br /&gt;
 1718    clicense2&amp;lt;strike&amp;gt;.cnm.anl.gov&amp;lt;/strike&amp;gt;&lt;br /&gt;
 1718    clicense3&amp;lt;strike&amp;gt;.cnm.anl.gov&amp;lt;/strike&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Advanced:&#039;&#039;&#039; A client machine&#039;s COMSOL license file &amp;lt;code&amp;gt;&amp;amp;lt;COMSOLDIR&amp;amp;gt;/Multiphysics/license/license.dat&amp;lt;/code&amp;gt; should look as follows:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;make&amp;quot;&amp;gt;&lt;br /&gt;
SERVER clicense1 ANY 1718&lt;br /&gt;
SERVER clicense2 ANY 1718&lt;br /&gt;
SERVER clicense3 ANY 1718&lt;br /&gt;
USE_SERVER&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;amp;lt;COMSOLDIR&amp;amp;gt;&amp;lt;/code&amp;gt; is located by default at:&lt;br /&gt;
* &#039;&#039;&#039;Windows&#039;&#039;&#039;: C:\Program files\COMSOL\COMSOL&#039;&#039;nn&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Linux&#039;&#039;&#039;: /usr/local/comsol&#039;&#039;nn&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Mac&#039;&#039;&#039;: /Applications/COMSOL&#039;&#039;nn&#039;&#039;&lt;br /&gt;
(&amp;quot;&#039;&#039;nn&#039;&#039;&amp;quot; is the application&#039;s abbreviated version number.)&lt;br /&gt;
&lt;br /&gt;
==== Network Troubleshooting ====&lt;br /&gt;
When using the license access model descibed here (as opposed to tunneled over SSH), ensure the following:&lt;br /&gt;
* Verify that short host names can be resolved to IP addresses. Either one of the following commands should produce sensible output:&lt;br /&gt;
 host clicense1&lt;br /&gt;
: or:&lt;br /&gt;
 ping -c 3 clicense1&lt;br /&gt;
* Verify that &#039;&#039;both license ports on the same server&#039;&#039; can be reached from your client machine:&lt;br /&gt;
 telnet &#039;&#039;&#039;clicense1&#039;&#039;&#039; 1718&lt;br /&gt;
 telnet &#039;&#039;&#039;clicense1&#039;&#039;&#039; 1719&lt;br /&gt;
: or:&lt;br /&gt;
 telnet &#039;&#039;&#039;clicense2&#039;&#039;&#039; 1718&lt;br /&gt;
 telnet &#039;&#039;&#039;clicense2&#039;&#039;&#039; 1719&lt;br /&gt;
: A &#039;&#039;successful&#039;&#039; connection looks like:&lt;br /&gt;
 Trying 146.139.x.y...&lt;br /&gt;
 Connected to clicense1.cnm.anl.gov.&lt;br /&gt;
 Escape character is &#039;^]&#039;.&lt;br /&gt;
:: Do not enter any data. Instead,  close each connection by hitting &amp;lt;code&amp;gt;Ctrl&amp;lt;/code&amp;gt;&amp;lt;code&amp;gt;]&amp;lt;/code&amp;gt; (closing square bracket), followed by &amp;lt;code&amp;gt;Ctrl&amp;lt;/code&amp;gt;&amp;lt;code&amp;gt;D&amp;lt;/code&amp;gt;.&lt;br /&gt;
: A &#039;&#039;failed&#039;&#039; connection gives one of these errors:&lt;br /&gt;
 telnet: connect to address 146.139.x.y: Operation timed out&lt;br /&gt;
: or:&lt;br /&gt;
 telnet: connect to address 146.139.x.y: Connection refused&lt;br /&gt;
:: In these cases, ask that your IP firewall configuration be reviewed and changed.&lt;br /&gt;
&lt;br /&gt;
=== License access when outside CNM ===&lt;br /&gt;
If you&#039;re comfortable with ssh and tunneling, set up client licensing as follows:&lt;br /&gt;
&lt;br /&gt;
==== Configure COMSOL ====&lt;br /&gt;
The following needs to be done just once, typically during COMSOL installation:&lt;br /&gt;
&lt;br /&gt;
In the COMSOL Installer, or in COMSOL Preferences, enter:&lt;br /&gt;
* &#039;&#039;&#039;License format:&#039;&#039;&#039; Floating Network License (FNL), &amp;quot;Port number and Hostname&amp;quot;&lt;br /&gt;
:: &amp;quot;Three-server redundancy&amp;quot; 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.&lt;br /&gt;
* &#039;&#039;&#039;Server:&#039;&#039;&#039; &amp;lt;code&amp;gt;127.0.0.1&amp;lt;/code&amp;gt;&lt;br /&gt;
:: Do not use &amp;quot;localhost&amp;quot;, as COMSOL interprets this incorrectly to mean that your machine &#039;&#039;is&#039;&#039; a license server.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Port:&#039;&#039;&#039; &amp;lt;code&amp;gt;1718&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
Or place a license file with this content:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;make&amp;quot;&amp;gt;&lt;br /&gt;
SERVER 127.0.0.1 ANY 1718&lt;br /&gt;
USE_SERVER&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
//--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Provide server connection ====&lt;br /&gt;
This step needs to be done prior to running COMSOL in your desktop session:&lt;br /&gt;
* Connect to &amp;lt;code&amp;gt;mega&amp;lt;/code&amp;gt; with the following ssh command:&lt;br /&gt;
 ssh  -L 1718:&#039;&#039;&#039;clicense1&#039;&#039;&#039;:1718  -L 1719:&#039;&#039;&#039;clicense1&#039;&#039;&#039;:1719  mega.cnm.anl.gov&lt;br /&gt;
* Leave the command running between invocations of COMSOL.&lt;br /&gt;
&lt;br /&gt;
==== Run COMSOL ====&lt;br /&gt;
* Ensure your connection to &amp;quot;mega&amp;quot; is still running. If not, restart it.&lt;br /&gt;
* Start the COMSOL application.&lt;br /&gt;
&lt;br /&gt;
** If you get an error that the number of licenses is &amp;quot;exhausted&amp;quot;, that is confirmation that you correctly reached the license server, though other users are using licenses.&lt;br /&gt;
** 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:&lt;br /&gt;
 ssh  -L 1718:clicense&#039;&#039;&#039;2&#039;&#039;&#039;:1718  -L 1719:clicense&#039;&#039;&#039;2&#039;&#039;&#039;:1719  mega.cnm.anl.gov&lt;br /&gt;
&lt;br /&gt;
== License Troubleshooting ==&lt;br /&gt;
The following are typical error messages.&lt;br /&gt;
=== Could not obtain license for COMSOL Multiphysics GUI ===&lt;br /&gt;
* Error details:&lt;br /&gt;
 License error: -4.&lt;br /&gt;
 &#039;&#039;&#039;Licensed number of users already reached.&#039;&#039;&#039;&lt;br /&gt;
 Feature:       COMSOLGUI&lt;br /&gt;
 License path:  /Users/stern/Applications/COMSOL52a/license/license.dat:&lt;br /&gt;
 FlexNet Licensing error:-4,132&lt;br /&gt;
* Reason: The connection to the license server succeeded, but the license token(s) you requested are in use.&lt;br /&gt;
* Solution: Wait a bit, or [http://carbonmgmt/ganglia/lic.php identify who&#039;s using COMSOL] and politely ask the user when they might be finished with their work.&lt;br /&gt;
&lt;br /&gt;
=== License server machine is down or not responding ===&lt;br /&gt;
* Error details:&lt;br /&gt;
  License error: -96.&lt;br /&gt;
  See the system administrator about starting the license server system, or&lt;br /&gt;
  make sure you&#039;re referring to the right host (see LM_LICENSE_FILE).&lt;br /&gt;
 Feature:       SERIAL&lt;br /&gt;
 Hostname:      clicense3&lt;br /&gt;
 License path:  /Users/stern/Applications/COMSOL52a/license/license.dat:&lt;br /&gt;
 FlexNet Licensing error:-96,7&lt;br /&gt;
* Reason: The license servers cannot be reached at all. The &amp;lt;code&amp;gt;ping&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;host&amp;lt;/code&amp;gt; tests mentioned above fail.&lt;br /&gt;
* Solution: Review the client license file and DNS lookup domains.&lt;br /&gt;
&lt;br /&gt;
=== License file does not support this version ===&lt;br /&gt;
* Error details:&lt;br /&gt;
  Feature: SERIAL&lt;br /&gt;
 &#039;&#039;&#039;Application version &amp;gt; License version: 5.21 &amp;gt; 3.5&#039;&#039;&#039;&lt;br /&gt;
 License path: /Users/stern/Applications/COMSOL52a/license/license.dat:&lt;br /&gt;
 FlexNet Licensing error:-21,126&lt;br /&gt;
* 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&#039;re connected to.&lt;br /&gt;
* Solution: When using SSH, try &amp;lt;code&amp;gt;clicense2&amp;lt;/code&amp;gt; instead of  &amp;lt;code&amp;gt;clicense1&amp;lt;/code&amp;gt;, or vice versa. Revisit your &amp;lt;code&amp;gt;~/.ssh/config&amp;lt;/code&amp;gt; file or use the alternate command line as shown in the SSH section above.&lt;br /&gt;
&lt;br /&gt;
== Multiple CPU cores ==&lt;br /&gt;
Ways to start multi-core (from http://www.comsol.com/support/knowledgebase/1096/)&lt;br /&gt;
 comsol -np 8&lt;br /&gt;
&lt;br /&gt;
 export COMSOL_NUM_THREADS=8    # automatically provided on &#039;&#039;Carbon&#039;&#039;&lt;br /&gt;
 comsol&lt;br /&gt;
* COMSOL does not benefit from hyperthreading (oversubscribing the physical core count).&lt;br /&gt;
&lt;br /&gt;
== Batch jobs ==&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
 comsol -clustersimple batch -inputfile input.mph -outputfile output.mph &lt;br /&gt;
&lt;br /&gt;
 &amp;lt;strike&amp;gt;comsol –nn 8 mpd boot&lt;br /&gt;
 comsol –nn 8 batch –inputfile in.mph&lt;br /&gt;
 comsol mpd allexit&amp;lt;/strike&amp;gt;&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
* http://www.comsol.com/support/knowledgebase/1001/ .&lt;br /&gt;
* [[Media:HPC 2012-05-16 Comsol parallel usage.pdf]] (Modified from http://www.comsol.com/support/knowledgebase/1001/files/4027/cluster_install_linux_42a.pptx – Appendix slide, PBS)&lt;br /&gt;
* &#039;&#039;&#039;Note:&#039;&#039;&#039; MPD is not supported on Carbon (I patched the main comsol script), and no longer necessary at all in Comsol-4.3.&lt;br /&gt;
&lt;br /&gt;
=== Sample Job file ===&lt;br /&gt;
See:&lt;br /&gt;
 $COMSOL_HOME/sample.job&lt;br /&gt;
&lt;br /&gt;
== Important COMSOL Support Articles ==&lt;br /&gt;
* Toplevel suport page: https://www.comsol.com/support&lt;br /&gt;
&lt;br /&gt;
=== KB Articles ===&lt;br /&gt;
* [https://www.comsol.com/support/knowledgebase/1001 Running COMSOL® in parallel on clusters]&lt;br /&gt;
* [https://www.comsol.com/support/knowledgebase/1250 Running parametric sweeps, batch sweeps, and cluster sweeps from the command line]&lt;br /&gt;
* [https://www.comsol.com/support/knowledgebase/1255 Reducing the amount of solution data stored in a model]&lt;br /&gt;
* [https://www.comsol.com/support/knowledgebase/830 Handling large models]&lt;br /&gt;
&lt;br /&gt;
=== Blog-style articles ===&lt;br /&gt;
* [https://www.comsol.com/blogs/the-power-of-the-batch-sweep/ The Power of the Batch Sweep]&lt;br /&gt;
* [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]&lt;/div&gt;</summary>
		<author><name>Stern</name></author>
	</entry>
	<entry>
		<id>https://wiki.anl.gov/wiki_cnm/index.php?title=HPC/Applications/comsol&amp;diff=7476</id>
		<title>HPC/Applications/comsol</title>
		<link rel="alternate" type="text/html" href="https://wiki.anl.gov/wiki_cnm/index.php?title=HPC/Applications/comsol&amp;diff=7476"/>
		<updated>2025-10-03T15:11:47Z</updated>

		<summary type="html">&lt;p&gt;Stern: /* License servers */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
The [http://www.comsol.com/products/multiphysics/ &#039;&#039;&#039;COMSOL Multiphysics&#039;&#039;&#039;] application suite&lt;br /&gt;
is available for Mac, Windows, and Linux.&lt;br /&gt;
&lt;br /&gt;
== Access ==&lt;br /&gt;
[[Image:HPC Comsol licensed modules.png|right|450px|thumb|COMSOL features licensed at CNM as of 2024-10.]]&lt;br /&gt;
=== COMSOL Multiphysics ===&lt;br /&gt;
Access to &#039;&#039;&#039;COMSOL Multiphysics&#039;&#039;&#039;, the main application with both a graphical user interface and batch computing capabilities, will be granted &#039;&#039;&#039;&#039;&#039;upon request&#039;&#039;&#039;&#039;&#039;&amp;amp;thinsp;.&lt;br /&gt;
&lt;br /&gt;
You must be:&lt;br /&gt;
* An &#039;&#039;&#039;&#039;&#039;Argonne employee&#039;&#039;&#039;&#039;&#039;&amp;amp;thinsp; in one of the following roles:&lt;br /&gt;
** &#039;&#039;&#039;&#039;&#039;NST staff member&#039;&#039;&#039;&#039;&#039;&amp;amp;thinsp; (including PostDocs, joint appointments, and students at NST).&lt;br /&gt;
** &#039;&#039;&#039;&#039;&#039;CNM Facility User&#039;&#039;&#039;&#039;&#039;&amp;amp;thinsp; (including &#039;&#039;non-NST Argonne employees&#039;&#039;), with an active proposal that has COMSOL in scope. Please see [[HPC/FAQ#Access_and_proposals]].&lt;br /&gt;
&lt;br /&gt;
The set of available COMSOL modules that we have licensed is shown at right.&lt;br /&gt;
&lt;br /&gt;
* The native desktop version can be installed only on &#039;&#039;Argonne-owned&#039;&#039; computers (laptop or desktop). Please contact [mailto:help@anl.gov?Subject=COMSOL%20license%20access%20request CNM support]. Make sure to review [http://www.comsol.com/support/updates/ Product Updates].&lt;br /&gt;
* To run COMSOL on our HPC system &#039;&#039;Carbon&#039;&#039;, as GUI or as batch computing jobs, your proposal must have &#039;&#039;Carbon&#039;&#039; access in scope.&lt;br /&gt;
&lt;br /&gt;
=== COMSOL Server ===&lt;br /&gt;
&#039;&#039;CNM Facility Users&#039;&#039; who are not Argonne employees are not eligible to access&lt;br /&gt;
the full &#039;&#039;&#039;COMSOL Multiphysics&#039;&#039;&#039; product, in compliance with its licensing terms and conditions.&lt;br /&gt;
However, the [https://www.comsol.com/comsol-server &#039;&#039;&#039;COMSOL Server&#039;&#039;&#039;] product offers an alternative&lt;br /&gt;
albeit more narrow means of access.&lt;br /&gt;
&lt;br /&gt;
All users, including &#039;&#039;&#039;&#039;&#039;non-Argonne users&#039;&#039;&#039;&#039;&#039; may be able to run, over a web interface in their browser,&lt;br /&gt;
pre-parameterized &amp;quot;fixed-model&amp;quot; simulations that were made with the &#039;&#039;&#039;COMSOL Application Builder&#039;&#039;&#039; (requires Windows).&lt;br /&gt;
&lt;br /&gt;
To inquire about using COMSOL server applications,&lt;br /&gt;
please contact us.&lt;br /&gt;
&amp;lt;!-- [mailto:cnm_useroffice@anl.gov?Subject=COMSOL%20server%20usage Support]. --&amp;gt;&lt;br /&gt;
We will review possible purchase paths for COMSOL Server, and the &#039;&#039;considerable effort&#039;&#039; likely required by users and the CNM to develop and deploy a COMSOL application.&lt;br /&gt;
&lt;br /&gt;
== Support ==&lt;br /&gt;
* For questions on how to run or start COMSOL:&lt;br /&gt;
*: Submit an [[HPC/Support | &#039;&#039;&#039;IT support request&#039;&#039;&#039;]]&lt;br /&gt;
* For questions related to most COMSOL data or scripts, contact COMSOL support at:&lt;br /&gt;
*: [mailto:support@comsol.com &#039;&#039;&#039;support&#039;&#039;&#039;@comsol.com]&lt;br /&gt;
* &#039;&#039;&#039;Exception:&#039;&#039;&#039; If your support question might contain data that is subject to &#039;&#039;&#039;US Export Control&#039;&#039;&#039; regulations, contact instead:&lt;br /&gt;
*: [mailto:us-export-control@us.comsol.com &#039;&#039;&#039;us-export-control&#039;&#039;&#039;@&#039;&#039;&#039;us&#039;&#039;&#039;.comsol.com]&lt;br /&gt;
&lt;br /&gt;
== The modes to run COMSOL ==&lt;br /&gt;
There are several ways of running COMSOL.&lt;br /&gt;
&lt;br /&gt;
=== Running the desktop application ===&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
# Run on Carbon, display on your desktop using the [http://en.wikipedia.org/wiki/X_Window_System X Window system (X11)].&lt;br /&gt;
#* Requires an &#039;&#039;X11 Server&#039;&#039; application running on your client machine, and SSH X11 forwarding.&lt;br /&gt;
#* The X11 protocol can be slow over LAN.&lt;br /&gt;
# Run on Carbon within a [[HPC/Network Access/Virtual Desktop | virtual desktop environment (VNC)]].&lt;br /&gt;
#* Requires a VNC client on your machine.&lt;br /&gt;
#* It can be confusing where VNC and the app runs.&lt;br /&gt;
#* The virtual desktop presents a (deliberatly) sparse windowing environment – Copy&amp;amp;Paste can be difficult to use.&lt;br /&gt;
# Run on your own computer, remotely checking out Carbon&#039;s license.&lt;br /&gt;
#* Requires a full installation of COMSOL on your desktoo or laptop computer.&lt;br /&gt;
#* 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.&lt;br /&gt;
&lt;br /&gt;
=== Running a batch calculation ===&lt;br /&gt;
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.&lt;br /&gt;
See the [[#Batch jobs|section below]].&lt;br /&gt;
&lt;br /&gt;
== Use with X11 ==&lt;br /&gt;
For casual use, and with [[HPC/Network Access/SSH Tunnel Setup on Linux and MacOS | X11 tunneling to Carbon]] set up, simply add to your &amp;lt;code&amp;gt;~/.bashrc&amp;lt;/code&amp;gt; file on Carbon:&lt;br /&gt;
 module load comsol&lt;br /&gt;
&lt;br /&gt;
Then, from the command line on a Carbon login node, start the COMSOL GUI:&lt;br /&gt;
 comsol &amp;amp;&lt;br /&gt;
&lt;br /&gt;
License configuration is automatic on Carbon.&lt;br /&gt;
&lt;br /&gt;
Comsol will use a number of cores to run calculations multithreaded by default. (On Carbon, COMSOL_NUM_THREADS is set.)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Quit the application&#039;&#039;&#039; as soon as you are done. Only one user can use Comsol at a time.&lt;br /&gt;
&lt;br /&gt;
== Use with VNC ==&lt;br /&gt;
See general  [[HPC/Network Access/Virtual Desktop | instructions on using VNC]], and the COMSOL example therein.&lt;br /&gt;
&lt;br /&gt;
== Native desktop version ==&lt;br /&gt;
&lt;br /&gt;
To get the fastest response from the COMSOL GUI, run a native COMSOL version on your desktop machine or laptop, called &#039;&#039;client machine&#039;&#039; below.&lt;br /&gt;
&lt;br /&gt;
Enter license details either in the COMSOL Setup configuration dialog.&lt;br /&gt;
&lt;br /&gt;
== Native desktop version — License configuration ==&lt;br /&gt;
A client&#039;s COMSOL license needs to be configured depending on how the client reaches CNM network resources. Follow the appropriate section:&lt;br /&gt;
* [[#License configuration when inside CNM or using VPN]]&lt;br /&gt;
* [[#License configuration when outside CNM and using SSH Tunneling]]&lt;br /&gt;
&lt;br /&gt;
=== License configuration when inside CNM or using VPN ===&lt;br /&gt;
==== &amp;lt;span style=&amp;quot;color:#A00;&amp;quot;&amp;gt;Ensure correct DNS search domains&amp;lt;/span&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
* Inspect the client machine&#039;s network configuration.&lt;br /&gt;
* Ensure that &#039;&#039;&#039;two&#039;&#039;&#039; entries are listed as DNS Search Domains for the current network profile:&lt;br /&gt;
 nst.anl.gov&lt;br /&gt;
 cnm.anl.gov&lt;br /&gt;
: (The order of entries does not matter for the purposes considered here.)&lt;br /&gt;
* If the client machine is &#039;&#039;wired to CNM networks&#039;&#039;, the domains are normally provided correctly by DHCP.&lt;br /&gt;
* If the client machine is &#039;&#039;connected over VPN&#039;&#039;, you may need edit the respective network profile.&lt;br /&gt;
:* 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 &amp;quot;Advanced…&amp;quot;. It appears that those changes are being saved and will be activated automatically the next time that this VPN session gets started.&lt;br /&gt;
: [[Image:VNC_add_cnm_to_DNS_1.png|400px]] [[Image:VNC_add_cnm_to_DNS_2.png|400px]]&lt;br /&gt;
:* On Windows or Linux machines, take &#039;&#039;analogous&#039;&#039; steps, using the platform&#039;s own configuration tools.&lt;br /&gt;
&lt;br /&gt;
* Exclude license manager components from client desktop installation. (Those are all handled server-side.)&lt;br /&gt;
&lt;br /&gt;
==== License format ====&lt;br /&gt;
* Floating Network License (FNL), &amp;quot;Three-server redundancy&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==== License servers ====&lt;br /&gt;
* On client machines, while running the COMSOL installer or license configuration, specify license servers and ports as follows:&lt;br /&gt;
 1718    clicense1&lt;br /&gt;
 1718    clicense2&lt;br /&gt;
 1718    clicense3&lt;br /&gt;
 # Do not use:&lt;br /&gt;
 # clicense1&amp;lt;strike&amp;gt;.cnm.anl.gov&amp;lt;/strike&amp;gt;&lt;br /&gt;
 # clicense2&amp;lt;strike&amp;gt;.cnm.anl.gov&amp;lt;/strike&amp;gt;&lt;br /&gt;
 # clicense3&amp;lt;strike&amp;gt;.cnm.anl.gov&amp;lt;/strike&amp;gt;&lt;br /&gt;
&lt;br /&gt;
: &#039;&#039;&#039;Note:&#039;&#039;&#039; Use the &#039;&#039;short host name&#039;&#039; form exactly as given here. (Technical Reason: The license must be usable both on Carbon&#039;s internal network as well as on divisional networks that are outside of Carbon).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Advanced:&#039;&#039;&#039; A client machine&#039;s COMSOL license file &amp;lt;code&amp;gt;&amp;amp;lt;COMSOLDIR&amp;amp;gt;/Multiphysics/license/license.dat&amp;lt;/code&amp;gt; should look as follows:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;make&amp;quot;&amp;gt;&lt;br /&gt;
SERVER clicense1 ANY 1718&lt;br /&gt;
SERVER clicense2 ANY 1718&lt;br /&gt;
SERVER clicense3 ANY 1718&lt;br /&gt;
USE_SERVER&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;amp;lt;COMSOLDIR&amp;amp;gt;&amp;lt;/code&amp;gt; is typically located at:&lt;br /&gt;
* &#039;&#039;&#039;Windows&#039;&#039;&#039;: C:\Program files\COMSOL\COMSOL&#039;&#039;nn&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Linux&#039;&#039;&#039;: /usr/local/comsol&#039;&#039;nn&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Mac&#039;&#039;&#039;: /Applications/COMSOL&#039;&#039;nn&#039;&#039;&lt;br /&gt;
(&amp;quot;&#039;&#039;nn&#039;&#039;&amp;quot; is the application&#039;s abbreviated version number.)&lt;br /&gt;
&lt;br /&gt;
==== Network Troubleshooting ====&lt;br /&gt;
When using the license access model descibed here (as opposed to tunneled over SSH), ensure the following:&lt;br /&gt;
* Verify that short host names can be resolved to IP addresses. Either one of the following commands should produce sensible output:&lt;br /&gt;
 host clicense1&lt;br /&gt;
: or:&lt;br /&gt;
 ping -c 3 clicense1&lt;br /&gt;
* Verify that &#039;&#039;both license ports on the same server&#039;&#039; can be reached from your client machine:&lt;br /&gt;
 telnet &#039;&#039;&#039;clicense1&#039;&#039;&#039; 1718&lt;br /&gt;
 telnet &#039;&#039;&#039;clicense1&#039;&#039;&#039; 1719&lt;br /&gt;
: or:&lt;br /&gt;
 telnet &#039;&#039;&#039;clicense2&#039;&#039;&#039; 1718&lt;br /&gt;
 telnet &#039;&#039;&#039;clicense2&#039;&#039;&#039; 1719&lt;br /&gt;
: A &#039;&#039;successful&#039;&#039; connection looks like:&lt;br /&gt;
 Trying 146.139.x.y...&lt;br /&gt;
 Connected to clicense1.cnm.anl.gov.&lt;br /&gt;
 Escape character is &#039;^]&#039;.&lt;br /&gt;
:: Do not enter any data. Instead,  close each connection by hitting &amp;lt;code&amp;gt;Ctrl&amp;lt;/code&amp;gt;&amp;lt;code&amp;gt;]&amp;lt;/code&amp;gt; (closing square bracket), followed by &amp;lt;code&amp;gt;Ctrl&amp;lt;/code&amp;gt;&amp;lt;code&amp;gt;D&amp;lt;/code&amp;gt;.&lt;br /&gt;
: A &#039;&#039;failed&#039;&#039; connection gives one of these errors:&lt;br /&gt;
 telnet: connect to address 146.139.x.y: Operation timed out&lt;br /&gt;
: or:&lt;br /&gt;
 telnet: connect to address 146.139.x.y: Connection refused&lt;br /&gt;
:: In these cases, ask that your IP firewall configuration be reviewed and changed.&lt;br /&gt;
&lt;br /&gt;
=== License access when outside CNM ===&lt;br /&gt;
If you&#039;re comfortable with ssh and tunneling, set up client licensing as follows:&lt;br /&gt;
&lt;br /&gt;
==== Configure COMSOL ====&lt;br /&gt;
The following needs to be done just once, typically during COMSOL installation:&lt;br /&gt;
&lt;br /&gt;
In the COMSOL Installer, or in COMSOL Preferences, enter:&lt;br /&gt;
* &#039;&#039;&#039;License format:&#039;&#039;&#039; Floating Network License (FNL), &amp;quot;Port number and Hostname&amp;quot;&lt;br /&gt;
:: &amp;quot;Three-server redundancy&amp;quot; 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.&lt;br /&gt;
* &#039;&#039;&#039;Server:&#039;&#039;&#039; &amp;lt;code&amp;gt;127.0.0.1&amp;lt;/code&amp;gt;&lt;br /&gt;
:: Do not use &amp;quot;localhost&amp;quot;, as COMSOL interprets this incorrectly to mean that your machine &#039;&#039;is&#039;&#039; a license server.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Port:&#039;&#039;&#039; &amp;lt;code&amp;gt;1718&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
Or place a license file with this content:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;make&amp;quot;&amp;gt;&lt;br /&gt;
SERVER 127.0.0.1 ANY 1718&lt;br /&gt;
USE_SERVER&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
//--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Provide server connection ====&lt;br /&gt;
This step needs to be done prior to running COMSOL in your desktop session:&lt;br /&gt;
* Connect to &amp;lt;code&amp;gt;mega&amp;lt;/code&amp;gt; with the following ssh command:&lt;br /&gt;
 ssh  -L 1718:&#039;&#039;&#039;clicense1&#039;&#039;&#039;:1718  -L 1719:&#039;&#039;&#039;clicense1&#039;&#039;&#039;:1719  mega.cnm.anl.gov&lt;br /&gt;
* Leave the command running between invocations of COMSOL.&lt;br /&gt;
&lt;br /&gt;
==== Run COMSOL ====&lt;br /&gt;
* Ensure your connection to &amp;quot;mega&amp;quot; is still running. If not, restart it.&lt;br /&gt;
* Start the COMSOL application.&lt;br /&gt;
&lt;br /&gt;
** If you get an error that the number of licenses is &amp;quot;exhausted&amp;quot;, that is confirmation that you correctly reached the license server, though other users are using licenses.&lt;br /&gt;
** 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:&lt;br /&gt;
 ssh  -L 1718:clicense&#039;&#039;&#039;2&#039;&#039;&#039;:1718  -L 1719:clicense&#039;&#039;&#039;2&#039;&#039;&#039;:1719  mega.cnm.anl.gov&lt;br /&gt;
&lt;br /&gt;
== License Troubleshooting ==&lt;br /&gt;
The following are typical error messages.&lt;br /&gt;
=== Could not obtain license for COMSOL Multiphysics GUI ===&lt;br /&gt;
* Error details:&lt;br /&gt;
 License error: -4.&lt;br /&gt;
 &#039;&#039;&#039;Licensed number of users already reached.&#039;&#039;&#039;&lt;br /&gt;
 Feature:       COMSOLGUI&lt;br /&gt;
 License path:  /Users/stern/Applications/COMSOL52a/license/license.dat:&lt;br /&gt;
 FlexNet Licensing error:-4,132&lt;br /&gt;
* Reason: The connection to the license server succeeded, but the license token(s) you requested are in use.&lt;br /&gt;
* Solution: Wait a bit, or [http://carbonmgmt/ganglia/lic.php identify who&#039;s using COMSOL] and politely ask the user when they might be finished with their work.&lt;br /&gt;
&lt;br /&gt;
=== License server machine is down or not responding ===&lt;br /&gt;
* Error details:&lt;br /&gt;
  License error: -96.&lt;br /&gt;
  See the system administrator about starting the license server system, or&lt;br /&gt;
  make sure you&#039;re referring to the right host (see LM_LICENSE_FILE).&lt;br /&gt;
 Feature:       SERIAL&lt;br /&gt;
 Hostname:      clicense3&lt;br /&gt;
 License path:  /Users/stern/Applications/COMSOL52a/license/license.dat:&lt;br /&gt;
 FlexNet Licensing error:-96,7&lt;br /&gt;
* Reason: The license servers cannot be reached at all. The &amp;lt;code&amp;gt;ping&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;host&amp;lt;/code&amp;gt; tests mentioned above fail.&lt;br /&gt;
* Solution: Review the client license file and DNS lookup domains.&lt;br /&gt;
&lt;br /&gt;
=== License file does not support this version ===&lt;br /&gt;
* Error details:&lt;br /&gt;
  Feature: SERIAL&lt;br /&gt;
 &#039;&#039;&#039;Application version &amp;gt; License version: 5.21 &amp;gt; 3.5&#039;&#039;&#039;&lt;br /&gt;
 License path: /Users/stern/Applications/COMSOL52a/license/license.dat:&lt;br /&gt;
 FlexNet Licensing error:-21,126&lt;br /&gt;
* 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&#039;re connected to.&lt;br /&gt;
* Solution: When using SSH, try &amp;lt;code&amp;gt;clicense2&amp;lt;/code&amp;gt; instead of  &amp;lt;code&amp;gt;clicense1&amp;lt;/code&amp;gt;, or vice versa. Revisit your &amp;lt;code&amp;gt;~/.ssh/config&amp;lt;/code&amp;gt; file or use the alternate command line as shown in the SSH section above.&lt;br /&gt;
&lt;br /&gt;
== Multiple CPU cores ==&lt;br /&gt;
Ways to start multi-core (from http://www.comsol.com/support/knowledgebase/1096/)&lt;br /&gt;
 comsol -np 8&lt;br /&gt;
&lt;br /&gt;
 export COMSOL_NUM_THREADS=8    # automatically provided on &#039;&#039;Carbon&#039;&#039;&lt;br /&gt;
 comsol&lt;br /&gt;
* COMSOL does not benefit from hyperthreading (oversubscribing the physical core count).&lt;br /&gt;
&lt;br /&gt;
== Batch jobs ==&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
 comsol -clustersimple batch -inputfile input.mph -outputfile output.mph &lt;br /&gt;
&lt;br /&gt;
 &amp;lt;strike&amp;gt;comsol –nn 8 mpd boot&lt;br /&gt;
 comsol –nn 8 batch –inputfile in.mph&lt;br /&gt;
 comsol mpd allexit&amp;lt;/strike&amp;gt;&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
* http://www.comsol.com/support/knowledgebase/1001/ .&lt;br /&gt;
* [[Media:HPC 2012-05-16 Comsol parallel usage.pdf]] (Modified from http://www.comsol.com/support/knowledgebase/1001/files/4027/cluster_install_linux_42a.pptx – Appendix slide, PBS)&lt;br /&gt;
* &#039;&#039;&#039;Note:&#039;&#039;&#039; MPD is not supported on Carbon (I patched the main comsol script), and no longer necessary at all in Comsol-4.3.&lt;br /&gt;
&lt;br /&gt;
=== Sample Job file ===&lt;br /&gt;
See:&lt;br /&gt;
 $COMSOL_HOME/sample.job&lt;br /&gt;
&lt;br /&gt;
== Important COMSOL Support Articles ==&lt;br /&gt;
* Toplevel suport page: https://www.comsol.com/support&lt;br /&gt;
&lt;br /&gt;
=== KB Articles ===&lt;br /&gt;
* [https://www.comsol.com/support/knowledgebase/1001 Running COMSOL® in parallel on clusters]&lt;br /&gt;
* [https://www.comsol.com/support/knowledgebase/1250 Running parametric sweeps, batch sweeps, and cluster sweeps from the command line]&lt;br /&gt;
* [https://www.comsol.com/support/knowledgebase/1255 Reducing the amount of solution data stored in a model]&lt;br /&gt;
* [https://www.comsol.com/support/knowledgebase/830 Handling large models]&lt;br /&gt;
&lt;br /&gt;
=== Blog-style articles ===&lt;br /&gt;
* [https://www.comsol.com/blogs/the-power-of-the-batch-sweep/ The Power of the Batch Sweep]&lt;br /&gt;
* [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]&lt;/div&gt;</summary>
		<author><name>Stern</name></author>
	</entry>
	<entry>
		<id>https://wiki.anl.gov/wiki_cnm/index.php?title=HPC/Network_Access/SSH_Tunnel_Setup_and_Use&amp;diff=7475</id>
		<title>HPC/Network Access/SSH Tunnel Setup and Use</title>
		<link rel="alternate" type="text/html" href="https://wiki.anl.gov/wiki_cnm/index.php?title=HPC/Network_Access/SSH_Tunnel_Setup_and_Use&amp;diff=7475"/>
		<updated>2025-09-23T18:05:10Z</updated>

		<summary type="html">&lt;p&gt;Stern: /* Config file contents */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The following sections document how to establish ssh tunneling on machines running [http://en.wikipedia.org/wiki/OpenSSH OpenSSH] or close relatives.&lt;br /&gt;
OpenSSH is available on all major operating systems: Linux, macOS, Windows, and on mobile.&lt;br /&gt;
&amp;lt;!--Numerous [http://www.google.com/search?hl=en&amp;amp;q=SSH+Windows solutions] are available to provide the same functionality, but details vary considerably. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Manual setup ==&lt;br /&gt;
[[Image:HPC 2012-02-06 screenshot sketch ssh tunneling windows.png|350px|right]]&lt;br /&gt;
&#039;&#039;&#039;On your computer&#039;&#039;&#039;, run the following commands:&lt;br /&gt;
&lt;br /&gt;
0. (Windows only) Start your X11 server if you have one.&lt;br /&gt;
&lt;br /&gt;
1. Open a terminal window (such as Mac Terminal, Cygwin, &amp;lt;strike&amp;gt;PuTTY&amp;lt;/strike&amp;gt;, or xterm).&lt;br /&gt;
&lt;br /&gt;
2. Type:&lt;br /&gt;
 &amp;lt;font color=&amp;quot;darkred&amp;quot;&amp;gt;ssh -v -L 33301:carbon:22  &#039;&#039;username&#039;&#039;@mega.cnm.anl.gov&amp;lt;/font&amp;gt;&lt;br /&gt;
: &#039;&#039;&#039;Do not type any further commands in this window.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
3. Minimize that window - no further commands need be typed there.&lt;br /&gt;
&lt;br /&gt;
4. Open another terminal window.&lt;br /&gt;
&lt;br /&gt;
5. Type:&lt;br /&gt;
 &amp;lt;font color=&amp;quot;darkgreen&amp;quot;&amp;gt;ssh -Y -p 33301 &#039;&#039;username&#039;&#039;@localhost&amp;lt;/font&amp;gt;&lt;br /&gt;
:* Replace &amp;lt;code&amp;gt;&#039;&#039;username&#039;&#039;&amp;lt;/code&amp;gt; by the name of your Argonne account name.&lt;br /&gt;
:* Steps 4 and 5 can be repeated as often as desired.&lt;br /&gt;
&lt;br /&gt;
Do not type any commands at a prompt on mega.&lt;br /&gt;
&lt;br /&gt;
== Using an ssh config file ==&lt;br /&gt;
To simplify making connections from your computer, create or use an ssh configuration file on it.&lt;br /&gt;
&lt;br /&gt;
=== Config file contents ===&lt;br /&gt;
&#039;&#039;&#039;On your computer&#039;&#039;&#039;:&lt;br /&gt;
* Close any Carbon windows opened previously.&lt;br /&gt;
* Open a new terminal window.&lt;br /&gt;
** Linux: xterm&lt;br /&gt;
** Mac: Terminal.app&lt;br /&gt;
** Windows: a Cygwin window.&lt;br /&gt;
* Copy&amp;amp;paste the following text into your &amp;lt;code&amp;gt;~/.ssh/config&amp;lt;/code&amp;gt; file.&lt;br /&gt;
&amp;lt;!-- You can use the following command to create the file from scratch:&lt;br /&gt;
 cat &amp;gt; ~/.ssh/config&lt;br /&gt;
: Copy&amp;amp;paste the text below, then press Ctrl-D to finish.&lt;br /&gt;
: &#039;&#039;&#039;Warning:&#039;&#039;&#039; This command will override an existing file.&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
 NoHostAuthenticationForLocalhost yes&lt;br /&gt;
 &lt;br /&gt;
 Host mega&lt;br /&gt;
         Hostname mega.cnm.anl.gov&lt;br /&gt;
         User              &#039;&#039;argonne_user_name&#039;&#039;&lt;br /&gt;
         LocalForward      33301  carbon:22&lt;br /&gt;
         LocalForward      33380  carbonmgmt:80&lt;br /&gt;
 &lt;br /&gt;
 Host carbon&lt;br /&gt;
         Hostname localhost&lt;br /&gt;
         User              &#039;&#039;argonne_user_name&#039;&#039;&lt;br /&gt;
         Port              33301&lt;br /&gt;
         ForwardX11        yes&lt;br /&gt;
         ForwardX11Trusted yes&lt;br /&gt;
         AddKeysToAgent    yes&lt;br /&gt;
         &#039;&#039;&#039;MACs              hmac-sha2-512,hmac-sha2-256&#039;&#039;&#039;&lt;br /&gt;
         &#039;&#039;&#039;RequiredRSASize   1024&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Replace&#039;&#039;&#039; the string &#039;&#039;argonne_user_name&#039;&#039; with the name of your Argonne domain account.&lt;br /&gt;
* The &amp;lt;code&amp;gt;MACs&amp;lt;/code&amp;gt; line is required on Windows 11 Subsystem for Linux (WSL).&lt;br /&gt;
* Remove write permissions to the config file, its parent directory, and your home for anyone but you:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chmod go-rwx ~/.ssh ~/.ssh/config&lt;br /&gt;
chmod go-w ~&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
:* &#039;&#039;&#039;Note for Cygwin users:&#039;&#039;&#039; To paste text into a Cygwin window, right-click with your mouse or use the Shift-Ins keyboard shortcut.&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
* Run this command:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
read -p &amp;quot;your Argonne user name: &amp;quot;&lt;br /&gt;
sed -i &amp;quot;s/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
:* Simply Copy &amp;amp; Paste the line from this browser window to your terminal.&lt;br /&gt;
* Advanced users: See the ssh_config man page for syntax and options of the config file.&lt;br /&gt;
&lt;br /&gt;
=== Connecting with a config file ===&lt;br /&gt;
With the config file in place, the commands in section [[#Manual setup]] above simplify to:&lt;br /&gt;
&lt;br /&gt;
: 1. In one window, run the following command, then minimize the window:&lt;br /&gt;
 &amp;lt;font color=&amp;quot;darkred&amp;quot;&amp;gt;ssh -v mega&amp;lt;/font&amp;gt;&lt;br /&gt;
: Do not type any further commands here. (You can use the -N option to intentionally suppress a command prompt.)&lt;br /&gt;
&lt;br /&gt;
: 2. Use other terminals as often as needed to log in interactively:&lt;br /&gt;
 &amp;lt;font color=&amp;quot;darkgreen&amp;quot;&amp;gt;ssh carbon&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Advanced: Connecting to a &#039;&#039;specific&#039;&#039; login node ===&lt;br /&gt;
The configuration described above uses a generic host name {{host|carbon}}, which at present will lead to one specific login node.&lt;br /&gt;
However, you may want to connect to another node that you have used previously, such as to reconnect to a VNC sesssion.&lt;br /&gt;
To do so, change your .ssh/config to forward additional ports and set up more specific &amp;lt;code&amp;gt;Host&amp;lt;/code&amp;gt; aliases.&lt;br /&gt;
&lt;br /&gt;
==== Modify configuration file ====&lt;br /&gt;
* Similar to the above, copy&amp;amp;paste the following text into your &amp;lt;code&amp;gt;~/.ssh/config&amp;lt;/code&amp;gt; file:&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;NoHostAuthenticationForLocalhost yes&lt;br /&gt;
 &lt;br /&gt;
 Host mega&lt;br /&gt;
         Hostname          mega.cnm.anl.gov&lt;br /&gt;
         User              &#039;&#039;argonne_user_name&#039;&#039;&lt;br /&gt;
         LocalForward      33301  carbon:22&amp;lt;/font&amp;gt;&amp;lt;strong&amp;gt;&lt;br /&gt;
         LocalForward      33305  clogin5:22&lt;br /&gt;
         LocalForward      33306  clogin6:22&amp;lt;/strong&amp;gt;&amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;&lt;br /&gt;
         LocalForward      33380  carbonmgmt:80&lt;br /&gt;
 &lt;br /&gt;
 Host carbon&lt;br /&gt;
         Port              33301&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;strong&amp;gt;Host clogin5&lt;br /&gt;
         Port              33305&lt;br /&gt;
 Host clogin6&lt;br /&gt;
         Port              33306&amp;lt;/strong&amp;gt;&amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;&lt;br /&gt;
 Host carbon clogin*&lt;br /&gt;
         …&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can then connect to either {{host|carbon}}, or specific host names  {{host|clogin5}} etc., as follows:&lt;br /&gt;
: 1. Run &#039;&#039;&#039;once&#039;&#039;&#039; in your desktop session:&lt;br /&gt;
 &amp;lt;font color=&amp;quot;darkred&amp;quot;&amp;gt;ssh -v mega&amp;lt;/font&amp;gt;&lt;br /&gt;
: 2. Run &#039;&#039;&#039;as often as needed&#039;&#039;&#039;:&lt;br /&gt;
 &amp;lt;font color=&amp;quot;darkgreen&amp;quot;&amp;gt;ssh clogin&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;darkgreen&amp;quot;&amp;gt;ssh clogin5&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;darkgreen&amp;quot;&amp;gt;ssh clogin6&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;darkgreen&amp;quot;&amp;gt;scp …&amp;lt;/font&amp;gt;      &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;# (to or from {{host|clogin}})&amp;lt;/font&amp;gt;&lt;br /&gt;
 …&lt;br /&gt;
&lt;br /&gt;
== Test remote graphics using X11 ==&lt;br /&gt;
# In a terminal &#039;&#039;&#039;connected to a Carbon login node&#039;&#039;&#039;, run the command:&lt;br /&gt;
#:: &amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;echo $DISPLAY&amp;lt;/source&amp;gt;&lt;br /&gt;
#:: You should get something like:&lt;br /&gt;
#:: &amp;lt;code&amp;gt;localhost:&#039;&#039;17.0&#039;&#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
#: The actual number will vary. [[Image:HPC 2011-06-23 xload example.png|right|60px]]&lt;br /&gt;
# Start a simple X11 program:&lt;br /&gt;
#:: &amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;xload&amp;lt;/source&amp;gt;&lt;br /&gt;
#: You should see a small window pop up on your screen, labeled &amp;quot;login5&amp;quot; or &amp;quot;login6&amp;quot;.&lt;br /&gt;
# Close the window using its close button or press Ctrl-C in the terminal window.&lt;br /&gt;
# Now use graphical applications on Carbon, for instance: [[Image:HPC 2011-06-23 gnuplot example.png|right|300px]]&lt;br /&gt;
#:: &amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;gnuplot&amp;lt;/source&amp;gt;&lt;br /&gt;
#: This will start the gnuplot interpreter in the terminal.&lt;br /&gt;
#* Create a sample plot. At the &amp;lt;code&amp;gt;gnuplot&amp;amp;gt; &amp;lt;/code&amp;gt; prompt, type:&lt;br /&gt;
#*: &amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;plot sin(x)&amp;lt;/source&amp;gt;&lt;br /&gt;
#* Exit the program:&lt;br /&gt;
#*: &amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;exit&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== File transfer ==&lt;br /&gt;
* There are many ways to transfer files through an ssh tunnel. However, you must always initiate the connection from the remote machine (your home computer), and either &#039;&#039;push&#039;&#039; files to Carbon or &#039;&#039;pull&#039;&#039; files from Carbon.&lt;br /&gt;
* With the above tunnel setup you cannot initiate a file transfer from Carbon or mega.&lt;br /&gt;
* Do not use mega as an intermediate. Files stored there wil be deleted.&lt;br /&gt;
&lt;br /&gt;
; Prerequisite: The command examples below require that a tunnel-establishing &#039;&#039;&#039;&#039;&#039;connection to &amp;lt;code&amp;gt;mega&amp;lt;/code&amp;gt; is open&#039;&#039;&#039;&#039;&#039;. Follow section [[#Manual setup]] or [[#Connecting with a config file]] above to open or re-open this connection if needed.&lt;br /&gt;
&lt;br /&gt;
=== Without SSH config file ===&lt;br /&gt;
&amp;lt;!-- * Without a config file (&#039;&#039;roughing it&#039;&#039;) --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Run the following &#039;&#039;&#039;example commands on your machine&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
; Copy &#039;&#039;to&#039;&#039; Carbon – &amp;quot;push&amp;quot;:&lt;br /&gt;
 &amp;lt;font color=&amp;quot;darkgreen&amp;quot;&amp;gt;scp -P 33301 -p  &#039;foofile&#039;  &#039;&#039;argonne_user_name&#039;&#039;@localhost:&#039;dir/on/carbon/&#039;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Copy &#039;&#039;from&#039;&#039; Carbon – &amp;quot;pull&amp;quot;:&lt;br /&gt;
 &amp;lt;font color=&amp;quot;darkgreen&amp;quot;&amp;gt;scp -P -p  &#039;&#039;argonne_user_name&#039;&#039;@localhost:&#039;dir/on/carbon/name_on_carbon&#039;  destination_on_your_machine/&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Type &amp;lt;code&amp;gt;localhost&amp;lt;/code&amp;gt; as written. Together with the option &amp;lt;code&amp;gt;-P  33301&amp;lt;/code&amp;gt; (or &amp;lt;code&amp;gt;-o port=&#039;&#039;number&#039;&#039;&amp;lt;/code&amp;gt; for older scp versions) it refers to the tunnel that you have set up earlier.&lt;br /&gt;
* Replace &#039;&#039;&amp;lt;code&amp;gt;argonne_user_name&amp;lt;/code&amp;gt;&#039;&#039; by the user name you have at Argonne.&lt;br /&gt;
&lt;br /&gt;
=== With an SSH config file ===&lt;br /&gt;
Run the following &#039;&#039;&#039;example commands on your machine&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==== Copy a file &#039;&#039;to&#039;&#039; Carbon (&#039;&#039;push&#039;&#039; from outside) ====&lt;br /&gt;
* With the above ssh/.config file in place:&lt;br /&gt;
 &amp;lt;font color=&amp;quot;darkgreen&amp;quot;&amp;gt;scp -p &#039;foofile&#039; carbon:&#039;dir/on/carbon/&#039;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Copy a whole directory &#039;&#039;to&#039;&#039; Carbon ====&lt;br /&gt;
Short of using tar or zip:&lt;br /&gt;
 &amp;lt;font color=&amp;quot;darkgreen&amp;quot;&amp;gt;scp -rp &#039;local/path/&#039; carbon:&#039;dir/on/carbon/&#039;&amp;lt;/font&amp;gt;&lt;br /&gt;
This method does not preserve symbolic links.&lt;br /&gt;
&lt;br /&gt;
==== Copy a file &#039;&#039;from&#039;&#039; Carbon (&#039;&#039;pull&#039;&#039; from outside) ====&lt;br /&gt;
 &amp;lt;font color=&amp;quot;darkgreen&amp;quot;&amp;gt;scp -p carbon:remote/path/foo  local/path/&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;darkgreen&amp;quot;&amp;gt;scp -p carbon:remote/path/foo  .&amp;lt;/font&amp;gt;&lt;br /&gt;
Note the trailing &amp;quot;.&amp;quot; in the last example to copy to your current directory.&lt;br /&gt;
; Reverse tunneling&lt;br /&gt;
The file copy operations above must all be initiated on the outside host.&lt;br /&gt;
It is possible to set up tunnels to be able to initiate file operations on the inside.&lt;br /&gt;
However, this is more complex and will be left as an exercise for advanced users.&lt;br /&gt;
It involves setting up:&lt;br /&gt;
# agent forwarding&lt;br /&gt;
# a &amp;lt;code&amp;gt;.ssh/config&amp;lt;/code&amp;gt; file on Carbon, and&lt;br /&gt;
# specifying &amp;lt;code&amp;gt;-R&amp;lt;/code&amp;gt; command line options or &amp;lt;code&amp;gt;RemoteForward&amp;lt;/code&amp;gt; config file directives when accessing {{host|carbon}} at the second stage.&lt;br /&gt;
&lt;br /&gt;
==== Bonus – Intranet web access ====&lt;br /&gt;
Open the following links in a browser &#039;&#039;on your external workstation&#039;&#039;:&lt;br /&gt;
 https://localhost:33343/cnm/HPC&lt;br /&gt;
 http://localhost:33380/&lt;br /&gt;
&lt;br /&gt;
==== Copy a file &#039;&#039;to&#039;&#039; Carbon from a &#039;&#039;third host&#039;&#039; ====&lt;br /&gt;
0. Similar to the procedure in section [[#Manual setup]] above, open two interactive sessions to the remote computer.&lt;br /&gt;
&lt;br /&gt;
1. From the first session, open a connection to Mega and forward a port:&lt;br /&gt;
 &amp;lt;font color=&amp;quot;darkred&amp;quot;&amp;gt;ssh -v -L 33301:carbon:22  &#039;&#039;username&#039;&#039;@mega.cnm.anl.gov&amp;lt;/font&amp;gt;&lt;br /&gt;
:* &#039;&#039;&#039;Do not type any further commands there.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
2. In the second session, test if you can reach Carbon interactively.&lt;br /&gt;
 &amp;lt;font color=&amp;quot;darkgreen&amp;quot;&amp;gt;ssh -Y -p 33301 -o NoHostAuthenticationForLocalhost=yes username@localhost&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. Close the Carbon connection from step 2.&lt;br /&gt;
 exit&lt;br /&gt;
: You should arrive back at the prompt of the third host.&lt;br /&gt;
&lt;br /&gt;
4. From the second session again, initiate the file transfer as:&lt;br /&gt;
 &amp;lt;font color=&amp;quot;darkgreen&amp;quot;&amp;gt;scp -v -p -o port=33301 -o NoHostAuthenticationForLocalhost=yes \&lt;br /&gt;
         &#039;&#039;filename_remote&#039;&#039; &#039;&#039;username&#039;&#039;@localhost&#039;&#039;&#039;:&#039;&#039;&#039;[&#039;&#039;target_directory/&#039;&#039;][&#039;&#039;filename_on_carbon&#039;&#039;]&amp;lt;/font&amp;gt;&lt;br /&gt;
:* Replace &amp;lt;code&amp;gt;&#039;&#039;username&#039;&#039;&amp;lt;/code&amp;gt; by the name of your Argonne account name.&lt;br /&gt;
:* Note the &amp;quot;:&amp;quot; at the end of the host name, which tells the &amp;lt;code&amp;gt;scp&amp;lt;/code&amp;gt; command that the copy target is on a remote host.&lt;br /&gt;
:* The file named &amp;lt;code&amp;gt;&#039;&#039;filename_remote&#039;&#039;&amp;lt;/code&amp;gt; will arrive in your Carbon home directory under this name, unless you specify a &amp;lt;code&amp;gt;&#039;&#039;target_directory&#039;&#039;&amp;lt;/code&amp;gt; and/or a &amp;lt;code&amp;gt;&#039;&#039;filename_on_carbon&#039;&#039;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
5. When done, press Ctrl-C in the first session to terminate the connection to mega.&lt;br /&gt;
&lt;br /&gt;
== Advanced: Speeding up logins using ssh keys ==&lt;br /&gt;
&lt;br /&gt;
Our SSH gatway host itself does not accept SSH keys – you must always type your password for the initial connection to Mega.&lt;br /&gt;
&lt;br /&gt;
Once you have established this initial connection and your tunnels are configured, you can use SSH keys to log in to Carbon login nodes without further passwords.&lt;br /&gt;
&lt;br /&gt;
=== Create a key ===&lt;br /&gt;
* Create an ssh key pair key &#039;&#039;if you do not already have one&#039;&#039; :&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;yourcomputer&amp;lt;/font&amp;gt;$ &#039;&#039;&#039;ssh-keygen -t rsa&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The output will look like:&lt;br /&gt;
 Generating public/private rsa key pair.&lt;br /&gt;
 Enter file in which to save the key (/Users/home_id/.ssh/id_rsa): &lt;br /&gt;
 Enter passphrase (empty for no passphrase):              &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;&amp;lt;strong&amp;gt;&amp;amp;lt;-- Choose and enter a password.&amp;lt;/strong&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
 Enter same passphrase again: &lt;br /&gt;
 &lt;br /&gt;
 Your identification has been saved in /Users/home_id/.ssh/id_rsa.&lt;br /&gt;
 Your public key has been saved in /Users/home_id/.ssh/id_rsa.pub.&lt;br /&gt;
 The key fingerprint is:&lt;br /&gt;
 42:c3:72:fb:4c:be:c6:80:81:bc:8b:73:d8:88:84:2e home_id@&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;yourcomputer&amp;lt;/font&amp;gt;.local&lt;br /&gt;
&lt;br /&gt;
* Inspect the .ssh directory &#039;&#039;&#039;on your computer&#039;&#039;&#039;. It should contain the following files:&lt;br /&gt;
 $ ls -1 ~/.ssh&lt;br /&gt;
 config&lt;br /&gt;
 &#039;&#039;&#039;id_rsa&#039;&#039;&#039;&lt;br /&gt;
 &#039;&#039;&#039;id_rsa.pub&#039;&#039;&#039;&lt;br /&gt;
 known_hosts&lt;br /&gt;
 random_seed&lt;br /&gt;
: id_* are the just created key files.&lt;br /&gt;
&lt;br /&gt;
=== Using an ssh-agent ===&lt;br /&gt;
On modern systems, the mere presence of private keys with their default names triggers handling through &#039;&#039;ssh-agent&#039;&#039; and brings up a passphrase dialog at the start of the desktop session or when a key is first requested for an outgoing connection.  This is the case on MacOS X since 10.5 (Leopard), where key management is secure and largely automated through its general &#039;&#039;keychain&#039;&#039; concept.&lt;br /&gt;
&lt;br /&gt;
On older systems, you need to (a) set up the session to run under &#039;&#039;ssh agent&#039;&#039; and (b) request the passphrase upon login.  Circumstances vary widely.  Ask [http://www.google.com/search?hl=en&amp;amp;q=ssh-agent Google] or your local admin for help.  See also the page [http://kimmo.suominen.com/docs/ssh/ &#039;&#039;Getting started with SSH&#039;&#039;].&lt;br /&gt;
&lt;br /&gt;
=== Place your public key on Carbon ===&lt;br /&gt;
[[Image:HPC 2012-02-06 screenshot ssh agent password request.png|350px|thumb|Password dialog on connecting to {{host|carbon}} once keys are in place.]]&lt;br /&gt;
To productively use your ssh key pair, you need to transfer the public half to Carbon.&lt;br /&gt;
&lt;br /&gt;
Requirements:&lt;br /&gt;
* you have a public/private ssh key pair on your machine (called &#039;&#039;&#039;&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;yourcomputer&amp;lt;/font&amp;gt;&#039;&#039;&#039; in this example).&lt;br /&gt;
* the public file on &#039;&#039;&#039;&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;yourcomputer&amp;lt;/font&amp;gt;&#039;&#039;&#039; is named &amp;lt;code&amp;gt;~/.ssh/id_rsa.pub&amp;lt;/code&amp;gt; or  &amp;lt;code&amp;gt;~/.ssh/id_dsa.pub&amp;lt;/code&amp;gt; (either one will work).&lt;br /&gt;
* the ssh host alias &amp;lt;code&amp;gt;&amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;mega&amp;lt;/font&amp;gt;&amp;lt;/code&amp;gt; has been set up on &#039;&#039;&#039;&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;yourcomputer&amp;lt;/font&amp;gt;&#039;&#039;&#039; in &amp;lt;code&amp;gt;~/.ssh/config&amp;lt;/code&amp;gt; and defines tunnels using &amp;lt;code&amp;gt;LocalForward&amp;lt;/code&amp;gt; declarations.&lt;br /&gt;
* the tunnel connection for &#039;&#039;&#039;&amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;mega&amp;lt;/font&amp;gt;&#039;&#039;&#039; is open, i.e., on &#039;&#039;&#039;&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;yourcomputer&amp;lt;/font&amp;gt;&#039;&#039;&#039;, &amp;lt;code&amp;gt;ssh mega&amp;lt;/code&amp;gt; runs in another terminal.&lt;br /&gt;
* the ssh alias {{host|carbon}} has been set up as described above.&lt;br /&gt;
* an interactive session &amp;lt;code&amp;gt;ssh carbon&amp;lt;/code&amp;gt; succeeds.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot; /&amp;gt;&lt;br /&gt;
Then, to transfer your public key from &#039;&#039;&#039;&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;yourcomputer&amp;lt;/font&amp;gt;&#039;&#039;&#039; to the Carbon login nodes, type:&lt;br /&gt;
 cat ~/.ssh/id_rsa.pub | ssh carbon &amp;quot;umask 033; mkdir -p .ssh; cat &amp;gt;&amp;gt; .ssh/authorized_keys&amp;quot;&lt;br /&gt;
This command will append the contents of your ssh public key on &#039;&#039;&#039;&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;yourcomputer&amp;lt;/font&amp;gt;&#039;&#039;&#039; to an &amp;lt;code&amp;gt;authorized_keys&amp;lt;/code&amp;gt; file on Carbon.  The command above is more reliable than cut&amp;amp;paste across interactive terminal sessions.  If you created a dsa-type key, or chose your own name for the key pair, you&#039;ll have to cat the appropriate file instead.  Remember to use the &#039;&#039;public&#039;&#039; part of the key, i.e. the file &amp;lt;code&amp;gt;id_foo.pub&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
&lt;br /&gt;
=== General connection issues ===&lt;br /&gt;
Run &amp;lt;code&amp;gt;ssh&amp;lt;/code&amp;gt; with one or more &amp;lt;code&amp;gt;-v&amp;lt;/code&amp;gt; options (&amp;quot;verbosity&amp;quot;), and record the output for diagnostic (copy&amp;amp;paste into a file). E.g.:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ssh -v -v [other options and arguments …]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
If you cannot resolve the issue yourself, follow [[HPC/Support]].&lt;br /&gt;
&lt;br /&gt;
=== Public keys ===&lt;br /&gt;
If public keys do not work, use your password to gain access, then check the following:&lt;br /&gt;
; Permissions: The directories and the &amp;lt;code&amp;gt;authorized_keys&amp;lt;/code&amp;gt; file must, at the least, not be writable by anyone except yourself; other permissions are recommended to be restrictive as well:&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;login5&amp;lt;/font&amp;gt;$ &amp;lt;strong&amp;gt;ls -ld ~ ~/.ssh ~/.ssh/authorized_keys&amp;lt;/strong&amp;gt;&lt;br /&gt;
 drwxr&amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;-&amp;lt;/font&amp;gt;xr&amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;-&amp;lt;/font&amp;gt;x 28 argonne_id users 4096 Feb 22 13:52 /home/argonne_id&lt;br /&gt;
 drwx&amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;------&amp;lt;/font&amp;gt;  4 argonne_id argonne_id 4096 Feb 18 21:25 /home/argonne_id/.ssh&lt;br /&gt;
 -rw-&amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;------&amp;lt;/font&amp;gt;  1 argonne_id argonne_id  829 Oct  9 10:55 /home/argonne_id/.ssh/authorized_keys&lt;br /&gt;
: To change:&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;login5&amp;lt;/font&amp;gt;$ &#039;&#039;&#039;chmod &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;go-w&amp;lt;/font&amp;gt; ~&#039;&#039;&#039;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;login5&amp;lt;/font&amp;gt;$ &#039;&#039;&#039;chmod &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;go-rwx&amp;lt;/font&amp;gt; ~/.ssh ~/.ssh/authorized_keys&#039;&#039;&#039;&lt;br /&gt;
; Corruption of &amp;lt;code&amp;gt;authorized_keys&amp;lt;/code&amp;gt; file: The file should contain public keys in OpenSSH format, &#039;&#039;one per line&#039;&#039;, without additional line breaks.  One way to check is:&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;yourcomputer&amp;lt;/font&amp;gt;$ &amp;lt;strong&amp;gt;cut -c1-50 ~/.ssh/authorized_keys&amp;lt;/strong&amp;gt;&lt;br /&gt;
 ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAIEjdsfjJSAHkjh88y&lt;br /&gt;
 ssh-dss AAAAB3NzaC1kc3MAAACBAkkjsadfJFg7EFjDJhWEjk&lt;br /&gt;
The output should &#039;&#039;look similar&#039;&#039; to the sample above.  Use your favorite text editor to join erroneously broken lines.&lt;br /&gt;
Note that there should &#039;&#039;&#039;not&#039;&#039;&#039; be anything like &amp;lt;code&amp;gt;BEGIN RSA PRIVATE KEY&amp;lt;/code&amp;gt;, which would obviously indicate a private, rather than public key.&lt;br /&gt;
; Verify that an ssh-agent is running:&lt;br /&gt;
To verify that an ssh-agent is running and visible to your shell, check for the presence of the environment variable &amp;lt;code&amp;gt;SSH_AUTH_SOCK&amp;lt;/code&amp;gt;.  To list the keys it has loaded, use &amp;lt;code&amp;gt;ssh-add -l&amp;lt;/code&amp;gt; (lowercase &amp;quot;L&amp;quot;).  Typical output is as follows:&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;yourcomputer&amp;lt;/font&amp;gt;$ &#039;&#039;&#039;echo $SSH_AUTH_SOCK&#039;&#039;&#039;&lt;br /&gt;
 /tmp/ssh-HCvZKt5478/agent.5478&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;yourcomputer&amp;lt;/font&amp;gt;$ &#039;&#039;&#039;ssh-add -l&#039;&#039;&#039;&lt;br /&gt;
 1024 b9:65:98:c0:7c:25:da:b6:86:48:98:6b:2a:5a:9d:21 /Users/home_id/.ssh/id_rsa (RSA)&lt;br /&gt;
&lt;br /&gt;
[[Category:HPC|Network]]&lt;/div&gt;</summary>
		<author><name>Stern</name></author>
	</entry>
	<entry>
		<id>https://wiki.anl.gov/wiki_cnm/index.php?title=HPC/Network_Access/SSH_Tunnel_Setup_and_Use&amp;diff=7474</id>
		<title>HPC/Network Access/SSH Tunnel Setup and Use</title>
		<link rel="alternate" type="text/html" href="https://wiki.anl.gov/wiki_cnm/index.php?title=HPC/Network_Access/SSH_Tunnel_Setup_and_Use&amp;diff=7474"/>
		<updated>2025-09-23T18:04:29Z</updated>

		<summary type="html">&lt;p&gt;Stern: /* Using an ssh config file */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The following sections document how to establish ssh tunneling on machines running [http://en.wikipedia.org/wiki/OpenSSH OpenSSH] or close relatives.&lt;br /&gt;
OpenSSH is available on all major operating systems: Linux, macOS, Windows, and on mobile.&lt;br /&gt;
&amp;lt;!--Numerous [http://www.google.com/search?hl=en&amp;amp;q=SSH+Windows solutions] are available to provide the same functionality, but details vary considerably. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Manual setup ==&lt;br /&gt;
[[Image:HPC 2012-02-06 screenshot sketch ssh tunneling windows.png|350px|right]]&lt;br /&gt;
&#039;&#039;&#039;On your computer&#039;&#039;&#039;, run the following commands:&lt;br /&gt;
&lt;br /&gt;
0. (Windows only) Start your X11 server if you have one.&lt;br /&gt;
&lt;br /&gt;
1. Open a terminal window (such as Mac Terminal, Cygwin, &amp;lt;strike&amp;gt;PuTTY&amp;lt;/strike&amp;gt;, or xterm).&lt;br /&gt;
&lt;br /&gt;
2. Type:&lt;br /&gt;
 &amp;lt;font color=&amp;quot;darkred&amp;quot;&amp;gt;ssh -v -L 33301:carbon:22  &#039;&#039;username&#039;&#039;@mega.cnm.anl.gov&amp;lt;/font&amp;gt;&lt;br /&gt;
: &#039;&#039;&#039;Do not type any further commands in this window.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
3. Minimize that window - no further commands need be typed there.&lt;br /&gt;
&lt;br /&gt;
4. Open another terminal window.&lt;br /&gt;
&lt;br /&gt;
5. Type:&lt;br /&gt;
 &amp;lt;font color=&amp;quot;darkgreen&amp;quot;&amp;gt;ssh -Y -p 33301 &#039;&#039;username&#039;&#039;@localhost&amp;lt;/font&amp;gt;&lt;br /&gt;
:* Replace &amp;lt;code&amp;gt;&#039;&#039;username&#039;&#039;&amp;lt;/code&amp;gt; by the name of your Argonne account name.&lt;br /&gt;
:* Steps 4 and 5 can be repeated as often as desired.&lt;br /&gt;
&lt;br /&gt;
Do not type any commands at a prompt on mega.&lt;br /&gt;
&lt;br /&gt;
== Using an ssh config file ==&lt;br /&gt;
To simplify making connections from your computer, create or use an ssh configuration file on it.&lt;br /&gt;
&lt;br /&gt;
=== Config file contents ===&lt;br /&gt;
&#039;&#039;&#039;On your computer&#039;&#039;&#039;:&lt;br /&gt;
* Close any Carbon windows opened previously.&lt;br /&gt;
* Open a new terminal window.&lt;br /&gt;
** Linux: xterm&lt;br /&gt;
** Mac: Terminal.app&lt;br /&gt;
** Windows: a Cygwin window.&lt;br /&gt;
* Copy&amp;amp;paste the following text into your ~/.ssh/config file.&lt;br /&gt;
&amp;lt;!-- You can use the following command to create the file from scratch:&lt;br /&gt;
 cat &amp;gt; ~/.ssh/config&lt;br /&gt;
: Copy&amp;amp;paste the text below, then press Ctrl-D to finish.&lt;br /&gt;
: &#039;&#039;&#039;Warning:&#039;&#039;&#039; This command will override an existing file.&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
 NoHostAuthenticationForLocalhost yes&lt;br /&gt;
 &lt;br /&gt;
 Host mega&lt;br /&gt;
         Hostname mega.cnm.anl.gov&lt;br /&gt;
         User              &#039;&#039;argonne_user_name&#039;&#039;&lt;br /&gt;
         LocalForward      33301  carbon:22&lt;br /&gt;
         LocalForward      33380  carbonmgmt:80&lt;br /&gt;
 &lt;br /&gt;
 Host carbon&lt;br /&gt;
         Hostname localhost&lt;br /&gt;
         User              &#039;&#039;argonne_user_name&#039;&#039;&lt;br /&gt;
         Port              33301&lt;br /&gt;
         ForwardX11        yes&lt;br /&gt;
         ForwardX11Trusted yes&lt;br /&gt;
         AddKeysToAgent    yes&lt;br /&gt;
         &#039;&#039;&#039;MACs              hmac-sha2-512,hmac-sha2-256&#039;&#039;&#039;&lt;br /&gt;
         &#039;&#039;&#039;RequiredRSASize   1024&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Replace&#039;&#039;&#039; the string &#039;&#039;argonne_user_name&#039;&#039; with the name of your Argonne domain account.&lt;br /&gt;
* The &amp;lt;code&amp;gt;MACs&amp;lt;/code&amp;gt; line is required on Windows 11 Subsystem for Linux (WSL).&lt;br /&gt;
* Remove write permissions to the config file, its parent directory, and your home for anyone but you:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chmod go-rwx ~/.ssh ~/.ssh/config&lt;br /&gt;
chmod go-w ~&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
:* &#039;&#039;&#039;Note for Cygwin users:&#039;&#039;&#039; To paste text into a Cygwin window, right-click with your mouse or use the Shift-Ins keyboard shortcut.&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
* Run this command:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
read -p &amp;quot;your Argonne user name: &amp;quot;&lt;br /&gt;
sed -i &amp;quot;s/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
:* Simply Copy &amp;amp; Paste the line from this browser window to your terminal.&lt;br /&gt;
* Advanced users: See the ssh_config man page for syntax and options of the config file.&lt;br /&gt;
&lt;br /&gt;
=== Connecting with a config file ===&lt;br /&gt;
With the config file in place, the commands in section [[#Manual setup]] above simplify to:&lt;br /&gt;
&lt;br /&gt;
: 1. In one window, run the following command, then minimize the window:&lt;br /&gt;
 &amp;lt;font color=&amp;quot;darkred&amp;quot;&amp;gt;ssh -v mega&amp;lt;/font&amp;gt;&lt;br /&gt;
: Do not type any further commands here. (You can use the -N option to intentionally suppress a command prompt.)&lt;br /&gt;
&lt;br /&gt;
: 2. Use other terminals as often as needed to log in interactively:&lt;br /&gt;
 &amp;lt;font color=&amp;quot;darkgreen&amp;quot;&amp;gt;ssh carbon&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Advanced: Connecting to a &#039;&#039;specific&#039;&#039; login node ===&lt;br /&gt;
The configuration described above uses a generic host name {{host|carbon}}, which at present will lead to one specific login node.&lt;br /&gt;
However, you may want to connect to another node that you have used previously, such as to reconnect to a VNC sesssion.&lt;br /&gt;
To do so, change your .ssh/config to forward additional ports and set up more specific &amp;lt;code&amp;gt;Host&amp;lt;/code&amp;gt; aliases.&lt;br /&gt;
&lt;br /&gt;
==== Modify configuration file ====&lt;br /&gt;
* Similar to the above, copy&amp;amp;paste the following text into your &amp;lt;code&amp;gt;~/.ssh/config&amp;lt;/code&amp;gt; file:&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;NoHostAuthenticationForLocalhost yes&lt;br /&gt;
 &lt;br /&gt;
 Host mega&lt;br /&gt;
         Hostname          mega.cnm.anl.gov&lt;br /&gt;
         User              &#039;&#039;argonne_user_name&#039;&#039;&lt;br /&gt;
         LocalForward      33301  carbon:22&amp;lt;/font&amp;gt;&amp;lt;strong&amp;gt;&lt;br /&gt;
         LocalForward      33305  clogin5:22&lt;br /&gt;
         LocalForward      33306  clogin6:22&amp;lt;/strong&amp;gt;&amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;&lt;br /&gt;
         LocalForward      33380  carbonmgmt:80&lt;br /&gt;
 &lt;br /&gt;
 Host carbon&lt;br /&gt;
         Port              33301&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;strong&amp;gt;Host clogin5&lt;br /&gt;
         Port              33305&lt;br /&gt;
 Host clogin6&lt;br /&gt;
         Port              33306&amp;lt;/strong&amp;gt;&amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;&lt;br /&gt;
 Host carbon clogin*&lt;br /&gt;
         …&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can then connect to either {{host|carbon}}, or specific host names  {{host|clogin5}} etc., as follows:&lt;br /&gt;
: 1. Run &#039;&#039;&#039;once&#039;&#039;&#039; in your desktop session:&lt;br /&gt;
 &amp;lt;font color=&amp;quot;darkred&amp;quot;&amp;gt;ssh -v mega&amp;lt;/font&amp;gt;&lt;br /&gt;
: 2. Run &#039;&#039;&#039;as often as needed&#039;&#039;&#039;:&lt;br /&gt;
 &amp;lt;font color=&amp;quot;darkgreen&amp;quot;&amp;gt;ssh clogin&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;darkgreen&amp;quot;&amp;gt;ssh clogin5&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;darkgreen&amp;quot;&amp;gt;ssh clogin6&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;darkgreen&amp;quot;&amp;gt;scp …&amp;lt;/font&amp;gt;      &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;# (to or from {{host|clogin}})&amp;lt;/font&amp;gt;&lt;br /&gt;
 …&lt;br /&gt;
&lt;br /&gt;
== Test remote graphics using X11 ==&lt;br /&gt;
# In a terminal &#039;&#039;&#039;connected to a Carbon login node&#039;&#039;&#039;, run the command:&lt;br /&gt;
#:: &amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;echo $DISPLAY&amp;lt;/source&amp;gt;&lt;br /&gt;
#:: You should get something like:&lt;br /&gt;
#:: &amp;lt;code&amp;gt;localhost:&#039;&#039;17.0&#039;&#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
#: The actual number will vary. [[Image:HPC 2011-06-23 xload example.png|right|60px]]&lt;br /&gt;
# Start a simple X11 program:&lt;br /&gt;
#:: &amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;xload&amp;lt;/source&amp;gt;&lt;br /&gt;
#: You should see a small window pop up on your screen, labeled &amp;quot;login5&amp;quot; or &amp;quot;login6&amp;quot;.&lt;br /&gt;
# Close the window using its close button or press Ctrl-C in the terminal window.&lt;br /&gt;
# Now use graphical applications on Carbon, for instance: [[Image:HPC 2011-06-23 gnuplot example.png|right|300px]]&lt;br /&gt;
#:: &amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;gnuplot&amp;lt;/source&amp;gt;&lt;br /&gt;
#: This will start the gnuplot interpreter in the terminal.&lt;br /&gt;
#* Create a sample plot. At the &amp;lt;code&amp;gt;gnuplot&amp;amp;gt; &amp;lt;/code&amp;gt; prompt, type:&lt;br /&gt;
#*: &amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;plot sin(x)&amp;lt;/source&amp;gt;&lt;br /&gt;
#* Exit the program:&lt;br /&gt;
#*: &amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;exit&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== File transfer ==&lt;br /&gt;
* There are many ways to transfer files through an ssh tunnel. However, you must always initiate the connection from the remote machine (your home computer), and either &#039;&#039;push&#039;&#039; files to Carbon or &#039;&#039;pull&#039;&#039; files from Carbon.&lt;br /&gt;
* With the above tunnel setup you cannot initiate a file transfer from Carbon or mega.&lt;br /&gt;
* Do not use mega as an intermediate. Files stored there wil be deleted.&lt;br /&gt;
&lt;br /&gt;
; Prerequisite: The command examples below require that a tunnel-establishing &#039;&#039;&#039;&#039;&#039;connection to &amp;lt;code&amp;gt;mega&amp;lt;/code&amp;gt; is open&#039;&#039;&#039;&#039;&#039;. Follow section [[#Manual setup]] or [[#Connecting with a config file]] above to open or re-open this connection if needed.&lt;br /&gt;
&lt;br /&gt;
=== Without SSH config file ===&lt;br /&gt;
&amp;lt;!-- * Without a config file (&#039;&#039;roughing it&#039;&#039;) --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Run the following &#039;&#039;&#039;example commands on your machine&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
; Copy &#039;&#039;to&#039;&#039; Carbon – &amp;quot;push&amp;quot;:&lt;br /&gt;
 &amp;lt;font color=&amp;quot;darkgreen&amp;quot;&amp;gt;scp -P 33301 -p  &#039;foofile&#039;  &#039;&#039;argonne_user_name&#039;&#039;@localhost:&#039;dir/on/carbon/&#039;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Copy &#039;&#039;from&#039;&#039; Carbon – &amp;quot;pull&amp;quot;:&lt;br /&gt;
 &amp;lt;font color=&amp;quot;darkgreen&amp;quot;&amp;gt;scp -P -p  &#039;&#039;argonne_user_name&#039;&#039;@localhost:&#039;dir/on/carbon/name_on_carbon&#039;  destination_on_your_machine/&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Type &amp;lt;code&amp;gt;localhost&amp;lt;/code&amp;gt; as written. Together with the option &amp;lt;code&amp;gt;-P  33301&amp;lt;/code&amp;gt; (or &amp;lt;code&amp;gt;-o port=&#039;&#039;number&#039;&#039;&amp;lt;/code&amp;gt; for older scp versions) it refers to the tunnel that you have set up earlier.&lt;br /&gt;
* Replace &#039;&#039;&amp;lt;code&amp;gt;argonne_user_name&amp;lt;/code&amp;gt;&#039;&#039; by the user name you have at Argonne.&lt;br /&gt;
&lt;br /&gt;
=== With an SSH config file ===&lt;br /&gt;
Run the following &#039;&#039;&#039;example commands on your machine&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==== Copy a file &#039;&#039;to&#039;&#039; Carbon (&#039;&#039;push&#039;&#039; from outside) ====&lt;br /&gt;
* With the above ssh/.config file in place:&lt;br /&gt;
 &amp;lt;font color=&amp;quot;darkgreen&amp;quot;&amp;gt;scp -p &#039;foofile&#039; carbon:&#039;dir/on/carbon/&#039;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Copy a whole directory &#039;&#039;to&#039;&#039; Carbon ====&lt;br /&gt;
Short of using tar or zip:&lt;br /&gt;
 &amp;lt;font color=&amp;quot;darkgreen&amp;quot;&amp;gt;scp -rp &#039;local/path/&#039; carbon:&#039;dir/on/carbon/&#039;&amp;lt;/font&amp;gt;&lt;br /&gt;
This method does not preserve symbolic links.&lt;br /&gt;
&lt;br /&gt;
==== Copy a file &#039;&#039;from&#039;&#039; Carbon (&#039;&#039;pull&#039;&#039; from outside) ====&lt;br /&gt;
 &amp;lt;font color=&amp;quot;darkgreen&amp;quot;&amp;gt;scp -p carbon:remote/path/foo  local/path/&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;darkgreen&amp;quot;&amp;gt;scp -p carbon:remote/path/foo  .&amp;lt;/font&amp;gt;&lt;br /&gt;
Note the trailing &amp;quot;.&amp;quot; in the last example to copy to your current directory.&lt;br /&gt;
; Reverse tunneling&lt;br /&gt;
The file copy operations above must all be initiated on the outside host.&lt;br /&gt;
It is possible to set up tunnels to be able to initiate file operations on the inside.&lt;br /&gt;
However, this is more complex and will be left as an exercise for advanced users.&lt;br /&gt;
It involves setting up:&lt;br /&gt;
# agent forwarding&lt;br /&gt;
# a &amp;lt;code&amp;gt;.ssh/config&amp;lt;/code&amp;gt; file on Carbon, and&lt;br /&gt;
# specifying &amp;lt;code&amp;gt;-R&amp;lt;/code&amp;gt; command line options or &amp;lt;code&amp;gt;RemoteForward&amp;lt;/code&amp;gt; config file directives when accessing {{host|carbon}} at the second stage.&lt;br /&gt;
&lt;br /&gt;
==== Bonus – Intranet web access ====&lt;br /&gt;
Open the following links in a browser &#039;&#039;on your external workstation&#039;&#039;:&lt;br /&gt;
 https://localhost:33343/cnm/HPC&lt;br /&gt;
 http://localhost:33380/&lt;br /&gt;
&lt;br /&gt;
==== Copy a file &#039;&#039;to&#039;&#039; Carbon from a &#039;&#039;third host&#039;&#039; ====&lt;br /&gt;
0. Similar to the procedure in section [[#Manual setup]] above, open two interactive sessions to the remote computer.&lt;br /&gt;
&lt;br /&gt;
1. From the first session, open a connection to Mega and forward a port:&lt;br /&gt;
 &amp;lt;font color=&amp;quot;darkred&amp;quot;&amp;gt;ssh -v -L 33301:carbon:22  &#039;&#039;username&#039;&#039;@mega.cnm.anl.gov&amp;lt;/font&amp;gt;&lt;br /&gt;
:* &#039;&#039;&#039;Do not type any further commands there.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
2. In the second session, test if you can reach Carbon interactively.&lt;br /&gt;
 &amp;lt;font color=&amp;quot;darkgreen&amp;quot;&amp;gt;ssh -Y -p 33301 -o NoHostAuthenticationForLocalhost=yes username@localhost&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. Close the Carbon connection from step 2.&lt;br /&gt;
 exit&lt;br /&gt;
: You should arrive back at the prompt of the third host.&lt;br /&gt;
&lt;br /&gt;
4. From the second session again, initiate the file transfer as:&lt;br /&gt;
 &amp;lt;font color=&amp;quot;darkgreen&amp;quot;&amp;gt;scp -v -p -o port=33301 -o NoHostAuthenticationForLocalhost=yes \&lt;br /&gt;
         &#039;&#039;filename_remote&#039;&#039; &#039;&#039;username&#039;&#039;@localhost&#039;&#039;&#039;:&#039;&#039;&#039;[&#039;&#039;target_directory/&#039;&#039;][&#039;&#039;filename_on_carbon&#039;&#039;]&amp;lt;/font&amp;gt;&lt;br /&gt;
:* Replace &amp;lt;code&amp;gt;&#039;&#039;username&#039;&#039;&amp;lt;/code&amp;gt; by the name of your Argonne account name.&lt;br /&gt;
:* Note the &amp;quot;:&amp;quot; at the end of the host name, which tells the &amp;lt;code&amp;gt;scp&amp;lt;/code&amp;gt; command that the copy target is on a remote host.&lt;br /&gt;
:* The file named &amp;lt;code&amp;gt;&#039;&#039;filename_remote&#039;&#039;&amp;lt;/code&amp;gt; will arrive in your Carbon home directory under this name, unless you specify a &amp;lt;code&amp;gt;&#039;&#039;target_directory&#039;&#039;&amp;lt;/code&amp;gt; and/or a &amp;lt;code&amp;gt;&#039;&#039;filename_on_carbon&#039;&#039;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
5. When done, press Ctrl-C in the first session to terminate the connection to mega.&lt;br /&gt;
&lt;br /&gt;
== Advanced: Speeding up logins using ssh keys ==&lt;br /&gt;
&lt;br /&gt;
Our SSH gatway host itself does not accept SSH keys – you must always type your password for the initial connection to Mega.&lt;br /&gt;
&lt;br /&gt;
Once you have established this initial connection and your tunnels are configured, you can use SSH keys to log in to Carbon login nodes without further passwords.&lt;br /&gt;
&lt;br /&gt;
=== Create a key ===&lt;br /&gt;
* Create an ssh key pair key &#039;&#039;if you do not already have one&#039;&#039; :&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;yourcomputer&amp;lt;/font&amp;gt;$ &#039;&#039;&#039;ssh-keygen -t rsa&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The output will look like:&lt;br /&gt;
 Generating public/private rsa key pair.&lt;br /&gt;
 Enter file in which to save the key (/Users/home_id/.ssh/id_rsa): &lt;br /&gt;
 Enter passphrase (empty for no passphrase):              &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;&amp;lt;strong&amp;gt;&amp;amp;lt;-- Choose and enter a password.&amp;lt;/strong&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
 Enter same passphrase again: &lt;br /&gt;
 &lt;br /&gt;
 Your identification has been saved in /Users/home_id/.ssh/id_rsa.&lt;br /&gt;
 Your public key has been saved in /Users/home_id/.ssh/id_rsa.pub.&lt;br /&gt;
 The key fingerprint is:&lt;br /&gt;
 42:c3:72:fb:4c:be:c6:80:81:bc:8b:73:d8:88:84:2e home_id@&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;yourcomputer&amp;lt;/font&amp;gt;.local&lt;br /&gt;
&lt;br /&gt;
* Inspect the .ssh directory &#039;&#039;&#039;on your computer&#039;&#039;&#039;. It should contain the following files:&lt;br /&gt;
 $ ls -1 ~/.ssh&lt;br /&gt;
 config&lt;br /&gt;
 &#039;&#039;&#039;id_rsa&#039;&#039;&#039;&lt;br /&gt;
 &#039;&#039;&#039;id_rsa.pub&#039;&#039;&#039;&lt;br /&gt;
 known_hosts&lt;br /&gt;
 random_seed&lt;br /&gt;
: id_* are the just created key files.&lt;br /&gt;
&lt;br /&gt;
=== Using an ssh-agent ===&lt;br /&gt;
On modern systems, the mere presence of private keys with their default names triggers handling through &#039;&#039;ssh-agent&#039;&#039; and brings up a passphrase dialog at the start of the desktop session or when a key is first requested for an outgoing connection.  This is the case on MacOS X since 10.5 (Leopard), where key management is secure and largely automated through its general &#039;&#039;keychain&#039;&#039; concept.&lt;br /&gt;
&lt;br /&gt;
On older systems, you need to (a) set up the session to run under &#039;&#039;ssh agent&#039;&#039; and (b) request the passphrase upon login.  Circumstances vary widely.  Ask [http://www.google.com/search?hl=en&amp;amp;q=ssh-agent Google] or your local admin for help.  See also the page [http://kimmo.suominen.com/docs/ssh/ &#039;&#039;Getting started with SSH&#039;&#039;].&lt;br /&gt;
&lt;br /&gt;
=== Place your public key on Carbon ===&lt;br /&gt;
[[Image:HPC 2012-02-06 screenshot ssh agent password request.png|350px|thumb|Password dialog on connecting to {{host|carbon}} once keys are in place.]]&lt;br /&gt;
To productively use your ssh key pair, you need to transfer the public half to Carbon.&lt;br /&gt;
&lt;br /&gt;
Requirements:&lt;br /&gt;
* you have a public/private ssh key pair on your machine (called &#039;&#039;&#039;&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;yourcomputer&amp;lt;/font&amp;gt;&#039;&#039;&#039; in this example).&lt;br /&gt;
* the public file on &#039;&#039;&#039;&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;yourcomputer&amp;lt;/font&amp;gt;&#039;&#039;&#039; is named &amp;lt;code&amp;gt;~/.ssh/id_rsa.pub&amp;lt;/code&amp;gt; or  &amp;lt;code&amp;gt;~/.ssh/id_dsa.pub&amp;lt;/code&amp;gt; (either one will work).&lt;br /&gt;
* the ssh host alias &amp;lt;code&amp;gt;&amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;mega&amp;lt;/font&amp;gt;&amp;lt;/code&amp;gt; has been set up on &#039;&#039;&#039;&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;yourcomputer&amp;lt;/font&amp;gt;&#039;&#039;&#039; in &amp;lt;code&amp;gt;~/.ssh/config&amp;lt;/code&amp;gt; and defines tunnels using &amp;lt;code&amp;gt;LocalForward&amp;lt;/code&amp;gt; declarations.&lt;br /&gt;
* the tunnel connection for &#039;&#039;&#039;&amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;mega&amp;lt;/font&amp;gt;&#039;&#039;&#039; is open, i.e., on &#039;&#039;&#039;&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;yourcomputer&amp;lt;/font&amp;gt;&#039;&#039;&#039;, &amp;lt;code&amp;gt;ssh mega&amp;lt;/code&amp;gt; runs in another terminal.&lt;br /&gt;
* the ssh alias {{host|carbon}} has been set up as described above.&lt;br /&gt;
* an interactive session &amp;lt;code&amp;gt;ssh carbon&amp;lt;/code&amp;gt; succeeds.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot; /&amp;gt;&lt;br /&gt;
Then, to transfer your public key from &#039;&#039;&#039;&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;yourcomputer&amp;lt;/font&amp;gt;&#039;&#039;&#039; to the Carbon login nodes, type:&lt;br /&gt;
 cat ~/.ssh/id_rsa.pub | ssh carbon &amp;quot;umask 033; mkdir -p .ssh; cat &amp;gt;&amp;gt; .ssh/authorized_keys&amp;quot;&lt;br /&gt;
This command will append the contents of your ssh public key on &#039;&#039;&#039;&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;yourcomputer&amp;lt;/font&amp;gt;&#039;&#039;&#039; to an &amp;lt;code&amp;gt;authorized_keys&amp;lt;/code&amp;gt; file on Carbon.  The command above is more reliable than cut&amp;amp;paste across interactive terminal sessions.  If you created a dsa-type key, or chose your own name for the key pair, you&#039;ll have to cat the appropriate file instead.  Remember to use the &#039;&#039;public&#039;&#039; part of the key, i.e. the file &amp;lt;code&amp;gt;id_foo.pub&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
&lt;br /&gt;
=== General connection issues ===&lt;br /&gt;
Run &amp;lt;code&amp;gt;ssh&amp;lt;/code&amp;gt; with one or more &amp;lt;code&amp;gt;-v&amp;lt;/code&amp;gt; options (&amp;quot;verbosity&amp;quot;), and record the output for diagnostic (copy&amp;amp;paste into a file). E.g.:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ssh -v -v [other options and arguments …]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
If you cannot resolve the issue yourself, follow [[HPC/Support]].&lt;br /&gt;
&lt;br /&gt;
=== Public keys ===&lt;br /&gt;
If public keys do not work, use your password to gain access, then check the following:&lt;br /&gt;
; Permissions: The directories and the &amp;lt;code&amp;gt;authorized_keys&amp;lt;/code&amp;gt; file must, at the least, not be writable by anyone except yourself; other permissions are recommended to be restrictive as well:&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;login5&amp;lt;/font&amp;gt;$ &amp;lt;strong&amp;gt;ls -ld ~ ~/.ssh ~/.ssh/authorized_keys&amp;lt;/strong&amp;gt;&lt;br /&gt;
 drwxr&amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;-&amp;lt;/font&amp;gt;xr&amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;-&amp;lt;/font&amp;gt;x 28 argonne_id users 4096 Feb 22 13:52 /home/argonne_id&lt;br /&gt;
 drwx&amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;------&amp;lt;/font&amp;gt;  4 argonne_id argonne_id 4096 Feb 18 21:25 /home/argonne_id/.ssh&lt;br /&gt;
 -rw-&amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;------&amp;lt;/font&amp;gt;  1 argonne_id argonne_id  829 Oct  9 10:55 /home/argonne_id/.ssh/authorized_keys&lt;br /&gt;
: To change:&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;login5&amp;lt;/font&amp;gt;$ &#039;&#039;&#039;chmod &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;go-w&amp;lt;/font&amp;gt; ~&#039;&#039;&#039;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;login5&amp;lt;/font&amp;gt;$ &#039;&#039;&#039;chmod &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;go-rwx&amp;lt;/font&amp;gt; ~/.ssh ~/.ssh/authorized_keys&#039;&#039;&#039;&lt;br /&gt;
; Corruption of &amp;lt;code&amp;gt;authorized_keys&amp;lt;/code&amp;gt; file: The file should contain public keys in OpenSSH format, &#039;&#039;one per line&#039;&#039;, without additional line breaks.  One way to check is:&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;yourcomputer&amp;lt;/font&amp;gt;$ &amp;lt;strong&amp;gt;cut -c1-50 ~/.ssh/authorized_keys&amp;lt;/strong&amp;gt;&lt;br /&gt;
 ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAIEjdsfjJSAHkjh88y&lt;br /&gt;
 ssh-dss AAAAB3NzaC1kc3MAAACBAkkjsadfJFg7EFjDJhWEjk&lt;br /&gt;
The output should &#039;&#039;look similar&#039;&#039; to the sample above.  Use your favorite text editor to join erroneously broken lines.&lt;br /&gt;
Note that there should &#039;&#039;&#039;not&#039;&#039;&#039; be anything like &amp;lt;code&amp;gt;BEGIN RSA PRIVATE KEY&amp;lt;/code&amp;gt;, which would obviously indicate a private, rather than public key.&lt;br /&gt;
; Verify that an ssh-agent is running:&lt;br /&gt;
To verify that an ssh-agent is running and visible to your shell, check for the presence of the environment variable &amp;lt;code&amp;gt;SSH_AUTH_SOCK&amp;lt;/code&amp;gt;.  To list the keys it has loaded, use &amp;lt;code&amp;gt;ssh-add -l&amp;lt;/code&amp;gt; (lowercase &amp;quot;L&amp;quot;).  Typical output is as follows:&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;yourcomputer&amp;lt;/font&amp;gt;$ &#039;&#039;&#039;echo $SSH_AUTH_SOCK&#039;&#039;&#039;&lt;br /&gt;
 /tmp/ssh-HCvZKt5478/agent.5478&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;yourcomputer&amp;lt;/font&amp;gt;$ &#039;&#039;&#039;ssh-add -l&#039;&#039;&#039;&lt;br /&gt;
 1024 b9:65:98:c0:7c:25:da:b6:86:48:98:6b:2a:5a:9d:21 /Users/home_id/.ssh/id_rsa (RSA)&lt;br /&gt;
&lt;br /&gt;
[[Category:HPC|Network]]&lt;/div&gt;</summary>
		<author><name>Stern</name></author>
	</entry>
	<entry>
		<id>https://wiki.anl.gov/wiki_cnm/index.php?title=HPC/FAQ&amp;diff=7473</id>
		<title>HPC/FAQ</title>
		<link rel="alternate" type="text/html" href="https://wiki.anl.gov/wiki_cnm/index.php?title=HPC/FAQ&amp;diff=7473"/>
		<updated>2025-09-19T17:14:49Z</updated>

		<summary type="html">&lt;p&gt;Stern: /* Password lockouts */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Access and proposals ==&lt;br /&gt;
The HPC &#039;&#039;Carbon&#039;&#039; cluster and its associated software licenses may be accessed,&lt;br /&gt;
like any tool at the CNM, by one or both of the following routes:&lt;br /&gt;
* CNM Facility Users are eligible under [https://www.anl.gov/cnm/become-a-cnm-user &#039;&#039;&#039;CNM&#039;s User Access Program&#039;&#039;&#039;]. Follow the link to learn how to initiate access under this route. Begin by registering as Facility User, then submit a proposal.&lt;br /&gt;
* Affiliates of [http://www.anl.gov/cnm Argonne&#039;s NST division] are eligible for discretionary access. Affiliate here refers to regular employees, Argonne/University joint appointees, visitor appointees, and student group members, being supervised by CNM staff.&lt;br /&gt;
&lt;br /&gt;
The following is a summary of the main points as they pertain to &#039;&#039;Carbon&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
=== Legal User Agreement ===&lt;br /&gt;
The institution where you work or study must have a legal signed&lt;br /&gt;
[https://www.anl.gov/cnm/prepare-for-your-arrival &#039;&#039;&#039;User Facility Agreement&#039;&#039;&#039;]&lt;br /&gt;
with Argonne in place before any work under an eventual proposal may be performed.&lt;br /&gt;
&lt;br /&gt;
[https://aps.anl.gov/Users-Information/Legal-Financial/Argonne-User-Facility-Agreements &#039;&#039;&#039;Look up existing User Facility Agreements&#039;&#039;&#039;] and locate your institution if you have never worked with Argonne before, or you recently changed your affiliation, or are going to change it soon.&lt;br /&gt;
&lt;br /&gt;
If your institution is not shown, &#039;&#039;get started&#039;&#039; with establishing a user agreement as soon as possible. Legal wheels turn slowly and your scientific work could be delayed.&lt;br /&gt;
&lt;br /&gt;
=== User Registration ===&lt;br /&gt;
Under CNM&#039;s User Access Program, your starting point is to [https://www.anl.gov/cnm/how-to-register-to-become-a-cnm-user &#039;&#039;&#039;become a CNM user&#039;&#039;&#039;].&lt;br /&gt;
&lt;br /&gt;
=== Proposal Lifecycle Overview ===&lt;br /&gt;
&amp;lt;!-- http://www.anl.gov/cnm/user-information/call-proposals --&amp;gt;&lt;br /&gt;
# To &#039;&#039;&#039;submit a proposal&#039;&#039;&#039;, follow the instructions at the CNM&#039;s [https://www.anl.gov/cnm/cnm-user-information &#039;&#039;&#039;Call for Proposals&#039;&#039;&#039;].&lt;br /&gt;
# Upon successful review of a proposal and grant of an allocation, &#039;&#039;&#039;the contacting author&#039;&#039;&#039; will receive an email with subject &#039;&#039;&#039;User Proposal Status Notification&#039;&#039;&#039;.&lt;br /&gt;
# &#039;&#039;&#039;The contacting author must submit,&#039;&#039;&#039; for each proposal, a Safety&amp;amp;Data Form as instructed in the status email. This will confirm the names and badge numbers of participating users, as well as various characteristics of the proposal that we need for statistical reporting to our funding agencies.&lt;br /&gt;
# Participating &#039;&#039;&#039;users register and respond&#039;&#039;&#039; at various steps to have their Argonne user accounts created, activated or reactivated as needed, and have them authorized to access Carbon. &lt;br /&gt;
# Participating users &#039;&#039;&#039;perform the work proposed&#039;&#039;&#039;.&lt;br /&gt;
# [https://www.anl.gov/cnm/cnm-acknowledgment-statements-for-publications &#039;&#039;&#039;Credit CNM in publications&#039;&#039;&#039;] that result from your proposal work with us.&lt;br /&gt;
# After the proposal expires, our User Office will ask you to please submit:&lt;br /&gt;
#* An approximately 1-page &#039;&#039;&#039;Activity Report&#039;&#039;&#039; summarizing work performed and perhaps already published under the proposal. We use these reports to document the use of our facilities to funding agencies.&lt;br /&gt;
#* An end-of-proposal &#039;&#039;&#039;Satisfaction Survey&#039;&#039;&#039;, to invite your feedback on our process.&lt;br /&gt;
&lt;br /&gt;
== Account Types ==&lt;br /&gt;
You access our computer systems by two different user accounts:&lt;br /&gt;
&lt;br /&gt;
=== User Registration Account ===&lt;br /&gt;
: – Looks like: &amp;lt;code&amp;gt;123456&amp;lt;/code&amp;gt; –&amp;lt;br&amp;gt;&lt;br /&gt;
Your &#039;&#039;User Registration Account:&#039;&#039;&lt;br /&gt;
* … is created when you register as CNM facility user, be it as participant or as Principal Investigator (PI), at the [https://beam.aps.anl.gov/pls/apsweb/ufr_main_pkg.usr_start_page &#039;&#039;&#039;User Registration&#039;&#039;&#039;] for the Advanced Photon Source (APS) and CNM.&lt;br /&gt;
* … has an all-numeric user name (no letters, no leading zeroes), which never changes – this is in fact your &#039;&#039;Argonne Badge Number&#039;&#039;,&lt;br /&gt;
* … has its own password and [https://beam.aps.anl.gov/pls/apsweb/forgot_password.start_process &#039;&#039;&#039;password reset process at APS&#039;&#039;&#039;],&lt;br /&gt;
&lt;br /&gt;
Use your User Registration Account to:&lt;br /&gt;
* … [https://beam.aps.anl.gov/pls/apsweb/ufr_main_pkg.usr_start_page &#039;&#039;&#039;update your user registration&#039;&#039;&#039;], such as when you change your affiliation, or to update visa information if Argonne needs them for you,&lt;br /&gt;
* … [https://pico.cnm.anl.gov/proposals/people/login &#039;&#039;&#039;submit a user proposal to CNM&#039;&#039;&#039;]&lt;br /&gt;
* … [https://beam.aps.anl.gov/pls/apsweb/rt0004.intro_process &#039;&#039;&#039;take remote training&#039;&#039;&#039;] prior to beginning work, and prior to being assigned an Argonne domain account, which is described next.&lt;br /&gt;
&lt;br /&gt;
=== Argonne Domain Account ===&lt;br /&gt;
: – Looks like: &amp;lt;code&amp;gt;&#039;&#039;&#039;b&#039;&#039;&#039;&#039;&#039;123456&#039;&#039;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&#039;&#039;jsmith&#039;&#039;&amp;lt;/code&amp;gt; –&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Your &#039;&#039;Argonne Domain Account:&#039;&#039;&lt;br /&gt;
* … is created &#039;&#039;&#039;when you first need it&#039;&#039;&#039;, such as when you are a PI and have received the go-ahead on your first proposal with us,&lt;br /&gt;
* … has, at first, a user name beginning with &amp;lt;code&amp;gt;&#039;&#039;&#039;b&#039;&#039;&#039;&amp;lt;/code&amp;gt;, followed by your badge number (without any leading zeroes),&lt;br /&gt;
* … will get, following your request, a personalized user name, such as &amp;lt;code&amp;gt;&#039;&#039;jsmith&#039;&#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
* … has its own password and uses its own [https://mypassword.anl.gov/ &#039;&#039;&#039;password reset and recovery&#039;&#039;&#039;].  &amp;lt;!-- Redirects to https://servicenow.anl.gov/pr --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Use your Argonne Domain Account to:&lt;br /&gt;
* … submit the &#039;&#039;&#039;Safety&amp;amp;Data Form (UWS)&#039;&#039;&#039; of each proposal for which you are the PI or delegated spokesperson,&lt;br /&gt;
* … perform work – always remotely – at [[HPC|CNM&#039;s &#039;&#039;&#039;High Performance Computing system &#039;&#039;Carbon&#039;&#039;&#039;&#039;&#039;]], &amp;lt;!-- , where you will typically run Linux terminal commands. This account&#039;s user name never begins with a number. --&amp;gt;&lt;br /&gt;
* … handle almost all other tasks at Argonne.&lt;br /&gt;
&lt;br /&gt;
For assistance, please contact our [mailto:cnm_useroffice@anl.gov?subject=Account%20Question CNM User Office]. – Specify &#039;&#039;which task&#039;&#039; you have difficulties with.&lt;br /&gt;
&lt;br /&gt;
== Getting started on a proposal ==&lt;br /&gt;
&amp;lt;!-- We will have notify the proposal spokesperson (usually the Principal Investigator,PI) once a proposal has been approved. At this point, … --&amp;gt;&lt;br /&gt;
To start working on a proposal once it has been granted, &#039;&#039;&#039;action is required for each proposal&#039;&#039;&#039; by the proposal spokesperson (usually the Principal Investigator,PI), regardless of any previous proposals with us.&lt;br /&gt;
At this stage, we collect and update information about each proposal for reporting purposes to our funding agencies, and ensure that safety and training requirements are met by all participating users.&lt;br /&gt;
&lt;br /&gt;
=== To get started as spokesperson or delegate ===&lt;br /&gt;
# Locate the email to you with subject &#039;&#039;User Proposal Status Notification&#039;&#039;, sent by the CNM User Office.&lt;br /&gt;
#* If you are delayed in starting your proposal, you may need to expand your mailbox search time frame, to begin the search at possibly several months before present.&lt;br /&gt;
#* You may need to inspect the &amp;quot;Junk&amp;quot; or &amp;quot;Spam&amp;quot; folder of your mail application.&lt;br /&gt;
# Follow the instructions in that email.&lt;br /&gt;
#* Certain steps are needed only once because they pertain to your institution, notably filing a User Agreement.&lt;br /&gt;
#* Before work on a new proposal may begin, we may ask you to submit &#039;&#039;Activity Reports&#039;&#039; that are due for previous proposals upon their conclusion.&lt;br /&gt;
#* Fill in the &#039;&#039;Safety and Data form&#039;&#039;, i.e., follow the &#039;&#039;User Work Submittal&#039;&#039; (UWS) link that is given in our notification email.&lt;br /&gt;
#:* Only the spokesperson may fill in the UWS form, or the PI may [mailto:cnm_useroffice@anl.gov?subject=Delegate%20UWS-PI%20submission designate a delegate]. Changes after the initial UWS submission by you (the PI or delegate) can only be made by your Scientific Contact at the CNM – see below.&lt;br /&gt;
#:* The UWS is &#039;&#039;&#039;due for each proposal&#039;&#039;&#039;, as it collects certain metadata that we need, on a per-proposal-basis, for usage reporting to our funding agencies.&lt;br /&gt;
#:* Confirm or add users in section &amp;quot;Personnel Participating In User Proposal&amp;quot; of the UWS form. Enter the &#039;&#039;&#039;badge numbers&#039;&#039;&#039; for all participating users, as far as they are known at submission time.&lt;br /&gt;
# Direct all users who you expect to access &#039;&#039;Carbon&#039;&#039;, possibly including yourself, to follow the instructions in section  &#039;&#039;&#039;[[#Ongoing user access requirements]]&#039;&#039;&#039;.&lt;br /&gt;
# Be patient. &#039;&#039;&#039;UWS Processing typically takes at least one business day,&#039;&#039;&#039; as both our User Office staff and your Scientific Contact need to attend to your submission in person.&lt;br /&gt;
# The User Office will notify the spokesperson or delegate once work on a proposal may begin, issuing what we call the &#039;&#039;User Work Approval (UWA)&#039;&#039;.  It will be valid for one year for regular proposals, and 6 months for rapid-access proposals.&lt;br /&gt;
&lt;br /&gt;
=== To get started as participating user ===&lt;br /&gt;
For new proposals or users new to CNM:&lt;br /&gt;
# Gently remind your spokesperson/PI to submit the UWS as shown above, or ask this person to nominate you via an email to the [mailto:cnm_useroffice@anl.gov?subject=Delegate%20UWS CNM User Office].&lt;br /&gt;
# Continue at section [[#Actions required by the User]].&lt;br /&gt;
&lt;br /&gt;
For proposals already in progress, see the next section.&lt;br /&gt;
&lt;br /&gt;
== Adding users to a proposal ==&lt;br /&gt;
Most users are nominated to work on a proposal when it is first submitted.&lt;br /&gt;
Additional users can be authorized to work under a proposal at any time after acceptance.&lt;br /&gt;
Actions are needed from both the user and the proposal spokesperson.&lt;br /&gt;
&lt;br /&gt;
=== Actions required by the User ===&lt;br /&gt;
:1. [[#Ongoing user access requirements|Enter or review your registration]] as facility user and update as necessary.&lt;br /&gt;
:2. Follow up in a day or a week as specified at [[#Follow-up actions required by the User]].&lt;br /&gt;
&lt;br /&gt;
=== Actions required by the PI or spokesperson ===&lt;br /&gt;
:3. Confirm that the user has entered or reviewed their registration, and determine their badge number(s).&lt;br /&gt;
:4.  Add the user to the proposal. &amp;lt;!-- How to do this depends on whether the proposal [[#To get started as spokesperson or delegate|has already started or not (see above)]]. --&amp;gt;&lt;br /&gt;
:* If the proposal has &#039;&#039;&#039;not yet started:&#039;&#039;&#039; See the section above [[#To get started as spokesperson or delegate]].&lt;br /&gt;
:* If the proposal has &#039;&#039;&#039;already started:&#039;&#039;&#039; Email the users&#039; names &#039;&#039;&#039;and badge numbers&#039;&#039;&#039; to the proposal&#039;s &#039;&#039;Scientific Contact&#039;&#039; at the CNM and ask for the UWS to be augmented.&lt;br /&gt;
&amp;lt;!-- If you have questions, please contact the [mailto:cnm_useroffice@anl.gov?subject=Reinstate%20user%20account CNM User Office]. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Actions required by the Scientific Contact ===&lt;br /&gt;
: 5. Open the UWS-SciCon form in the  CNM Proposal Dashboard on the &amp;quot;Inside CNM&amp;quot; web page.&lt;br /&gt;
:* Add users under section &amp;quot;Participating Personnel&amp;quot;.&lt;br /&gt;
:* Enter users&#039; badge numbers which may have been left empty in earlier UWS submissions, as happens by necessity for very newly registered users.&lt;br /&gt;
:* Again, review that badge numbers are present and are correct for all relevant participants that are to work on &#039;&#039;Carbon&#039;&#039;, or at least need to use {{sshgw}}.&lt;br /&gt;
&lt;br /&gt;
=== Follow-up actions required by the User ===&lt;br /&gt;
: 6. Contact our [mailto:cnm_useroffice@anl.gov?subject=Process%20new%20user%20registration CNM User Office] and ask to review your registration and to initiate the next steps.&lt;br /&gt;
:* To work onsite at CNM or remotely on Carbon, you will need an &#039;&#039;Argonne computer account&#039;&#039;, which is different from the account you used to enter your User Registration details – see section [[#Account Types]].&lt;br /&gt;
:* If you are new to Argonne, our User Office will be in contact with you to set up this account. Since the Argonne account is for more general use than your registration account, it will involve formal approvals, cyber security training, etc. and typically takes about &#039;&#039;one week&#039;&#039; to complete.&lt;br /&gt;
: 7. Complete or refresh training courses, as requested by the User Office.&lt;br /&gt;
:* Course requirements are triggered at various levels. There are courses for being a visitor at Argonne, a user at CNM, and for work performed under proposals, be it onsite or remotely.&lt;br /&gt;
: 8. Have your Argonne computer account finalized and ready.&lt;br /&gt;
:* &#039;&#039;&#039;New users:&#039;&#039;&#039; See section [[#Finalize your Argonne computer account]].&lt;br /&gt;
:* &#039;&#039;&#039; Existing users:&#039;&#039;&#039;  Check for and if necessary renew your expired password, [[#Verify or change your password|see below]].&lt;br /&gt;
&lt;br /&gt;
=== Carbon account and access ===&lt;br /&gt;
When all prerequisites are met, your Argonne account will be  enabled or (if so needed) re-enabled for use on Carbon.&lt;br /&gt;
&lt;br /&gt;
: Enabling your account on Carbon &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;&#039;&#039;does not happen immediately&#039;&#039;&amp;lt;/font&amp;gt; after a password reset or rename, or submitting proposal forms – it is a separate process.&lt;br /&gt;
&lt;br /&gt;
: 9. &#039;&#039;&#039;Await confirmation&#039;&#039;&#039; from us that your account has been enabled &#039;&#039;on Carbon&#039;&#039; and been added to one or more proposals.&lt;br /&gt;
: 10. Review and follow the instructions on [[HPC/Network Access]], i.e., how to connect to the cluster.&lt;br /&gt;
&lt;br /&gt;
If you do not receive an expected notification within two days, contact our [mailto:cnm_useroffice@anl.gov?subject=Process%20new%20user%20registration User Office] and describe your issue.&lt;br /&gt;
&lt;br /&gt;
== Finalize your Argonne computer account ==&lt;br /&gt;
After your registration as a new Argonne Facility User has been processed, an [[#Account Types|Argonne &amp;quot;domain account&amp;quot;]] will be created for you.&lt;br /&gt;
Its user name will be in the form &amp;lt;code&amp;gt;b123456&amp;lt;/code&amp;gt; and our User Office will have communicated to you an initial password.&lt;br /&gt;
&lt;br /&gt;
To begin work on &#039;&#039;Carbon&#039;&#039; and possibly other CNM instruments, personalize both your &#039;&#039;password&#039;&#039; and your &#039;&#039;user name&#039;&#039;, in this order.&lt;br /&gt;
&lt;br /&gt;
; For Argonne personnel&amp;lt;nowiki&amp;gt;:&amp;lt;/nowiki&amp;gt; User name vs. email address:&lt;br /&gt;
:* Your &#039;&#039;&#039;user name&#039;&#039;&#039; is the one by which you log in to Argonne-internal services, and takes one of three forms. Web login services typically indicate which user name form they expect..&lt;br /&gt;
:**&amp;lt;code&amp;gt;username&amp;lt;/code&amp;gt; –  This is the most typical form expected, used to log in to {{sshgw}}.&lt;br /&gt;
:** &amp;lt;code&amp;gt;username@ANL.GOV&amp;lt;/code&amp;gt; – Your user name with a &#039;&#039;directory domain&#039;&#039; appended.&lt;br /&gt;
::* &amp;lt;code&amp;gt;ANL.GOV\username&amp;lt;/code&amp;gt; – An alternate form of your user name and directory domain.&lt;br /&gt;
:* Your user name is &#039;&#039;&#039;not necessarily&#039;&#039;&#039; merely the name part of an Argonne &#039;&#039;&#039;email address&#039;&#039;&#039; that you will have if you work or study at Argonne.&lt;br /&gt;
&amp;lt;!-- name part of the address (before &amp;lt;code&amp;gt;@anl.gov&amp;lt;/code&amp;gt;) may have been established by setting an email alias. --&amp;gt;&lt;br /&gt;
&amp;lt;!-- If you were to reverse the order, your account would look as being still unused or dormant, and be ineligible for use. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Change your password ===&lt;br /&gt;
* Change your password as instructed when your account got created.&lt;br /&gt;
*: See also section [[#Verify or change your password]] below.&lt;br /&gt;
* If you chose to call the Argonne Help Desk at [tel:+1-630-252-9999 +1-630-252-9999], option 4, to make the password change:&lt;br /&gt;
*: While on the phone regarding your password, state that you are a &#039;&#039;CNM Carbon User&#039;&#039; and ask to also &#039;&#039;personalize your user name&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
=== Change your user name ===&lt;br /&gt;
# Request a user name change, either over the phone or by email. We will choose the user name for you.&lt;br /&gt;
#; To request by phone: Call the Argonne Help Desk at [tel:+1-630-252-9999 +1-630-252-9999], and select option 4.&lt;br /&gt;
#; To request by email: Follow this link: [mailto:help@anl.gov?subject=User%20name%20change%20request&amp;amp;body=I%20am%20a%20new%20user%20of%20CNM%27s%20Carbon%20HPC%20system.%20Please%20personalize%20the%20user%20name%20of%20my%20Argonne%20Domain%20computer%20account.%0D%0A%0D%0AMy%20full%20name%3A%09__%0D%0AArgonne%20Badge%3A%09__%0D%0A%0D%0AThank%20you.%0D%0A%0D%0A &#039;&#039;&#039;Open email template&#039;&#039;&#039;] – (Use a web browser that supports [https://en.wikipedia.org/wiki/Mailto &amp;quot;mailto:&amp;quot; links].)&lt;br /&gt;
&amp;lt;!-- Wiki authoring note: Encode body text by:&lt;br /&gt;
    perl -MURI::Escape -p -e &#039;s/\n/\r\n/; $_ = uri_escape($_);&#039;&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
## Respond from the &#039;&#039;same email address&#039;&#039; as you filled in at the CNM User Registration form.&lt;br /&gt;
##: In your email application, choose or switch to the &#039;&#039;mail account&#039;&#039; that handles the address you registered with at our User Registration. Messages pertaining to your Argonne activities that are sent from an unrelated email account may be &#039;&#039;disregarded&#039;&#039; (not taken up) by our help desk staff, for obvious reasons.&lt;br /&gt;
## Fill in your &#039;&#039;name&#039;&#039; and &#039;&#039;badge number&#039;&#039; in the email template that opens, then send the email.&lt;br /&gt;
&amp;lt;!-- ## Fill in the email template.&lt;br /&gt;
##: If you have a user name at your institution that you are happy with it, supply that name as the first of three name preferences. This will make it simpler to configure your network connections to the cluster.&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&amp;lt;!-- ## Check your &#039;&#039;&#039;From:&#039;&#039;&#039; address again.&lt;br /&gt;
##: The email address you send from must match your User Registration, see above.&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&amp;lt;!-- # Request user names that have:&lt;br /&gt;
#* Lowercase letters &#039;&#039;&#039;a–z&#039;&#039;&#039;, at most 8.&lt;br /&gt;
#* At most 2 numerals &#039;&#039;&#039;0–9&#039;&#039;&#039;, preferably none.&lt;br /&gt;
#* &#039;&#039;&#039;No&#039;&#039;&#039; punctuation, including none of &amp;lt;code&amp;gt;.&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;-&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;_&amp;lt;/code&amp;gt;, and no other special characters like &amp;lt;code&amp;gt;@,;:%&amp;amp;amp;+*=()[]{}\|/&amp;amp;lt;&amp;amp;gt;#&#039;&amp;quot;`~!$^&amp;lt;/code&amp;gt;.&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
# &#039;&#039;&#039;Await an emailed ticket number&#039;&#039;&#039; from Argonne&#039;s service desk, or &#039;&#039;&#039;follow the instructions of the person&#039;&#039;&#039; you called.&lt;br /&gt;
#* Ticket numbers are assigned upon manual review, typically within an hour or so during business hours.&lt;br /&gt;
#* If you &#039;&#039;&#039;did not get a ticket number&#039;&#039;&#039; after such reasonable time, re-send the request, making sure you do so &#039;&#039;from the email account you provided at User Registration&#039;&#039;. &amp;lt;!-- [mailto:cnm_useroffice@anl.gov?subject=User%20name%20change%20request ask the CNM User Office] to review. --&amp;gt;&lt;br /&gt;
# Check your email for follow-up questions and respond.&lt;br /&gt;
# Await the completion notice for your user name change.&lt;br /&gt;
&lt;br /&gt;
=== Next steps ===&lt;br /&gt;
&#039;&#039;Carbon&#039;&#039; access &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;&#039;&#039;is not immediately enabled&#039;&#039;&amp;lt;/font&amp;gt; once your user name change request has been completed – it is a separate process.&lt;br /&gt;
# Expect an email that your &#039;&#039;Carbon&#039;&#039; access has been granted.&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
# Follow the instructions in that email to learn [[HPC/Network Access|&#039;&#039;&#039;how to log in&#039;&#039;&#039;]] and where to find further documentation&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
# Proceed under [[#Carbon account and access]].&lt;br /&gt;
&lt;br /&gt;
== Proposal troubleshooting ==&lt;br /&gt;
&#039;&#039;&#039;Email the [mailto:cnm_useroffice@anl.gov?subject=Proposal%20Question CNM User Office]&#039;&#039;&#039; with any questions or concerns, such as:&lt;br /&gt;
* about proposals,&lt;br /&gt;
* about users, or&lt;br /&gt;
* you find that responding to any of your submissions or previous communications takes longer than a few business days.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Only our User Office staff&#039;&#039;&#039; is able to review all aspects of your proposal or your user access requirements, and determine any steps that have yet to be taken or need to be refreshed.&lt;br /&gt;
&lt;br /&gt;
Include in your message:&lt;br /&gt;
* Proposal number(s),&lt;br /&gt;
* Name of the Principal Investigator (PI),&lt;br /&gt;
* Names and badge numbers of participants.&lt;br /&gt;
&lt;br /&gt;
== Ongoing user access requirements ==&lt;br /&gt;
For you to log into Carbon and its SSH gateway, a number of criteria must be met, most of which are subject to &#039;&#039;&#039;expiration dates&#039;&#039;&#039; and &#039;&#039;&#039;require action from you for renewal&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
You will &#039;&#039;not&#039;&#039; get notified (for various reasons) on some of these expirations.&lt;br /&gt;
Different duration terms may cause expirations to happen right in the middle of your proposal&#039;s lifecycle and can cause immediate inconvenience.&lt;br /&gt;
Depending on which criterion expired, one or both of the following will happen to your Argonne computer account:&lt;br /&gt;
* The account&#039;s permission to use {{sshgw}} will be revoked.&lt;br /&gt;
* The account &#039;&#039;as such&#039;&#039; will be disabled, equivalent to revoking all its permissions.&lt;br /&gt;
&lt;br /&gt;
To recover, do one or more of the following:&lt;br /&gt;
&lt;br /&gt;
=== User Registration ===&lt;br /&gt;
# Review and update your [https://beam.aps.anl.gov/pls/apsweb/ufr_main_pkg.usr_start_page &#039;&#039;&#039;User Registration.&#039;&#039;&#039;]&lt;br /&gt;
#* For this system, log in  with your &#039;&#039;badge number&#039;&#039; and the password associated with it, not your regular Argonne account – see section [[#Account Types]] above.&lt;br /&gt;
#* The registration itself requires renewal at least every 2 years, or earlier when any one of various prerequisite items expires.&lt;br /&gt;
#* For &#039;&#039;&#039;non-US citizens&#039;&#039;&#039; present in the US: Review and update registration items regarding your &#039;&#039;&#039;US visa&#039;&#039;&#039; or related work permit. A current US work or study status is required to access Argonne computers, the same as if you were to visit in person.&lt;br /&gt;
# Ask our [mailto:cnm_useroffice@anl.gov?subject=Reinstate%20user%20account CNM User Office] staff to review your registration updates and to recreate or re-instate your Argonne account, as the case might be.&lt;br /&gt;
&lt;br /&gt;
=== Legal User Agreement ===&lt;br /&gt;
* If you &#039;&#039;&#039;changed your affiliation&#039;&#039;&#039; (the institution where you work or study), check to see if your new institution has a legal [https://aps.anl.gov/Users-Information/Legal-Financial/Argonne-User-Facility-Agreements &#039;&#039;&#039;User Facility Agreement&#039;&#039;&#039;] with Argonne in place and request one if not.&lt;br /&gt;
*: Be advised that the process may take several weeks to percolate through legal and adminstrative channels.&lt;br /&gt;
&lt;br /&gt;
=== Training ===&lt;br /&gt;
*Review and renew your [http://beam.aps.anl.gov/pls/apsweb/rt0004.intro_process &#039;&#039;&#039;User Courses.&#039;&#039;&#039;]&lt;br /&gt;
*: For remote users, the ESH223 course &amp;quot;Cybersecurity Annual Education and Awareness&amp;quot; is the one most likely to be in need of renewal.&lt;br /&gt;
&lt;br /&gt;
=== Password ===&lt;br /&gt;
* Review and update the [[#Verify or change your password|&#039;&#039;&#039;password&#039;&#039;&#039;]] to your Argonne computer account  if you now have or previously had such an account.&lt;br /&gt;
*: If your account&#039;s password expired, we consider the account dormant and &#039;&#039;will not notify you about new proposals&#039;&#039; where you are listed as a participant.&lt;br /&gt;
&lt;br /&gt;
=== Active proposal ===&lt;br /&gt;
You must be a participant in at least &#039;&#039;&#039;one active or recently expired [https://www.anl.gov/cnm/become-a-cnm-user User Proposal]&#039;&#039;&#039;.&lt;br /&gt;
You may run compute jobs under a given proposal while it is active, i.e., within the dates stated in the proposal&#039;s User Work Approval (UWA).&lt;br /&gt;
* To review the dates for your proposals, ask your PI to search their email archive for subjects &#039;&#039;&amp;quot;Work Approval Received&amp;quot;&#039;&#039; or &#039;&#039;&amp;quot;Proposal Expiration&amp;quot;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
=== Data-only access for inactive proposals ===&lt;br /&gt;
After your last active proposal on Carbon has expired you may still access,  for &#039;&#039;&#039;up to 30 days&#039;&#039;&#039;, the SSH gateway and Carbon&#039;s login nodes.&lt;br /&gt;
Past that time window, your access will be revoked and &#039;&#039;&#039;your data may be deleted&#039;&#039;&#039;, following [https://www.anl.gov/cnm/complete-your-work-at-cnm &#039;&#039;&#039;CNM&#039;s Data Retention Policy&#039;&#039;&#039;]. &lt;br /&gt;
&lt;br /&gt;
* While you still have access, offload from Carbon all your files and data that you may wish to keep.&lt;br /&gt;
*: The CNM cannot be expected or held responsible to store your data beyond your access window.&lt;br /&gt;
&lt;br /&gt;
=== Practical hints ===&lt;br /&gt;
* Set yourself &#039;&#039;&#039;calendar entries&#039;&#039;&#039; about one year into the future to remind yourself to renew any of your user registration or training requirements.&lt;br /&gt;
* After you were added to a user proposal, &#039;&#039;&#039;wait at least an hour or more&#039;&#039;&#039; before trying to access our SSH gateway, preferably until the next morning.&lt;br /&gt;
*: Updates of your status need to be propagated through a handful of systems, each being done about hourly, so it may take several cycles for your status change to reach {{sshgw}}.&lt;br /&gt;
&lt;br /&gt;
== Login issues ==&lt;br /&gt;
When you ask &amp;quot;I cannot log in&amp;quot; or &amp;quot;My password does not work&amp;quot;, consider the following sections:&lt;br /&gt;
&lt;br /&gt;
=== Review your access requirements ===&lt;br /&gt;
See section [[#Ongoing user access requirements]] above.&lt;br /&gt;
&lt;br /&gt;
=== Verify or change your password ===&lt;br /&gt;
Do &#039;&#039;&#039;one of the following:&#039;&#039;&#039;&lt;br /&gt;
* Visit &#039;&#039;&#039;https://servicenow.anl.gov/pr&#039;&#039;&#039; &amp;lt;!-- . Mnemonic: &amp;quot;pr&amp;quot; stands for &#039;&#039;&#039;p&#039;&#039;&#039;assword &#039;&#039;&#039;r&#039;&#039;&#039;eset). --&amp;gt;&lt;br /&gt;
** Complete the &#039;&#039;Password Enrollment&#039;&#039; process at this service on your first visit when you &#039;&#039;know&#039;&#039; your password. You will be (or have been) thus instructed when your account has been created.&lt;br /&gt;
** You can &#039;&#039;verify&#039;&#039; or &#039;&#039;change&#039;&#039; your existing known password.&lt;br /&gt;
** You can &#039;&#039;reset&#039;&#039; or &#039;&#039;unlock&#039;&#039; your password &#039;&#039;&#039;only&#039;&#039;&#039; after you enrolled.&lt;br /&gt;
&amp;lt;!-- #*: With enrollment completed, you can later reset your password, and also [[#Password lockouts|unlock your account]] in case it has been blocked after too many incorrect password attempts. --&amp;gt;&lt;br /&gt;
** You cannot use this service if your account has been &#039;&#039;disabled&#039;&#039; as such, in which case revisit the section [[#Ongoing user access requirements]].&lt;br /&gt;
* You can &#039;&#039;change&#039;&#039; your &#039;&#039;known&#039;&#039; password also at our SSH gateway host &amp;lt;code&amp;gt;mega&amp;lt;/code&amp;gt;.&lt;br /&gt;
&amp;lt;!-- ** You will be asked to update an expired password upon logging in. --&amp;gt;&lt;br /&gt;
** At least one of your CNM proposals must still be active.&lt;br /&gt;
** You cannot log in if your account is &#039;&#039;disabled&#039;&#039; as such.&lt;br /&gt;
: Error messages for login failures will not disclose a specific reason. You cannot tell if merely your password was wrong or your account is disabled.&lt;br /&gt;
* If you cannot use any of the above systems:&lt;br /&gt;
** request a [mailto:help@anl.gov?subject=Password%20reset password reset at the Argonne Service Desk], or&lt;br /&gt;
** request a [mailto:cnm_useroffice@anl.gov?subject=Requesting%20password%20reset password reset from the CNM User Office].&lt;br /&gt;
&amp;lt;!--# &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;Visit our older account profile service, being phased out in early 2021: &#039;&#039;&#039;https://mypassword.anl.gov/&#039;&#039;&#039;.&lt;br /&gt;
** You must have previously completed an Argonne Account Profile at this service.&lt;br /&gt;
** Profiles from this service were not transferred to our current account service above.&amp;lt;/font&amp;gt; --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After a password update, you should be able to connect to {{sshgw}} normally.&lt;br /&gt;
If you find that you cannot log in, however, retry only &#039;&#039;&#039;after an hour or two&#039;&#039;&#039;, as in some cases extra time is needed for passwords or other account changes to propagate.&lt;br /&gt;
&lt;br /&gt;
=== Password lockouts ===&lt;br /&gt;
After trying incorrect passwords several times, your account may be &#039;&#039;&#039;temporarily locked out.&#039;&#039;&#039; To recover, try one of the following:&lt;br /&gt;
* Wait &#039;&#039;&#039;approximately 30 min.&#039;&#039;&#039;&lt;br /&gt;
* Unlock at &#039;&#039;&#039;https://servicenow.anl.gov/pr&#039;&#039;&#039; – available if you have previously enrolled there.&lt;br /&gt;
&lt;br /&gt;
=== Review host names ===&lt;br /&gt;
Connect to the correct host names:&lt;br /&gt;
* When connecting from outside Argonne, at least &#039;&#039;two ssh sessions&#039;&#039; are required.&lt;br /&gt;
** {{sshgw|fqdn}} – an ssh &amp;quot;tunnel setup&amp;quot; connection.&lt;br /&gt;
** {{host|carbon}} – one or more &amp;quot;payload&amp;quot; connections for the ssh, scp, or sftp commands. Here, {{host|carbon}} is not a hostname but an entry in your ssh configuration that you must make (called a host alias or &amp;quot;profile&amp;quot;, depending on the ssh application). The entry stands for a connection to localhost (your machine), at a port number forwarded by the preceding tunnel setup connection.&lt;br /&gt;
* When onsite (for any user) or using VPN (for Argonne staff):&lt;br /&gt;
** {{host|carbon.cnm.anl.gov}}. The previous name was {{host|clogin. …}}.&lt;br /&gt;
To learn more, read [[HPC/Network Access]].&lt;br /&gt;
&lt;br /&gt;
=== Review network configuration ===&lt;br /&gt;
* Read again [[HPC/Network Access]], and follow the instructions for your platform.&lt;br /&gt;
&lt;br /&gt;
=== Request support ===&lt;br /&gt;
* If the above sections did not help you to resolve your issue, [[HPC/Support|submit a support request]].&lt;br /&gt;
&lt;br /&gt;
== Expected files or commands are unavailable ==&lt;br /&gt;
When you cannot create or edit files or directories under your home directory, or you find that commands you expect are not found, then:&lt;br /&gt;
&lt;br /&gt;
# Inspect the beginning of your command line, called the &#039;&#039;prompt&#039;&#039;:&lt;br /&gt;
#* If your prompt mentions &amp;quot;@mega&amp;quot; or &amp;quot;GATEWAY&amp;quot;, e.g.:&lt;br /&gt;
#:: &amp;lt;code&amp;gt;&#039;&#039;username&#039;&#039;&amp;lt;font color=&amp;quot;brown&amp;quot;&amp;gt;&#039;&#039;&#039;@mega5 CNM-GATEWAY&#039;&#039;&#039;&amp;lt;/font&amp;gt; $ &amp;lt;/code&amp;gt;&lt;br /&gt;
#: then you are working &#039;&#039;&#039;not on Carbon just yet&#039;&#039;&#039;, but rather on its SSH gateway. Visit [[HPC/Network_Access]] to learn how to connect properly.&lt;br /&gt;
#* If the prompt mentions &amp;quot;@login&amp;quot;, e.g.:&lt;br /&gt;
#:: &amp;lt;code&amp;gt;&#039;&#039;username&#039;&#039;&amp;lt;font color=&amp;quot;brown&amp;quot;&amp;gt;&#039;&#039;&#039;@login6&#039;&#039;&#039;&amp;lt;/font&amp;gt; … $&amp;lt;/code&amp;gt;&lt;br /&gt;
#: then there may be a temporary file system issue which may resolve after a few minutes.&lt;br /&gt;
#: If such issue persists or recurs over several hours, however, read the message that will have appeared right after you logged in, above the first command prompt. To locate these messages, scroll up the content of your terminal application window, or log out and log back in to bring up these messages again.&lt;br /&gt;
&lt;br /&gt;
=== My home directory is read-only ===&lt;br /&gt;
=== I cannot edit my .bashrc file ===&lt;br /&gt;
=== Expected commands unavailable ===&lt;br /&gt;
In all these situations, see [[#Expected files or commands are unavailable | the beginning of the current section]].&lt;br /&gt;
&lt;br /&gt;
== Mailing lists ==&lt;br /&gt;
Announcements about Carbon are made on the [https://lists.anl.gov/mailman/listinfo/cnm-hpc-announce &#039;&#039;cnm-hpc-announce&#039;&#039; mailing list], hosted at Argonne.&lt;br /&gt;
The mailing list home page and its archive are, unfortunately, only accessible from onsite or (for authorized users) over VPN.&lt;br /&gt;
&lt;br /&gt;
* To &#039;&#039;&#039;unsubscribe&#039;&#039;&#039; from the mailing list, do one of the following:&lt;br /&gt;
*# Open the &amp;quot;unsubscribe&amp;quot; link at the bottom of a recent message that you received from the mailing list.&lt;br /&gt;
*# Send a blank message to [mailto:cnm-hpc-announce-leave@lists.anl.gov cnm-hpc-announce&#039;&#039;&#039;-leave&#039;&#039;&#039;@lists.anl.gov] and follow up on the confirmation notice.&lt;br /&gt;
* To &#039;&#039;&#039;subscribe&#039;&#039;&#039; to the mailing list, send a blank message to [mailto:cnm-hpc-announce-join@lists.anl.gov cnm-hpc-announce&#039;&#039;&#039;-join&#039;&#039;&#039;@lists.anl.gov] and follow up on the confirmation notice.&lt;br /&gt;
* To &#039;&#039;&#039;change your email address&#039;&#039;&#039; on the list, simply do both of the above, in order.&lt;br /&gt;
&lt;br /&gt;
; Hints:&lt;br /&gt;
* When sending commands by email, be sure to have the relevant email account selected in the &amp;quot;From&amp;quot; line of the compose window in your email application.&lt;br /&gt;
* Inspect the &#039;&#039;&#039;Junk&#039;&#039;&#039; mail folder of your email application if you do not receive a confirmation message for subscribing or unsubscribing within a minute or so.&lt;br /&gt;
* See the [http://www.gnu.org/software/mailman/mailman-member/node22.html GNU Mailman] documenation for background.&lt;br /&gt;
&lt;br /&gt;
== Applications ==&lt;br /&gt;
&lt;br /&gt;
=== I&#039;d like to use application X ===&lt;br /&gt;
; Check if the application is already available on Carbon:&lt;br /&gt;
Either:&lt;br /&gt;
* Browse the [[HPC/Applications | Application Catalog]], or&lt;br /&gt;
* View the catalog on the Carbon command line:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
module avail&lt;br /&gt;
module -l avail 2&amp;gt;&amp;amp;1 | less&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
: The second form gives you browsable output.&lt;br /&gt;
&lt;br /&gt;
; If you cannot find the application on Carbon:&lt;br /&gt;
* Submit a [[HPC/Support| support request]].&lt;br /&gt;
** Provide one or more &#039;&#039;URLs&#039;&#039; relevant to software you have in mind – be specific.&lt;br /&gt;
** Describe &#039;&#039;the problem&#039;&#039; you are trying to solve – it may well be that we can suggest an alternative solution.&lt;br /&gt;
** Give the extent of your planned use.&lt;br /&gt;
; If you see the application on Carbon but you cannot access it:&lt;br /&gt;
* Existing license agreements may cover only a subset of users (typically Argonne employees).&lt;br /&gt;
* If you feel you are eligible, submit a [[HPC/Support| support request]].&lt;br /&gt;
; If a version newer than the installed one on Carbon is available :&lt;br /&gt;
* Submit a [[HPC/Support| support request]].&lt;br /&gt;
* Include a URL to information about the new version.&lt;br /&gt;
&lt;br /&gt;
===How do I run application X? ===&lt;br /&gt;
* [[HPC/Module Setup#Shell Customizations|Customize your shell environment]] to load the application module.&lt;br /&gt;
* Learn about [[HPC/Module Setup#Module Conventions on Carbon | module conventions on Carbon]].&lt;br /&gt;
* To determine the names of a package&#039;s executable scripts and binaries, load the application module (if you have not yet done so in your shell setup), then inspect the module&#039;s &amp;lt;code&amp;gt;$&#039;&#039;NAME&#039;&#039;_HOME/bin&amp;lt;/code&amp;gt; directory. For instance, for the Quantum-ESPRESSO package:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
module load quantum_espresso&lt;br /&gt;
ls $QUANTUM_ESPRESSO_HOME/bin&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
* Learn how to [[HPC/Submitting and Managing Jobs | submit and manage jobs]].&lt;br /&gt;
&lt;br /&gt;
=== How do I &#039;&#039;use&#039;&#039; application X? ===&lt;br /&gt;
Read the package&#039;s documentation, using one or more of the following:&lt;br /&gt;
* Inspect the package&#039;s &amp;lt;code&amp;gt;$&#039;&#039;NAME&#039;&#039;_HOME/share&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;$&#039;&#039;NAME&#039;&#039;_HOME/doc&amp;lt;/code&amp;gt; directory on Carbon (see [[HPC/Module Setup#Module Conventions on Carbon | module conventions]]).&lt;br /&gt;
* Browse the package&#039;s web page, generally mentioned in the &amp;lt;code&amp;gt;module help&amp;lt;/code&amp;gt; text or the  [[HPC/Applications | application catalog]] entry.&lt;br /&gt;
* Consult a package&#039;s man pages. Few packages have them. Man page files are generally installed under &amp;lt;code&amp;gt;$&#039;&#039;NAME&#039;&#039;_HOME/man&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;$&#039;&#039;NAME&#039;&#039;_HOME/share/man&amp;lt;/code&amp;gt; and if so, will be made available automatically to the &amp;lt;code&amp;gt;man&amp;lt;/code&amp;gt; command.&lt;br /&gt;
&lt;br /&gt;
== What&#039;s my account balance? ==&lt;br /&gt;
=== Simple answer: mybalance ===&lt;br /&gt;
To find out how many core-hours you have available, the simplest command to run is:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mybalance -h&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
 Project  Machines Balance    &lt;br /&gt;
 -------- -------- ---------- &lt;br /&gt;
 user     ANY         993.26&lt;br /&gt;
 cnm34567 ANY       158760.93&lt;br /&gt;
 cnm31234 ANY      -148893.62&lt;br /&gt;
The table gives all the &amp;lt;code&amp;gt;Project&amp;lt;/code&amp;gt;s you have access to (for use with the &amp;lt;code&amp;gt;qsub -A&amp;lt;/code&amp;gt; argument), and their balance.&lt;br /&gt;
&amp;lt;code&amp;gt;Machine&amp;lt;/code&amp;gt; lists all systems that  can book jobs against your allocations. &#039;&#039;Carbon&#039;&#039; is currently the only machine that can do so.&lt;br /&gt;
&amp;lt;code&amp;gt;Balance&amp;lt;/code&amp;gt; is your account balance, in &#039;&#039;core-hours&#039;&#039;, as selected by the -h command option. This is the most useful and recommended unit.&lt;br /&gt;
Without -h, you get core-seconds, which are integers but rather more unwieldy numbers.&lt;br /&gt;
* The &amp;quot;user&amp;quot; project provides you with a small initial startup allocation of typically 1000 core-hours.&lt;br /&gt;
* When a Balance is reported as negative, that account typically has a CreditLimit assigned, which permits the balance to dip below zero. These details, however, are not shown by &amp;lt;code&amp;gt;mybalance&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Complete answer: gbalance ===&lt;br /&gt;
To get allocation details for accounts that have CreditLimits, run the &amp;lt;code&amp;gt;gbalance&amp;lt;/code&amp;gt; command. Pass on -u &#039;&#039;username&#039;&#039; or &#039;&#039;-p projectname&#039;&#039; to select your allocations:&lt;br /&gt;
 gbalance -h -u $USER&lt;br /&gt;
: Type &amp;lt;code&amp;gt;$USER&amp;lt;/code&amp;gt; &#039;&#039;as shown&#039;&#039;. The command interpreter will fill in your actual username.&lt;br /&gt;
The ouput looks like:&lt;br /&gt;
 Id  Name     Amount     Reserved Balance    CreditLimit &#039;&#039;&#039;Available&#039;&#039;&#039;&lt;br /&gt;
 --- -------- ---------- -------- ---------- ----------- --------- &lt;br /&gt;
 100 cnm31234 -148893.62     0.00 -148893.62   150000.00   &#039;&#039;&#039;1106.38&#039;&#039;&#039;&lt;br /&gt;
 217 kpelzer      993.26     0.00     993.26        0.00    993.26 &lt;br /&gt;
 123 cnm34567  166440.93  7680.00  158760.93        0.00 158760.93 &lt;br /&gt;
The most relevant column for you is &#039;&#039;&#039;Available&#039;&#039;&#039;. The units, given the -h option, are again core-hours.&lt;br /&gt;
&lt;br /&gt;
The colums and their meanings are:&lt;br /&gt;
; Id: an internal number for the account.&lt;br /&gt;
; Name: The project name (for use with &amp;lt;code&amp;gt;qsub -A&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;#PBS -A&amp;lt;/code&amp;gt;).&lt;br /&gt;
; Amount: Amount for transactions completely on the books for the project account; does not include running jobs or credits. Deposits are allocated by the User Office and implemented by the Carbon administrator.&lt;br /&gt;
; Reserved: Amounts held in reserve by all running jobs using this account. The reserve ensures that a job does not cause an overdraft when it finishes and when its actual use will be booked. The quantity is calculated by walltime * number of cores blocked. When a job terminates, the charge according to the actual time used will be &#039;&#039;subtracted&#039;&#039; from Amount, and the unused quantities will be &#039;&#039;re-added&#039;&#039; to Available.&lt;br /&gt;
; Balance: Available for new jobs; may go negative if CreditLimits are in place.&lt;br /&gt;
 Balance = Amount - Reserved&lt;br /&gt;
; CreditLimit: Amount by which Balance may go negative; assigned by the Carbon administrator.&lt;br /&gt;
; Available: Relevant quantity for new jobs. Must be positive for a new job to start, and large enough to Reserve the entire job.&lt;br /&gt;
 Available = Balance + CreditLimit&lt;br /&gt;
&lt;br /&gt;
== Why did my account balance suddenly drop? ==&lt;br /&gt;
The compute time physically available by Carbon&#039;s processors is a &amp;quot;perishable&amp;quot; resource — CPU-hours pass by regardless of being used or not.&lt;br /&gt;
Therefore, your allocations are time-restricted in a &amp;quot;use-it-or-lose-it&amp;quot; manner.&lt;br /&gt;
This is done to encourage consistent use of the machine throughout allocation cycles.&lt;br /&gt;
&lt;br /&gt;
Otherwise, resource contention becomes likely near the end of an allocation cycle, one year after each bunch of proposals has started, during which it would be increasingly impractical and eventually physically impossible to use up a large remaining allocation within a short time.&lt;br /&gt;
You would need to claim a large fraction of Carbon&#039;s nodes during a relatively short time window, which is unlikely to be possible because jobs from other users will be running as well.&lt;br /&gt;
&lt;br /&gt;
=== Allocation expiration schedule ===&lt;br /&gt;
Unused allocations &#039;&#039;will expire&#039;&#039;, following to schedule:&lt;br /&gt;
* Your allocation is provided in three equal-sized installments.&lt;br /&gt;
* All installments are active from the beginning.&lt;br /&gt;
* Installments &#039;&#039;expire&#039;&#039; in a staggered fashion, currently after 4, 8, and 12 months, respectively. A diagram might illuminate this:&lt;br /&gt;
 &lt;br /&gt;
     Proposal                Proposal&lt;br /&gt;
      start                 expiration&lt;br /&gt;
        |-------|-------|-------|------&amp;gt; Time    &lt;br /&gt;
        0       4       8       12      (months)&lt;br /&gt;
        |&lt;br /&gt;
 Installment&lt;br /&gt;
        |&lt;br /&gt;
     (1)|########....................               KEY&lt;br /&gt;
        |                            &lt;br /&gt;
     (2)|################............               .  Installment is inactive&lt;br /&gt;
        |                            &lt;br /&gt;
     (3)|########################....               #  Installment is active&lt;br /&gt;
        |&lt;br /&gt;
 &lt;br /&gt;
* Your jobs will, sensibly, be booked against the installments that expire the earliest.&lt;br /&gt;
&lt;br /&gt;
== My question is not answered here ==&lt;br /&gt;
See [[HPC/Support]].&lt;/div&gt;</summary>
		<author><name>Stern</name></author>
	</entry>
	<entry>
		<id>https://wiki.anl.gov/wiki_cnm/index.php?title=HPC/FAQ&amp;diff=7472</id>
		<title>HPC/FAQ</title>
		<link rel="alternate" type="text/html" href="https://wiki.anl.gov/wiki_cnm/index.php?title=HPC/FAQ&amp;diff=7472"/>
		<updated>2025-09-19T17:14:25Z</updated>

		<summary type="html">&lt;p&gt;Stern: /* Verify or change your password */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Access and proposals ==&lt;br /&gt;
The HPC &#039;&#039;Carbon&#039;&#039; cluster and its associated software licenses may be accessed,&lt;br /&gt;
like any tool at the CNM, by one or both of the following routes:&lt;br /&gt;
* CNM Facility Users are eligible under [https://www.anl.gov/cnm/become-a-cnm-user &#039;&#039;&#039;CNM&#039;s User Access Program&#039;&#039;&#039;]. Follow the link to learn how to initiate access under this route. Begin by registering as Facility User, then submit a proposal.&lt;br /&gt;
* Affiliates of [http://www.anl.gov/cnm Argonne&#039;s NST division] are eligible for discretionary access. Affiliate here refers to regular employees, Argonne/University joint appointees, visitor appointees, and student group members, being supervised by CNM staff.&lt;br /&gt;
&lt;br /&gt;
The following is a summary of the main points as they pertain to &#039;&#039;Carbon&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
=== Legal User Agreement ===&lt;br /&gt;
The institution where you work or study must have a legal signed&lt;br /&gt;
[https://www.anl.gov/cnm/prepare-for-your-arrival &#039;&#039;&#039;User Facility Agreement&#039;&#039;&#039;]&lt;br /&gt;
with Argonne in place before any work under an eventual proposal may be performed.&lt;br /&gt;
&lt;br /&gt;
[https://aps.anl.gov/Users-Information/Legal-Financial/Argonne-User-Facility-Agreements &#039;&#039;&#039;Look up existing User Facility Agreements&#039;&#039;&#039;] and locate your institution if you have never worked with Argonne before, or you recently changed your affiliation, or are going to change it soon.&lt;br /&gt;
&lt;br /&gt;
If your institution is not shown, &#039;&#039;get started&#039;&#039; with establishing a user agreement as soon as possible. Legal wheels turn slowly and your scientific work could be delayed.&lt;br /&gt;
&lt;br /&gt;
=== User Registration ===&lt;br /&gt;
Under CNM&#039;s User Access Program, your starting point is to [https://www.anl.gov/cnm/how-to-register-to-become-a-cnm-user &#039;&#039;&#039;become a CNM user&#039;&#039;&#039;].&lt;br /&gt;
&lt;br /&gt;
=== Proposal Lifecycle Overview ===&lt;br /&gt;
&amp;lt;!-- http://www.anl.gov/cnm/user-information/call-proposals --&amp;gt;&lt;br /&gt;
# To &#039;&#039;&#039;submit a proposal&#039;&#039;&#039;, follow the instructions at the CNM&#039;s [https://www.anl.gov/cnm/cnm-user-information &#039;&#039;&#039;Call for Proposals&#039;&#039;&#039;].&lt;br /&gt;
# Upon successful review of a proposal and grant of an allocation, &#039;&#039;&#039;the contacting author&#039;&#039;&#039; will receive an email with subject &#039;&#039;&#039;User Proposal Status Notification&#039;&#039;&#039;.&lt;br /&gt;
# &#039;&#039;&#039;The contacting author must submit,&#039;&#039;&#039; for each proposal, a Safety&amp;amp;Data Form as instructed in the status email. This will confirm the names and badge numbers of participating users, as well as various characteristics of the proposal that we need for statistical reporting to our funding agencies.&lt;br /&gt;
# Participating &#039;&#039;&#039;users register and respond&#039;&#039;&#039; at various steps to have their Argonne user accounts created, activated or reactivated as needed, and have them authorized to access Carbon. &lt;br /&gt;
# Participating users &#039;&#039;&#039;perform the work proposed&#039;&#039;&#039;.&lt;br /&gt;
# [https://www.anl.gov/cnm/cnm-acknowledgment-statements-for-publications &#039;&#039;&#039;Credit CNM in publications&#039;&#039;&#039;] that result from your proposal work with us.&lt;br /&gt;
# After the proposal expires, our User Office will ask you to please submit:&lt;br /&gt;
#* An approximately 1-page &#039;&#039;&#039;Activity Report&#039;&#039;&#039; summarizing work performed and perhaps already published under the proposal. We use these reports to document the use of our facilities to funding agencies.&lt;br /&gt;
#* An end-of-proposal &#039;&#039;&#039;Satisfaction Survey&#039;&#039;&#039;, to invite your feedback on our process.&lt;br /&gt;
&lt;br /&gt;
== Account Types ==&lt;br /&gt;
You access our computer systems by two different user accounts:&lt;br /&gt;
&lt;br /&gt;
=== User Registration Account ===&lt;br /&gt;
: – Looks like: &amp;lt;code&amp;gt;123456&amp;lt;/code&amp;gt; –&amp;lt;br&amp;gt;&lt;br /&gt;
Your &#039;&#039;User Registration Account:&#039;&#039;&lt;br /&gt;
* … is created when you register as CNM facility user, be it as participant or as Principal Investigator (PI), at the [https://beam.aps.anl.gov/pls/apsweb/ufr_main_pkg.usr_start_page &#039;&#039;&#039;User Registration&#039;&#039;&#039;] for the Advanced Photon Source (APS) and CNM.&lt;br /&gt;
* … has an all-numeric user name (no letters, no leading zeroes), which never changes – this is in fact your &#039;&#039;Argonne Badge Number&#039;&#039;,&lt;br /&gt;
* … has its own password and [https://beam.aps.anl.gov/pls/apsweb/forgot_password.start_process &#039;&#039;&#039;password reset process at APS&#039;&#039;&#039;],&lt;br /&gt;
&lt;br /&gt;
Use your User Registration Account to:&lt;br /&gt;
* … [https://beam.aps.anl.gov/pls/apsweb/ufr_main_pkg.usr_start_page &#039;&#039;&#039;update your user registration&#039;&#039;&#039;], such as when you change your affiliation, or to update visa information if Argonne needs them for you,&lt;br /&gt;
* … [https://pico.cnm.anl.gov/proposals/people/login &#039;&#039;&#039;submit a user proposal to CNM&#039;&#039;&#039;]&lt;br /&gt;
* … [https://beam.aps.anl.gov/pls/apsweb/rt0004.intro_process &#039;&#039;&#039;take remote training&#039;&#039;&#039;] prior to beginning work, and prior to being assigned an Argonne domain account, which is described next.&lt;br /&gt;
&lt;br /&gt;
=== Argonne Domain Account ===&lt;br /&gt;
: – Looks like: &amp;lt;code&amp;gt;&#039;&#039;&#039;b&#039;&#039;&#039;&#039;&#039;123456&#039;&#039;&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&#039;&#039;jsmith&#039;&#039;&amp;lt;/code&amp;gt; –&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Your &#039;&#039;Argonne Domain Account:&#039;&#039;&lt;br /&gt;
* … is created &#039;&#039;&#039;when you first need it&#039;&#039;&#039;, such as when you are a PI and have received the go-ahead on your first proposal with us,&lt;br /&gt;
* … has, at first, a user name beginning with &amp;lt;code&amp;gt;&#039;&#039;&#039;b&#039;&#039;&#039;&amp;lt;/code&amp;gt;, followed by your badge number (without any leading zeroes),&lt;br /&gt;
* … will get, following your request, a personalized user name, such as &amp;lt;code&amp;gt;&#039;&#039;jsmith&#039;&#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
* … has its own password and uses its own [https://mypassword.anl.gov/ &#039;&#039;&#039;password reset and recovery&#039;&#039;&#039;].  &amp;lt;!-- Redirects to https://servicenow.anl.gov/pr --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Use your Argonne Domain Account to:&lt;br /&gt;
* … submit the &#039;&#039;&#039;Safety&amp;amp;Data Form (UWS)&#039;&#039;&#039; of each proposal for which you are the PI or delegated spokesperson,&lt;br /&gt;
* … perform work – always remotely – at [[HPC|CNM&#039;s &#039;&#039;&#039;High Performance Computing system &#039;&#039;Carbon&#039;&#039;&#039;&#039;&#039;]], &amp;lt;!-- , where you will typically run Linux terminal commands. This account&#039;s user name never begins with a number. --&amp;gt;&lt;br /&gt;
* … handle almost all other tasks at Argonne.&lt;br /&gt;
&lt;br /&gt;
For assistance, please contact our [mailto:cnm_useroffice@anl.gov?subject=Account%20Question CNM User Office]. – Specify &#039;&#039;which task&#039;&#039; you have difficulties with.&lt;br /&gt;
&lt;br /&gt;
== Getting started on a proposal ==&lt;br /&gt;
&amp;lt;!-- We will have notify the proposal spokesperson (usually the Principal Investigator,PI) once a proposal has been approved. At this point, … --&amp;gt;&lt;br /&gt;
To start working on a proposal once it has been granted, &#039;&#039;&#039;action is required for each proposal&#039;&#039;&#039; by the proposal spokesperson (usually the Principal Investigator,PI), regardless of any previous proposals with us.&lt;br /&gt;
At this stage, we collect and update information about each proposal for reporting purposes to our funding agencies, and ensure that safety and training requirements are met by all participating users.&lt;br /&gt;
&lt;br /&gt;
=== To get started as spokesperson or delegate ===&lt;br /&gt;
# Locate the email to you with subject &#039;&#039;User Proposal Status Notification&#039;&#039;, sent by the CNM User Office.&lt;br /&gt;
#* If you are delayed in starting your proposal, you may need to expand your mailbox search time frame, to begin the search at possibly several months before present.&lt;br /&gt;
#* You may need to inspect the &amp;quot;Junk&amp;quot; or &amp;quot;Spam&amp;quot; folder of your mail application.&lt;br /&gt;
# Follow the instructions in that email.&lt;br /&gt;
#* Certain steps are needed only once because they pertain to your institution, notably filing a User Agreement.&lt;br /&gt;
#* Before work on a new proposal may begin, we may ask you to submit &#039;&#039;Activity Reports&#039;&#039; that are due for previous proposals upon their conclusion.&lt;br /&gt;
#* Fill in the &#039;&#039;Safety and Data form&#039;&#039;, i.e., follow the &#039;&#039;User Work Submittal&#039;&#039; (UWS) link that is given in our notification email.&lt;br /&gt;
#:* Only the spokesperson may fill in the UWS form, or the PI may [mailto:cnm_useroffice@anl.gov?subject=Delegate%20UWS-PI%20submission designate a delegate]. Changes after the initial UWS submission by you (the PI or delegate) can only be made by your Scientific Contact at the CNM – see below.&lt;br /&gt;
#:* The UWS is &#039;&#039;&#039;due for each proposal&#039;&#039;&#039;, as it collects certain metadata that we need, on a per-proposal-basis, for usage reporting to our funding agencies.&lt;br /&gt;
#:* Confirm or add users in section &amp;quot;Personnel Participating In User Proposal&amp;quot; of the UWS form. Enter the &#039;&#039;&#039;badge numbers&#039;&#039;&#039; for all participating users, as far as they are known at submission time.&lt;br /&gt;
# Direct all users who you expect to access &#039;&#039;Carbon&#039;&#039;, possibly including yourself, to follow the instructions in section  &#039;&#039;&#039;[[#Ongoing user access requirements]]&#039;&#039;&#039;.&lt;br /&gt;
# Be patient. &#039;&#039;&#039;UWS Processing typically takes at least one business day,&#039;&#039;&#039; as both our User Office staff and your Scientific Contact need to attend to your submission in person.&lt;br /&gt;
# The User Office will notify the spokesperson or delegate once work on a proposal may begin, issuing what we call the &#039;&#039;User Work Approval (UWA)&#039;&#039;.  It will be valid for one year for regular proposals, and 6 months for rapid-access proposals.&lt;br /&gt;
&lt;br /&gt;
=== To get started as participating user ===&lt;br /&gt;
For new proposals or users new to CNM:&lt;br /&gt;
# Gently remind your spokesperson/PI to submit the UWS as shown above, or ask this person to nominate you via an email to the [mailto:cnm_useroffice@anl.gov?subject=Delegate%20UWS CNM User Office].&lt;br /&gt;
# Continue at section [[#Actions required by the User]].&lt;br /&gt;
&lt;br /&gt;
For proposals already in progress, see the next section.&lt;br /&gt;
&lt;br /&gt;
== Adding users to a proposal ==&lt;br /&gt;
Most users are nominated to work on a proposal when it is first submitted.&lt;br /&gt;
Additional users can be authorized to work under a proposal at any time after acceptance.&lt;br /&gt;
Actions are needed from both the user and the proposal spokesperson.&lt;br /&gt;
&lt;br /&gt;
=== Actions required by the User ===&lt;br /&gt;
:1. [[#Ongoing user access requirements|Enter or review your registration]] as facility user and update as necessary.&lt;br /&gt;
:2. Follow up in a day or a week as specified at [[#Follow-up actions required by the User]].&lt;br /&gt;
&lt;br /&gt;
=== Actions required by the PI or spokesperson ===&lt;br /&gt;
:3. Confirm that the user has entered or reviewed their registration, and determine their badge number(s).&lt;br /&gt;
:4.  Add the user to the proposal. &amp;lt;!-- How to do this depends on whether the proposal [[#To get started as spokesperson or delegate|has already started or not (see above)]]. --&amp;gt;&lt;br /&gt;
:* If the proposal has &#039;&#039;&#039;not yet started:&#039;&#039;&#039; See the section above [[#To get started as spokesperson or delegate]].&lt;br /&gt;
:* If the proposal has &#039;&#039;&#039;already started:&#039;&#039;&#039; Email the users&#039; names &#039;&#039;&#039;and badge numbers&#039;&#039;&#039; to the proposal&#039;s &#039;&#039;Scientific Contact&#039;&#039; at the CNM and ask for the UWS to be augmented.&lt;br /&gt;
&amp;lt;!-- If you have questions, please contact the [mailto:cnm_useroffice@anl.gov?subject=Reinstate%20user%20account CNM User Office]. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Actions required by the Scientific Contact ===&lt;br /&gt;
: 5. Open the UWS-SciCon form in the  CNM Proposal Dashboard on the &amp;quot;Inside CNM&amp;quot; web page.&lt;br /&gt;
:* Add users under section &amp;quot;Participating Personnel&amp;quot;.&lt;br /&gt;
:* Enter users&#039; badge numbers which may have been left empty in earlier UWS submissions, as happens by necessity for very newly registered users.&lt;br /&gt;
:* Again, review that badge numbers are present and are correct for all relevant participants that are to work on &#039;&#039;Carbon&#039;&#039;, or at least need to use {{sshgw}}.&lt;br /&gt;
&lt;br /&gt;
=== Follow-up actions required by the User ===&lt;br /&gt;
: 6. Contact our [mailto:cnm_useroffice@anl.gov?subject=Process%20new%20user%20registration CNM User Office] and ask to review your registration and to initiate the next steps.&lt;br /&gt;
:* To work onsite at CNM or remotely on Carbon, you will need an &#039;&#039;Argonne computer account&#039;&#039;, which is different from the account you used to enter your User Registration details – see section [[#Account Types]].&lt;br /&gt;
:* If you are new to Argonne, our User Office will be in contact with you to set up this account. Since the Argonne account is for more general use than your registration account, it will involve formal approvals, cyber security training, etc. and typically takes about &#039;&#039;one week&#039;&#039; to complete.&lt;br /&gt;
: 7. Complete or refresh training courses, as requested by the User Office.&lt;br /&gt;
:* Course requirements are triggered at various levels. There are courses for being a visitor at Argonne, a user at CNM, and for work performed under proposals, be it onsite or remotely.&lt;br /&gt;
: 8. Have your Argonne computer account finalized and ready.&lt;br /&gt;
:* &#039;&#039;&#039;New users:&#039;&#039;&#039; See section [[#Finalize your Argonne computer account]].&lt;br /&gt;
:* &#039;&#039;&#039; Existing users:&#039;&#039;&#039;  Check for and if necessary renew your expired password, [[#Verify or change your password|see below]].&lt;br /&gt;
&lt;br /&gt;
=== Carbon account and access ===&lt;br /&gt;
When all prerequisites are met, your Argonne account will be  enabled or (if so needed) re-enabled for use on Carbon.&lt;br /&gt;
&lt;br /&gt;
: Enabling your account on Carbon &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;&#039;&#039;does not happen immediately&#039;&#039;&amp;lt;/font&amp;gt; after a password reset or rename, or submitting proposal forms – it is a separate process.&lt;br /&gt;
&lt;br /&gt;
: 9. &#039;&#039;&#039;Await confirmation&#039;&#039;&#039; from us that your account has been enabled &#039;&#039;on Carbon&#039;&#039; and been added to one or more proposals.&lt;br /&gt;
: 10. Review and follow the instructions on [[HPC/Network Access]], i.e., how to connect to the cluster.&lt;br /&gt;
&lt;br /&gt;
If you do not receive an expected notification within two days, contact our [mailto:cnm_useroffice@anl.gov?subject=Process%20new%20user%20registration User Office] and describe your issue.&lt;br /&gt;
&lt;br /&gt;
== Finalize your Argonne computer account ==&lt;br /&gt;
After your registration as a new Argonne Facility User has been processed, an [[#Account Types|Argonne &amp;quot;domain account&amp;quot;]] will be created for you.&lt;br /&gt;
Its user name will be in the form &amp;lt;code&amp;gt;b123456&amp;lt;/code&amp;gt; and our User Office will have communicated to you an initial password.&lt;br /&gt;
&lt;br /&gt;
To begin work on &#039;&#039;Carbon&#039;&#039; and possibly other CNM instruments, personalize both your &#039;&#039;password&#039;&#039; and your &#039;&#039;user name&#039;&#039;, in this order.&lt;br /&gt;
&lt;br /&gt;
; For Argonne personnel&amp;lt;nowiki&amp;gt;:&amp;lt;/nowiki&amp;gt; User name vs. email address:&lt;br /&gt;
:* Your &#039;&#039;&#039;user name&#039;&#039;&#039; is the one by which you log in to Argonne-internal services, and takes one of three forms. Web login services typically indicate which user name form they expect..&lt;br /&gt;
:**&amp;lt;code&amp;gt;username&amp;lt;/code&amp;gt; –  This is the most typical form expected, used to log in to {{sshgw}}.&lt;br /&gt;
:** &amp;lt;code&amp;gt;username@ANL.GOV&amp;lt;/code&amp;gt; – Your user name with a &#039;&#039;directory domain&#039;&#039; appended.&lt;br /&gt;
::* &amp;lt;code&amp;gt;ANL.GOV\username&amp;lt;/code&amp;gt; – An alternate form of your user name and directory domain.&lt;br /&gt;
:* Your user name is &#039;&#039;&#039;not necessarily&#039;&#039;&#039; merely the name part of an Argonne &#039;&#039;&#039;email address&#039;&#039;&#039; that you will have if you work or study at Argonne.&lt;br /&gt;
&amp;lt;!-- name part of the address (before &amp;lt;code&amp;gt;@anl.gov&amp;lt;/code&amp;gt;) may have been established by setting an email alias. --&amp;gt;&lt;br /&gt;
&amp;lt;!-- If you were to reverse the order, your account would look as being still unused or dormant, and be ineligible for use. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Change your password ===&lt;br /&gt;
* Change your password as instructed when your account got created.&lt;br /&gt;
*: See also section [[#Verify or change your password]] below.&lt;br /&gt;
* If you chose to call the Argonne Help Desk at [tel:+1-630-252-9999 +1-630-252-9999], option 4, to make the password change:&lt;br /&gt;
*: While on the phone regarding your password, state that you are a &#039;&#039;CNM Carbon User&#039;&#039; and ask to also &#039;&#039;personalize your user name&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
=== Change your user name ===&lt;br /&gt;
# Request a user name change, either over the phone or by email. We will choose the user name for you.&lt;br /&gt;
#; To request by phone: Call the Argonne Help Desk at [tel:+1-630-252-9999 +1-630-252-9999], and select option 4.&lt;br /&gt;
#; To request by email: Follow this link: [mailto:help@anl.gov?subject=User%20name%20change%20request&amp;amp;body=I%20am%20a%20new%20user%20of%20CNM%27s%20Carbon%20HPC%20system.%20Please%20personalize%20the%20user%20name%20of%20my%20Argonne%20Domain%20computer%20account.%0D%0A%0D%0AMy%20full%20name%3A%09__%0D%0AArgonne%20Badge%3A%09__%0D%0A%0D%0AThank%20you.%0D%0A%0D%0A &#039;&#039;&#039;Open email template&#039;&#039;&#039;] – (Use a web browser that supports [https://en.wikipedia.org/wiki/Mailto &amp;quot;mailto:&amp;quot; links].)&lt;br /&gt;
&amp;lt;!-- Wiki authoring note: Encode body text by:&lt;br /&gt;
    perl -MURI::Escape -p -e &#039;s/\n/\r\n/; $_ = uri_escape($_);&#039;&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
## Respond from the &#039;&#039;same email address&#039;&#039; as you filled in at the CNM User Registration form.&lt;br /&gt;
##: In your email application, choose or switch to the &#039;&#039;mail account&#039;&#039; that handles the address you registered with at our User Registration. Messages pertaining to your Argonne activities that are sent from an unrelated email account may be &#039;&#039;disregarded&#039;&#039; (not taken up) by our help desk staff, for obvious reasons.&lt;br /&gt;
## Fill in your &#039;&#039;name&#039;&#039; and &#039;&#039;badge number&#039;&#039; in the email template that opens, then send the email.&lt;br /&gt;
&amp;lt;!-- ## Fill in the email template.&lt;br /&gt;
##: If you have a user name at your institution that you are happy with it, supply that name as the first of three name preferences. This will make it simpler to configure your network connections to the cluster.&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&amp;lt;!-- ## Check your &#039;&#039;&#039;From:&#039;&#039;&#039; address again.&lt;br /&gt;
##: The email address you send from must match your User Registration, see above.&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&amp;lt;!-- # Request user names that have:&lt;br /&gt;
#* Lowercase letters &#039;&#039;&#039;a–z&#039;&#039;&#039;, at most 8.&lt;br /&gt;
#* At most 2 numerals &#039;&#039;&#039;0–9&#039;&#039;&#039;, preferably none.&lt;br /&gt;
#* &#039;&#039;&#039;No&#039;&#039;&#039; punctuation, including none of &amp;lt;code&amp;gt;.&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;-&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;_&amp;lt;/code&amp;gt;, and no other special characters like &amp;lt;code&amp;gt;@,;:%&amp;amp;amp;+*=()[]{}\|/&amp;amp;lt;&amp;amp;gt;#&#039;&amp;quot;`~!$^&amp;lt;/code&amp;gt;.&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
# &#039;&#039;&#039;Await an emailed ticket number&#039;&#039;&#039; from Argonne&#039;s service desk, or &#039;&#039;&#039;follow the instructions of the person&#039;&#039;&#039; you called.&lt;br /&gt;
#* Ticket numbers are assigned upon manual review, typically within an hour or so during business hours.&lt;br /&gt;
#* If you &#039;&#039;&#039;did not get a ticket number&#039;&#039;&#039; after such reasonable time, re-send the request, making sure you do so &#039;&#039;from the email account you provided at User Registration&#039;&#039;. &amp;lt;!-- [mailto:cnm_useroffice@anl.gov?subject=User%20name%20change%20request ask the CNM User Office] to review. --&amp;gt;&lt;br /&gt;
# Check your email for follow-up questions and respond.&lt;br /&gt;
# Await the completion notice for your user name change.&lt;br /&gt;
&lt;br /&gt;
=== Next steps ===&lt;br /&gt;
&#039;&#039;Carbon&#039;&#039; access &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;&#039;&#039;is not immediately enabled&#039;&#039;&amp;lt;/font&amp;gt; once your user name change request has been completed – it is a separate process.&lt;br /&gt;
# Expect an email that your &#039;&#039;Carbon&#039;&#039; access has been granted.&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
# Follow the instructions in that email to learn [[HPC/Network Access|&#039;&#039;&#039;how to log in&#039;&#039;&#039;]] and where to find further documentation&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
# Proceed under [[#Carbon account and access]].&lt;br /&gt;
&lt;br /&gt;
== Proposal troubleshooting ==&lt;br /&gt;
&#039;&#039;&#039;Email the [mailto:cnm_useroffice@anl.gov?subject=Proposal%20Question CNM User Office]&#039;&#039;&#039; with any questions or concerns, such as:&lt;br /&gt;
* about proposals,&lt;br /&gt;
* about users, or&lt;br /&gt;
* you find that responding to any of your submissions or previous communications takes longer than a few business days.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Only our User Office staff&#039;&#039;&#039; is able to review all aspects of your proposal or your user access requirements, and determine any steps that have yet to be taken or need to be refreshed.&lt;br /&gt;
&lt;br /&gt;
Include in your message:&lt;br /&gt;
* Proposal number(s),&lt;br /&gt;
* Name of the Principal Investigator (PI),&lt;br /&gt;
* Names and badge numbers of participants.&lt;br /&gt;
&lt;br /&gt;
== Ongoing user access requirements ==&lt;br /&gt;
For you to log into Carbon and its SSH gateway, a number of criteria must be met, most of which are subject to &#039;&#039;&#039;expiration dates&#039;&#039;&#039; and &#039;&#039;&#039;require action from you for renewal&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
You will &#039;&#039;not&#039;&#039; get notified (for various reasons) on some of these expirations.&lt;br /&gt;
Different duration terms may cause expirations to happen right in the middle of your proposal&#039;s lifecycle and can cause immediate inconvenience.&lt;br /&gt;
Depending on which criterion expired, one or both of the following will happen to your Argonne computer account:&lt;br /&gt;
* The account&#039;s permission to use {{sshgw}} will be revoked.&lt;br /&gt;
* The account &#039;&#039;as such&#039;&#039; will be disabled, equivalent to revoking all its permissions.&lt;br /&gt;
&lt;br /&gt;
To recover, do one or more of the following:&lt;br /&gt;
&lt;br /&gt;
=== User Registration ===&lt;br /&gt;
# Review and update your [https://beam.aps.anl.gov/pls/apsweb/ufr_main_pkg.usr_start_page &#039;&#039;&#039;User Registration.&#039;&#039;&#039;]&lt;br /&gt;
#* For this system, log in  with your &#039;&#039;badge number&#039;&#039; and the password associated with it, not your regular Argonne account – see section [[#Account Types]] above.&lt;br /&gt;
#* The registration itself requires renewal at least every 2 years, or earlier when any one of various prerequisite items expires.&lt;br /&gt;
#* For &#039;&#039;&#039;non-US citizens&#039;&#039;&#039; present in the US: Review and update registration items regarding your &#039;&#039;&#039;US visa&#039;&#039;&#039; or related work permit. A current US work or study status is required to access Argonne computers, the same as if you were to visit in person.&lt;br /&gt;
# Ask our [mailto:cnm_useroffice@anl.gov?subject=Reinstate%20user%20account CNM User Office] staff to review your registration updates and to recreate or re-instate your Argonne account, as the case might be.&lt;br /&gt;
&lt;br /&gt;
=== Legal User Agreement ===&lt;br /&gt;
* If you &#039;&#039;&#039;changed your affiliation&#039;&#039;&#039; (the institution where you work or study), check to see if your new institution has a legal [https://aps.anl.gov/Users-Information/Legal-Financial/Argonne-User-Facility-Agreements &#039;&#039;&#039;User Facility Agreement&#039;&#039;&#039;] with Argonne in place and request one if not.&lt;br /&gt;
*: Be advised that the process may take several weeks to percolate through legal and adminstrative channels.&lt;br /&gt;
&lt;br /&gt;
=== Training ===&lt;br /&gt;
*Review and renew your [http://beam.aps.anl.gov/pls/apsweb/rt0004.intro_process &#039;&#039;&#039;User Courses.&#039;&#039;&#039;]&lt;br /&gt;
*: For remote users, the ESH223 course &amp;quot;Cybersecurity Annual Education and Awareness&amp;quot; is the one most likely to be in need of renewal.&lt;br /&gt;
&lt;br /&gt;
=== Password ===&lt;br /&gt;
* Review and update the [[#Verify or change your password|&#039;&#039;&#039;password&#039;&#039;&#039;]] to your Argonne computer account  if you now have or previously had such an account.&lt;br /&gt;
*: If your account&#039;s password expired, we consider the account dormant and &#039;&#039;will not notify you about new proposals&#039;&#039; where you are listed as a participant.&lt;br /&gt;
&lt;br /&gt;
=== Active proposal ===&lt;br /&gt;
You must be a participant in at least &#039;&#039;&#039;one active or recently expired [https://www.anl.gov/cnm/become-a-cnm-user User Proposal]&#039;&#039;&#039;.&lt;br /&gt;
You may run compute jobs under a given proposal while it is active, i.e., within the dates stated in the proposal&#039;s User Work Approval (UWA).&lt;br /&gt;
* To review the dates for your proposals, ask your PI to search their email archive for subjects &#039;&#039;&amp;quot;Work Approval Received&amp;quot;&#039;&#039; or &#039;&#039;&amp;quot;Proposal Expiration&amp;quot;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
=== Data-only access for inactive proposals ===&lt;br /&gt;
After your last active proposal on Carbon has expired you may still access,  for &#039;&#039;&#039;up to 30 days&#039;&#039;&#039;, the SSH gateway and Carbon&#039;s login nodes.&lt;br /&gt;
Past that time window, your access will be revoked and &#039;&#039;&#039;your data may be deleted&#039;&#039;&#039;, following [https://www.anl.gov/cnm/complete-your-work-at-cnm &#039;&#039;&#039;CNM&#039;s Data Retention Policy&#039;&#039;&#039;]. &lt;br /&gt;
&lt;br /&gt;
* While you still have access, offload from Carbon all your files and data that you may wish to keep.&lt;br /&gt;
*: The CNM cannot be expected or held responsible to store your data beyond your access window.&lt;br /&gt;
&lt;br /&gt;
=== Practical hints ===&lt;br /&gt;
* Set yourself &#039;&#039;&#039;calendar entries&#039;&#039;&#039; about one year into the future to remind yourself to renew any of your user registration or training requirements.&lt;br /&gt;
* After you were added to a user proposal, &#039;&#039;&#039;wait at least an hour or more&#039;&#039;&#039; before trying to access our SSH gateway, preferably until the next morning.&lt;br /&gt;
*: Updates of your status need to be propagated through a handful of systems, each being done about hourly, so it may take several cycles for your status change to reach {{sshgw}}.&lt;br /&gt;
&lt;br /&gt;
== Login issues ==&lt;br /&gt;
When you ask &amp;quot;I cannot log in&amp;quot; or &amp;quot;My password does not work&amp;quot;, consider the following sections:&lt;br /&gt;
&lt;br /&gt;
=== Review your access requirements ===&lt;br /&gt;
See section [[#Ongoing user access requirements]] above.&lt;br /&gt;
&lt;br /&gt;
=== Verify or change your password ===&lt;br /&gt;
Do &#039;&#039;&#039;one of the following:&#039;&#039;&#039;&lt;br /&gt;
* Visit &#039;&#039;&#039;https://servicenow.anl.gov/pr&#039;&#039;&#039; &amp;lt;!-- . Mnemonic: &amp;quot;pr&amp;quot; stands for &#039;&#039;&#039;p&#039;&#039;&#039;assword &#039;&#039;&#039;r&#039;&#039;&#039;eset). --&amp;gt;&lt;br /&gt;
** Complete the &#039;&#039;Password Enrollment&#039;&#039; process at this service on your first visit when you &#039;&#039;know&#039;&#039; your password. You will be (or have been) thus instructed when your account has been created.&lt;br /&gt;
** You can &#039;&#039;verify&#039;&#039; or &#039;&#039;change&#039;&#039; your existing known password.&lt;br /&gt;
** You can &#039;&#039;reset&#039;&#039; or &#039;&#039;unlock&#039;&#039; your password &#039;&#039;&#039;only&#039;&#039;&#039; after you enrolled.&lt;br /&gt;
&amp;lt;!-- #*: With enrollment completed, you can later reset your password, and also [[#Password lockouts|unlock your account]] in case it has been blocked after too many incorrect password attempts. --&amp;gt;&lt;br /&gt;
** You cannot use this service if your account has been &#039;&#039;disabled&#039;&#039; as such, in which case revisit the section [[#Ongoing user access requirements]].&lt;br /&gt;
* You can &#039;&#039;change&#039;&#039; your &#039;&#039;known&#039;&#039; password also at our SSH gateway host &amp;lt;code&amp;gt;mega&amp;lt;/code&amp;gt;.&lt;br /&gt;
&amp;lt;!-- ** You will be asked to update an expired password upon logging in. --&amp;gt;&lt;br /&gt;
** At least one of your CNM proposals must still be active.&lt;br /&gt;
** You cannot log in if your account is &#039;&#039;disabled&#039;&#039; as such.&lt;br /&gt;
: Error messages for login failures will not disclose a specific reason. You cannot tell if merely your password was wrong or your account is disabled.&lt;br /&gt;
* If you cannot use any of the above systems:&lt;br /&gt;
** request a [mailto:help@anl.gov?subject=Password%20reset password reset at the Argonne Service Desk], or&lt;br /&gt;
** request a [mailto:cnm_useroffice@anl.gov?subject=Requesting%20password%20reset password reset from the CNM User Office].&lt;br /&gt;
&amp;lt;!--# &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;Visit our older account profile service, being phased out in early 2021: &#039;&#039;&#039;https://mypassword.anl.gov/&#039;&#039;&#039;.&lt;br /&gt;
** You must have previously completed an Argonne Account Profile at this service.&lt;br /&gt;
** Profiles from this service were not transferred to our current account service above.&amp;lt;/font&amp;gt; --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After a password update, you should be able to connect to {{sshgw}} normally.&lt;br /&gt;
If you find that you cannot log in, however, retry only &#039;&#039;&#039;after an hour or two&#039;&#039;&#039;, as in some cases extra time is needed for passwords or other account changes to propagate.&lt;br /&gt;
&lt;br /&gt;
=== Password lockouts ===&lt;br /&gt;
After trying incorrect passwords several times, your account may be &#039;&#039;&#039;temporarily locked out.&#039;&#039;&#039; To recover, try one of the following:&lt;br /&gt;
* Wait &#039;&#039;&#039;approximately 30 min.&#039;&#039;&#039;&lt;br /&gt;
* Unlock at &#039;&#039;&#039;https://mypassword.anl.gov/&#039;&#039;&#039;&amp;lt;!-- https://servicenow.anl.gov/pr --&amp;gt; – available if you have previously enrolled there.&lt;br /&gt;
&lt;br /&gt;
=== Review host names ===&lt;br /&gt;
Connect to the correct host names:&lt;br /&gt;
* When connecting from outside Argonne, at least &#039;&#039;two ssh sessions&#039;&#039; are required.&lt;br /&gt;
** {{sshgw|fqdn}} – an ssh &amp;quot;tunnel setup&amp;quot; connection.&lt;br /&gt;
** {{host|carbon}} – one or more &amp;quot;payload&amp;quot; connections for the ssh, scp, or sftp commands. Here, {{host|carbon}} is not a hostname but an entry in your ssh configuration that you must make (called a host alias or &amp;quot;profile&amp;quot;, depending on the ssh application). The entry stands for a connection to localhost (your machine), at a port number forwarded by the preceding tunnel setup connection.&lt;br /&gt;
* When onsite (for any user) or using VPN (for Argonne staff):&lt;br /&gt;
** {{host|carbon.cnm.anl.gov}}. The previous name was {{host|clogin. …}}.&lt;br /&gt;
To learn more, read [[HPC/Network Access]].&lt;br /&gt;
&lt;br /&gt;
=== Review network configuration ===&lt;br /&gt;
* Read again [[HPC/Network Access]], and follow the instructions for your platform.&lt;br /&gt;
&lt;br /&gt;
=== Request support ===&lt;br /&gt;
* If the above sections did not help you to resolve your issue, [[HPC/Support|submit a support request]].&lt;br /&gt;
&lt;br /&gt;
== Expected files or commands are unavailable ==&lt;br /&gt;
When you cannot create or edit files or directories under your home directory, or you find that commands you expect are not found, then:&lt;br /&gt;
&lt;br /&gt;
# Inspect the beginning of your command line, called the &#039;&#039;prompt&#039;&#039;:&lt;br /&gt;
#* If your prompt mentions &amp;quot;@mega&amp;quot; or &amp;quot;GATEWAY&amp;quot;, e.g.:&lt;br /&gt;
#:: &amp;lt;code&amp;gt;&#039;&#039;username&#039;&#039;&amp;lt;font color=&amp;quot;brown&amp;quot;&amp;gt;&#039;&#039;&#039;@mega5 CNM-GATEWAY&#039;&#039;&#039;&amp;lt;/font&amp;gt; $ &amp;lt;/code&amp;gt;&lt;br /&gt;
#: then you are working &#039;&#039;&#039;not on Carbon just yet&#039;&#039;&#039;, but rather on its SSH gateway. Visit [[HPC/Network_Access]] to learn how to connect properly.&lt;br /&gt;
#* If the prompt mentions &amp;quot;@login&amp;quot;, e.g.:&lt;br /&gt;
#:: &amp;lt;code&amp;gt;&#039;&#039;username&#039;&#039;&amp;lt;font color=&amp;quot;brown&amp;quot;&amp;gt;&#039;&#039;&#039;@login6&#039;&#039;&#039;&amp;lt;/font&amp;gt; … $&amp;lt;/code&amp;gt;&lt;br /&gt;
#: then there may be a temporary file system issue which may resolve after a few minutes.&lt;br /&gt;
#: If such issue persists or recurs over several hours, however, read the message that will have appeared right after you logged in, above the first command prompt. To locate these messages, scroll up the content of your terminal application window, or log out and log back in to bring up these messages again.&lt;br /&gt;
&lt;br /&gt;
=== My home directory is read-only ===&lt;br /&gt;
=== I cannot edit my .bashrc file ===&lt;br /&gt;
=== Expected commands unavailable ===&lt;br /&gt;
In all these situations, see [[#Expected files or commands are unavailable | the beginning of the current section]].&lt;br /&gt;
&lt;br /&gt;
== Mailing lists ==&lt;br /&gt;
Announcements about Carbon are made on the [https://lists.anl.gov/mailman/listinfo/cnm-hpc-announce &#039;&#039;cnm-hpc-announce&#039;&#039; mailing list], hosted at Argonne.&lt;br /&gt;
The mailing list home page and its archive are, unfortunately, only accessible from onsite or (for authorized users) over VPN.&lt;br /&gt;
&lt;br /&gt;
* To &#039;&#039;&#039;unsubscribe&#039;&#039;&#039; from the mailing list, do one of the following:&lt;br /&gt;
*# Open the &amp;quot;unsubscribe&amp;quot; link at the bottom of a recent message that you received from the mailing list.&lt;br /&gt;
*# Send a blank message to [mailto:cnm-hpc-announce-leave@lists.anl.gov cnm-hpc-announce&#039;&#039;&#039;-leave&#039;&#039;&#039;@lists.anl.gov] and follow up on the confirmation notice.&lt;br /&gt;
* To &#039;&#039;&#039;subscribe&#039;&#039;&#039; to the mailing list, send a blank message to [mailto:cnm-hpc-announce-join@lists.anl.gov cnm-hpc-announce&#039;&#039;&#039;-join&#039;&#039;&#039;@lists.anl.gov] and follow up on the confirmation notice.&lt;br /&gt;
* To &#039;&#039;&#039;change your email address&#039;&#039;&#039; on the list, simply do both of the above, in order.&lt;br /&gt;
&lt;br /&gt;
; Hints:&lt;br /&gt;
* When sending commands by email, be sure to have the relevant email account selected in the &amp;quot;From&amp;quot; line of the compose window in your email application.&lt;br /&gt;
* Inspect the &#039;&#039;&#039;Junk&#039;&#039;&#039; mail folder of your email application if you do not receive a confirmation message for subscribing or unsubscribing within a minute or so.&lt;br /&gt;
* See the [http://www.gnu.org/software/mailman/mailman-member/node22.html GNU Mailman] documenation for background.&lt;br /&gt;
&lt;br /&gt;
== Applications ==&lt;br /&gt;
&lt;br /&gt;
=== I&#039;d like to use application X ===&lt;br /&gt;
; Check if the application is already available on Carbon:&lt;br /&gt;
Either:&lt;br /&gt;
* Browse the [[HPC/Applications | Application Catalog]], or&lt;br /&gt;
* View the catalog on the Carbon command line:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
module avail&lt;br /&gt;
module -l avail 2&amp;gt;&amp;amp;1 | less&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
: The second form gives you browsable output.&lt;br /&gt;
&lt;br /&gt;
; If you cannot find the application on Carbon:&lt;br /&gt;
* Submit a [[HPC/Support| support request]].&lt;br /&gt;
** Provide one or more &#039;&#039;URLs&#039;&#039; relevant to software you have in mind – be specific.&lt;br /&gt;
** Describe &#039;&#039;the problem&#039;&#039; you are trying to solve – it may well be that we can suggest an alternative solution.&lt;br /&gt;
** Give the extent of your planned use.&lt;br /&gt;
; If you see the application on Carbon but you cannot access it:&lt;br /&gt;
* Existing license agreements may cover only a subset of users (typically Argonne employees).&lt;br /&gt;
* If you feel you are eligible, submit a [[HPC/Support| support request]].&lt;br /&gt;
; If a version newer than the installed one on Carbon is available :&lt;br /&gt;
* Submit a [[HPC/Support| support request]].&lt;br /&gt;
* Include a URL to information about the new version.&lt;br /&gt;
&lt;br /&gt;
===How do I run application X? ===&lt;br /&gt;
* [[HPC/Module Setup#Shell Customizations|Customize your shell environment]] to load the application module.&lt;br /&gt;
* Learn about [[HPC/Module Setup#Module Conventions on Carbon | module conventions on Carbon]].&lt;br /&gt;
* To determine the names of a package&#039;s executable scripts and binaries, load the application module (if you have not yet done so in your shell setup), then inspect the module&#039;s &amp;lt;code&amp;gt;$&#039;&#039;NAME&#039;&#039;_HOME/bin&amp;lt;/code&amp;gt; directory. For instance, for the Quantum-ESPRESSO package:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
module load quantum_espresso&lt;br /&gt;
ls $QUANTUM_ESPRESSO_HOME/bin&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
* Learn how to [[HPC/Submitting and Managing Jobs | submit and manage jobs]].&lt;br /&gt;
&lt;br /&gt;
=== How do I &#039;&#039;use&#039;&#039; application X? ===&lt;br /&gt;
Read the package&#039;s documentation, using one or more of the following:&lt;br /&gt;
* Inspect the package&#039;s &amp;lt;code&amp;gt;$&#039;&#039;NAME&#039;&#039;_HOME/share&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;$&#039;&#039;NAME&#039;&#039;_HOME/doc&amp;lt;/code&amp;gt; directory on Carbon (see [[HPC/Module Setup#Module Conventions on Carbon | module conventions]]).&lt;br /&gt;
* Browse the package&#039;s web page, generally mentioned in the &amp;lt;code&amp;gt;module help&amp;lt;/code&amp;gt; text or the  [[HPC/Applications | application catalog]] entry.&lt;br /&gt;
* Consult a package&#039;s man pages. Few packages have them. Man page files are generally installed under &amp;lt;code&amp;gt;$&#039;&#039;NAME&#039;&#039;_HOME/man&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;$&#039;&#039;NAME&#039;&#039;_HOME/share/man&amp;lt;/code&amp;gt; and if so, will be made available automatically to the &amp;lt;code&amp;gt;man&amp;lt;/code&amp;gt; command.&lt;br /&gt;
&lt;br /&gt;
== What&#039;s my account balance? ==&lt;br /&gt;
=== Simple answer: mybalance ===&lt;br /&gt;
To find out how many core-hours you have available, the simplest command to run is:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mybalance -h&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
 Project  Machines Balance    &lt;br /&gt;
 -------- -------- ---------- &lt;br /&gt;
 user     ANY         993.26&lt;br /&gt;
 cnm34567 ANY       158760.93&lt;br /&gt;
 cnm31234 ANY      -148893.62&lt;br /&gt;
The table gives all the &amp;lt;code&amp;gt;Project&amp;lt;/code&amp;gt;s you have access to (for use with the &amp;lt;code&amp;gt;qsub -A&amp;lt;/code&amp;gt; argument), and their balance.&lt;br /&gt;
&amp;lt;code&amp;gt;Machine&amp;lt;/code&amp;gt; lists all systems that  can book jobs against your allocations. &#039;&#039;Carbon&#039;&#039; is currently the only machine that can do so.&lt;br /&gt;
&amp;lt;code&amp;gt;Balance&amp;lt;/code&amp;gt; is your account balance, in &#039;&#039;core-hours&#039;&#039;, as selected by the -h command option. This is the most useful and recommended unit.&lt;br /&gt;
Without -h, you get core-seconds, which are integers but rather more unwieldy numbers.&lt;br /&gt;
* The &amp;quot;user&amp;quot; project provides you with a small initial startup allocation of typically 1000 core-hours.&lt;br /&gt;
* When a Balance is reported as negative, that account typically has a CreditLimit assigned, which permits the balance to dip below zero. These details, however, are not shown by &amp;lt;code&amp;gt;mybalance&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Complete answer: gbalance ===&lt;br /&gt;
To get allocation details for accounts that have CreditLimits, run the &amp;lt;code&amp;gt;gbalance&amp;lt;/code&amp;gt; command. Pass on -u &#039;&#039;username&#039;&#039; or &#039;&#039;-p projectname&#039;&#039; to select your allocations:&lt;br /&gt;
 gbalance -h -u $USER&lt;br /&gt;
: Type &amp;lt;code&amp;gt;$USER&amp;lt;/code&amp;gt; &#039;&#039;as shown&#039;&#039;. The command interpreter will fill in your actual username.&lt;br /&gt;
The ouput looks like:&lt;br /&gt;
 Id  Name     Amount     Reserved Balance    CreditLimit &#039;&#039;&#039;Available&#039;&#039;&#039;&lt;br /&gt;
 --- -------- ---------- -------- ---------- ----------- --------- &lt;br /&gt;
 100 cnm31234 -148893.62     0.00 -148893.62   150000.00   &#039;&#039;&#039;1106.38&#039;&#039;&#039;&lt;br /&gt;
 217 kpelzer      993.26     0.00     993.26        0.00    993.26 &lt;br /&gt;
 123 cnm34567  166440.93  7680.00  158760.93        0.00 158760.93 &lt;br /&gt;
The most relevant column for you is &#039;&#039;&#039;Available&#039;&#039;&#039;. The units, given the -h option, are again core-hours.&lt;br /&gt;
&lt;br /&gt;
The colums and their meanings are:&lt;br /&gt;
; Id: an internal number for the account.&lt;br /&gt;
; Name: The project name (for use with &amp;lt;code&amp;gt;qsub -A&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;#PBS -A&amp;lt;/code&amp;gt;).&lt;br /&gt;
; Amount: Amount for transactions completely on the books for the project account; does not include running jobs or credits. Deposits are allocated by the User Office and implemented by the Carbon administrator.&lt;br /&gt;
; Reserved: Amounts held in reserve by all running jobs using this account. The reserve ensures that a job does not cause an overdraft when it finishes and when its actual use will be booked. The quantity is calculated by walltime * number of cores blocked. When a job terminates, the charge according to the actual time used will be &#039;&#039;subtracted&#039;&#039; from Amount, and the unused quantities will be &#039;&#039;re-added&#039;&#039; to Available.&lt;br /&gt;
; Balance: Available for new jobs; may go negative if CreditLimits are in place.&lt;br /&gt;
 Balance = Amount - Reserved&lt;br /&gt;
; CreditLimit: Amount by which Balance may go negative; assigned by the Carbon administrator.&lt;br /&gt;
; Available: Relevant quantity for new jobs. Must be positive for a new job to start, and large enough to Reserve the entire job.&lt;br /&gt;
 Available = Balance + CreditLimit&lt;br /&gt;
&lt;br /&gt;
== Why did my account balance suddenly drop? ==&lt;br /&gt;
The compute time physically available by Carbon&#039;s processors is a &amp;quot;perishable&amp;quot; resource — CPU-hours pass by regardless of being used or not.&lt;br /&gt;
Therefore, your allocations are time-restricted in a &amp;quot;use-it-or-lose-it&amp;quot; manner.&lt;br /&gt;
This is done to encourage consistent use of the machine throughout allocation cycles.&lt;br /&gt;
&lt;br /&gt;
Otherwise, resource contention becomes likely near the end of an allocation cycle, one year after each bunch of proposals has started, during which it would be increasingly impractical and eventually physically impossible to use up a large remaining allocation within a short time.&lt;br /&gt;
You would need to claim a large fraction of Carbon&#039;s nodes during a relatively short time window, which is unlikely to be possible because jobs from other users will be running as well.&lt;br /&gt;
&lt;br /&gt;
=== Allocation expiration schedule ===&lt;br /&gt;
Unused allocations &#039;&#039;will expire&#039;&#039;, following to schedule:&lt;br /&gt;
* Your allocation is provided in three equal-sized installments.&lt;br /&gt;
* All installments are active from the beginning.&lt;br /&gt;
* Installments &#039;&#039;expire&#039;&#039; in a staggered fashion, currently after 4, 8, and 12 months, respectively. A diagram might illuminate this:&lt;br /&gt;
 &lt;br /&gt;
     Proposal                Proposal&lt;br /&gt;
      start                 expiration&lt;br /&gt;
        |-------|-------|-------|------&amp;gt; Time    &lt;br /&gt;
        0       4       8       12      (months)&lt;br /&gt;
        |&lt;br /&gt;
 Installment&lt;br /&gt;
        |&lt;br /&gt;
     (1)|########....................               KEY&lt;br /&gt;
        |                            &lt;br /&gt;
     (2)|################............               .  Installment is inactive&lt;br /&gt;
        |                            &lt;br /&gt;
     (3)|########################....               #  Installment is active&lt;br /&gt;
        |&lt;br /&gt;
 &lt;br /&gt;
* Your jobs will, sensibly, be booked against the installments that expire the earliest.&lt;br /&gt;
&lt;br /&gt;
== My question is not answered here ==&lt;br /&gt;
See [[HPC/Support]].&lt;/div&gt;</summary>
		<author><name>Stern</name></author>
	</entry>
	<entry>
		<id>https://wiki.anl.gov/wiki_cnm/index.php?title=HPC/Applications/comsol&amp;diff=7471</id>
		<title>HPC/Applications/comsol</title>
		<link rel="alternate" type="text/html" href="https://wiki.anl.gov/wiki_cnm/index.php?title=HPC/Applications/comsol&amp;diff=7471"/>
		<updated>2025-08-11T21:18:49Z</updated>

		<summary type="html">&lt;p&gt;Stern: /* License configuration when outside CNM and using SSH Tunneling */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
The [http://www.comsol.com/products/multiphysics/ &#039;&#039;&#039;COMSOL Multiphysics&#039;&#039;&#039;] application suite&lt;br /&gt;
is available for Mac, Windows, and Linux.&lt;br /&gt;
&lt;br /&gt;
== Access ==&lt;br /&gt;
[[Image:HPC Comsol licensed modules.png|right|450px|thumb|COMSOL features licensed at CNM as of 2024-10.]]&lt;br /&gt;
=== COMSOL Multiphysics ===&lt;br /&gt;
Access to &#039;&#039;&#039;COMSOL Multiphysics&#039;&#039;&#039;, the main application with both a graphical user interface and batch computing capabilities, will be granted &#039;&#039;&#039;&#039;&#039;upon request&#039;&#039;&#039;&#039;&#039;&amp;amp;thinsp;.&lt;br /&gt;
&lt;br /&gt;
You must be:&lt;br /&gt;
* An &#039;&#039;&#039;&#039;&#039;Argonne employee&#039;&#039;&#039;&#039;&#039;&amp;amp;thinsp; in one of the following roles:&lt;br /&gt;
** &#039;&#039;&#039;&#039;&#039;NST staff member&#039;&#039;&#039;&#039;&#039;&amp;amp;thinsp; (including PostDocs, joint appointments, and students at NST).&lt;br /&gt;
** &#039;&#039;&#039;&#039;&#039;CNM Facility User&#039;&#039;&#039;&#039;&#039;&amp;amp;thinsp; (including &#039;&#039;non-NST Argonne employees&#039;&#039;), with an active proposal that has COMSOL in scope. Please see [[HPC/FAQ#Access_and_proposals]].&lt;br /&gt;
&lt;br /&gt;
The set of available COMSOL modules that we have licensed is shown at right.&lt;br /&gt;
&lt;br /&gt;
* The native desktop version can be installed only on &#039;&#039;Argonne-owned&#039;&#039; computers (laptop or desktop). Please contact [mailto:help@anl.gov?Subject=COMSOL%20license%20access%20request CNM support]. Make sure to review [http://www.comsol.com/support/updates/ Product Updates].&lt;br /&gt;
* To run COMSOL on our HPC system &#039;&#039;Carbon&#039;&#039;, as GUI or as batch computing jobs, your proposal must have &#039;&#039;Carbon&#039;&#039; access in scope.&lt;br /&gt;
&lt;br /&gt;
=== COMSOL Server ===&lt;br /&gt;
&#039;&#039;CNM Facility Users&#039;&#039; who are not Argonne employees are not eligible to access&lt;br /&gt;
the full &#039;&#039;&#039;COMSOL Multiphysics&#039;&#039;&#039; product, in compliance with its licensing terms and conditions.&lt;br /&gt;
However, the [https://www.comsol.com/comsol-server &#039;&#039;&#039;COMSOL Server&#039;&#039;&#039;] product offers an alternative&lt;br /&gt;
albeit more narrow means of access.&lt;br /&gt;
&lt;br /&gt;
All users, including &#039;&#039;&#039;&#039;&#039;non-Argonne users&#039;&#039;&#039;&#039;&#039; may be able to run, over a web interface in their browser,&lt;br /&gt;
pre-parameterized &amp;quot;fixed-model&amp;quot; simulations that were made with the &#039;&#039;&#039;COMSOL Application Builder&#039;&#039;&#039; (requires Windows).&lt;br /&gt;
&lt;br /&gt;
To inquire about using COMSOL server applications,&lt;br /&gt;
please contact us.&lt;br /&gt;
&amp;lt;!-- [mailto:cnm_useroffice@anl.gov?Subject=COMSOL%20server%20usage Support]. --&amp;gt;&lt;br /&gt;
We will review possible purchase paths for COMSOL Server, and the &#039;&#039;considerable effort&#039;&#039; likely required by users and the CNM to develop and deploy a COMSOL application.&lt;br /&gt;
&lt;br /&gt;
== Support ==&lt;br /&gt;
* For questions on how to run or start COMSOL:&lt;br /&gt;
*: Submit an [[HPC/Support | &#039;&#039;&#039;IT support request&#039;&#039;&#039;]]&lt;br /&gt;
* For questions related to most COMSOL data or scripts, contact COMSOL support at:&lt;br /&gt;
*: [mailto:support@comsol.com &#039;&#039;&#039;support&#039;&#039;&#039;@comsol.com]&lt;br /&gt;
* &#039;&#039;&#039;Exception:&#039;&#039;&#039; If your support question might contain data that is subject to &#039;&#039;&#039;US Export Control&#039;&#039;&#039; regulations, contact instead:&lt;br /&gt;
*: [mailto:us-export-control@us.comsol.com &#039;&#039;&#039;us-export-control&#039;&#039;&#039;@&#039;&#039;&#039;us&#039;&#039;&#039;.comsol.com]&lt;br /&gt;
&lt;br /&gt;
== The modes to run COMSOL ==&lt;br /&gt;
There are several ways of running COMSOL.&lt;br /&gt;
&lt;br /&gt;
=== Running the desktop application ===&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
# Run on Carbon, display on your desktop using the [http://en.wikipedia.org/wiki/X_Window_System X Window system (X11)].&lt;br /&gt;
#* Requires an &#039;&#039;X11 Server&#039;&#039; application running on your client machine, and SSH X11 forwarding.&lt;br /&gt;
#* The X11 protocol can be slow over LAN.&lt;br /&gt;
# Run on Carbon within a [[HPC/Network Access/Virtual Desktop | virtual desktop environment (VNC)]].&lt;br /&gt;
#* Requires a VNC client on your machine.&lt;br /&gt;
#* It can be confusing where VNC and the app runs.&lt;br /&gt;
#* The virtual desktop presents a (deliberatly) sparse windowing environment – Copy&amp;amp;Paste can be difficult to use.&lt;br /&gt;
# Run on your own computer, remotely checking out Carbon&#039;s license.&lt;br /&gt;
#* Requires a full installation of COMSOL on your desktoo or laptop computer.&lt;br /&gt;
#* 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.&lt;br /&gt;
&lt;br /&gt;
=== Running a batch calculation ===&lt;br /&gt;
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.&lt;br /&gt;
See the [[#Batch jobs|section below]].&lt;br /&gt;
&lt;br /&gt;
== Use with X11 ==&lt;br /&gt;
For casual use, and with [[HPC/Network Access/SSH Tunnel Setup on Linux and MacOS | X11 tunneling to Carbon]] set up, simply add to your &amp;lt;code&amp;gt;~/.bashrc&amp;lt;/code&amp;gt; file on Carbon:&lt;br /&gt;
 module load comsol&lt;br /&gt;
&lt;br /&gt;
Then, from the command line on a Carbon login node, start the COMSOL GUI:&lt;br /&gt;
 comsol &amp;amp;&lt;br /&gt;
&lt;br /&gt;
License configuration is automatic on Carbon.&lt;br /&gt;
&lt;br /&gt;
Comsol will use a number of cores to run calculations multithreaded by default. (On Carbon, COMSOL_NUM_THREADS is set.)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Quit the application&#039;&#039;&#039; as soon as you are done. Only one user can use Comsol at a time.&lt;br /&gt;
&lt;br /&gt;
== Use with VNC ==&lt;br /&gt;
See general  [[HPC/Network Access/Virtual Desktop | instructions on using VNC]], and the COMSOL example therein.&lt;br /&gt;
&lt;br /&gt;
== Native desktop version ==&lt;br /&gt;
&lt;br /&gt;
To get the fastest response from the COMSOL GUI, run a native COMSOL version on your desktop machine or laptop, called &#039;&#039;client machine&#039;&#039; below.&lt;br /&gt;
&lt;br /&gt;
Enter license details either in the COMSOL Setup configuration dialog.&lt;br /&gt;
&lt;br /&gt;
== Native desktop version — License configuration ==&lt;br /&gt;
A client&#039;s COMSOL license needs to be configured depending on how the client reaches CNM network resources. Follow the appropriate section:&lt;br /&gt;
* [[#License configuration when inside CNM or using VPN]]&lt;br /&gt;
* [[#License configuration when outside CNM and using SSH Tunneling]]&lt;br /&gt;
&lt;br /&gt;
=== License configuration when inside CNM or using VPN ===&lt;br /&gt;
==== &amp;lt;span style=&amp;quot;color:#A00;&amp;quot;&amp;gt;Ensure correct DNS search domains&amp;lt;/span&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
* Inspect the client machine&#039;s network configuration.&lt;br /&gt;
* Ensure that &#039;&#039;&#039;two&#039;&#039;&#039; entries are listed as DNS Search Domains for the current network profile:&lt;br /&gt;
 nst.anl.gov&lt;br /&gt;
 cnm.anl.gov&lt;br /&gt;
: (The order of entries does not matter for the purposes considered here.)&lt;br /&gt;
* If the client machine is &#039;&#039;wired to CNM networks&#039;&#039;, the domains are normally provided correctly by DHCP.&lt;br /&gt;
* If the client machine is &#039;&#039;connected over VPN&#039;&#039;, you may need edit the respective network profile.&lt;br /&gt;
:* 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 &amp;quot;Advanced…&amp;quot;. It appears that those changes are being saved and will be activated automatically the next time that this VPN session gets started.&lt;br /&gt;
: [[Image:VNC_add_cnm_to_DNS_1.png|400px]] [[Image:VNC_add_cnm_to_DNS_2.png|400px]]&lt;br /&gt;
:* On Windows or Linux machines, take &#039;&#039;analogous&#039;&#039; steps, using the platform&#039;s own configuration tools.&lt;br /&gt;
&lt;br /&gt;
* Exclude license manager components from client desktop installation. (Those are all handled server-side.)&lt;br /&gt;
&lt;br /&gt;
==== License format ====&lt;br /&gt;
* Floating Network License (FNL), &amp;quot;Three-server redundancy&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==== License servers ====&lt;br /&gt;
* On client machines, while running the COMSOL installer or license configuration, specify license servers and ports as follows:&lt;br /&gt;
 clicense1    1718&lt;br /&gt;
 clicense2    1718&lt;br /&gt;
 clicense3    1718&lt;br /&gt;
: &#039;&#039;&#039;Note:&#039;&#039;&#039; Use &#039;&#039;short host name&#039;&#039; form exactly as given here. (Technical Reason: The license must be usable both on Carbon&#039;s internal network as well as on divisional networks that are outside of Carbon).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Advanced:&#039;&#039;&#039; A client machine&#039;s COMSOL license file &amp;lt;code&amp;gt;&amp;amp;lt;COMSOLDIR&amp;amp;gt;/Multiphysics/license/license.dat&amp;lt;/code&amp;gt; should look as follows:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;make&amp;quot;&amp;gt;&lt;br /&gt;
SERVER clicense1 ANY 1718&lt;br /&gt;
SERVER clicense2 ANY 1718&lt;br /&gt;
SERVER clicense3 ANY 1718&lt;br /&gt;
USE_SERVER&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;amp;lt;COMSOLDIR&amp;amp;gt;&amp;lt;/code&amp;gt; is located by default at:&lt;br /&gt;
* &#039;&#039;&#039;Windows&#039;&#039;&#039;: C:\Program files\COMSOL\COMSOL&#039;&#039;nn&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Linux&#039;&#039;&#039;: /usr/local/comsol&#039;&#039;nn&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Mac&#039;&#039;&#039;: /Applications/COMSOL&#039;&#039;nn&#039;&#039;&lt;br /&gt;
(&amp;quot;&#039;&#039;nn&#039;&#039;&amp;quot; is the application&#039;s abbreviated version number.)&lt;br /&gt;
&lt;br /&gt;
==== Network Troubleshooting ====&lt;br /&gt;
When using the license access model descibed here (as opposed to tunneled over SSH), ensure the following:&lt;br /&gt;
* Verify that short host names can be resolved to IP addresses. Either one of the following commands should produce sensible output:&lt;br /&gt;
 host clicense1&lt;br /&gt;
: or:&lt;br /&gt;
 ping -c 3 clicense1&lt;br /&gt;
* Verify that &#039;&#039;both license ports on the same server&#039;&#039; can be reached from your client machine:&lt;br /&gt;
 telnet &#039;&#039;&#039;clicense1&#039;&#039;&#039; 1718&lt;br /&gt;
 telnet &#039;&#039;&#039;clicense1&#039;&#039;&#039; 1719&lt;br /&gt;
: or:&lt;br /&gt;
 telnet &#039;&#039;&#039;clicense2&#039;&#039;&#039; 1718&lt;br /&gt;
 telnet &#039;&#039;&#039;clicense2&#039;&#039;&#039; 1719&lt;br /&gt;
: A &#039;&#039;successful&#039;&#039; connection looks like:&lt;br /&gt;
 Trying 146.139.x.y...&lt;br /&gt;
 Connected to clicense1.cnm.anl.gov.&lt;br /&gt;
 Escape character is &#039;^]&#039;.&lt;br /&gt;
:: Do not enter any data. Instead,  close each connection by hitting &amp;lt;code&amp;gt;Ctrl&amp;lt;/code&amp;gt;&amp;lt;code&amp;gt;]&amp;lt;/code&amp;gt; (closing square bracket), followed by &amp;lt;code&amp;gt;Ctrl&amp;lt;/code&amp;gt;&amp;lt;code&amp;gt;D&amp;lt;/code&amp;gt;.&lt;br /&gt;
: A &#039;&#039;failed&#039;&#039; connection gives one of these errors:&lt;br /&gt;
 telnet: connect to address 146.139.x.y: Operation timed out&lt;br /&gt;
: or:&lt;br /&gt;
 telnet: connect to address 146.139.x.y: Connection refused&lt;br /&gt;
:: In these cases, ask that your IP firewall configuration be reviewed and changed.&lt;br /&gt;
&lt;br /&gt;
=== License access when outside CNM ===&lt;br /&gt;
If you&#039;re comfortable with ssh and tunneling, set up client licensing as follows:&lt;br /&gt;
&lt;br /&gt;
==== Configure COMSOL ====&lt;br /&gt;
The following needs to be done just once, typically during COMSOL installation:&lt;br /&gt;
&lt;br /&gt;
In the COMSOL Installer, or in COMSOL Preferences, enter:&lt;br /&gt;
* &#039;&#039;&#039;License format:&#039;&#039;&#039; Floating Network License (FNL), &amp;quot;Port number and Hostname&amp;quot;&lt;br /&gt;
:: &amp;quot;Three-server redundancy&amp;quot; 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.&lt;br /&gt;
* &#039;&#039;&#039;Server:&#039;&#039;&#039; &amp;lt;code&amp;gt;127.0.0.1&amp;lt;/code&amp;gt;&lt;br /&gt;
:: Do not use &amp;quot;localhost&amp;quot;, as COMSOL interprets this incorrectly to mean that your machine &#039;&#039;is&#039;&#039; a license server.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Port:&#039;&#039;&#039; &amp;lt;code&amp;gt;1718&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
Or place a license file with this content:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;make&amp;quot;&amp;gt;&lt;br /&gt;
SERVER 127.0.0.1 ANY 1718&lt;br /&gt;
USE_SERVER&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
//--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Provide server connection ====&lt;br /&gt;
This step needs to be done prior to running COMSOL in your desktop session:&lt;br /&gt;
* Connect to &amp;lt;code&amp;gt;mega&amp;lt;/code&amp;gt; with the following ssh command:&lt;br /&gt;
 ssh  -L 1718:&#039;&#039;&#039;clicense1&#039;&#039;&#039;:1718  -L 1719:&#039;&#039;&#039;clicense1&#039;&#039;&#039;:1719  mega.cnm.anl.gov&lt;br /&gt;
* Leave the command running between invocations of COMSOL.&lt;br /&gt;
&lt;br /&gt;
==== Run COMSOL ====&lt;br /&gt;
* Ensure your connection to &amp;quot;mega&amp;quot; is still running. If not, restart it.&lt;br /&gt;
* Start the COMSOL application.&lt;br /&gt;
&lt;br /&gt;
** If you get an error that the number of licenses is &amp;quot;exhausted&amp;quot;, that is confirmation that you correctly reached the license server, though other users are using licenses.&lt;br /&gt;
** 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:&lt;br /&gt;
 ssh  -L 1718:clicense&#039;&#039;&#039;2&#039;&#039;&#039;:1718  -L 1719:clicense&#039;&#039;&#039;2&#039;&#039;&#039;:1719  mega.cnm.anl.gov&lt;br /&gt;
&lt;br /&gt;
== License Troubleshooting ==&lt;br /&gt;
The following are typical error messages.&lt;br /&gt;
=== Could not obtain license for COMSOL Multiphysics GUI ===&lt;br /&gt;
* Error details:&lt;br /&gt;
 License error: -4.&lt;br /&gt;
 &#039;&#039;&#039;Licensed number of users already reached.&#039;&#039;&#039;&lt;br /&gt;
 Feature:       COMSOLGUI&lt;br /&gt;
 License path:  /Users/stern/Applications/COMSOL52a/license/license.dat:&lt;br /&gt;
 FlexNet Licensing error:-4,132&lt;br /&gt;
* Reason: The connection to the license server succeeded, but the license token(s) you requested are in use.&lt;br /&gt;
* Solution: Wait a bit, or [http://carbonmgmt/ganglia/lic.php identify who&#039;s using COMSOL] and politely ask the user when they might be finished with their work.&lt;br /&gt;
&lt;br /&gt;
=== License server machine is down or not responding ===&lt;br /&gt;
* Error details:&lt;br /&gt;
  License error: -96.&lt;br /&gt;
  See the system administrator about starting the license server system, or&lt;br /&gt;
  make sure you&#039;re referring to the right host (see LM_LICENSE_FILE).&lt;br /&gt;
 Feature:       SERIAL&lt;br /&gt;
 Hostname:      clicense3&lt;br /&gt;
 License path:  /Users/stern/Applications/COMSOL52a/license/license.dat:&lt;br /&gt;
 FlexNet Licensing error:-96,7&lt;br /&gt;
* Reason: The license servers cannot be reached at all. The &amp;lt;code&amp;gt;ping&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;host&amp;lt;/code&amp;gt; tests mentioned above fail.&lt;br /&gt;
* Solution: Review the client license file and DNS lookup domains.&lt;br /&gt;
&lt;br /&gt;
=== License file does not support this version ===&lt;br /&gt;
* Error details:&lt;br /&gt;
  Feature: SERIAL&lt;br /&gt;
 &#039;&#039;&#039;Application version &amp;gt; License version: 5.21 &amp;gt; 3.5&#039;&#039;&#039;&lt;br /&gt;
 License path: /Users/stern/Applications/COMSOL52a/license/license.dat:&lt;br /&gt;
 FlexNet Licensing error:-21,126&lt;br /&gt;
* 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&#039;re connected to.&lt;br /&gt;
* Solution: When using SSH, try &amp;lt;code&amp;gt;clicense2&amp;lt;/code&amp;gt; instead of  &amp;lt;code&amp;gt;clicense1&amp;lt;/code&amp;gt;, or vice versa. Revisit your &amp;lt;code&amp;gt;~/.ssh/config&amp;lt;/code&amp;gt; file or use the alternate command line as shown in the SSH section above.&lt;br /&gt;
&lt;br /&gt;
== Multiple CPU cores ==&lt;br /&gt;
Ways to start multi-core (from http://www.comsol.com/support/knowledgebase/1096/)&lt;br /&gt;
 comsol -np 8&lt;br /&gt;
&lt;br /&gt;
 export COMSOL_NUM_THREADS=8    # automatically provided on &#039;&#039;Carbon&#039;&#039;&lt;br /&gt;
 comsol&lt;br /&gt;
* COMSOL does not benefit from hyperthreading (oversubscribing the physical core count).&lt;br /&gt;
&lt;br /&gt;
== Batch jobs ==&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
 comsol -clustersimple batch -inputfile input.mph -outputfile output.mph &lt;br /&gt;
&lt;br /&gt;
 &amp;lt;strike&amp;gt;comsol –nn 8 mpd boot&lt;br /&gt;
 comsol –nn 8 batch –inputfile in.mph&lt;br /&gt;
 comsol mpd allexit&amp;lt;/strike&amp;gt;&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
* http://www.comsol.com/support/knowledgebase/1001/ .&lt;br /&gt;
* [[Media:HPC 2012-05-16 Comsol parallel usage.pdf]] (Modified from http://www.comsol.com/support/knowledgebase/1001/files/4027/cluster_install_linux_42a.pptx – Appendix slide, PBS)&lt;br /&gt;
* &#039;&#039;&#039;Note:&#039;&#039;&#039; MPD is not supported on Carbon (I patched the main comsol script), and no longer necessary at all in Comsol-4.3.&lt;br /&gt;
&lt;br /&gt;
=== Sample Job file ===&lt;br /&gt;
See:&lt;br /&gt;
 $COMSOL_HOME/sample.job&lt;br /&gt;
&lt;br /&gt;
== Important COMSOL Support Articles ==&lt;br /&gt;
* Toplevel suport page: https://www.comsol.com/support&lt;br /&gt;
&lt;br /&gt;
=== KB Articles ===&lt;br /&gt;
* [https://www.comsol.com/support/knowledgebase/1001 Running COMSOL® in parallel on clusters]&lt;br /&gt;
* [https://www.comsol.com/support/knowledgebase/1250 Running parametric sweeps, batch sweeps, and cluster sweeps from the command line]&lt;br /&gt;
* [https://www.comsol.com/support/knowledgebase/1255 Reducing the amount of solution data stored in a model]&lt;br /&gt;
* [https://www.comsol.com/support/knowledgebase/830 Handling large models]&lt;br /&gt;
&lt;br /&gt;
=== Blog-style articles ===&lt;br /&gt;
* [https://www.comsol.com/blogs/the-power-of-the-batch-sweep/ The Power of the Batch Sweep]&lt;br /&gt;
* [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]&lt;/div&gt;</summary>
		<author><name>Stern</name></author>
	</entry>
	<entry>
		<id>https://wiki.anl.gov/wiki_cnm/index.php?title=HPC/Applications/comsol&amp;diff=7470</id>
		<title>HPC/Applications/comsol</title>
		<link rel="alternate" type="text/html" href="https://wiki.anl.gov/wiki_cnm/index.php?title=HPC/Applications/comsol&amp;diff=7470"/>
		<updated>2025-08-11T20:59:12Z</updated>

		<summary type="html">&lt;p&gt;Stern: /* License server */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
The [http://www.comsol.com/products/multiphysics/ &#039;&#039;&#039;COMSOL Multiphysics&#039;&#039;&#039;] application suite&lt;br /&gt;
is available for Mac, Windows, and Linux.&lt;br /&gt;
&lt;br /&gt;
== Access ==&lt;br /&gt;
[[Image:HPC Comsol licensed modules.png|right|450px|thumb|COMSOL features licensed at CNM as of 2024-10.]]&lt;br /&gt;
=== COMSOL Multiphysics ===&lt;br /&gt;
Access to &#039;&#039;&#039;COMSOL Multiphysics&#039;&#039;&#039;, the main application with both a graphical user interface and batch computing capabilities, will be granted &#039;&#039;&#039;&#039;&#039;upon request&#039;&#039;&#039;&#039;&#039;&amp;amp;thinsp;.&lt;br /&gt;
&lt;br /&gt;
You must be:&lt;br /&gt;
* An &#039;&#039;&#039;&#039;&#039;Argonne employee&#039;&#039;&#039;&#039;&#039;&amp;amp;thinsp; in one of the following roles:&lt;br /&gt;
** &#039;&#039;&#039;&#039;&#039;NST staff member&#039;&#039;&#039;&#039;&#039;&amp;amp;thinsp; (including PostDocs, joint appointments, and students at NST).&lt;br /&gt;
** &#039;&#039;&#039;&#039;&#039;CNM Facility User&#039;&#039;&#039;&#039;&#039;&amp;amp;thinsp; (including &#039;&#039;non-NST Argonne employees&#039;&#039;), with an active proposal that has COMSOL in scope. Please see [[HPC/FAQ#Access_and_proposals]].&lt;br /&gt;
&lt;br /&gt;
The set of available COMSOL modules that we have licensed is shown at right.&lt;br /&gt;
&lt;br /&gt;
* The native desktop version can be installed only on &#039;&#039;Argonne-owned&#039;&#039; computers (laptop or desktop). Please contact [mailto:help@anl.gov?Subject=COMSOL%20license%20access%20request CNM support]. Make sure to review [http://www.comsol.com/support/updates/ Product Updates].&lt;br /&gt;
* To run COMSOL on our HPC system &#039;&#039;Carbon&#039;&#039;, as GUI or as batch computing jobs, your proposal must have &#039;&#039;Carbon&#039;&#039; access in scope.&lt;br /&gt;
&lt;br /&gt;
=== COMSOL Server ===&lt;br /&gt;
&#039;&#039;CNM Facility Users&#039;&#039; who are not Argonne employees are not eligible to access&lt;br /&gt;
the full &#039;&#039;&#039;COMSOL Multiphysics&#039;&#039;&#039; product, in compliance with its licensing terms and conditions.&lt;br /&gt;
However, the [https://www.comsol.com/comsol-server &#039;&#039;&#039;COMSOL Server&#039;&#039;&#039;] product offers an alternative&lt;br /&gt;
albeit more narrow means of access.&lt;br /&gt;
&lt;br /&gt;
All users, including &#039;&#039;&#039;&#039;&#039;non-Argonne users&#039;&#039;&#039;&#039;&#039; may be able to run, over a web interface in their browser,&lt;br /&gt;
pre-parameterized &amp;quot;fixed-model&amp;quot; simulations that were made with the &#039;&#039;&#039;COMSOL Application Builder&#039;&#039;&#039; (requires Windows).&lt;br /&gt;
&lt;br /&gt;
To inquire about using COMSOL server applications,&lt;br /&gt;
please contact us.&lt;br /&gt;
&amp;lt;!-- [mailto:cnm_useroffice@anl.gov?Subject=COMSOL%20server%20usage Support]. --&amp;gt;&lt;br /&gt;
We will review possible purchase paths for COMSOL Server, and the &#039;&#039;considerable effort&#039;&#039; likely required by users and the CNM to develop and deploy a COMSOL application.&lt;br /&gt;
&lt;br /&gt;
== Support ==&lt;br /&gt;
* For questions on how to run or start COMSOL:&lt;br /&gt;
*: Submit an [[HPC/Support | &#039;&#039;&#039;IT support request&#039;&#039;&#039;]]&lt;br /&gt;
* For questions related to most COMSOL data or scripts, contact COMSOL support at:&lt;br /&gt;
*: [mailto:support@comsol.com &#039;&#039;&#039;support&#039;&#039;&#039;@comsol.com]&lt;br /&gt;
* &#039;&#039;&#039;Exception:&#039;&#039;&#039; If your support question might contain data that is subject to &#039;&#039;&#039;US Export Control&#039;&#039;&#039; regulations, contact instead:&lt;br /&gt;
*: [mailto:us-export-control@us.comsol.com &#039;&#039;&#039;us-export-control&#039;&#039;&#039;@&#039;&#039;&#039;us&#039;&#039;&#039;.comsol.com]&lt;br /&gt;
&lt;br /&gt;
== The modes to run COMSOL ==&lt;br /&gt;
There are several ways of running COMSOL.&lt;br /&gt;
&lt;br /&gt;
=== Running the desktop application ===&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
# Run on Carbon, display on your desktop using the [http://en.wikipedia.org/wiki/X_Window_System X Window system (X11)].&lt;br /&gt;
#* Requires an &#039;&#039;X11 Server&#039;&#039; application running on your client machine, and SSH X11 forwarding.&lt;br /&gt;
#* The X11 protocol can be slow over LAN.&lt;br /&gt;
# Run on Carbon within a [[HPC/Network Access/Virtual Desktop | virtual desktop environment (VNC)]].&lt;br /&gt;
#* Requires a VNC client on your machine.&lt;br /&gt;
#* It can be confusing where VNC and the app runs.&lt;br /&gt;
#* The virtual desktop presents a (deliberatly) sparse windowing environment – Copy&amp;amp;Paste can be difficult to use.&lt;br /&gt;
# Run on your own computer, remotely checking out Carbon&#039;s license.&lt;br /&gt;
#* Requires a full installation of COMSOL on your desktoo or laptop computer.&lt;br /&gt;
#* 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.&lt;br /&gt;
&lt;br /&gt;
=== Running a batch calculation ===&lt;br /&gt;
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.&lt;br /&gt;
See the [[#Batch jobs|section below]].&lt;br /&gt;
&lt;br /&gt;
== Use with X11 ==&lt;br /&gt;
For casual use, and with [[HPC/Network Access/SSH Tunnel Setup on Linux and MacOS | X11 tunneling to Carbon]] set up, simply add to your &amp;lt;code&amp;gt;~/.bashrc&amp;lt;/code&amp;gt; file on Carbon:&lt;br /&gt;
 module load comsol&lt;br /&gt;
&lt;br /&gt;
Then, from the command line on a Carbon login node, start the COMSOL GUI:&lt;br /&gt;
 comsol &amp;amp;&lt;br /&gt;
&lt;br /&gt;
License configuration is automatic on Carbon.&lt;br /&gt;
&lt;br /&gt;
Comsol will use a number of cores to run calculations multithreaded by default. (On Carbon, COMSOL_NUM_THREADS is set.)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Quit the application&#039;&#039;&#039; as soon as you are done. Only one user can use Comsol at a time.&lt;br /&gt;
&lt;br /&gt;
== Use with VNC ==&lt;br /&gt;
See general  [[HPC/Network Access/Virtual Desktop | instructions on using VNC]], and the COMSOL example therein.&lt;br /&gt;
&lt;br /&gt;
== Native desktop version ==&lt;br /&gt;
&lt;br /&gt;
To get the fastest response from the COMSOL GUI, run a native COMSOL version on your desktop machine or laptop, called &#039;&#039;client machine&#039;&#039; below.&lt;br /&gt;
&lt;br /&gt;
Enter license details either in the COMSOL Setup configuration dialog.&lt;br /&gt;
&lt;br /&gt;
== Native desktop version — License configuration ==&lt;br /&gt;
A client&#039;s COMSOL license needs to be configured depending on how the client reaches CNM network resources. Follow the appropriate section:&lt;br /&gt;
* [[#License configuration when inside CNM or using VPN]]&lt;br /&gt;
* [[#License configuration when outside CNM and using SSH Tunneling]]&lt;br /&gt;
&lt;br /&gt;
=== License configuration when inside CNM or using VPN ===&lt;br /&gt;
==== &amp;lt;span style=&amp;quot;color:#A00;&amp;quot;&amp;gt;Ensure correct DNS search domains&amp;lt;/span&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
* Inspect the client machine&#039;s network configuration.&lt;br /&gt;
* Ensure that &#039;&#039;&#039;two&#039;&#039;&#039; entries are listed as DNS Search Domains for the current network profile:&lt;br /&gt;
 nst.anl.gov&lt;br /&gt;
 cnm.anl.gov&lt;br /&gt;
: (The order of entries does not matter for the purposes considered here.)&lt;br /&gt;
* If the client machine is &#039;&#039;wired to CNM networks&#039;&#039;, the domains are normally provided correctly by DHCP.&lt;br /&gt;
* If the client machine is &#039;&#039;connected over VPN&#039;&#039;, you may need edit the respective network profile.&lt;br /&gt;
:* 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 &amp;quot;Advanced…&amp;quot;. It appears that those changes are being saved and will be activated automatically the next time that this VPN session gets started.&lt;br /&gt;
: [[Image:VNC_add_cnm_to_DNS_1.png|400px]] [[Image:VNC_add_cnm_to_DNS_2.png|400px]]&lt;br /&gt;
:* On Windows or Linux machines, take &#039;&#039;analogous&#039;&#039; steps, using the platform&#039;s own configuration tools.&lt;br /&gt;
&lt;br /&gt;
* Exclude license manager components from client desktop installation. (Those are all handled server-side.)&lt;br /&gt;
&lt;br /&gt;
==== License format ====&lt;br /&gt;
* Floating Network License (FNL), &amp;quot;Three-server redundancy&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==== License servers ====&lt;br /&gt;
* On client machines, while running the COMSOL installer or license configuration, specify license servers and ports as follows:&lt;br /&gt;
 clicense1    1718&lt;br /&gt;
 clicense2    1718&lt;br /&gt;
 clicense3    1718&lt;br /&gt;
: &#039;&#039;&#039;Note:&#039;&#039;&#039; Use &#039;&#039;short host name&#039;&#039; form exactly as given here. (Technical Reason: The license must be usable both on Carbon&#039;s internal network as well as on divisional networks that are outside of Carbon).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Advanced:&#039;&#039;&#039; A client machine&#039;s COMSOL license file &amp;lt;code&amp;gt;&amp;amp;lt;COMSOLDIR&amp;amp;gt;/Multiphysics/license/license.dat&amp;lt;/code&amp;gt; should look as follows:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;make&amp;quot;&amp;gt;&lt;br /&gt;
SERVER clicense1 ANY 1718&lt;br /&gt;
SERVER clicense2 ANY 1718&lt;br /&gt;
SERVER clicense3 ANY 1718&lt;br /&gt;
USE_SERVER&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;amp;lt;COMSOLDIR&amp;amp;gt;&amp;lt;/code&amp;gt; is located by default at:&lt;br /&gt;
* &#039;&#039;&#039;Windows&#039;&#039;&#039;: C:\Program files\COMSOL\COMSOL&#039;&#039;nn&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Linux&#039;&#039;&#039;: /usr/local/comsol&#039;&#039;nn&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Mac&#039;&#039;&#039;: /Applications/COMSOL&#039;&#039;nn&#039;&#039;&lt;br /&gt;
(&amp;quot;&#039;&#039;nn&#039;&#039;&amp;quot; is the application&#039;s abbreviated version number.)&lt;br /&gt;
&lt;br /&gt;
==== Network Troubleshooting ====&lt;br /&gt;
When using the license access model descibed here (as opposed to tunneled over SSH), ensure the following:&lt;br /&gt;
* Verify that short host names can be resolved to IP addresses. Either one of the following commands should produce sensible output:&lt;br /&gt;
 host clicense1&lt;br /&gt;
: or:&lt;br /&gt;
 ping -c 3 clicense1&lt;br /&gt;
* Verify that &#039;&#039;both license ports on the same server&#039;&#039; can be reached from your client machine:&lt;br /&gt;
 telnet &#039;&#039;&#039;clicense1&#039;&#039;&#039; 1718&lt;br /&gt;
 telnet &#039;&#039;&#039;clicense1&#039;&#039;&#039; 1719&lt;br /&gt;
: or:&lt;br /&gt;
 telnet &#039;&#039;&#039;clicense2&#039;&#039;&#039; 1718&lt;br /&gt;
 telnet &#039;&#039;&#039;clicense2&#039;&#039;&#039; 1719&lt;br /&gt;
: A &#039;&#039;successful&#039;&#039; connection looks like:&lt;br /&gt;
 Trying 146.139.x.y...&lt;br /&gt;
 Connected to clicense1.cnm.anl.gov.&lt;br /&gt;
 Escape character is &#039;^]&#039;.&lt;br /&gt;
:: Do not enter any data. Instead,  close each connection by hitting &amp;lt;code&amp;gt;Ctrl&amp;lt;/code&amp;gt;&amp;lt;code&amp;gt;]&amp;lt;/code&amp;gt; (closing square bracket), followed by &amp;lt;code&amp;gt;Ctrl&amp;lt;/code&amp;gt;&amp;lt;code&amp;gt;D&amp;lt;/code&amp;gt;.&lt;br /&gt;
: A &#039;&#039;failed&#039;&#039; connection gives one of these errors:&lt;br /&gt;
 telnet: connect to address 146.139.x.y: Operation timed out&lt;br /&gt;
: or:&lt;br /&gt;
 telnet: connect to address 146.139.x.y: Connection refused&lt;br /&gt;
:: In these cases, ask that your IP firewall configuration be reviewed and changed.&lt;br /&gt;
&lt;br /&gt;
=== License configuration when outside CNM and using SSH Tunneling ===&lt;br /&gt;
If you&#039;re comfortable with ssh and tunneling, configure client licensing as follows:&lt;br /&gt;
&lt;br /&gt;
==== License format ====&lt;br /&gt;
* Floating Network License (FNL), &amp;quot;Port number and Hostname&amp;quot;&lt;br /&gt;
: &#039;&#039;&#039;Note:&#039;&#039;&#039; Three-server redundancy cannot be accessed over SSH tunneling. Instead, the user must configure just one server, and if needed in rare situations manually reconfigure to use the other server if the first one fails.&lt;br /&gt;
&lt;br /&gt;
==== License server ====&lt;br /&gt;
* On running the COMSOL installer, provide as license source:&lt;br /&gt;
** Server: 127.0.0.1&lt;br /&gt;
** Port: 1718&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
Or place a license file with this content:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;make&amp;quot;&amp;gt;&lt;br /&gt;
SERVER 127.0.0.1 ANY 1718&lt;br /&gt;
USE_SERVER&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
: &#039;&#039;&#039;Note:&#039;&#039;&#039; Do not use &amp;quot;localhost&amp;quot;, as this will be directly (and incorrectly) interpreted by COMSOL to mean that the current machine actually &#039;&#039;is&#039;&#039; a license server.&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Connect to &amp;lt;code&amp;gt;mega&amp;lt;/code&amp;gt; or a Carbon login node with one of the following ssh commands:&lt;br /&gt;
* First, set up a tunnel to the primary license server:&lt;br /&gt;
 ssh  -L 1718:&#039;&#039;&#039;clicense1&#039;&#039;&#039;:1718  -L 1719:&#039;&#039;&#039;clicense1&#039;&#039;&#039;:1719  mega.cnm.anl.gov&lt;br /&gt;
* Start COMSOL.&lt;br /&gt;
: If you get an error that the number of licenses is exhausted, that is at least confirmation that you correctly reached the license server.&lt;br /&gt;
&lt;br /&gt;
If the above attempt takes a long time or hangs entirely, it may be because the license service currently runs on the secondary server.&lt;br /&gt;
* Connect to the alternate license server:&lt;br /&gt;
 ssh  -L 1718:&#039;&#039;&#039;clicense2&#039;&#039;&#039;:1718  -L 1719:&#039;&#039;&#039;clicense2&#039;&#039;&#039;:1719  mega.cnm.anl.gov&lt;br /&gt;
* Start COMSOL.&lt;br /&gt;
&lt;br /&gt;
== License Troubleshooting ==&lt;br /&gt;
The following are typical error messages.&lt;br /&gt;
=== Could not obtain license for COMSOL Multiphysics GUI ===&lt;br /&gt;
* Error details:&lt;br /&gt;
 License error: -4.&lt;br /&gt;
 &#039;&#039;&#039;Licensed number of users already reached.&#039;&#039;&#039;&lt;br /&gt;
 Feature:       COMSOLGUI&lt;br /&gt;
 License path:  /Users/stern/Applications/COMSOL52a/license/license.dat:&lt;br /&gt;
 FlexNet Licensing error:-4,132&lt;br /&gt;
* Reason: The connection to the license server succeeded, but the license token(s) you requested are in use.&lt;br /&gt;
* Solution: Wait a bit, or [http://carbonmgmt/ganglia/lic.php identify who&#039;s using COMSOL] and politely ask the user when they might be finished with their work.&lt;br /&gt;
&lt;br /&gt;
=== License server machine is down or not responding ===&lt;br /&gt;
* Error details:&lt;br /&gt;
  License error: -96.&lt;br /&gt;
  See the system administrator about starting the license server system, or&lt;br /&gt;
  make sure you&#039;re referring to the right host (see LM_LICENSE_FILE).&lt;br /&gt;
 Feature:       SERIAL&lt;br /&gt;
 Hostname:      clicense3&lt;br /&gt;
 License path:  /Users/stern/Applications/COMSOL52a/license/license.dat:&lt;br /&gt;
 FlexNet Licensing error:-96,7&lt;br /&gt;
* Reason: The license servers cannot be reached at all. The &amp;lt;code&amp;gt;ping&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;host&amp;lt;/code&amp;gt; tests mentioned above fail.&lt;br /&gt;
* Solution: Review the client license file and DNS lookup domains.&lt;br /&gt;
&lt;br /&gt;
=== License file does not support this version ===&lt;br /&gt;
* Error details:&lt;br /&gt;
  Feature: SERIAL&lt;br /&gt;
 &#039;&#039;&#039;Application version &amp;gt; License version: 5.21 &amp;gt; 3.5&#039;&#039;&#039;&lt;br /&gt;
 License path: /Users/stern/Applications/COMSOL52a/license/license.dat:&lt;br /&gt;
 FlexNet Licensing error:-21,126&lt;br /&gt;
* 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&#039;re connected to.&lt;br /&gt;
* Solution: When using SSH, try &amp;lt;code&amp;gt;clicense2&amp;lt;/code&amp;gt; instead of  &amp;lt;code&amp;gt;clicense1&amp;lt;/code&amp;gt;, or vice versa. Revisit your &amp;lt;code&amp;gt;~/.ssh/config&amp;lt;/code&amp;gt; file or use the alternate command line as shown in the SSH section above.&lt;br /&gt;
&lt;br /&gt;
== Multiple CPU cores ==&lt;br /&gt;
Ways to start multi-core (from http://www.comsol.com/support/knowledgebase/1096/)&lt;br /&gt;
 comsol -np 8&lt;br /&gt;
&lt;br /&gt;
 export COMSOL_NUM_THREADS=8    # automatically provided on &#039;&#039;Carbon&#039;&#039;&lt;br /&gt;
 comsol&lt;br /&gt;
* COMSOL does not benefit from hyperthreading (oversubscribing the physical core count).&lt;br /&gt;
&lt;br /&gt;
== Batch jobs ==&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
 comsol -clustersimple batch -inputfile input.mph -outputfile output.mph &lt;br /&gt;
&lt;br /&gt;
 &amp;lt;strike&amp;gt;comsol –nn 8 mpd boot&lt;br /&gt;
 comsol –nn 8 batch –inputfile in.mph&lt;br /&gt;
 comsol mpd allexit&amp;lt;/strike&amp;gt;&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
* http://www.comsol.com/support/knowledgebase/1001/ .&lt;br /&gt;
* [[Media:HPC 2012-05-16 Comsol parallel usage.pdf]] (Modified from http://www.comsol.com/support/knowledgebase/1001/files/4027/cluster_install_linux_42a.pptx – Appendix slide, PBS)&lt;br /&gt;
* &#039;&#039;&#039;Note:&#039;&#039;&#039; MPD is not supported on Carbon (I patched the main comsol script), and no longer necessary at all in Comsol-4.3.&lt;br /&gt;
&lt;br /&gt;
=== Sample Job file ===&lt;br /&gt;
See:&lt;br /&gt;
 $COMSOL_HOME/sample.job&lt;br /&gt;
&lt;br /&gt;
== Important COMSOL Support Articles ==&lt;br /&gt;
* Toplevel suport page: https://www.comsol.com/support&lt;br /&gt;
&lt;br /&gt;
=== KB Articles ===&lt;br /&gt;
* [https://www.comsol.com/support/knowledgebase/1001 Running COMSOL® in parallel on clusters]&lt;br /&gt;
* [https://www.comsol.com/support/knowledgebase/1250 Running parametric sweeps, batch sweeps, and cluster sweeps from the command line]&lt;br /&gt;
* [https://www.comsol.com/support/knowledgebase/1255 Reducing the amount of solution data stored in a model]&lt;br /&gt;
* [https://www.comsol.com/support/knowledgebase/830 Handling large models]&lt;br /&gt;
&lt;br /&gt;
=== Blog-style articles ===&lt;br /&gt;
* [https://www.comsol.com/blogs/the-power-of-the-batch-sweep/ The Power of the Batch Sweep]&lt;br /&gt;
* [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]&lt;/div&gt;</summary>
		<author><name>Stern</name></author>
	</entry>
	<entry>
		<id>https://wiki.anl.gov/wiki_cnm/index.php?title=HPC/Applications/comsol&amp;diff=7469</id>
		<title>HPC/Applications/comsol</title>
		<link rel="alternate" type="text/html" href="https://wiki.anl.gov/wiki_cnm/index.php?title=HPC/Applications/comsol&amp;diff=7469"/>
		<updated>2025-08-07T15:37:01Z</updated>

		<summary type="html">&lt;p&gt;Stern: /* COMSOL Multiphysics */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
The [http://www.comsol.com/products/multiphysics/ &#039;&#039;&#039;COMSOL Multiphysics&#039;&#039;&#039;] application suite&lt;br /&gt;
is available for Mac, Windows, and Linux.&lt;br /&gt;
&lt;br /&gt;
== Access ==&lt;br /&gt;
[[Image:HPC Comsol licensed modules.png|right|450px|thumb|COMSOL features licensed at CNM as of 2024-10.]]&lt;br /&gt;
=== COMSOL Multiphysics ===&lt;br /&gt;
Access to &#039;&#039;&#039;COMSOL Multiphysics&#039;&#039;&#039;, the main application with both a graphical user interface and batch computing capabilities, will be granted &#039;&#039;&#039;&#039;&#039;upon request&#039;&#039;&#039;&#039;&#039;&amp;amp;thinsp;.&lt;br /&gt;
&lt;br /&gt;
You must be:&lt;br /&gt;
* An &#039;&#039;&#039;&#039;&#039;Argonne employee&#039;&#039;&#039;&#039;&#039;&amp;amp;thinsp; in one of the following roles:&lt;br /&gt;
** &#039;&#039;&#039;&#039;&#039;NST staff member&#039;&#039;&#039;&#039;&#039;&amp;amp;thinsp; (including PostDocs, joint appointments, and students at NST).&lt;br /&gt;
** &#039;&#039;&#039;&#039;&#039;CNM Facility User&#039;&#039;&#039;&#039;&#039;&amp;amp;thinsp; (including &#039;&#039;non-NST Argonne employees&#039;&#039;), with an active proposal that has COMSOL in scope. Please see [[HPC/FAQ#Access_and_proposals]].&lt;br /&gt;
&lt;br /&gt;
The set of available COMSOL modules that we have licensed is shown at right.&lt;br /&gt;
&lt;br /&gt;
* The native desktop version can be installed only on &#039;&#039;Argonne-owned&#039;&#039; computers (laptop or desktop). Please contact [mailto:help@anl.gov?Subject=COMSOL%20license%20access%20request CNM support]. Make sure to review [http://www.comsol.com/support/updates/ Product Updates].&lt;br /&gt;
* To run COMSOL on our HPC system &#039;&#039;Carbon&#039;&#039;, as GUI or as batch computing jobs, your proposal must have &#039;&#039;Carbon&#039;&#039; access in scope.&lt;br /&gt;
&lt;br /&gt;
=== COMSOL Server ===&lt;br /&gt;
&#039;&#039;CNM Facility Users&#039;&#039; who are not Argonne employees are not eligible to access&lt;br /&gt;
the full &#039;&#039;&#039;COMSOL Multiphysics&#039;&#039;&#039; product, in compliance with its licensing terms and conditions.&lt;br /&gt;
However, the [https://www.comsol.com/comsol-server &#039;&#039;&#039;COMSOL Server&#039;&#039;&#039;] product offers an alternative&lt;br /&gt;
albeit more narrow means of access.&lt;br /&gt;
&lt;br /&gt;
All users, including &#039;&#039;&#039;&#039;&#039;non-Argonne users&#039;&#039;&#039;&#039;&#039; may be able to run, over a web interface in their browser,&lt;br /&gt;
pre-parameterized &amp;quot;fixed-model&amp;quot; simulations that were made with the &#039;&#039;&#039;COMSOL Application Builder&#039;&#039;&#039; (requires Windows).&lt;br /&gt;
&lt;br /&gt;
To inquire about using COMSOL server applications,&lt;br /&gt;
please contact us.&lt;br /&gt;
&amp;lt;!-- [mailto:cnm_useroffice@anl.gov?Subject=COMSOL%20server%20usage Support]. --&amp;gt;&lt;br /&gt;
We will review possible purchase paths for COMSOL Server, and the &#039;&#039;considerable effort&#039;&#039; likely required by users and the CNM to develop and deploy a COMSOL application.&lt;br /&gt;
&lt;br /&gt;
== Support ==&lt;br /&gt;
* For questions on how to run or start COMSOL:&lt;br /&gt;
*: Submit an [[HPC/Support | &#039;&#039;&#039;IT support request&#039;&#039;&#039;]]&lt;br /&gt;
* For questions related to most COMSOL data or scripts, contact COMSOL support at:&lt;br /&gt;
*: [mailto:support@comsol.com &#039;&#039;&#039;support&#039;&#039;&#039;@comsol.com]&lt;br /&gt;
* &#039;&#039;&#039;Exception:&#039;&#039;&#039; If your support question might contain data that is subject to &#039;&#039;&#039;US Export Control&#039;&#039;&#039; regulations, contact instead:&lt;br /&gt;
*: [mailto:us-export-control@us.comsol.com &#039;&#039;&#039;us-export-control&#039;&#039;&#039;@&#039;&#039;&#039;us&#039;&#039;&#039;.comsol.com]&lt;br /&gt;
&lt;br /&gt;
== The modes to run COMSOL ==&lt;br /&gt;
There are several ways of running COMSOL.&lt;br /&gt;
&lt;br /&gt;
=== Running the desktop application ===&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
# Run on Carbon, display on your desktop using the [http://en.wikipedia.org/wiki/X_Window_System X Window system (X11)].&lt;br /&gt;
#* Requires an &#039;&#039;X11 Server&#039;&#039; application running on your client machine, and SSH X11 forwarding.&lt;br /&gt;
#* The X11 protocol can be slow over LAN.&lt;br /&gt;
# Run on Carbon within a [[HPC/Network Access/Virtual Desktop | virtual desktop environment (VNC)]].&lt;br /&gt;
#* Requires a VNC client on your machine.&lt;br /&gt;
#* It can be confusing where VNC and the app runs.&lt;br /&gt;
#* The virtual desktop presents a (deliberatly) sparse windowing environment – Copy&amp;amp;Paste can be difficult to use.&lt;br /&gt;
# Run on your own computer, remotely checking out Carbon&#039;s license.&lt;br /&gt;
#* Requires a full installation of COMSOL on your desktoo or laptop computer.&lt;br /&gt;
#* 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.&lt;br /&gt;
&lt;br /&gt;
=== Running a batch calculation ===&lt;br /&gt;
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.&lt;br /&gt;
See the [[#Batch jobs|section below]].&lt;br /&gt;
&lt;br /&gt;
== Use with X11 ==&lt;br /&gt;
For casual use, and with [[HPC/Network Access/SSH Tunnel Setup on Linux and MacOS | X11 tunneling to Carbon]] set up, simply add to your &amp;lt;code&amp;gt;~/.bashrc&amp;lt;/code&amp;gt; file on Carbon:&lt;br /&gt;
 module load comsol&lt;br /&gt;
&lt;br /&gt;
Then, from the command line on a Carbon login node, start the COMSOL GUI:&lt;br /&gt;
 comsol &amp;amp;&lt;br /&gt;
&lt;br /&gt;
License configuration is automatic on Carbon.&lt;br /&gt;
&lt;br /&gt;
Comsol will use a number of cores to run calculations multithreaded by default. (On Carbon, COMSOL_NUM_THREADS is set.)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Quit the application&#039;&#039;&#039; as soon as you are done. Only one user can use Comsol at a time.&lt;br /&gt;
&lt;br /&gt;
== Use with VNC ==&lt;br /&gt;
See general  [[HPC/Network Access/Virtual Desktop | instructions on using VNC]], and the COMSOL example therein.&lt;br /&gt;
&lt;br /&gt;
== Native desktop version ==&lt;br /&gt;
&lt;br /&gt;
To get the fastest response from the COMSOL GUI, run a native COMSOL version on your desktop machine or laptop, called &#039;&#039;client machine&#039;&#039; below.&lt;br /&gt;
&lt;br /&gt;
Enter license details either in the COMSOL Setup configuration dialog.&lt;br /&gt;
&lt;br /&gt;
== Native desktop version — License configuration ==&lt;br /&gt;
A client&#039;s COMSOL license needs to be configured depending on how the client reaches CNM network resources. Follow the appropriate section:&lt;br /&gt;
* [[#License configuration when inside CNM or using VPN]]&lt;br /&gt;
* [[#License configuration when outside CNM and using SSH Tunneling]]&lt;br /&gt;
&lt;br /&gt;
=== License configuration when inside CNM or using VPN ===&lt;br /&gt;
==== &amp;lt;span style=&amp;quot;color:#A00;&amp;quot;&amp;gt;Ensure correct DNS search domains&amp;lt;/span&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
* Inspect the client machine&#039;s network configuration.&lt;br /&gt;
* Ensure that &#039;&#039;&#039;two&#039;&#039;&#039; entries are listed as DNS Search Domains for the current network profile:&lt;br /&gt;
 nst.anl.gov&lt;br /&gt;
 cnm.anl.gov&lt;br /&gt;
: (The order of entries does not matter for the purposes considered here.)&lt;br /&gt;
* If the client machine is &#039;&#039;wired to CNM networks&#039;&#039;, the domains are normally provided correctly by DHCP.&lt;br /&gt;
* If the client machine is &#039;&#039;connected over VPN&#039;&#039;, you may need edit the respective network profile.&lt;br /&gt;
:* 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 &amp;quot;Advanced…&amp;quot;. It appears that those changes are being saved and will be activated automatically the next time that this VPN session gets started.&lt;br /&gt;
: [[Image:VNC_add_cnm_to_DNS_1.png|400px]] [[Image:VNC_add_cnm_to_DNS_2.png|400px]]&lt;br /&gt;
:* On Windows or Linux machines, take &#039;&#039;analogous&#039;&#039; steps, using the platform&#039;s own configuration tools.&lt;br /&gt;
&lt;br /&gt;
* Exclude license manager components from client desktop installation. (Those are all handled server-side.)&lt;br /&gt;
&lt;br /&gt;
==== License format ====&lt;br /&gt;
* Floating Network License (FNL), &amp;quot;Three-server redundancy&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==== License servers ====&lt;br /&gt;
* On client machines, while running the COMSOL installer or license configuration, specify license servers and ports as follows:&lt;br /&gt;
 clicense1    1718&lt;br /&gt;
 clicense2    1718&lt;br /&gt;
 clicense3    1718&lt;br /&gt;
: &#039;&#039;&#039;Note:&#039;&#039;&#039; Use &#039;&#039;short host name&#039;&#039; form exactly as given here. (Technical Reason: The license must be usable both on Carbon&#039;s internal network as well as on divisional networks that are outside of Carbon).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Advanced:&#039;&#039;&#039; A client machine&#039;s COMSOL license file &amp;lt;code&amp;gt;&amp;amp;lt;COMSOLDIR&amp;amp;gt;/Multiphysics/license/license.dat&amp;lt;/code&amp;gt; should look as follows:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;make&amp;quot;&amp;gt;&lt;br /&gt;
SERVER clicense1 ANY 1718&lt;br /&gt;
SERVER clicense2 ANY 1718&lt;br /&gt;
SERVER clicense3 ANY 1718&lt;br /&gt;
USE_SERVER&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;amp;lt;COMSOLDIR&amp;amp;gt;&amp;lt;/code&amp;gt; is located by default at:&lt;br /&gt;
* &#039;&#039;&#039;Windows&#039;&#039;&#039;: C:\Program files\COMSOL\COMSOL&#039;&#039;nn&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Linux&#039;&#039;&#039;: /usr/local/comsol&#039;&#039;nn&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Mac&#039;&#039;&#039;: /Applications/COMSOL&#039;&#039;nn&#039;&#039;&lt;br /&gt;
(&amp;quot;&#039;&#039;nn&#039;&#039;&amp;quot; is the application&#039;s abbreviated version number.)&lt;br /&gt;
&lt;br /&gt;
==== Network Troubleshooting ====&lt;br /&gt;
When using the license access model descibed here (as opposed to tunneled over SSH), ensure the following:&lt;br /&gt;
* Verify that short host names can be resolved to IP addresses. Either one of the following commands should produce sensible output:&lt;br /&gt;
 host clicense1&lt;br /&gt;
: or:&lt;br /&gt;
 ping -c 3 clicense1&lt;br /&gt;
* Verify that &#039;&#039;both license ports on the same server&#039;&#039; can be reached from your client machine:&lt;br /&gt;
 telnet &#039;&#039;&#039;clicense1&#039;&#039;&#039; 1718&lt;br /&gt;
 telnet &#039;&#039;&#039;clicense1&#039;&#039;&#039; 1719&lt;br /&gt;
: or:&lt;br /&gt;
 telnet &#039;&#039;&#039;clicense2&#039;&#039;&#039; 1718&lt;br /&gt;
 telnet &#039;&#039;&#039;clicense2&#039;&#039;&#039; 1719&lt;br /&gt;
: A &#039;&#039;successful&#039;&#039; connection looks like:&lt;br /&gt;
 Trying 146.139.x.y...&lt;br /&gt;
 Connected to clicense1.cnm.anl.gov.&lt;br /&gt;
 Escape character is &#039;^]&#039;.&lt;br /&gt;
:: Do not enter any data. Instead,  close each connection by hitting &amp;lt;code&amp;gt;Ctrl&amp;lt;/code&amp;gt;&amp;lt;code&amp;gt;]&amp;lt;/code&amp;gt; (closing square bracket), followed by &amp;lt;code&amp;gt;Ctrl&amp;lt;/code&amp;gt;&amp;lt;code&amp;gt;D&amp;lt;/code&amp;gt;.&lt;br /&gt;
: A &#039;&#039;failed&#039;&#039; connection gives one of these errors:&lt;br /&gt;
 telnet: connect to address 146.139.x.y: Operation timed out&lt;br /&gt;
: or:&lt;br /&gt;
 telnet: connect to address 146.139.x.y: Connection refused&lt;br /&gt;
:: In these cases, ask that your IP firewall configuration be reviewed and changed.&lt;br /&gt;
&lt;br /&gt;
=== License configuration when outside CNM and using SSH Tunneling ===&lt;br /&gt;
If you&#039;re comfortable with ssh and tunneling, configure client licensing as follows:&lt;br /&gt;
&lt;br /&gt;
==== License format ====&lt;br /&gt;
* Floating Network License (FNL), &amp;quot;Port number and Hostname&amp;quot;&lt;br /&gt;
: &#039;&#039;&#039;Note:&#039;&#039;&#039; Three-server redundancy cannot be accessed over SSH tunneling. Instead, the user must configure just one server, and if needed in rare situations manually reconfigure to use the other server if the first one fails.&lt;br /&gt;
&lt;br /&gt;
==== License server ====&lt;br /&gt;
* Enter into the COMSOL license file:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;make&amp;quot;&amp;gt;&lt;br /&gt;
SERVER 127.0.0.1 ANY 1718&lt;br /&gt;
USE_SERVER&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
: &#039;&#039;&#039;Note:&#039;&#039;&#039; Do not use &amp;quot;localhost&amp;quot;, as this will be directly (and incorrectly) interpreted by COMSOL to mean that the current machine actually &#039;&#039;is&#039;&#039; a license server.&lt;br /&gt;
&lt;br /&gt;
Connect to &amp;lt;code&amp;gt;mega&amp;lt;/code&amp;gt; or a Carbon login node with one of the following ssh commands:&lt;br /&gt;
* First, set up a tunnel to the primary license server:&lt;br /&gt;
 ssh  -L 1718:&#039;&#039;&#039;clicense1&#039;&#039;&#039;:1718  -L 1719:&#039;&#039;&#039;clicense1&#039;&#039;&#039;:1719  mega&lt;br /&gt;
* Start COMSOL.&lt;br /&gt;
: If you get an error that the number of licenses is exhausted, that is at least confirmation that you correctly reached the license server.&lt;br /&gt;
&lt;br /&gt;
If the above attempt takes a long time or hangs entirely, it may be because the license service currently runs on the secondary server.&lt;br /&gt;
* Connect to the alternate license server:&lt;br /&gt;
 ssh  -L 1718:&#039;&#039;&#039;clicense2&#039;&#039;&#039;:1718  -L 1719:&#039;&#039;&#039;clicense2&#039;&#039;&#039;:1719  mega&lt;br /&gt;
* Start COMSOL.&lt;br /&gt;
&lt;br /&gt;
== License Troubleshooting ==&lt;br /&gt;
The following are typical error messages.&lt;br /&gt;
=== Could not obtain license for COMSOL Multiphysics GUI ===&lt;br /&gt;
* Error details:&lt;br /&gt;
 License error: -4.&lt;br /&gt;
 &#039;&#039;&#039;Licensed number of users already reached.&#039;&#039;&#039;&lt;br /&gt;
 Feature:       COMSOLGUI&lt;br /&gt;
 License path:  /Users/stern/Applications/COMSOL52a/license/license.dat:&lt;br /&gt;
 FlexNet Licensing error:-4,132&lt;br /&gt;
* Reason: The connection to the license server succeeded, but the license token(s) you requested are in use.&lt;br /&gt;
* Solution: Wait a bit, or [http://carbonmgmt/ganglia/lic.php identify who&#039;s using COMSOL] and politely ask the user when they might be finished with their work.&lt;br /&gt;
&lt;br /&gt;
=== License server machine is down or not responding ===&lt;br /&gt;
* Error details:&lt;br /&gt;
  License error: -96.&lt;br /&gt;
  See the system administrator about starting the license server system, or&lt;br /&gt;
  make sure you&#039;re referring to the right host (see LM_LICENSE_FILE).&lt;br /&gt;
 Feature:       SERIAL&lt;br /&gt;
 Hostname:      clicense3&lt;br /&gt;
 License path:  /Users/stern/Applications/COMSOL52a/license/license.dat:&lt;br /&gt;
 FlexNet Licensing error:-96,7&lt;br /&gt;
* Reason: The license servers cannot be reached at all. The &amp;lt;code&amp;gt;ping&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;host&amp;lt;/code&amp;gt; tests mentioned above fail.&lt;br /&gt;
* Solution: Review the client license file and DNS lookup domains.&lt;br /&gt;
&lt;br /&gt;
=== License file does not support this version ===&lt;br /&gt;
* Error details:&lt;br /&gt;
  Feature: SERIAL&lt;br /&gt;
 &#039;&#039;&#039;Application version &amp;gt; License version: 5.21 &amp;gt; 3.5&#039;&#039;&#039;&lt;br /&gt;
 License path: /Users/stern/Applications/COMSOL52a/license/license.dat:&lt;br /&gt;
 FlexNet Licensing error:-21,126&lt;br /&gt;
* 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&#039;re connected to.&lt;br /&gt;
* Solution: When using SSH, try &amp;lt;code&amp;gt;clicense2&amp;lt;/code&amp;gt; instead of  &amp;lt;code&amp;gt;clicense1&amp;lt;/code&amp;gt;, or vice versa. Revisit your &amp;lt;code&amp;gt;~/.ssh/config&amp;lt;/code&amp;gt; file or use the alternate command line as shown in the SSH section above.&lt;br /&gt;
&lt;br /&gt;
== Multiple CPU cores ==&lt;br /&gt;
Ways to start multi-core (from http://www.comsol.com/support/knowledgebase/1096/)&lt;br /&gt;
 comsol -np 8&lt;br /&gt;
&lt;br /&gt;
 export COMSOL_NUM_THREADS=8    # automatically provided on &#039;&#039;Carbon&#039;&#039;&lt;br /&gt;
 comsol&lt;br /&gt;
* COMSOL does not benefit from hyperthreading (oversubscribing the physical core count).&lt;br /&gt;
&lt;br /&gt;
== Batch jobs ==&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
 comsol -clustersimple batch -inputfile input.mph -outputfile output.mph &lt;br /&gt;
&lt;br /&gt;
 &amp;lt;strike&amp;gt;comsol –nn 8 mpd boot&lt;br /&gt;
 comsol –nn 8 batch –inputfile in.mph&lt;br /&gt;
 comsol mpd allexit&amp;lt;/strike&amp;gt;&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
* http://www.comsol.com/support/knowledgebase/1001/ .&lt;br /&gt;
* [[Media:HPC 2012-05-16 Comsol parallel usage.pdf]] (Modified from http://www.comsol.com/support/knowledgebase/1001/files/4027/cluster_install_linux_42a.pptx – Appendix slide, PBS)&lt;br /&gt;
* &#039;&#039;&#039;Note:&#039;&#039;&#039; MPD is not supported on Carbon (I patched the main comsol script), and no longer necessary at all in Comsol-4.3.&lt;br /&gt;
&lt;br /&gt;
=== Sample Job file ===&lt;br /&gt;
See:&lt;br /&gt;
 $COMSOL_HOME/sample.job&lt;br /&gt;
&lt;br /&gt;
== Important COMSOL Support Articles ==&lt;br /&gt;
* Toplevel suport page: https://www.comsol.com/support&lt;br /&gt;
&lt;br /&gt;
=== KB Articles ===&lt;br /&gt;
* [https://www.comsol.com/support/knowledgebase/1001 Running COMSOL® in parallel on clusters]&lt;br /&gt;
* [https://www.comsol.com/support/knowledgebase/1250 Running parametric sweeps, batch sweeps, and cluster sweeps from the command line]&lt;br /&gt;
* [https://www.comsol.com/support/knowledgebase/1255 Reducing the amount of solution data stored in a model]&lt;br /&gt;
* [https://www.comsol.com/support/knowledgebase/830 Handling large models]&lt;br /&gt;
&lt;br /&gt;
=== Blog-style articles ===&lt;br /&gt;
* [https://www.comsol.com/blogs/the-power-of-the-batch-sweep/ The Power of the Batch Sweep]&lt;br /&gt;
* [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]&lt;/div&gt;</summary>
		<author><name>Stern</name></author>
	</entry>
	<entry>
		<id>https://wiki.anl.gov/wiki_cnm/index.php?title=HPC/Applications/comsol&amp;diff=7468</id>
		<title>HPC/Applications/comsol</title>
		<link rel="alternate" type="text/html" href="https://wiki.anl.gov/wiki_cnm/index.php?title=HPC/Applications/comsol&amp;diff=7468"/>
		<updated>2025-08-07T15:33:57Z</updated>

		<summary type="html">&lt;p&gt;Stern: /* COMSOL Multiphysics */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
The [http://www.comsol.com/products/multiphysics/ &#039;&#039;&#039;COMSOL Multiphysics&#039;&#039;&#039;] application suite&lt;br /&gt;
is available for Mac, Windows, and Linux.&lt;br /&gt;
&lt;br /&gt;
== Access ==&lt;br /&gt;
[[Image:HPC Comsol licensed modules.png|right|450px|thumb|COMSOL features licensed at CNM as of 2024-10.]]&lt;br /&gt;
=== COMSOL Multiphysics ===&lt;br /&gt;
Access to &#039;&#039;&#039;COMSOL Multiphysics&#039;&#039;&#039;, the main application with both a graphical user interface and batch computing capabilities, will be granted &#039;&#039;&#039;&#039;&#039;upon request&#039;&#039;&#039;&#039;&#039;&amp;amp;thinsp;.&lt;br /&gt;
&lt;br /&gt;
You must be:&lt;br /&gt;
* An &#039;&#039;&#039;&#039;&#039;Argonne employee&#039;&#039;&#039;&#039;&#039;&amp;amp;thinsp; in one of the following roles:&lt;br /&gt;
** &#039;&#039;&#039;&#039;&#039;NST staff member&#039;&#039;&#039;&#039;&#039;&amp;amp;thinsp; (including PostDocs, joint appointments, and students at NST).&lt;br /&gt;
** &#039;&#039;&#039;&#039;&#039;CNM Facility User&#039;&#039;&#039;&#039;&#039;&amp;amp;thinsp; (including &#039;&#039;non-NST Argonne employees&#039;&#039;), with an active proposal that has COMSOL in scope. Please see [[HPC/FAQ#Access_and_proposals]].&lt;br /&gt;
&lt;br /&gt;
The set of available COMSOL modules that we have licensed is shown at right.&lt;br /&gt;
&lt;br /&gt;
* To have a native desktop version installed on your Argonne-owned computer (laptop or desktop), please contact [mailto:help@anl.gov?Subject=COMSOL%20license%20access%20request CNM support]. Make sure to review [http://www.comsol.com/support/updates/ Product Updates].&lt;br /&gt;
* To run COMSOL on our HPC system &#039;&#039;Carbon&#039;&#039;, as GUI or as batch computing jobs, your proposal must have &#039;&#039;Carbon&#039;&#039; access in scope.&lt;br /&gt;
&lt;br /&gt;
=== COMSOL Server ===&lt;br /&gt;
&#039;&#039;CNM Facility Users&#039;&#039; who are not Argonne employees are not eligible to access&lt;br /&gt;
the full &#039;&#039;&#039;COMSOL Multiphysics&#039;&#039;&#039; product, in compliance with its licensing terms and conditions.&lt;br /&gt;
However, the [https://www.comsol.com/comsol-server &#039;&#039;&#039;COMSOL Server&#039;&#039;&#039;] product offers an alternative&lt;br /&gt;
albeit more narrow means of access.&lt;br /&gt;
&lt;br /&gt;
All users, including &#039;&#039;&#039;&#039;&#039;non-Argonne users&#039;&#039;&#039;&#039;&#039; may be able to run, over a web interface in their browser,&lt;br /&gt;
pre-parameterized &amp;quot;fixed-model&amp;quot; simulations that were made with the &#039;&#039;&#039;COMSOL Application Builder&#039;&#039;&#039; (requires Windows).&lt;br /&gt;
&lt;br /&gt;
To inquire about using COMSOL server applications,&lt;br /&gt;
please contact us.&lt;br /&gt;
&amp;lt;!-- [mailto:cnm_useroffice@anl.gov?Subject=COMSOL%20server%20usage Support]. --&amp;gt;&lt;br /&gt;
We will review possible purchase paths for COMSOL Server, and the &#039;&#039;considerable effort&#039;&#039; likely required by users and the CNM to develop and deploy a COMSOL application.&lt;br /&gt;
&lt;br /&gt;
== Support ==&lt;br /&gt;
* For questions on how to run or start COMSOL:&lt;br /&gt;
*: Submit an [[HPC/Support | &#039;&#039;&#039;IT support request&#039;&#039;&#039;]]&lt;br /&gt;
* For questions related to most COMSOL data or scripts, contact COMSOL support at:&lt;br /&gt;
*: [mailto:support@comsol.com &#039;&#039;&#039;support&#039;&#039;&#039;@comsol.com]&lt;br /&gt;
* &#039;&#039;&#039;Exception:&#039;&#039;&#039; If your support question might contain data that is subject to &#039;&#039;&#039;US Export Control&#039;&#039;&#039; regulations, contact instead:&lt;br /&gt;
*: [mailto:us-export-control@us.comsol.com &#039;&#039;&#039;us-export-control&#039;&#039;&#039;@&#039;&#039;&#039;us&#039;&#039;&#039;.comsol.com]&lt;br /&gt;
&lt;br /&gt;
== The modes to run COMSOL ==&lt;br /&gt;
There are several ways of running COMSOL.&lt;br /&gt;
&lt;br /&gt;
=== Running the desktop application ===&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
# Run on Carbon, display on your desktop using the [http://en.wikipedia.org/wiki/X_Window_System X Window system (X11)].&lt;br /&gt;
#* Requires an &#039;&#039;X11 Server&#039;&#039; application running on your client machine, and SSH X11 forwarding.&lt;br /&gt;
#* The X11 protocol can be slow over LAN.&lt;br /&gt;
# Run on Carbon within a [[HPC/Network Access/Virtual Desktop | virtual desktop environment (VNC)]].&lt;br /&gt;
#* Requires a VNC client on your machine.&lt;br /&gt;
#* It can be confusing where VNC and the app runs.&lt;br /&gt;
#* The virtual desktop presents a (deliberatly) sparse windowing environment – Copy&amp;amp;Paste can be difficult to use.&lt;br /&gt;
# Run on your own computer, remotely checking out Carbon&#039;s license.&lt;br /&gt;
#* Requires a full installation of COMSOL on your desktoo or laptop computer.&lt;br /&gt;
#* 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.&lt;br /&gt;
&lt;br /&gt;
=== Running a batch calculation ===&lt;br /&gt;
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.&lt;br /&gt;
See the [[#Batch jobs|section below]].&lt;br /&gt;
&lt;br /&gt;
== Use with X11 ==&lt;br /&gt;
For casual use, and with [[HPC/Network Access/SSH Tunnel Setup on Linux and MacOS | X11 tunneling to Carbon]] set up, simply add to your &amp;lt;code&amp;gt;~/.bashrc&amp;lt;/code&amp;gt; file on Carbon:&lt;br /&gt;
 module load comsol&lt;br /&gt;
&lt;br /&gt;
Then, from the command line on a Carbon login node, start the COMSOL GUI:&lt;br /&gt;
 comsol &amp;amp;&lt;br /&gt;
&lt;br /&gt;
License configuration is automatic on Carbon.&lt;br /&gt;
&lt;br /&gt;
Comsol will use a number of cores to run calculations multithreaded by default. (On Carbon, COMSOL_NUM_THREADS is set.)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Quit the application&#039;&#039;&#039; as soon as you are done. Only one user can use Comsol at a time.&lt;br /&gt;
&lt;br /&gt;
== Use with VNC ==&lt;br /&gt;
See general  [[HPC/Network Access/Virtual Desktop | instructions on using VNC]], and the COMSOL example therein.&lt;br /&gt;
&lt;br /&gt;
== Native desktop version ==&lt;br /&gt;
&lt;br /&gt;
To get the fastest response from the COMSOL GUI, run a native COMSOL version on your desktop machine or laptop, called &#039;&#039;client machine&#039;&#039; below.&lt;br /&gt;
&lt;br /&gt;
Enter license details either in the COMSOL Setup configuration dialog.&lt;br /&gt;
&lt;br /&gt;
== Native desktop version — License configuration ==&lt;br /&gt;
A client&#039;s COMSOL license needs to be configured depending on how the client reaches CNM network resources. Follow the appropriate section:&lt;br /&gt;
* [[#License configuration when inside CNM or using VPN]]&lt;br /&gt;
* [[#License configuration when outside CNM and using SSH Tunneling]]&lt;br /&gt;
&lt;br /&gt;
=== License configuration when inside CNM or using VPN ===&lt;br /&gt;
==== &amp;lt;span style=&amp;quot;color:#A00;&amp;quot;&amp;gt;Ensure correct DNS search domains&amp;lt;/span&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
* Inspect the client machine&#039;s network configuration.&lt;br /&gt;
* Ensure that &#039;&#039;&#039;two&#039;&#039;&#039; entries are listed as DNS Search Domains for the current network profile:&lt;br /&gt;
 nst.anl.gov&lt;br /&gt;
 cnm.anl.gov&lt;br /&gt;
: (The order of entries does not matter for the purposes considered here.)&lt;br /&gt;
* If the client machine is &#039;&#039;wired to CNM networks&#039;&#039;, the domains are normally provided correctly by DHCP.&lt;br /&gt;
* If the client machine is &#039;&#039;connected over VPN&#039;&#039;, you may need edit the respective network profile.&lt;br /&gt;
:* 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 &amp;quot;Advanced…&amp;quot;. It appears that those changes are being saved and will be activated automatically the next time that this VPN session gets started.&lt;br /&gt;
: [[Image:VNC_add_cnm_to_DNS_1.png|400px]] [[Image:VNC_add_cnm_to_DNS_2.png|400px]]&lt;br /&gt;
:* On Windows or Linux machines, take &#039;&#039;analogous&#039;&#039; steps, using the platform&#039;s own configuration tools.&lt;br /&gt;
&lt;br /&gt;
* Exclude license manager components from client desktop installation. (Those are all handled server-side.)&lt;br /&gt;
&lt;br /&gt;
==== License format ====&lt;br /&gt;
* Floating Network License (FNL), &amp;quot;Three-server redundancy&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==== License servers ====&lt;br /&gt;
* On client machines, while running the COMSOL installer or license configuration, specify license servers and ports as follows:&lt;br /&gt;
 clicense1    1718&lt;br /&gt;
 clicense2    1718&lt;br /&gt;
 clicense3    1718&lt;br /&gt;
: &#039;&#039;&#039;Note:&#039;&#039;&#039; Use &#039;&#039;short host name&#039;&#039; form exactly as given here. (Technical Reason: The license must be usable both on Carbon&#039;s internal network as well as on divisional networks that are outside of Carbon).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Advanced:&#039;&#039;&#039; A client machine&#039;s COMSOL license file &amp;lt;code&amp;gt;&amp;amp;lt;COMSOLDIR&amp;amp;gt;/Multiphysics/license/license.dat&amp;lt;/code&amp;gt; should look as follows:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;make&amp;quot;&amp;gt;&lt;br /&gt;
SERVER clicense1 ANY 1718&lt;br /&gt;
SERVER clicense2 ANY 1718&lt;br /&gt;
SERVER clicense3 ANY 1718&lt;br /&gt;
USE_SERVER&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;amp;lt;COMSOLDIR&amp;amp;gt;&amp;lt;/code&amp;gt; is located by default at:&lt;br /&gt;
* &#039;&#039;&#039;Windows&#039;&#039;&#039;: C:\Program files\COMSOL\COMSOL&#039;&#039;nn&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Linux&#039;&#039;&#039;: /usr/local/comsol&#039;&#039;nn&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Mac&#039;&#039;&#039;: /Applications/COMSOL&#039;&#039;nn&#039;&#039;&lt;br /&gt;
(&amp;quot;&#039;&#039;nn&#039;&#039;&amp;quot; is the application&#039;s abbreviated version number.)&lt;br /&gt;
&lt;br /&gt;
==== Network Troubleshooting ====&lt;br /&gt;
When using the license access model descibed here (as opposed to tunneled over SSH), ensure the following:&lt;br /&gt;
* Verify that short host names can be resolved to IP addresses. Either one of the following commands should produce sensible output:&lt;br /&gt;
 host clicense1&lt;br /&gt;
: or:&lt;br /&gt;
 ping -c 3 clicense1&lt;br /&gt;
* Verify that &#039;&#039;both license ports on the same server&#039;&#039; can be reached from your client machine:&lt;br /&gt;
 telnet &#039;&#039;&#039;clicense1&#039;&#039;&#039; 1718&lt;br /&gt;
 telnet &#039;&#039;&#039;clicense1&#039;&#039;&#039; 1719&lt;br /&gt;
: or:&lt;br /&gt;
 telnet &#039;&#039;&#039;clicense2&#039;&#039;&#039; 1718&lt;br /&gt;
 telnet &#039;&#039;&#039;clicense2&#039;&#039;&#039; 1719&lt;br /&gt;
: A &#039;&#039;successful&#039;&#039; connection looks like:&lt;br /&gt;
 Trying 146.139.x.y...&lt;br /&gt;
 Connected to clicense1.cnm.anl.gov.&lt;br /&gt;
 Escape character is &#039;^]&#039;.&lt;br /&gt;
:: Do not enter any data. Instead,  close each connection by hitting &amp;lt;code&amp;gt;Ctrl&amp;lt;/code&amp;gt;&amp;lt;code&amp;gt;]&amp;lt;/code&amp;gt; (closing square bracket), followed by &amp;lt;code&amp;gt;Ctrl&amp;lt;/code&amp;gt;&amp;lt;code&amp;gt;D&amp;lt;/code&amp;gt;.&lt;br /&gt;
: A &#039;&#039;failed&#039;&#039; connection gives one of these errors:&lt;br /&gt;
 telnet: connect to address 146.139.x.y: Operation timed out&lt;br /&gt;
: or:&lt;br /&gt;
 telnet: connect to address 146.139.x.y: Connection refused&lt;br /&gt;
:: In these cases, ask that your IP firewall configuration be reviewed and changed.&lt;br /&gt;
&lt;br /&gt;
=== License configuration when outside CNM and using SSH Tunneling ===&lt;br /&gt;
If you&#039;re comfortable with ssh and tunneling, configure client licensing as follows:&lt;br /&gt;
&lt;br /&gt;
==== License format ====&lt;br /&gt;
* Floating Network License (FNL), &amp;quot;Port number and Hostname&amp;quot;&lt;br /&gt;
: &#039;&#039;&#039;Note:&#039;&#039;&#039; Three-server redundancy cannot be accessed over SSH tunneling. Instead, the user must configure just one server, and if needed in rare situations manually reconfigure to use the other server if the first one fails.&lt;br /&gt;
&lt;br /&gt;
==== License server ====&lt;br /&gt;
* Enter into the COMSOL license file:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;make&amp;quot;&amp;gt;&lt;br /&gt;
SERVER 127.0.0.1 ANY 1718&lt;br /&gt;
USE_SERVER&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
: &#039;&#039;&#039;Note:&#039;&#039;&#039; Do not use &amp;quot;localhost&amp;quot;, as this will be directly (and incorrectly) interpreted by COMSOL to mean that the current machine actually &#039;&#039;is&#039;&#039; a license server.&lt;br /&gt;
&lt;br /&gt;
Connect to &amp;lt;code&amp;gt;mega&amp;lt;/code&amp;gt; or a Carbon login node with one of the following ssh commands:&lt;br /&gt;
* First, set up a tunnel to the primary license server:&lt;br /&gt;
 ssh  -L 1718:&#039;&#039;&#039;clicense1&#039;&#039;&#039;:1718  -L 1719:&#039;&#039;&#039;clicense1&#039;&#039;&#039;:1719  mega&lt;br /&gt;
* Start COMSOL.&lt;br /&gt;
: If you get an error that the number of licenses is exhausted, that is at least confirmation that you correctly reached the license server.&lt;br /&gt;
&lt;br /&gt;
If the above attempt takes a long time or hangs entirely, it may be because the license service currently runs on the secondary server.&lt;br /&gt;
* Connect to the alternate license server:&lt;br /&gt;
 ssh  -L 1718:&#039;&#039;&#039;clicense2&#039;&#039;&#039;:1718  -L 1719:&#039;&#039;&#039;clicense2&#039;&#039;&#039;:1719  mega&lt;br /&gt;
* Start COMSOL.&lt;br /&gt;
&lt;br /&gt;
== License Troubleshooting ==&lt;br /&gt;
The following are typical error messages.&lt;br /&gt;
=== Could not obtain license for COMSOL Multiphysics GUI ===&lt;br /&gt;
* Error details:&lt;br /&gt;
 License error: -4.&lt;br /&gt;
 &#039;&#039;&#039;Licensed number of users already reached.&#039;&#039;&#039;&lt;br /&gt;
 Feature:       COMSOLGUI&lt;br /&gt;
 License path:  /Users/stern/Applications/COMSOL52a/license/license.dat:&lt;br /&gt;
 FlexNet Licensing error:-4,132&lt;br /&gt;
* Reason: The connection to the license server succeeded, but the license token(s) you requested are in use.&lt;br /&gt;
* Solution: Wait a bit, or [http://carbonmgmt/ganglia/lic.php identify who&#039;s using COMSOL] and politely ask the user when they might be finished with their work.&lt;br /&gt;
&lt;br /&gt;
=== License server machine is down or not responding ===&lt;br /&gt;
* Error details:&lt;br /&gt;
  License error: -96.&lt;br /&gt;
  See the system administrator about starting the license server system, or&lt;br /&gt;
  make sure you&#039;re referring to the right host (see LM_LICENSE_FILE).&lt;br /&gt;
 Feature:       SERIAL&lt;br /&gt;
 Hostname:      clicense3&lt;br /&gt;
 License path:  /Users/stern/Applications/COMSOL52a/license/license.dat:&lt;br /&gt;
 FlexNet Licensing error:-96,7&lt;br /&gt;
* Reason: The license servers cannot be reached at all. The &amp;lt;code&amp;gt;ping&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;host&amp;lt;/code&amp;gt; tests mentioned above fail.&lt;br /&gt;
* Solution: Review the client license file and DNS lookup domains.&lt;br /&gt;
&lt;br /&gt;
=== License file does not support this version ===&lt;br /&gt;
* Error details:&lt;br /&gt;
  Feature: SERIAL&lt;br /&gt;
 &#039;&#039;&#039;Application version &amp;gt; License version: 5.21 &amp;gt; 3.5&#039;&#039;&#039;&lt;br /&gt;
 License path: /Users/stern/Applications/COMSOL52a/license/license.dat:&lt;br /&gt;
 FlexNet Licensing error:-21,126&lt;br /&gt;
* 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&#039;re connected to.&lt;br /&gt;
* Solution: When using SSH, try &amp;lt;code&amp;gt;clicense2&amp;lt;/code&amp;gt; instead of  &amp;lt;code&amp;gt;clicense1&amp;lt;/code&amp;gt;, or vice versa. Revisit your &amp;lt;code&amp;gt;~/.ssh/config&amp;lt;/code&amp;gt; file or use the alternate command line as shown in the SSH section above.&lt;br /&gt;
&lt;br /&gt;
== Multiple CPU cores ==&lt;br /&gt;
Ways to start multi-core (from http://www.comsol.com/support/knowledgebase/1096/)&lt;br /&gt;
 comsol -np 8&lt;br /&gt;
&lt;br /&gt;
 export COMSOL_NUM_THREADS=8    # automatically provided on &#039;&#039;Carbon&#039;&#039;&lt;br /&gt;
 comsol&lt;br /&gt;
* COMSOL does not benefit from hyperthreading (oversubscribing the physical core count).&lt;br /&gt;
&lt;br /&gt;
== Batch jobs ==&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
 comsol -clustersimple batch -inputfile input.mph -outputfile output.mph &lt;br /&gt;
&lt;br /&gt;
 &amp;lt;strike&amp;gt;comsol –nn 8 mpd boot&lt;br /&gt;
 comsol –nn 8 batch –inputfile in.mph&lt;br /&gt;
 comsol mpd allexit&amp;lt;/strike&amp;gt;&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
* http://www.comsol.com/support/knowledgebase/1001/ .&lt;br /&gt;
* [[Media:HPC 2012-05-16 Comsol parallel usage.pdf]] (Modified from http://www.comsol.com/support/knowledgebase/1001/files/4027/cluster_install_linux_42a.pptx – Appendix slide, PBS)&lt;br /&gt;
* &#039;&#039;&#039;Note:&#039;&#039;&#039; MPD is not supported on Carbon (I patched the main comsol script), and no longer necessary at all in Comsol-4.3.&lt;br /&gt;
&lt;br /&gt;
=== Sample Job file ===&lt;br /&gt;
See:&lt;br /&gt;
 $COMSOL_HOME/sample.job&lt;br /&gt;
&lt;br /&gt;
== Important COMSOL Support Articles ==&lt;br /&gt;
* Toplevel suport page: https://www.comsol.com/support&lt;br /&gt;
&lt;br /&gt;
=== KB Articles ===&lt;br /&gt;
* [https://www.comsol.com/support/knowledgebase/1001 Running COMSOL® in parallel on clusters]&lt;br /&gt;
* [https://www.comsol.com/support/knowledgebase/1250 Running parametric sweeps, batch sweeps, and cluster sweeps from the command line]&lt;br /&gt;
* [https://www.comsol.com/support/knowledgebase/1255 Reducing the amount of solution data stored in a model]&lt;br /&gt;
* [https://www.comsol.com/support/knowledgebase/830 Handling large models]&lt;br /&gt;
&lt;br /&gt;
=== Blog-style articles ===&lt;br /&gt;
* [https://www.comsol.com/blogs/the-power-of-the-batch-sweep/ The Power of the Batch Sweep]&lt;br /&gt;
* [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]&lt;/div&gt;</summary>
		<author><name>Stern</name></author>
	</entry>
	<entry>
		<id>https://wiki.anl.gov/wiki_cnm/index.php?title=HPC/Applications/comsol&amp;diff=7467</id>
		<title>HPC/Applications/comsol</title>
		<link rel="alternate" type="text/html" href="https://wiki.anl.gov/wiki_cnm/index.php?title=HPC/Applications/comsol&amp;diff=7467"/>
		<updated>2025-08-07T15:32:31Z</updated>

		<summary type="html">&lt;p&gt;Stern: /* COMSOL Multiphysics */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
The [http://www.comsol.com/products/multiphysics/ &#039;&#039;&#039;COMSOL Multiphysics&#039;&#039;&#039;] application suite&lt;br /&gt;
is available for Mac, Windows, and Linux.&lt;br /&gt;
&lt;br /&gt;
== Access ==&lt;br /&gt;
[[Image:HPC Comsol licensed modules.png|right|450px|thumb|COMSOL features licensed at CNM as of 2024-10.]]&lt;br /&gt;
=== COMSOL Multiphysics ===&lt;br /&gt;
Access to &#039;&#039;&#039;COMSOL Multiphysics&#039;&#039;&#039;, the main application with both a graphical user interface and batch computing capabilities, will be granted &#039;&#039;&#039;&#039;&#039;upon request&#039;&#039;&#039;&#039;&#039;&amp;amp;thinsp;.&lt;br /&gt;
&lt;br /&gt;
You must be:&lt;br /&gt;
* An &#039;&#039;&#039;&#039;&#039;Argonne employee&#039;&#039;&#039;&#039;&#039;&amp;amp;thinsp; in one of the following roles:&lt;br /&gt;
** &#039;&#039;&#039;&#039;&#039;NST staff member&#039;&#039;&#039;&#039;&#039;&amp;amp;thinsp; (including PostDocs, joint appointments, and students at NST).&lt;br /&gt;
** &#039;&#039;&#039;&#039;&#039;CNM Facility User&#039;&#039;&#039;&#039;&#039;&amp;amp;thinsp; (including &#039;&#039;non-NST Argonne employees&#039;&#039;), with an active proposal that has COMSOL in scope. This includes . — please see [[HPC/FAQ#Access_and_proposals]].&lt;br /&gt;
&lt;br /&gt;
The set of available COMSOL modules that we have licensed is shown at right.&lt;br /&gt;
&lt;br /&gt;
* To have a native desktop version installed on your Argonne-owned computer (laptop or desktop), please contact [mailto:help@anl.gov?Subject=COMSOL%20license%20access%20request CNM support]. Make sure to review [http://www.comsol.com/support/updates/ Product Updates].&lt;br /&gt;
* To run COMSOL on our HPC system &#039;&#039;Carbon&#039;&#039;, as GUI or as batch computing jobs, your proposal must have &#039;&#039;Carbon&#039;&#039; access in scope.&lt;br /&gt;
&lt;br /&gt;
=== COMSOL Server ===&lt;br /&gt;
&#039;&#039;CNM Facility Users&#039;&#039; who are not Argonne employees are not eligible to access&lt;br /&gt;
the full &#039;&#039;&#039;COMSOL Multiphysics&#039;&#039;&#039; product, in compliance with its licensing terms and conditions.&lt;br /&gt;
However, the [https://www.comsol.com/comsol-server &#039;&#039;&#039;COMSOL Server&#039;&#039;&#039;] product offers an alternative&lt;br /&gt;
albeit more narrow means of access.&lt;br /&gt;
&lt;br /&gt;
All users, including &#039;&#039;&#039;&#039;&#039;non-Argonne users&#039;&#039;&#039;&#039;&#039; may be able to run, over a web interface in their browser,&lt;br /&gt;
pre-parameterized &amp;quot;fixed-model&amp;quot; simulations that were made with the &#039;&#039;&#039;COMSOL Application Builder&#039;&#039;&#039; (requires Windows).&lt;br /&gt;
&lt;br /&gt;
To inquire about using COMSOL server applications,&lt;br /&gt;
please contact us.&lt;br /&gt;
&amp;lt;!-- [mailto:cnm_useroffice@anl.gov?Subject=COMSOL%20server%20usage Support]. --&amp;gt;&lt;br /&gt;
We will review possible purchase paths for COMSOL Server, and the &#039;&#039;considerable effort&#039;&#039; likely required by users and the CNM to develop and deploy a COMSOL application.&lt;br /&gt;
&lt;br /&gt;
== Support ==&lt;br /&gt;
* For questions on how to run or start COMSOL:&lt;br /&gt;
*: Submit an [[HPC/Support | &#039;&#039;&#039;IT support request&#039;&#039;&#039;]]&lt;br /&gt;
* For questions related to most COMSOL data or scripts, contact COMSOL support at:&lt;br /&gt;
*: [mailto:support@comsol.com &#039;&#039;&#039;support&#039;&#039;&#039;@comsol.com]&lt;br /&gt;
* &#039;&#039;&#039;Exception:&#039;&#039;&#039; If your support question might contain data that is subject to &#039;&#039;&#039;US Export Control&#039;&#039;&#039; regulations, contact instead:&lt;br /&gt;
*: [mailto:us-export-control@us.comsol.com &#039;&#039;&#039;us-export-control&#039;&#039;&#039;@&#039;&#039;&#039;us&#039;&#039;&#039;.comsol.com]&lt;br /&gt;
&lt;br /&gt;
== The modes to run COMSOL ==&lt;br /&gt;
There are several ways of running COMSOL.&lt;br /&gt;
&lt;br /&gt;
=== Running the desktop application ===&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
# Run on Carbon, display on your desktop using the [http://en.wikipedia.org/wiki/X_Window_System X Window system (X11)].&lt;br /&gt;
#* Requires an &#039;&#039;X11 Server&#039;&#039; application running on your client machine, and SSH X11 forwarding.&lt;br /&gt;
#* The X11 protocol can be slow over LAN.&lt;br /&gt;
# Run on Carbon within a [[HPC/Network Access/Virtual Desktop | virtual desktop environment (VNC)]].&lt;br /&gt;
#* Requires a VNC client on your machine.&lt;br /&gt;
#* It can be confusing where VNC and the app runs.&lt;br /&gt;
#* The virtual desktop presents a (deliberatly) sparse windowing environment – Copy&amp;amp;Paste can be difficult to use.&lt;br /&gt;
# Run on your own computer, remotely checking out Carbon&#039;s license.&lt;br /&gt;
#* Requires a full installation of COMSOL on your desktoo or laptop computer.&lt;br /&gt;
#* 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.&lt;br /&gt;
&lt;br /&gt;
=== Running a batch calculation ===&lt;br /&gt;
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.&lt;br /&gt;
See the [[#Batch jobs|section below]].&lt;br /&gt;
&lt;br /&gt;
== Use with X11 ==&lt;br /&gt;
For casual use, and with [[HPC/Network Access/SSH Tunnel Setup on Linux and MacOS | X11 tunneling to Carbon]] set up, simply add to your &amp;lt;code&amp;gt;~/.bashrc&amp;lt;/code&amp;gt; file on Carbon:&lt;br /&gt;
 module load comsol&lt;br /&gt;
&lt;br /&gt;
Then, from the command line on a Carbon login node, start the COMSOL GUI:&lt;br /&gt;
 comsol &amp;amp;&lt;br /&gt;
&lt;br /&gt;
License configuration is automatic on Carbon.&lt;br /&gt;
&lt;br /&gt;
Comsol will use a number of cores to run calculations multithreaded by default. (On Carbon, COMSOL_NUM_THREADS is set.)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Quit the application&#039;&#039;&#039; as soon as you are done. Only one user can use Comsol at a time.&lt;br /&gt;
&lt;br /&gt;
== Use with VNC ==&lt;br /&gt;
See general  [[HPC/Network Access/Virtual Desktop | instructions on using VNC]], and the COMSOL example therein.&lt;br /&gt;
&lt;br /&gt;
== Native desktop version ==&lt;br /&gt;
&lt;br /&gt;
To get the fastest response from the COMSOL GUI, run a native COMSOL version on your desktop machine or laptop, called &#039;&#039;client machine&#039;&#039; below.&lt;br /&gt;
&lt;br /&gt;
Enter license details either in the COMSOL Setup configuration dialog.&lt;br /&gt;
&lt;br /&gt;
== Native desktop version — License configuration ==&lt;br /&gt;
A client&#039;s COMSOL license needs to be configured depending on how the client reaches CNM network resources. Follow the appropriate section:&lt;br /&gt;
* [[#License configuration when inside CNM or using VPN]]&lt;br /&gt;
* [[#License configuration when outside CNM and using SSH Tunneling]]&lt;br /&gt;
&lt;br /&gt;
=== License configuration when inside CNM or using VPN ===&lt;br /&gt;
==== &amp;lt;span style=&amp;quot;color:#A00;&amp;quot;&amp;gt;Ensure correct DNS search domains&amp;lt;/span&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
* Inspect the client machine&#039;s network configuration.&lt;br /&gt;
* Ensure that &#039;&#039;&#039;two&#039;&#039;&#039; entries are listed as DNS Search Domains for the current network profile:&lt;br /&gt;
 nst.anl.gov&lt;br /&gt;
 cnm.anl.gov&lt;br /&gt;
: (The order of entries does not matter for the purposes considered here.)&lt;br /&gt;
* If the client machine is &#039;&#039;wired to CNM networks&#039;&#039;, the domains are normally provided correctly by DHCP.&lt;br /&gt;
* If the client machine is &#039;&#039;connected over VPN&#039;&#039;, you may need edit the respective network profile.&lt;br /&gt;
:* 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 &amp;quot;Advanced…&amp;quot;. It appears that those changes are being saved and will be activated automatically the next time that this VPN session gets started.&lt;br /&gt;
: [[Image:VNC_add_cnm_to_DNS_1.png|400px]] [[Image:VNC_add_cnm_to_DNS_2.png|400px]]&lt;br /&gt;
:* On Windows or Linux machines, take &#039;&#039;analogous&#039;&#039; steps, using the platform&#039;s own configuration tools.&lt;br /&gt;
&lt;br /&gt;
* Exclude license manager components from client desktop installation. (Those are all handled server-side.)&lt;br /&gt;
&lt;br /&gt;
==== License format ====&lt;br /&gt;
* Floating Network License (FNL), &amp;quot;Three-server redundancy&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==== License servers ====&lt;br /&gt;
* On client machines, while running the COMSOL installer or license configuration, specify license servers and ports as follows:&lt;br /&gt;
 clicense1    1718&lt;br /&gt;
 clicense2    1718&lt;br /&gt;
 clicense3    1718&lt;br /&gt;
: &#039;&#039;&#039;Note:&#039;&#039;&#039; Use &#039;&#039;short host name&#039;&#039; form exactly as given here. (Technical Reason: The license must be usable both on Carbon&#039;s internal network as well as on divisional networks that are outside of Carbon).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Advanced:&#039;&#039;&#039; A client machine&#039;s COMSOL license file &amp;lt;code&amp;gt;&amp;amp;lt;COMSOLDIR&amp;amp;gt;/Multiphysics/license/license.dat&amp;lt;/code&amp;gt; should look as follows:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;make&amp;quot;&amp;gt;&lt;br /&gt;
SERVER clicense1 ANY 1718&lt;br /&gt;
SERVER clicense2 ANY 1718&lt;br /&gt;
SERVER clicense3 ANY 1718&lt;br /&gt;
USE_SERVER&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;amp;lt;COMSOLDIR&amp;amp;gt;&amp;lt;/code&amp;gt; is located by default at:&lt;br /&gt;
* &#039;&#039;&#039;Windows&#039;&#039;&#039;: C:\Program files\COMSOL\COMSOL&#039;&#039;nn&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Linux&#039;&#039;&#039;: /usr/local/comsol&#039;&#039;nn&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Mac&#039;&#039;&#039;: /Applications/COMSOL&#039;&#039;nn&#039;&#039;&lt;br /&gt;
(&amp;quot;&#039;&#039;nn&#039;&#039;&amp;quot; is the application&#039;s abbreviated version number.)&lt;br /&gt;
&lt;br /&gt;
==== Network Troubleshooting ====&lt;br /&gt;
When using the license access model descibed here (as opposed to tunneled over SSH), ensure the following:&lt;br /&gt;
* Verify that short host names can be resolved to IP addresses. Either one of the following commands should produce sensible output:&lt;br /&gt;
 host clicense1&lt;br /&gt;
: or:&lt;br /&gt;
 ping -c 3 clicense1&lt;br /&gt;
* Verify that &#039;&#039;both license ports on the same server&#039;&#039; can be reached from your client machine:&lt;br /&gt;
 telnet &#039;&#039;&#039;clicense1&#039;&#039;&#039; 1718&lt;br /&gt;
 telnet &#039;&#039;&#039;clicense1&#039;&#039;&#039; 1719&lt;br /&gt;
: or:&lt;br /&gt;
 telnet &#039;&#039;&#039;clicense2&#039;&#039;&#039; 1718&lt;br /&gt;
 telnet &#039;&#039;&#039;clicense2&#039;&#039;&#039; 1719&lt;br /&gt;
: A &#039;&#039;successful&#039;&#039; connection looks like:&lt;br /&gt;
 Trying 146.139.x.y...&lt;br /&gt;
 Connected to clicense1.cnm.anl.gov.&lt;br /&gt;
 Escape character is &#039;^]&#039;.&lt;br /&gt;
:: Do not enter any data. Instead,  close each connection by hitting &amp;lt;code&amp;gt;Ctrl&amp;lt;/code&amp;gt;&amp;lt;code&amp;gt;]&amp;lt;/code&amp;gt; (closing square bracket), followed by &amp;lt;code&amp;gt;Ctrl&amp;lt;/code&amp;gt;&amp;lt;code&amp;gt;D&amp;lt;/code&amp;gt;.&lt;br /&gt;
: A &#039;&#039;failed&#039;&#039; connection gives one of these errors:&lt;br /&gt;
 telnet: connect to address 146.139.x.y: Operation timed out&lt;br /&gt;
: or:&lt;br /&gt;
 telnet: connect to address 146.139.x.y: Connection refused&lt;br /&gt;
:: In these cases, ask that your IP firewall configuration be reviewed and changed.&lt;br /&gt;
&lt;br /&gt;
=== License configuration when outside CNM and using SSH Tunneling ===&lt;br /&gt;
If you&#039;re comfortable with ssh and tunneling, configure client licensing as follows:&lt;br /&gt;
&lt;br /&gt;
==== License format ====&lt;br /&gt;
* Floating Network License (FNL), &amp;quot;Port number and Hostname&amp;quot;&lt;br /&gt;
: &#039;&#039;&#039;Note:&#039;&#039;&#039; Three-server redundancy cannot be accessed over SSH tunneling. Instead, the user must configure just one server, and if needed in rare situations manually reconfigure to use the other server if the first one fails.&lt;br /&gt;
&lt;br /&gt;
==== License server ====&lt;br /&gt;
* Enter into the COMSOL license file:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;make&amp;quot;&amp;gt;&lt;br /&gt;
SERVER 127.0.0.1 ANY 1718&lt;br /&gt;
USE_SERVER&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
: &#039;&#039;&#039;Note:&#039;&#039;&#039; Do not use &amp;quot;localhost&amp;quot;, as this will be directly (and incorrectly) interpreted by COMSOL to mean that the current machine actually &#039;&#039;is&#039;&#039; a license server.&lt;br /&gt;
&lt;br /&gt;
Connect to &amp;lt;code&amp;gt;mega&amp;lt;/code&amp;gt; or a Carbon login node with one of the following ssh commands:&lt;br /&gt;
* First, set up a tunnel to the primary license server:&lt;br /&gt;
 ssh  -L 1718:&#039;&#039;&#039;clicense1&#039;&#039;&#039;:1718  -L 1719:&#039;&#039;&#039;clicense1&#039;&#039;&#039;:1719  mega&lt;br /&gt;
* Start COMSOL.&lt;br /&gt;
: If you get an error that the number of licenses is exhausted, that is at least confirmation that you correctly reached the license server.&lt;br /&gt;
&lt;br /&gt;
If the above attempt takes a long time or hangs entirely, it may be because the license service currently runs on the secondary server.&lt;br /&gt;
* Connect to the alternate license server:&lt;br /&gt;
 ssh  -L 1718:&#039;&#039;&#039;clicense2&#039;&#039;&#039;:1718  -L 1719:&#039;&#039;&#039;clicense2&#039;&#039;&#039;:1719  mega&lt;br /&gt;
* Start COMSOL.&lt;br /&gt;
&lt;br /&gt;
== License Troubleshooting ==&lt;br /&gt;
The following are typical error messages.&lt;br /&gt;
=== Could not obtain license for COMSOL Multiphysics GUI ===&lt;br /&gt;
* Error details:&lt;br /&gt;
 License error: -4.&lt;br /&gt;
 &#039;&#039;&#039;Licensed number of users already reached.&#039;&#039;&#039;&lt;br /&gt;
 Feature:       COMSOLGUI&lt;br /&gt;
 License path:  /Users/stern/Applications/COMSOL52a/license/license.dat:&lt;br /&gt;
 FlexNet Licensing error:-4,132&lt;br /&gt;
* Reason: The connection to the license server succeeded, but the license token(s) you requested are in use.&lt;br /&gt;
* Solution: Wait a bit, or [http://carbonmgmt/ganglia/lic.php identify who&#039;s using COMSOL] and politely ask the user when they might be finished with their work.&lt;br /&gt;
&lt;br /&gt;
=== License server machine is down or not responding ===&lt;br /&gt;
* Error details:&lt;br /&gt;
  License error: -96.&lt;br /&gt;
  See the system administrator about starting the license server system, or&lt;br /&gt;
  make sure you&#039;re referring to the right host (see LM_LICENSE_FILE).&lt;br /&gt;
 Feature:       SERIAL&lt;br /&gt;
 Hostname:      clicense3&lt;br /&gt;
 License path:  /Users/stern/Applications/COMSOL52a/license/license.dat:&lt;br /&gt;
 FlexNet Licensing error:-96,7&lt;br /&gt;
* Reason: The license servers cannot be reached at all. The &amp;lt;code&amp;gt;ping&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;host&amp;lt;/code&amp;gt; tests mentioned above fail.&lt;br /&gt;
* Solution: Review the client license file and DNS lookup domains.&lt;br /&gt;
&lt;br /&gt;
=== License file does not support this version ===&lt;br /&gt;
* Error details:&lt;br /&gt;
  Feature: SERIAL&lt;br /&gt;
 &#039;&#039;&#039;Application version &amp;gt; License version: 5.21 &amp;gt; 3.5&#039;&#039;&#039;&lt;br /&gt;
 License path: /Users/stern/Applications/COMSOL52a/license/license.dat:&lt;br /&gt;
 FlexNet Licensing error:-21,126&lt;br /&gt;
* 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&#039;re connected to.&lt;br /&gt;
* Solution: When using SSH, try &amp;lt;code&amp;gt;clicense2&amp;lt;/code&amp;gt; instead of  &amp;lt;code&amp;gt;clicense1&amp;lt;/code&amp;gt;, or vice versa. Revisit your &amp;lt;code&amp;gt;~/.ssh/config&amp;lt;/code&amp;gt; file or use the alternate command line as shown in the SSH section above.&lt;br /&gt;
&lt;br /&gt;
== Multiple CPU cores ==&lt;br /&gt;
Ways to start multi-core (from http://www.comsol.com/support/knowledgebase/1096/)&lt;br /&gt;
 comsol -np 8&lt;br /&gt;
&lt;br /&gt;
 export COMSOL_NUM_THREADS=8    # automatically provided on &#039;&#039;Carbon&#039;&#039;&lt;br /&gt;
 comsol&lt;br /&gt;
* COMSOL does not benefit from hyperthreading (oversubscribing the physical core count).&lt;br /&gt;
&lt;br /&gt;
== Batch jobs ==&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
 comsol -clustersimple batch -inputfile input.mph -outputfile output.mph &lt;br /&gt;
&lt;br /&gt;
 &amp;lt;strike&amp;gt;comsol –nn 8 mpd boot&lt;br /&gt;
 comsol –nn 8 batch –inputfile in.mph&lt;br /&gt;
 comsol mpd allexit&amp;lt;/strike&amp;gt;&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
* http://www.comsol.com/support/knowledgebase/1001/ .&lt;br /&gt;
* [[Media:HPC 2012-05-16 Comsol parallel usage.pdf]] (Modified from http://www.comsol.com/support/knowledgebase/1001/files/4027/cluster_install_linux_42a.pptx – Appendix slide, PBS)&lt;br /&gt;
* &#039;&#039;&#039;Note:&#039;&#039;&#039; MPD is not supported on Carbon (I patched the main comsol script), and no longer necessary at all in Comsol-4.3.&lt;br /&gt;
&lt;br /&gt;
=== Sample Job file ===&lt;br /&gt;
See:&lt;br /&gt;
 $COMSOL_HOME/sample.job&lt;br /&gt;
&lt;br /&gt;
== Important COMSOL Support Articles ==&lt;br /&gt;
* Toplevel suport page: https://www.comsol.com/support&lt;br /&gt;
&lt;br /&gt;
=== KB Articles ===&lt;br /&gt;
* [https://www.comsol.com/support/knowledgebase/1001 Running COMSOL® in parallel on clusters]&lt;br /&gt;
* [https://www.comsol.com/support/knowledgebase/1250 Running parametric sweeps, batch sweeps, and cluster sweeps from the command line]&lt;br /&gt;
* [https://www.comsol.com/support/knowledgebase/1255 Reducing the amount of solution data stored in a model]&lt;br /&gt;
* [https://www.comsol.com/support/knowledgebase/830 Handling large models]&lt;br /&gt;
&lt;br /&gt;
=== Blog-style articles ===&lt;br /&gt;
* [https://www.comsol.com/blogs/the-power-of-the-batch-sweep/ The Power of the Batch Sweep]&lt;br /&gt;
* [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]&lt;/div&gt;</summary>
		<author><name>Stern</name></author>
	</entry>
	<entry>
		<id>https://wiki.anl.gov/wiki_cnm/index.php?title=HPC/Applications/comsol&amp;diff=7466</id>
		<title>HPC/Applications/comsol</title>
		<link rel="alternate" type="text/html" href="https://wiki.anl.gov/wiki_cnm/index.php?title=HPC/Applications/comsol&amp;diff=7466"/>
		<updated>2025-08-07T15:26:59Z</updated>

		<summary type="html">&lt;p&gt;Stern: /* COMSOL Multiphysics */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
The [http://www.comsol.com/products/multiphysics/ &#039;&#039;&#039;COMSOL Multiphysics&#039;&#039;&#039;] application suite&lt;br /&gt;
is available for Mac, Windows, and Linux.&lt;br /&gt;
&lt;br /&gt;
== Access ==&lt;br /&gt;
[[Image:HPC Comsol licensed modules.png|right|450px|thumb|COMSOL features licensed at CNM as of 2024-10.]]&lt;br /&gt;
=== COMSOL Multiphysics ===&lt;br /&gt;
Access to &#039;&#039;&#039;COMSOL Multiphysics&#039;&#039;&#039;, the main application with both a graphical user interface and batch computing capabilities, will be granted &#039;&#039;&#039;&#039;&#039;upon request&#039;&#039;&#039;&#039;&#039;&amp;amp;thinsp;.&lt;br /&gt;
&lt;br /&gt;
You must be:&lt;br /&gt;
* An &#039;&#039;&#039;&#039;&#039;Argonne employee&#039;&#039;&#039;&#039;&#039;&amp;amp;thinsp; in one of the following roles:&lt;br /&gt;
** &#039;&#039;&#039;&#039;&#039;CNM Facility User&#039;&#039;&#039;&#039;&#039;&amp;amp;thinsp; with an active proposal that has COMSOL in scope — please see [[HPC/FAQ#Access_and_proposals]].&lt;br /&gt;
** &#039;&#039;&#039;&#039;&#039;NST staff&#039;&#039;&#039;&#039;&#039;&amp;amp;thinsp; (including PostDocs, joint appointments, and students).&lt;br /&gt;
&lt;br /&gt;
The set of available COMSOL modules that we have licensed is shown at right.&lt;br /&gt;
&lt;br /&gt;
* To have a native desktop version installed on your Argonne-owned computer (laptop or desktop), please contact [mailto:help@anl.gov?Subject=COMSOL%20license%20access%20request CNM support]. Make sure to review [http://www.comsol.com/support/updates/ Product Updates].&lt;br /&gt;
* To run COMSOL on our HPC system &#039;&#039;Carbon&#039;&#039;, as GUI or as batch computing jobs, your proposal must have &#039;&#039;Carbon&#039;&#039; access in scope.&lt;br /&gt;
&lt;br /&gt;
=== COMSOL Server ===&lt;br /&gt;
&#039;&#039;CNM Facility Users&#039;&#039; who are not Argonne employees are not eligible to access&lt;br /&gt;
the full &#039;&#039;&#039;COMSOL Multiphysics&#039;&#039;&#039; product, in compliance with its licensing terms and conditions.&lt;br /&gt;
However, the [https://www.comsol.com/comsol-server &#039;&#039;&#039;COMSOL Server&#039;&#039;&#039;] product offers an alternative&lt;br /&gt;
albeit more narrow means of access.&lt;br /&gt;
&lt;br /&gt;
All users, including &#039;&#039;&#039;&#039;&#039;non-Argonne users&#039;&#039;&#039;&#039;&#039; may be able to run, over a web interface in their browser,&lt;br /&gt;
pre-parameterized &amp;quot;fixed-model&amp;quot; simulations that were made with the &#039;&#039;&#039;COMSOL Application Builder&#039;&#039;&#039; (requires Windows).&lt;br /&gt;
&lt;br /&gt;
To inquire about using COMSOL server applications,&lt;br /&gt;
please contact us.&lt;br /&gt;
&amp;lt;!-- [mailto:cnm_useroffice@anl.gov?Subject=COMSOL%20server%20usage Support]. --&amp;gt;&lt;br /&gt;
We will review possible purchase paths for COMSOL Server, and the &#039;&#039;considerable effort&#039;&#039; likely required by users and the CNM to develop and deploy a COMSOL application.&lt;br /&gt;
&lt;br /&gt;
== Support ==&lt;br /&gt;
* For questions on how to run or start COMSOL:&lt;br /&gt;
*: Submit an [[HPC/Support | &#039;&#039;&#039;IT support request&#039;&#039;&#039;]]&lt;br /&gt;
* For questions related to most COMSOL data or scripts, contact COMSOL support at:&lt;br /&gt;
*: [mailto:support@comsol.com &#039;&#039;&#039;support&#039;&#039;&#039;@comsol.com]&lt;br /&gt;
* &#039;&#039;&#039;Exception:&#039;&#039;&#039; If your support question might contain data that is subject to &#039;&#039;&#039;US Export Control&#039;&#039;&#039; regulations, contact instead:&lt;br /&gt;
*: [mailto:us-export-control@us.comsol.com &#039;&#039;&#039;us-export-control&#039;&#039;&#039;@&#039;&#039;&#039;us&#039;&#039;&#039;.comsol.com]&lt;br /&gt;
&lt;br /&gt;
== The modes to run COMSOL ==&lt;br /&gt;
There are several ways of running COMSOL.&lt;br /&gt;
&lt;br /&gt;
=== Running the desktop application ===&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
# Run on Carbon, display on your desktop using the [http://en.wikipedia.org/wiki/X_Window_System X Window system (X11)].&lt;br /&gt;
#* Requires an &#039;&#039;X11 Server&#039;&#039; application running on your client machine, and SSH X11 forwarding.&lt;br /&gt;
#* The X11 protocol can be slow over LAN.&lt;br /&gt;
# Run on Carbon within a [[HPC/Network Access/Virtual Desktop | virtual desktop environment (VNC)]].&lt;br /&gt;
#* Requires a VNC client on your machine.&lt;br /&gt;
#* It can be confusing where VNC and the app runs.&lt;br /&gt;
#* The virtual desktop presents a (deliberatly) sparse windowing environment – Copy&amp;amp;Paste can be difficult to use.&lt;br /&gt;
# Run on your own computer, remotely checking out Carbon&#039;s license.&lt;br /&gt;
#* Requires a full installation of COMSOL on your desktoo or laptop computer.&lt;br /&gt;
#* 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.&lt;br /&gt;
&lt;br /&gt;
=== Running a batch calculation ===&lt;br /&gt;
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.&lt;br /&gt;
See the [[#Batch jobs|section below]].&lt;br /&gt;
&lt;br /&gt;
== Use with X11 ==&lt;br /&gt;
For casual use, and with [[HPC/Network Access/SSH Tunnel Setup on Linux and MacOS | X11 tunneling to Carbon]] set up, simply add to your &amp;lt;code&amp;gt;~/.bashrc&amp;lt;/code&amp;gt; file on Carbon:&lt;br /&gt;
 module load comsol&lt;br /&gt;
&lt;br /&gt;
Then, from the command line on a Carbon login node, start the COMSOL GUI:&lt;br /&gt;
 comsol &amp;amp;&lt;br /&gt;
&lt;br /&gt;
License configuration is automatic on Carbon.&lt;br /&gt;
&lt;br /&gt;
Comsol will use a number of cores to run calculations multithreaded by default. (On Carbon, COMSOL_NUM_THREADS is set.)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Quit the application&#039;&#039;&#039; as soon as you are done. Only one user can use Comsol at a time.&lt;br /&gt;
&lt;br /&gt;
== Use with VNC ==&lt;br /&gt;
See general  [[HPC/Network Access/Virtual Desktop | instructions on using VNC]], and the COMSOL example therein.&lt;br /&gt;
&lt;br /&gt;
== Native desktop version ==&lt;br /&gt;
&lt;br /&gt;
To get the fastest response from the COMSOL GUI, run a native COMSOL version on your desktop machine or laptop, called &#039;&#039;client machine&#039;&#039; below.&lt;br /&gt;
&lt;br /&gt;
Enter license details either in the COMSOL Setup configuration dialog.&lt;br /&gt;
&lt;br /&gt;
== Native desktop version — License configuration ==&lt;br /&gt;
A client&#039;s COMSOL license needs to be configured depending on how the client reaches CNM network resources. Follow the appropriate section:&lt;br /&gt;
* [[#License configuration when inside CNM or using VPN]]&lt;br /&gt;
* [[#License configuration when outside CNM and using SSH Tunneling]]&lt;br /&gt;
&lt;br /&gt;
=== License configuration when inside CNM or using VPN ===&lt;br /&gt;
==== &amp;lt;span style=&amp;quot;color:#A00;&amp;quot;&amp;gt;Ensure correct DNS search domains&amp;lt;/span&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
* Inspect the client machine&#039;s network configuration.&lt;br /&gt;
* Ensure that &#039;&#039;&#039;two&#039;&#039;&#039; entries are listed as DNS Search Domains for the current network profile:&lt;br /&gt;
 nst.anl.gov&lt;br /&gt;
 cnm.anl.gov&lt;br /&gt;
: (The order of entries does not matter for the purposes considered here.)&lt;br /&gt;
* If the client machine is &#039;&#039;wired to CNM networks&#039;&#039;, the domains are normally provided correctly by DHCP.&lt;br /&gt;
* If the client machine is &#039;&#039;connected over VPN&#039;&#039;, you may need edit the respective network profile.&lt;br /&gt;
:* 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 &amp;quot;Advanced…&amp;quot;. It appears that those changes are being saved and will be activated automatically the next time that this VPN session gets started.&lt;br /&gt;
: [[Image:VNC_add_cnm_to_DNS_1.png|400px]] [[Image:VNC_add_cnm_to_DNS_2.png|400px]]&lt;br /&gt;
:* On Windows or Linux machines, take &#039;&#039;analogous&#039;&#039; steps, using the platform&#039;s own configuration tools.&lt;br /&gt;
&lt;br /&gt;
* Exclude license manager components from client desktop installation. (Those are all handled server-side.)&lt;br /&gt;
&lt;br /&gt;
==== License format ====&lt;br /&gt;
* Floating Network License (FNL), &amp;quot;Three-server redundancy&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==== License servers ====&lt;br /&gt;
* On client machines, while running the COMSOL installer or license configuration, specify license servers and ports as follows:&lt;br /&gt;
 clicense1    1718&lt;br /&gt;
 clicense2    1718&lt;br /&gt;
 clicense3    1718&lt;br /&gt;
: &#039;&#039;&#039;Note:&#039;&#039;&#039; Use &#039;&#039;short host name&#039;&#039; form exactly as given here. (Technical Reason: The license must be usable both on Carbon&#039;s internal network as well as on divisional networks that are outside of Carbon).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Advanced:&#039;&#039;&#039; A client machine&#039;s COMSOL license file &amp;lt;code&amp;gt;&amp;amp;lt;COMSOLDIR&amp;amp;gt;/Multiphysics/license/license.dat&amp;lt;/code&amp;gt; should look as follows:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;make&amp;quot;&amp;gt;&lt;br /&gt;
SERVER clicense1 ANY 1718&lt;br /&gt;
SERVER clicense2 ANY 1718&lt;br /&gt;
SERVER clicense3 ANY 1718&lt;br /&gt;
USE_SERVER&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;amp;lt;COMSOLDIR&amp;amp;gt;&amp;lt;/code&amp;gt; is located by default at:&lt;br /&gt;
* &#039;&#039;&#039;Windows&#039;&#039;&#039;: C:\Program files\COMSOL\COMSOL&#039;&#039;nn&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Linux&#039;&#039;&#039;: /usr/local/comsol&#039;&#039;nn&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Mac&#039;&#039;&#039;: /Applications/COMSOL&#039;&#039;nn&#039;&#039;&lt;br /&gt;
(&amp;quot;&#039;&#039;nn&#039;&#039;&amp;quot; is the application&#039;s abbreviated version number.)&lt;br /&gt;
&lt;br /&gt;
==== Network Troubleshooting ====&lt;br /&gt;
When using the license access model descibed here (as opposed to tunneled over SSH), ensure the following:&lt;br /&gt;
* Verify that short host names can be resolved to IP addresses. Either one of the following commands should produce sensible output:&lt;br /&gt;
 host clicense1&lt;br /&gt;
: or:&lt;br /&gt;
 ping -c 3 clicense1&lt;br /&gt;
* Verify that &#039;&#039;both license ports on the same server&#039;&#039; can be reached from your client machine:&lt;br /&gt;
 telnet &#039;&#039;&#039;clicense1&#039;&#039;&#039; 1718&lt;br /&gt;
 telnet &#039;&#039;&#039;clicense1&#039;&#039;&#039; 1719&lt;br /&gt;
: or:&lt;br /&gt;
 telnet &#039;&#039;&#039;clicense2&#039;&#039;&#039; 1718&lt;br /&gt;
 telnet &#039;&#039;&#039;clicense2&#039;&#039;&#039; 1719&lt;br /&gt;
: A &#039;&#039;successful&#039;&#039; connection looks like:&lt;br /&gt;
 Trying 146.139.x.y...&lt;br /&gt;
 Connected to clicense1.cnm.anl.gov.&lt;br /&gt;
 Escape character is &#039;^]&#039;.&lt;br /&gt;
:: Do not enter any data. Instead,  close each connection by hitting &amp;lt;code&amp;gt;Ctrl&amp;lt;/code&amp;gt;&amp;lt;code&amp;gt;]&amp;lt;/code&amp;gt; (closing square bracket), followed by &amp;lt;code&amp;gt;Ctrl&amp;lt;/code&amp;gt;&amp;lt;code&amp;gt;D&amp;lt;/code&amp;gt;.&lt;br /&gt;
: A &#039;&#039;failed&#039;&#039; connection gives one of these errors:&lt;br /&gt;
 telnet: connect to address 146.139.x.y: Operation timed out&lt;br /&gt;
: or:&lt;br /&gt;
 telnet: connect to address 146.139.x.y: Connection refused&lt;br /&gt;
:: In these cases, ask that your IP firewall configuration be reviewed and changed.&lt;br /&gt;
&lt;br /&gt;
=== License configuration when outside CNM and using SSH Tunneling ===&lt;br /&gt;
If you&#039;re comfortable with ssh and tunneling, configure client licensing as follows:&lt;br /&gt;
&lt;br /&gt;
==== License format ====&lt;br /&gt;
* Floating Network License (FNL), &amp;quot;Port number and Hostname&amp;quot;&lt;br /&gt;
: &#039;&#039;&#039;Note:&#039;&#039;&#039; Three-server redundancy cannot be accessed over SSH tunneling. Instead, the user must configure just one server, and if needed in rare situations manually reconfigure to use the other server if the first one fails.&lt;br /&gt;
&lt;br /&gt;
==== License server ====&lt;br /&gt;
* Enter into the COMSOL license file:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;make&amp;quot;&amp;gt;&lt;br /&gt;
SERVER 127.0.0.1 ANY 1718&lt;br /&gt;
USE_SERVER&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
: &#039;&#039;&#039;Note:&#039;&#039;&#039; Do not use &amp;quot;localhost&amp;quot;, as this will be directly (and incorrectly) interpreted by COMSOL to mean that the current machine actually &#039;&#039;is&#039;&#039; a license server.&lt;br /&gt;
&lt;br /&gt;
Connect to &amp;lt;code&amp;gt;mega&amp;lt;/code&amp;gt; or a Carbon login node with one of the following ssh commands:&lt;br /&gt;
* First, set up a tunnel to the primary license server:&lt;br /&gt;
 ssh  -L 1718:&#039;&#039;&#039;clicense1&#039;&#039;&#039;:1718  -L 1719:&#039;&#039;&#039;clicense1&#039;&#039;&#039;:1719  mega&lt;br /&gt;
* Start COMSOL.&lt;br /&gt;
: If you get an error that the number of licenses is exhausted, that is at least confirmation that you correctly reached the license server.&lt;br /&gt;
&lt;br /&gt;
If the above attempt takes a long time or hangs entirely, it may be because the license service currently runs on the secondary server.&lt;br /&gt;
* Connect to the alternate license server:&lt;br /&gt;
 ssh  -L 1718:&#039;&#039;&#039;clicense2&#039;&#039;&#039;:1718  -L 1719:&#039;&#039;&#039;clicense2&#039;&#039;&#039;:1719  mega&lt;br /&gt;
* Start COMSOL.&lt;br /&gt;
&lt;br /&gt;
== License Troubleshooting ==&lt;br /&gt;
The following are typical error messages.&lt;br /&gt;
=== Could not obtain license for COMSOL Multiphysics GUI ===&lt;br /&gt;
* Error details:&lt;br /&gt;
 License error: -4.&lt;br /&gt;
 &#039;&#039;&#039;Licensed number of users already reached.&#039;&#039;&#039;&lt;br /&gt;
 Feature:       COMSOLGUI&lt;br /&gt;
 License path:  /Users/stern/Applications/COMSOL52a/license/license.dat:&lt;br /&gt;
 FlexNet Licensing error:-4,132&lt;br /&gt;
* Reason: The connection to the license server succeeded, but the license token(s) you requested are in use.&lt;br /&gt;
* Solution: Wait a bit, or [http://carbonmgmt/ganglia/lic.php identify who&#039;s using COMSOL] and politely ask the user when they might be finished with their work.&lt;br /&gt;
&lt;br /&gt;
=== License server machine is down or not responding ===&lt;br /&gt;
* Error details:&lt;br /&gt;
  License error: -96.&lt;br /&gt;
  See the system administrator about starting the license server system, or&lt;br /&gt;
  make sure you&#039;re referring to the right host (see LM_LICENSE_FILE).&lt;br /&gt;
 Feature:       SERIAL&lt;br /&gt;
 Hostname:      clicense3&lt;br /&gt;
 License path:  /Users/stern/Applications/COMSOL52a/license/license.dat:&lt;br /&gt;
 FlexNet Licensing error:-96,7&lt;br /&gt;
* Reason: The license servers cannot be reached at all. The &amp;lt;code&amp;gt;ping&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;host&amp;lt;/code&amp;gt; tests mentioned above fail.&lt;br /&gt;
* Solution: Review the client license file and DNS lookup domains.&lt;br /&gt;
&lt;br /&gt;
=== License file does not support this version ===&lt;br /&gt;
* Error details:&lt;br /&gt;
  Feature: SERIAL&lt;br /&gt;
 &#039;&#039;&#039;Application version &amp;gt; License version: 5.21 &amp;gt; 3.5&#039;&#039;&#039;&lt;br /&gt;
 License path: /Users/stern/Applications/COMSOL52a/license/license.dat:&lt;br /&gt;
 FlexNet Licensing error:-21,126&lt;br /&gt;
* 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&#039;re connected to.&lt;br /&gt;
* Solution: When using SSH, try &amp;lt;code&amp;gt;clicense2&amp;lt;/code&amp;gt; instead of  &amp;lt;code&amp;gt;clicense1&amp;lt;/code&amp;gt;, or vice versa. Revisit your &amp;lt;code&amp;gt;~/.ssh/config&amp;lt;/code&amp;gt; file or use the alternate command line as shown in the SSH section above.&lt;br /&gt;
&lt;br /&gt;
== Multiple CPU cores ==&lt;br /&gt;
Ways to start multi-core (from http://www.comsol.com/support/knowledgebase/1096/)&lt;br /&gt;
 comsol -np 8&lt;br /&gt;
&lt;br /&gt;
 export COMSOL_NUM_THREADS=8    # automatically provided on &#039;&#039;Carbon&#039;&#039;&lt;br /&gt;
 comsol&lt;br /&gt;
* COMSOL does not benefit from hyperthreading (oversubscribing the physical core count).&lt;br /&gt;
&lt;br /&gt;
== Batch jobs ==&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
 comsol -clustersimple batch -inputfile input.mph -outputfile output.mph &lt;br /&gt;
&lt;br /&gt;
 &amp;lt;strike&amp;gt;comsol –nn 8 mpd boot&lt;br /&gt;
 comsol –nn 8 batch –inputfile in.mph&lt;br /&gt;
 comsol mpd allexit&amp;lt;/strike&amp;gt;&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
* http://www.comsol.com/support/knowledgebase/1001/ .&lt;br /&gt;
* [[Media:HPC 2012-05-16 Comsol parallel usage.pdf]] (Modified from http://www.comsol.com/support/knowledgebase/1001/files/4027/cluster_install_linux_42a.pptx – Appendix slide, PBS)&lt;br /&gt;
* &#039;&#039;&#039;Note:&#039;&#039;&#039; MPD is not supported on Carbon (I patched the main comsol script), and no longer necessary at all in Comsol-4.3.&lt;br /&gt;
&lt;br /&gt;
=== Sample Job file ===&lt;br /&gt;
See:&lt;br /&gt;
 $COMSOL_HOME/sample.job&lt;br /&gt;
&lt;br /&gt;
== Important COMSOL Support Articles ==&lt;br /&gt;
* Toplevel suport page: https://www.comsol.com/support&lt;br /&gt;
&lt;br /&gt;
=== KB Articles ===&lt;br /&gt;
* [https://www.comsol.com/support/knowledgebase/1001 Running COMSOL® in parallel on clusters]&lt;br /&gt;
* [https://www.comsol.com/support/knowledgebase/1250 Running parametric sweeps, batch sweeps, and cluster sweeps from the command line]&lt;br /&gt;
* [https://www.comsol.com/support/knowledgebase/1255 Reducing the amount of solution data stored in a model]&lt;br /&gt;
* [https://www.comsol.com/support/knowledgebase/830 Handling large models]&lt;br /&gt;
&lt;br /&gt;
=== Blog-style articles ===&lt;br /&gt;
* [https://www.comsol.com/blogs/the-power-of-the-batch-sweep/ The Power of the Batch Sweep]&lt;br /&gt;
* [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]&lt;/div&gt;</summary>
		<author><name>Stern</name></author>
	</entry>
	<entry>
		<id>https://wiki.anl.gov/wiki_cnm/index.php?title=HPC/Applications/comsol&amp;diff=7465</id>
		<title>HPC/Applications/comsol</title>
		<link rel="alternate" type="text/html" href="https://wiki.anl.gov/wiki_cnm/index.php?title=HPC/Applications/comsol&amp;diff=7465"/>
		<updated>2025-08-07T15:26:41Z</updated>

		<summary type="html">&lt;p&gt;Stern: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
The [http://www.comsol.com/products/multiphysics/ &#039;&#039;&#039;COMSOL Multiphysics&#039;&#039;&#039;] application suite&lt;br /&gt;
is available for Mac, Windows, and Linux.&lt;br /&gt;
&lt;br /&gt;
== Access ==&lt;br /&gt;
[[Image:HPC Comsol licensed modules.png|right|450px|thumb|COMSOL features licensed at CNM as of 2024-10.]]&lt;br /&gt;
=== COMSOL Multiphysics ===&lt;br /&gt;
Access to &#039;&#039;&#039;COMSOL Multiphysics&#039;&#039;&#039;, the main application with both a graphical user interface and batch computing capabilities, will be granted &#039;&#039;&#039;&#039;&#039;upon request&#039;&#039;&#039;&#039;&#039;&amp;amp;thinsp;.&lt;br /&gt;
&lt;br /&gt;
You must be:&lt;br /&gt;
* An &#039;&#039;&#039;&#039;&#039;Argonne employee&#039;&#039;&#039;&#039;&#039;&amp;amp;thinsp; in of the following roles:&lt;br /&gt;
** &#039;&#039;&#039;&#039;&#039;CNM Facility User&#039;&#039;&#039;&#039;&#039;&amp;amp;thinsp; with an active proposal that has COMSOL in scope — please see [[HPC/FAQ#Access_and_proposals]].&lt;br /&gt;
** &#039;&#039;&#039;&#039;&#039;NST staff&#039;&#039;&#039;&#039;&#039;&amp;amp;thinsp; (including PostDocs, joint appointments, and students).&lt;br /&gt;
&lt;br /&gt;
The set of available COMSOL modules that we have licensed is shown at right.&lt;br /&gt;
&lt;br /&gt;
* To have a native desktop version installed on your Argonne-owned computer (laptop or desktop), please contact [mailto:help@anl.gov?Subject=COMSOL%20license%20access%20request CNM support]. Make sure to review [http://www.comsol.com/support/updates/ Product Updates].&lt;br /&gt;
* To run COMSOL on our HPC system &#039;&#039;Carbon&#039;&#039;, as GUI or as batch computing jobs, your proposal must have &#039;&#039;Carbon&#039;&#039; access in scope.&lt;br /&gt;
&lt;br /&gt;
=== COMSOL Server ===&lt;br /&gt;
&#039;&#039;CNM Facility Users&#039;&#039; who are not Argonne employees are not eligible to access&lt;br /&gt;
the full &#039;&#039;&#039;COMSOL Multiphysics&#039;&#039;&#039; product, in compliance with its licensing terms and conditions.&lt;br /&gt;
However, the [https://www.comsol.com/comsol-server &#039;&#039;&#039;COMSOL Server&#039;&#039;&#039;] product offers an alternative&lt;br /&gt;
albeit more narrow means of access.&lt;br /&gt;
&lt;br /&gt;
All users, including &#039;&#039;&#039;&#039;&#039;non-Argonne users&#039;&#039;&#039;&#039;&#039; may be able to run, over a web interface in their browser,&lt;br /&gt;
pre-parameterized &amp;quot;fixed-model&amp;quot; simulations that were made with the &#039;&#039;&#039;COMSOL Application Builder&#039;&#039;&#039; (requires Windows).&lt;br /&gt;
&lt;br /&gt;
To inquire about using COMSOL server applications,&lt;br /&gt;
please contact us.&lt;br /&gt;
&amp;lt;!-- [mailto:cnm_useroffice@anl.gov?Subject=COMSOL%20server%20usage Support]. --&amp;gt;&lt;br /&gt;
We will review possible purchase paths for COMSOL Server, and the &#039;&#039;considerable effort&#039;&#039; likely required by users and the CNM to develop and deploy a COMSOL application.&lt;br /&gt;
&lt;br /&gt;
== Support ==&lt;br /&gt;
* For questions on how to run or start COMSOL:&lt;br /&gt;
*: Submit an [[HPC/Support | &#039;&#039;&#039;IT support request&#039;&#039;&#039;]]&lt;br /&gt;
* For questions related to most COMSOL data or scripts, contact COMSOL support at:&lt;br /&gt;
*: [mailto:support@comsol.com &#039;&#039;&#039;support&#039;&#039;&#039;@comsol.com]&lt;br /&gt;
* &#039;&#039;&#039;Exception:&#039;&#039;&#039; If your support question might contain data that is subject to &#039;&#039;&#039;US Export Control&#039;&#039;&#039; regulations, contact instead:&lt;br /&gt;
*: [mailto:us-export-control@us.comsol.com &#039;&#039;&#039;us-export-control&#039;&#039;&#039;@&#039;&#039;&#039;us&#039;&#039;&#039;.comsol.com]&lt;br /&gt;
&lt;br /&gt;
== The modes to run COMSOL ==&lt;br /&gt;
There are several ways of running COMSOL.&lt;br /&gt;
&lt;br /&gt;
=== Running the desktop application ===&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
# Run on Carbon, display on your desktop using the [http://en.wikipedia.org/wiki/X_Window_System X Window system (X11)].&lt;br /&gt;
#* Requires an &#039;&#039;X11 Server&#039;&#039; application running on your client machine, and SSH X11 forwarding.&lt;br /&gt;
#* The X11 protocol can be slow over LAN.&lt;br /&gt;
# Run on Carbon within a [[HPC/Network Access/Virtual Desktop | virtual desktop environment (VNC)]].&lt;br /&gt;
#* Requires a VNC client on your machine.&lt;br /&gt;
#* It can be confusing where VNC and the app runs.&lt;br /&gt;
#* The virtual desktop presents a (deliberatly) sparse windowing environment – Copy&amp;amp;Paste can be difficult to use.&lt;br /&gt;
# Run on your own computer, remotely checking out Carbon&#039;s license.&lt;br /&gt;
#* Requires a full installation of COMSOL on your desktoo or laptop computer.&lt;br /&gt;
#* 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.&lt;br /&gt;
&lt;br /&gt;
=== Running a batch calculation ===&lt;br /&gt;
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.&lt;br /&gt;
See the [[#Batch jobs|section below]].&lt;br /&gt;
&lt;br /&gt;
== Use with X11 ==&lt;br /&gt;
For casual use, and with [[HPC/Network Access/SSH Tunnel Setup on Linux and MacOS | X11 tunneling to Carbon]] set up, simply add to your &amp;lt;code&amp;gt;~/.bashrc&amp;lt;/code&amp;gt; file on Carbon:&lt;br /&gt;
 module load comsol&lt;br /&gt;
&lt;br /&gt;
Then, from the command line on a Carbon login node, start the COMSOL GUI:&lt;br /&gt;
 comsol &amp;amp;&lt;br /&gt;
&lt;br /&gt;
License configuration is automatic on Carbon.&lt;br /&gt;
&lt;br /&gt;
Comsol will use a number of cores to run calculations multithreaded by default. (On Carbon, COMSOL_NUM_THREADS is set.)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Quit the application&#039;&#039;&#039; as soon as you are done. Only one user can use Comsol at a time.&lt;br /&gt;
&lt;br /&gt;
== Use with VNC ==&lt;br /&gt;
See general  [[HPC/Network Access/Virtual Desktop | instructions on using VNC]], and the COMSOL example therein.&lt;br /&gt;
&lt;br /&gt;
== Native desktop version ==&lt;br /&gt;
&lt;br /&gt;
To get the fastest response from the COMSOL GUI, run a native COMSOL version on your desktop machine or laptop, called &#039;&#039;client machine&#039;&#039; below.&lt;br /&gt;
&lt;br /&gt;
Enter license details either in the COMSOL Setup configuration dialog.&lt;br /&gt;
&lt;br /&gt;
== Native desktop version — License configuration ==&lt;br /&gt;
A client&#039;s COMSOL license needs to be configured depending on how the client reaches CNM network resources. Follow the appropriate section:&lt;br /&gt;
* [[#License configuration when inside CNM or using VPN]]&lt;br /&gt;
* [[#License configuration when outside CNM and using SSH Tunneling]]&lt;br /&gt;
&lt;br /&gt;
=== License configuration when inside CNM or using VPN ===&lt;br /&gt;
==== &amp;lt;span style=&amp;quot;color:#A00;&amp;quot;&amp;gt;Ensure correct DNS search domains&amp;lt;/span&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
* Inspect the client machine&#039;s network configuration.&lt;br /&gt;
* Ensure that &#039;&#039;&#039;two&#039;&#039;&#039; entries are listed as DNS Search Domains for the current network profile:&lt;br /&gt;
 nst.anl.gov&lt;br /&gt;
 cnm.anl.gov&lt;br /&gt;
: (The order of entries does not matter for the purposes considered here.)&lt;br /&gt;
* If the client machine is &#039;&#039;wired to CNM networks&#039;&#039;, the domains are normally provided correctly by DHCP.&lt;br /&gt;
* If the client machine is &#039;&#039;connected over VPN&#039;&#039;, you may need edit the respective network profile.&lt;br /&gt;
:* 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 &amp;quot;Advanced…&amp;quot;. It appears that those changes are being saved and will be activated automatically the next time that this VPN session gets started.&lt;br /&gt;
: [[Image:VNC_add_cnm_to_DNS_1.png|400px]] [[Image:VNC_add_cnm_to_DNS_2.png|400px]]&lt;br /&gt;
:* On Windows or Linux machines, take &#039;&#039;analogous&#039;&#039; steps, using the platform&#039;s own configuration tools.&lt;br /&gt;
&lt;br /&gt;
* Exclude license manager components from client desktop installation. (Those are all handled server-side.)&lt;br /&gt;
&lt;br /&gt;
==== License format ====&lt;br /&gt;
* Floating Network License (FNL), &amp;quot;Three-server redundancy&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==== License servers ====&lt;br /&gt;
* On client machines, while running the COMSOL installer or license configuration, specify license servers and ports as follows:&lt;br /&gt;
 clicense1    1718&lt;br /&gt;
 clicense2    1718&lt;br /&gt;
 clicense3    1718&lt;br /&gt;
: &#039;&#039;&#039;Note:&#039;&#039;&#039; Use &#039;&#039;short host name&#039;&#039; form exactly as given here. (Technical Reason: The license must be usable both on Carbon&#039;s internal network as well as on divisional networks that are outside of Carbon).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Advanced:&#039;&#039;&#039; A client machine&#039;s COMSOL license file &amp;lt;code&amp;gt;&amp;amp;lt;COMSOLDIR&amp;amp;gt;/Multiphysics/license/license.dat&amp;lt;/code&amp;gt; should look as follows:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;make&amp;quot;&amp;gt;&lt;br /&gt;
SERVER clicense1 ANY 1718&lt;br /&gt;
SERVER clicense2 ANY 1718&lt;br /&gt;
SERVER clicense3 ANY 1718&lt;br /&gt;
USE_SERVER&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;amp;lt;COMSOLDIR&amp;amp;gt;&amp;lt;/code&amp;gt; is located by default at:&lt;br /&gt;
* &#039;&#039;&#039;Windows&#039;&#039;&#039;: C:\Program files\COMSOL\COMSOL&#039;&#039;nn&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Linux&#039;&#039;&#039;: /usr/local/comsol&#039;&#039;nn&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Mac&#039;&#039;&#039;: /Applications/COMSOL&#039;&#039;nn&#039;&#039;&lt;br /&gt;
(&amp;quot;&#039;&#039;nn&#039;&#039;&amp;quot; is the application&#039;s abbreviated version number.)&lt;br /&gt;
&lt;br /&gt;
==== Network Troubleshooting ====&lt;br /&gt;
When using the license access model descibed here (as opposed to tunneled over SSH), ensure the following:&lt;br /&gt;
* Verify that short host names can be resolved to IP addresses. Either one of the following commands should produce sensible output:&lt;br /&gt;
 host clicense1&lt;br /&gt;
: or:&lt;br /&gt;
 ping -c 3 clicense1&lt;br /&gt;
* Verify that &#039;&#039;both license ports on the same server&#039;&#039; can be reached from your client machine:&lt;br /&gt;
 telnet &#039;&#039;&#039;clicense1&#039;&#039;&#039; 1718&lt;br /&gt;
 telnet &#039;&#039;&#039;clicense1&#039;&#039;&#039; 1719&lt;br /&gt;
: or:&lt;br /&gt;
 telnet &#039;&#039;&#039;clicense2&#039;&#039;&#039; 1718&lt;br /&gt;
 telnet &#039;&#039;&#039;clicense2&#039;&#039;&#039; 1719&lt;br /&gt;
: A &#039;&#039;successful&#039;&#039; connection looks like:&lt;br /&gt;
 Trying 146.139.x.y...&lt;br /&gt;
 Connected to clicense1.cnm.anl.gov.&lt;br /&gt;
 Escape character is &#039;^]&#039;.&lt;br /&gt;
:: Do not enter any data. Instead,  close each connection by hitting &amp;lt;code&amp;gt;Ctrl&amp;lt;/code&amp;gt;&amp;lt;code&amp;gt;]&amp;lt;/code&amp;gt; (closing square bracket), followed by &amp;lt;code&amp;gt;Ctrl&amp;lt;/code&amp;gt;&amp;lt;code&amp;gt;D&amp;lt;/code&amp;gt;.&lt;br /&gt;
: A &#039;&#039;failed&#039;&#039; connection gives one of these errors:&lt;br /&gt;
 telnet: connect to address 146.139.x.y: Operation timed out&lt;br /&gt;
: or:&lt;br /&gt;
 telnet: connect to address 146.139.x.y: Connection refused&lt;br /&gt;
:: In these cases, ask that your IP firewall configuration be reviewed and changed.&lt;br /&gt;
&lt;br /&gt;
=== License configuration when outside CNM and using SSH Tunneling ===&lt;br /&gt;
If you&#039;re comfortable with ssh and tunneling, configure client licensing as follows:&lt;br /&gt;
&lt;br /&gt;
==== License format ====&lt;br /&gt;
* Floating Network License (FNL), &amp;quot;Port number and Hostname&amp;quot;&lt;br /&gt;
: &#039;&#039;&#039;Note:&#039;&#039;&#039; Three-server redundancy cannot be accessed over SSH tunneling. Instead, the user must configure just one server, and if needed in rare situations manually reconfigure to use the other server if the first one fails.&lt;br /&gt;
&lt;br /&gt;
==== License server ====&lt;br /&gt;
* Enter into the COMSOL license file:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;make&amp;quot;&amp;gt;&lt;br /&gt;
SERVER 127.0.0.1 ANY 1718&lt;br /&gt;
USE_SERVER&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
: &#039;&#039;&#039;Note:&#039;&#039;&#039; Do not use &amp;quot;localhost&amp;quot;, as this will be directly (and incorrectly) interpreted by COMSOL to mean that the current machine actually &#039;&#039;is&#039;&#039; a license server.&lt;br /&gt;
&lt;br /&gt;
Connect to &amp;lt;code&amp;gt;mega&amp;lt;/code&amp;gt; or a Carbon login node with one of the following ssh commands:&lt;br /&gt;
* First, set up a tunnel to the primary license server:&lt;br /&gt;
 ssh  -L 1718:&#039;&#039;&#039;clicense1&#039;&#039;&#039;:1718  -L 1719:&#039;&#039;&#039;clicense1&#039;&#039;&#039;:1719  mega&lt;br /&gt;
* Start COMSOL.&lt;br /&gt;
: If you get an error that the number of licenses is exhausted, that is at least confirmation that you correctly reached the license server.&lt;br /&gt;
&lt;br /&gt;
If the above attempt takes a long time or hangs entirely, it may be because the license service currently runs on the secondary server.&lt;br /&gt;
* Connect to the alternate license server:&lt;br /&gt;
 ssh  -L 1718:&#039;&#039;&#039;clicense2&#039;&#039;&#039;:1718  -L 1719:&#039;&#039;&#039;clicense2&#039;&#039;&#039;:1719  mega&lt;br /&gt;
* Start COMSOL.&lt;br /&gt;
&lt;br /&gt;
== License Troubleshooting ==&lt;br /&gt;
The following are typical error messages.&lt;br /&gt;
=== Could not obtain license for COMSOL Multiphysics GUI ===&lt;br /&gt;
* Error details:&lt;br /&gt;
 License error: -4.&lt;br /&gt;
 &#039;&#039;&#039;Licensed number of users already reached.&#039;&#039;&#039;&lt;br /&gt;
 Feature:       COMSOLGUI&lt;br /&gt;
 License path:  /Users/stern/Applications/COMSOL52a/license/license.dat:&lt;br /&gt;
 FlexNet Licensing error:-4,132&lt;br /&gt;
* Reason: The connection to the license server succeeded, but the license token(s) you requested are in use.&lt;br /&gt;
* Solution: Wait a bit, or [http://carbonmgmt/ganglia/lic.php identify who&#039;s using COMSOL] and politely ask the user when they might be finished with their work.&lt;br /&gt;
&lt;br /&gt;
=== License server machine is down or not responding ===&lt;br /&gt;
* Error details:&lt;br /&gt;
  License error: -96.&lt;br /&gt;
  See the system administrator about starting the license server system, or&lt;br /&gt;
  make sure you&#039;re referring to the right host (see LM_LICENSE_FILE).&lt;br /&gt;
 Feature:       SERIAL&lt;br /&gt;
 Hostname:      clicense3&lt;br /&gt;
 License path:  /Users/stern/Applications/COMSOL52a/license/license.dat:&lt;br /&gt;
 FlexNet Licensing error:-96,7&lt;br /&gt;
* Reason: The license servers cannot be reached at all. The &amp;lt;code&amp;gt;ping&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;host&amp;lt;/code&amp;gt; tests mentioned above fail.&lt;br /&gt;
* Solution: Review the client license file and DNS lookup domains.&lt;br /&gt;
&lt;br /&gt;
=== License file does not support this version ===&lt;br /&gt;
* Error details:&lt;br /&gt;
  Feature: SERIAL&lt;br /&gt;
 &#039;&#039;&#039;Application version &amp;gt; License version: 5.21 &amp;gt; 3.5&#039;&#039;&#039;&lt;br /&gt;
 License path: /Users/stern/Applications/COMSOL52a/license/license.dat:&lt;br /&gt;
 FlexNet Licensing error:-21,126&lt;br /&gt;
* 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&#039;re connected to.&lt;br /&gt;
* Solution: When using SSH, try &amp;lt;code&amp;gt;clicense2&amp;lt;/code&amp;gt; instead of  &amp;lt;code&amp;gt;clicense1&amp;lt;/code&amp;gt;, or vice versa. Revisit your &amp;lt;code&amp;gt;~/.ssh/config&amp;lt;/code&amp;gt; file or use the alternate command line as shown in the SSH section above.&lt;br /&gt;
&lt;br /&gt;
== Multiple CPU cores ==&lt;br /&gt;
Ways to start multi-core (from http://www.comsol.com/support/knowledgebase/1096/)&lt;br /&gt;
 comsol -np 8&lt;br /&gt;
&lt;br /&gt;
 export COMSOL_NUM_THREADS=8    # automatically provided on &#039;&#039;Carbon&#039;&#039;&lt;br /&gt;
 comsol&lt;br /&gt;
* COMSOL does not benefit from hyperthreading (oversubscribing the physical core count).&lt;br /&gt;
&lt;br /&gt;
== Batch jobs ==&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
 comsol -clustersimple batch -inputfile input.mph -outputfile output.mph &lt;br /&gt;
&lt;br /&gt;
 &amp;lt;strike&amp;gt;comsol –nn 8 mpd boot&lt;br /&gt;
 comsol –nn 8 batch –inputfile in.mph&lt;br /&gt;
 comsol mpd allexit&amp;lt;/strike&amp;gt;&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
* http://www.comsol.com/support/knowledgebase/1001/ .&lt;br /&gt;
* [[Media:HPC 2012-05-16 Comsol parallel usage.pdf]] (Modified from http://www.comsol.com/support/knowledgebase/1001/files/4027/cluster_install_linux_42a.pptx – Appendix slide, PBS)&lt;br /&gt;
* &#039;&#039;&#039;Note:&#039;&#039;&#039; MPD is not supported on Carbon (I patched the main comsol script), and no longer necessary at all in Comsol-4.3.&lt;br /&gt;
&lt;br /&gt;
=== Sample Job file ===&lt;br /&gt;
See:&lt;br /&gt;
 $COMSOL_HOME/sample.job&lt;br /&gt;
&lt;br /&gt;
== Important COMSOL Support Articles ==&lt;br /&gt;
* Toplevel suport page: https://www.comsol.com/support&lt;br /&gt;
&lt;br /&gt;
=== KB Articles ===&lt;br /&gt;
* [https://www.comsol.com/support/knowledgebase/1001 Running COMSOL® in parallel on clusters]&lt;br /&gt;
* [https://www.comsol.com/support/knowledgebase/1250 Running parametric sweeps, batch sweeps, and cluster sweeps from the command line]&lt;br /&gt;
* [https://www.comsol.com/support/knowledgebase/1255 Reducing the amount of solution data stored in a model]&lt;br /&gt;
* [https://www.comsol.com/support/knowledgebase/830 Handling large models]&lt;br /&gt;
&lt;br /&gt;
=== Blog-style articles ===&lt;br /&gt;
* [https://www.comsol.com/blogs/the-power-of-the-batch-sweep/ The Power of the Batch Sweep]&lt;br /&gt;
* [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]&lt;/div&gt;</summary>
		<author><name>Stern</name></author>
	</entry>
	<entry>
		<id>https://wiki.anl.gov/wiki_cnm/index.php?title=HPC/Applications/comsol&amp;diff=7464</id>
		<title>HPC/Applications/comsol</title>
		<link rel="alternate" type="text/html" href="https://wiki.anl.gov/wiki_cnm/index.php?title=HPC/Applications/comsol&amp;diff=7464"/>
		<updated>2025-08-07T15:25:07Z</updated>

		<summary type="html">&lt;p&gt;Stern: /* COMSOL Multiphysics */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
The [http://www.comsol.com/products/multiphysics/ &#039;&#039;&#039;COMSOL Multiphysics&#039;&#039;&#039;] application suite&lt;br /&gt;
is available for Mac, Windows, and Linux.&lt;br /&gt;
[[Image:HPC Comsol licensed modules.png|right|450px|thumb|COMSOL features licensed at CNM as of 2024-10.]]&lt;br /&gt;
&lt;br /&gt;
== Access ==&lt;br /&gt;
=== COMSOL Multiphysics ===&lt;br /&gt;
Access to &#039;&#039;&#039;COMSOL Multiphysics&#039;&#039;&#039;, the main application with both a graphical user interface and batch computing capabilities, will be granted &#039;&#039;&#039;&#039;&#039;upon request&#039;&#039;&#039;&#039;&#039;&amp;amp;thinsp;.&lt;br /&gt;
&lt;br /&gt;
You must be:&lt;br /&gt;
* An &#039;&#039;&#039;&#039;&#039;Argonne employee&#039;&#039;&#039;&#039;&#039;&amp;amp;thinsp; in of the following roles:&lt;br /&gt;
** &#039;&#039;&#039;&#039;&#039;CNM Facility User&#039;&#039;&#039;&#039;&#039;&amp;amp;thinsp; with an active proposal with COMSOL in scope — please see [[HPC/FAQ#Access_and_proposals]].&lt;br /&gt;
** &#039;&#039;&#039;&#039;&#039;NST staff&#039;&#039;&#039;&#039;&#039;&amp;amp;thinsp; (including PostDocs, joint appointments, and students).&lt;br /&gt;
&lt;br /&gt;
The set of available COMSOL modules that we have licensed is shown at right.&lt;br /&gt;
&lt;br /&gt;
* To have a native desktop version installed on your Argonne-owned computer (laptop or desktop), please contact [mailto:help@anl.gov?Subject=COMSOL%20license%20access%20request CNM support]. Make sure to review [http://www.comsol.com/support/updates/ Product Updates].&lt;br /&gt;
* To run COMSOL on our HPC system &#039;&#039;Carbon&#039;&#039;, as GUI or as batch computing jobs, your proposal must have &#039;&#039;Carbon&#039;&#039; access in scope.&lt;br /&gt;
&lt;br /&gt;
=== COMSOL Server ===&lt;br /&gt;
&#039;&#039;CNM Facility Users&#039;&#039; who are not Argonne employees are not eligible to access&lt;br /&gt;
the full &#039;&#039;&#039;COMSOL Multiphysics&#039;&#039;&#039; product, in compliance with its licensing terms and conditions.&lt;br /&gt;
However, the [https://www.comsol.com/comsol-server &#039;&#039;&#039;COMSOL Server&#039;&#039;&#039;] product offers an alternative&lt;br /&gt;
albeit more narrow means of access.&lt;br /&gt;
&lt;br /&gt;
All users, including &#039;&#039;&#039;&#039;&#039;non-Argonne users&#039;&#039;&#039;&#039;&#039; may be able to run, over a web interface in their browser,&lt;br /&gt;
pre-parameterized &amp;quot;fixed-model&amp;quot; simulations that were made with the &#039;&#039;&#039;COMSOL Application Builder&#039;&#039;&#039; (requires Windows).&lt;br /&gt;
&lt;br /&gt;
To inquire about using COMSOL server applications,&lt;br /&gt;
please contact us.&lt;br /&gt;
&amp;lt;!-- [mailto:cnm_useroffice@anl.gov?Subject=COMSOL%20server%20usage Support]. --&amp;gt;&lt;br /&gt;
We will review possible purchase paths for COMSOL Server, and the &#039;&#039;considerable effort&#039;&#039; likely required by users and the CNM to develop and deploy a COMSOL application.&lt;br /&gt;
&lt;br /&gt;
== Support ==&lt;br /&gt;
* For questions on how to run or start COMSOL:&lt;br /&gt;
*: Submit an [[HPC/Support | &#039;&#039;&#039;IT support request&#039;&#039;&#039;]]&lt;br /&gt;
* For questions related to most COMSOL data or scripts, contact COMSOL support at:&lt;br /&gt;
*: [mailto:support@comsol.com &#039;&#039;&#039;support&#039;&#039;&#039;@comsol.com]&lt;br /&gt;
* &#039;&#039;&#039;Exception:&#039;&#039;&#039; If your support question might contain data that is subject to &#039;&#039;&#039;US Export Control&#039;&#039;&#039; regulations, contact instead:&lt;br /&gt;
*: [mailto:us-export-control@us.comsol.com &#039;&#039;&#039;us-export-control&#039;&#039;&#039;@&#039;&#039;&#039;us&#039;&#039;&#039;.comsol.com]&lt;br /&gt;
&lt;br /&gt;
== The modes to run COMSOL ==&lt;br /&gt;
There are several ways of running COMSOL.&lt;br /&gt;
&lt;br /&gt;
=== Running the desktop application ===&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
# Run on Carbon, display on your desktop using the [http://en.wikipedia.org/wiki/X_Window_System X Window system (X11)].&lt;br /&gt;
#* Requires an &#039;&#039;X11 Server&#039;&#039; application running on your client machine, and SSH X11 forwarding.&lt;br /&gt;
#* The X11 protocol can be slow over LAN.&lt;br /&gt;
# Run on Carbon within a [[HPC/Network Access/Virtual Desktop | virtual desktop environment (VNC)]].&lt;br /&gt;
#* Requires a VNC client on your machine.&lt;br /&gt;
#* It can be confusing where VNC and the app runs.&lt;br /&gt;
#* The virtual desktop presents a (deliberatly) sparse windowing environment – Copy&amp;amp;Paste can be difficult to use.&lt;br /&gt;
# Run on your own computer, remotely checking out Carbon&#039;s license.&lt;br /&gt;
#* Requires a full installation of COMSOL on your desktoo or laptop computer.&lt;br /&gt;
#* 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.&lt;br /&gt;
&lt;br /&gt;
=== Running a batch calculation ===&lt;br /&gt;
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.&lt;br /&gt;
See the [[#Batch jobs|section below]].&lt;br /&gt;
&lt;br /&gt;
== Use with X11 ==&lt;br /&gt;
For casual use, and with [[HPC/Network Access/SSH Tunnel Setup on Linux and MacOS | X11 tunneling to Carbon]] set up, simply add to your &amp;lt;code&amp;gt;~/.bashrc&amp;lt;/code&amp;gt; file on Carbon:&lt;br /&gt;
 module load comsol&lt;br /&gt;
&lt;br /&gt;
Then, from the command line on a Carbon login node, start the COMSOL GUI:&lt;br /&gt;
 comsol &amp;amp;&lt;br /&gt;
&lt;br /&gt;
License configuration is automatic on Carbon.&lt;br /&gt;
&lt;br /&gt;
Comsol will use a number of cores to run calculations multithreaded by default. (On Carbon, COMSOL_NUM_THREADS is set.)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Quit the application&#039;&#039;&#039; as soon as you are done. Only one user can use Comsol at a time.&lt;br /&gt;
&lt;br /&gt;
== Use with VNC ==&lt;br /&gt;
See general  [[HPC/Network Access/Virtual Desktop | instructions on using VNC]], and the COMSOL example therein.&lt;br /&gt;
&lt;br /&gt;
== Native desktop version ==&lt;br /&gt;
&lt;br /&gt;
To get the fastest response from the COMSOL GUI, run a native COMSOL version on your desktop machine or laptop, called &#039;&#039;client machine&#039;&#039; below.&lt;br /&gt;
&lt;br /&gt;
Enter license details either in the COMSOL Setup configuration dialog.&lt;br /&gt;
&lt;br /&gt;
== Native desktop version — License configuration ==&lt;br /&gt;
A client&#039;s COMSOL license needs to be configured depending on how the client reaches CNM network resources. Follow the appropriate section:&lt;br /&gt;
* [[#License configuration when inside CNM or using VPN]]&lt;br /&gt;
* [[#License configuration when outside CNM and using SSH Tunneling]]&lt;br /&gt;
&lt;br /&gt;
=== License configuration when inside CNM or using VPN ===&lt;br /&gt;
==== &amp;lt;span style=&amp;quot;color:#A00;&amp;quot;&amp;gt;Ensure correct DNS search domains&amp;lt;/span&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
* Inspect the client machine&#039;s network configuration.&lt;br /&gt;
* Ensure that &#039;&#039;&#039;two&#039;&#039;&#039; entries are listed as DNS Search Domains for the current network profile:&lt;br /&gt;
 nst.anl.gov&lt;br /&gt;
 cnm.anl.gov&lt;br /&gt;
: (The order of entries does not matter for the purposes considered here.)&lt;br /&gt;
* If the client machine is &#039;&#039;wired to CNM networks&#039;&#039;, the domains are normally provided correctly by DHCP.&lt;br /&gt;
* If the client machine is &#039;&#039;connected over VPN&#039;&#039;, you may need edit the respective network profile.&lt;br /&gt;
:* 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 &amp;quot;Advanced…&amp;quot;. It appears that those changes are being saved and will be activated automatically the next time that this VPN session gets started.&lt;br /&gt;
: [[Image:VNC_add_cnm_to_DNS_1.png|400px]] [[Image:VNC_add_cnm_to_DNS_2.png|400px]]&lt;br /&gt;
:* On Windows or Linux machines, take &#039;&#039;analogous&#039;&#039; steps, using the platform&#039;s own configuration tools.&lt;br /&gt;
&lt;br /&gt;
* Exclude license manager components from client desktop installation. (Those are all handled server-side.)&lt;br /&gt;
&lt;br /&gt;
==== License format ====&lt;br /&gt;
* Floating Network License (FNL), &amp;quot;Three-server redundancy&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==== License servers ====&lt;br /&gt;
* On client machines, while running the COMSOL installer or license configuration, specify license servers and ports as follows:&lt;br /&gt;
 clicense1    1718&lt;br /&gt;
 clicense2    1718&lt;br /&gt;
 clicense3    1718&lt;br /&gt;
: &#039;&#039;&#039;Note:&#039;&#039;&#039; Use &#039;&#039;short host name&#039;&#039; form exactly as given here. (Technical Reason: The license must be usable both on Carbon&#039;s internal network as well as on divisional networks that are outside of Carbon).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Advanced:&#039;&#039;&#039; A client machine&#039;s COMSOL license file &amp;lt;code&amp;gt;&amp;amp;lt;COMSOLDIR&amp;amp;gt;/Multiphysics/license/license.dat&amp;lt;/code&amp;gt; should look as follows:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;make&amp;quot;&amp;gt;&lt;br /&gt;
SERVER clicense1 ANY 1718&lt;br /&gt;
SERVER clicense2 ANY 1718&lt;br /&gt;
SERVER clicense3 ANY 1718&lt;br /&gt;
USE_SERVER&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;amp;lt;COMSOLDIR&amp;amp;gt;&amp;lt;/code&amp;gt; is located by default at:&lt;br /&gt;
* &#039;&#039;&#039;Windows&#039;&#039;&#039;: C:\Program files\COMSOL\COMSOL&#039;&#039;nn&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Linux&#039;&#039;&#039;: /usr/local/comsol&#039;&#039;nn&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Mac&#039;&#039;&#039;: /Applications/COMSOL&#039;&#039;nn&#039;&#039;&lt;br /&gt;
(&amp;quot;&#039;&#039;nn&#039;&#039;&amp;quot; is the application&#039;s abbreviated version number.)&lt;br /&gt;
&lt;br /&gt;
==== Network Troubleshooting ====&lt;br /&gt;
When using the license access model descibed here (as opposed to tunneled over SSH), ensure the following:&lt;br /&gt;
* Verify that short host names can be resolved to IP addresses. Either one of the following commands should produce sensible output:&lt;br /&gt;
 host clicense1&lt;br /&gt;
: or:&lt;br /&gt;
 ping -c 3 clicense1&lt;br /&gt;
* Verify that &#039;&#039;both license ports on the same server&#039;&#039; can be reached from your client machine:&lt;br /&gt;
 telnet &#039;&#039;&#039;clicense1&#039;&#039;&#039; 1718&lt;br /&gt;
 telnet &#039;&#039;&#039;clicense1&#039;&#039;&#039; 1719&lt;br /&gt;
: or:&lt;br /&gt;
 telnet &#039;&#039;&#039;clicense2&#039;&#039;&#039; 1718&lt;br /&gt;
 telnet &#039;&#039;&#039;clicense2&#039;&#039;&#039; 1719&lt;br /&gt;
: A &#039;&#039;successful&#039;&#039; connection looks like:&lt;br /&gt;
 Trying 146.139.x.y...&lt;br /&gt;
 Connected to clicense1.cnm.anl.gov.&lt;br /&gt;
 Escape character is &#039;^]&#039;.&lt;br /&gt;
:: Do not enter any data. Instead,  close each connection by hitting &amp;lt;code&amp;gt;Ctrl&amp;lt;/code&amp;gt;&amp;lt;code&amp;gt;]&amp;lt;/code&amp;gt; (closing square bracket), followed by &amp;lt;code&amp;gt;Ctrl&amp;lt;/code&amp;gt;&amp;lt;code&amp;gt;D&amp;lt;/code&amp;gt;.&lt;br /&gt;
: A &#039;&#039;failed&#039;&#039; connection gives one of these errors:&lt;br /&gt;
 telnet: connect to address 146.139.x.y: Operation timed out&lt;br /&gt;
: or:&lt;br /&gt;
 telnet: connect to address 146.139.x.y: Connection refused&lt;br /&gt;
:: In these cases, ask that your IP firewall configuration be reviewed and changed.&lt;br /&gt;
&lt;br /&gt;
=== License configuration when outside CNM and using SSH Tunneling ===&lt;br /&gt;
If you&#039;re comfortable with ssh and tunneling, configure client licensing as follows:&lt;br /&gt;
&lt;br /&gt;
==== License format ====&lt;br /&gt;
* Floating Network License (FNL), &amp;quot;Port number and Hostname&amp;quot;&lt;br /&gt;
: &#039;&#039;&#039;Note:&#039;&#039;&#039; Three-server redundancy cannot be accessed over SSH tunneling. Instead, the user must configure just one server, and if needed in rare situations manually reconfigure to use the other server if the first one fails.&lt;br /&gt;
&lt;br /&gt;
==== License server ====&lt;br /&gt;
* Enter into the COMSOL license file:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;make&amp;quot;&amp;gt;&lt;br /&gt;
SERVER 127.0.0.1 ANY 1718&lt;br /&gt;
USE_SERVER&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
: &#039;&#039;&#039;Note:&#039;&#039;&#039; Do not use &amp;quot;localhost&amp;quot;, as this will be directly (and incorrectly) interpreted by COMSOL to mean that the current machine actually &#039;&#039;is&#039;&#039; a license server.&lt;br /&gt;
&lt;br /&gt;
Connect to &amp;lt;code&amp;gt;mega&amp;lt;/code&amp;gt; or a Carbon login node with one of the following ssh commands:&lt;br /&gt;
* First, set up a tunnel to the primary license server:&lt;br /&gt;
 ssh  -L 1718:&#039;&#039;&#039;clicense1&#039;&#039;&#039;:1718  -L 1719:&#039;&#039;&#039;clicense1&#039;&#039;&#039;:1719  mega&lt;br /&gt;
* Start COMSOL.&lt;br /&gt;
: If you get an error that the number of licenses is exhausted, that is at least confirmation that you correctly reached the license server.&lt;br /&gt;
&lt;br /&gt;
If the above attempt takes a long time or hangs entirely, it may be because the license service currently runs on the secondary server.&lt;br /&gt;
* Connect to the alternate license server:&lt;br /&gt;
 ssh  -L 1718:&#039;&#039;&#039;clicense2&#039;&#039;&#039;:1718  -L 1719:&#039;&#039;&#039;clicense2&#039;&#039;&#039;:1719  mega&lt;br /&gt;
* Start COMSOL.&lt;br /&gt;
&lt;br /&gt;
== License Troubleshooting ==&lt;br /&gt;
The following are typical error messages.&lt;br /&gt;
=== Could not obtain license for COMSOL Multiphysics GUI ===&lt;br /&gt;
* Error details:&lt;br /&gt;
 License error: -4.&lt;br /&gt;
 &#039;&#039;&#039;Licensed number of users already reached.&#039;&#039;&#039;&lt;br /&gt;
 Feature:       COMSOLGUI&lt;br /&gt;
 License path:  /Users/stern/Applications/COMSOL52a/license/license.dat:&lt;br /&gt;
 FlexNet Licensing error:-4,132&lt;br /&gt;
* Reason: The connection to the license server succeeded, but the license token(s) you requested are in use.&lt;br /&gt;
* Solution: Wait a bit, or [http://carbonmgmt/ganglia/lic.php identify who&#039;s using COMSOL] and politely ask the user when they might be finished with their work.&lt;br /&gt;
&lt;br /&gt;
=== License server machine is down or not responding ===&lt;br /&gt;
* Error details:&lt;br /&gt;
  License error: -96.&lt;br /&gt;
  See the system administrator about starting the license server system, or&lt;br /&gt;
  make sure you&#039;re referring to the right host (see LM_LICENSE_FILE).&lt;br /&gt;
 Feature:       SERIAL&lt;br /&gt;
 Hostname:      clicense3&lt;br /&gt;
 License path:  /Users/stern/Applications/COMSOL52a/license/license.dat:&lt;br /&gt;
 FlexNet Licensing error:-96,7&lt;br /&gt;
* Reason: The license servers cannot be reached at all. The &amp;lt;code&amp;gt;ping&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;host&amp;lt;/code&amp;gt; tests mentioned above fail.&lt;br /&gt;
* Solution: Review the client license file and DNS lookup domains.&lt;br /&gt;
&lt;br /&gt;
=== License file does not support this version ===&lt;br /&gt;
* Error details:&lt;br /&gt;
  Feature: SERIAL&lt;br /&gt;
 &#039;&#039;&#039;Application version &amp;gt; License version: 5.21 &amp;gt; 3.5&#039;&#039;&#039;&lt;br /&gt;
 License path: /Users/stern/Applications/COMSOL52a/license/license.dat:&lt;br /&gt;
 FlexNet Licensing error:-21,126&lt;br /&gt;
* 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&#039;re connected to.&lt;br /&gt;
* Solution: When using SSH, try &amp;lt;code&amp;gt;clicense2&amp;lt;/code&amp;gt; instead of  &amp;lt;code&amp;gt;clicense1&amp;lt;/code&amp;gt;, or vice versa. Revisit your &amp;lt;code&amp;gt;~/.ssh/config&amp;lt;/code&amp;gt; file or use the alternate command line as shown in the SSH section above.&lt;br /&gt;
&lt;br /&gt;
== Multiple CPU cores ==&lt;br /&gt;
Ways to start multi-core (from http://www.comsol.com/support/knowledgebase/1096/)&lt;br /&gt;
 comsol -np 8&lt;br /&gt;
&lt;br /&gt;
 export COMSOL_NUM_THREADS=8    # automatically provided on &#039;&#039;Carbon&#039;&#039;&lt;br /&gt;
 comsol&lt;br /&gt;
* COMSOL does not benefit from hyperthreading (oversubscribing the physical core count).&lt;br /&gt;
&lt;br /&gt;
== Batch jobs ==&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
 comsol -clustersimple batch -inputfile input.mph -outputfile output.mph &lt;br /&gt;
&lt;br /&gt;
 &amp;lt;strike&amp;gt;comsol –nn 8 mpd boot&lt;br /&gt;
 comsol –nn 8 batch –inputfile in.mph&lt;br /&gt;
 comsol mpd allexit&amp;lt;/strike&amp;gt;&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
* http://www.comsol.com/support/knowledgebase/1001/ .&lt;br /&gt;
* [[Media:HPC 2012-05-16 Comsol parallel usage.pdf]] (Modified from http://www.comsol.com/support/knowledgebase/1001/files/4027/cluster_install_linux_42a.pptx – Appendix slide, PBS)&lt;br /&gt;
* &#039;&#039;&#039;Note:&#039;&#039;&#039; MPD is not supported on Carbon (I patched the main comsol script), and no longer necessary at all in Comsol-4.3.&lt;br /&gt;
&lt;br /&gt;
=== Sample Job file ===&lt;br /&gt;
See:&lt;br /&gt;
 $COMSOL_HOME/sample.job&lt;br /&gt;
&lt;br /&gt;
== Important COMSOL Support Articles ==&lt;br /&gt;
* Toplevel suport page: https://www.comsol.com/support&lt;br /&gt;
&lt;br /&gt;
=== KB Articles ===&lt;br /&gt;
* [https://www.comsol.com/support/knowledgebase/1001 Running COMSOL® in parallel on clusters]&lt;br /&gt;
* [https://www.comsol.com/support/knowledgebase/1250 Running parametric sweeps, batch sweeps, and cluster sweeps from the command line]&lt;br /&gt;
* [https://www.comsol.com/support/knowledgebase/1255 Reducing the amount of solution data stored in a model]&lt;br /&gt;
* [https://www.comsol.com/support/knowledgebase/830 Handling large models]&lt;br /&gt;
&lt;br /&gt;
=== Blog-style articles ===&lt;br /&gt;
* [https://www.comsol.com/blogs/the-power-of-the-batch-sweep/ The Power of the Batch Sweep]&lt;br /&gt;
* [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]&lt;/div&gt;</summary>
		<author><name>Stern</name></author>
	</entry>
	<entry>
		<id>https://wiki.anl.gov/wiki_cnm/index.php?title=HPC/Applications/comsol&amp;diff=7463</id>
		<title>HPC/Applications/comsol</title>
		<link rel="alternate" type="text/html" href="https://wiki.anl.gov/wiki_cnm/index.php?title=HPC/Applications/comsol&amp;diff=7463"/>
		<updated>2025-08-07T15:11:39Z</updated>

		<summary type="html">&lt;p&gt;Stern: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
The [http://www.comsol.com/products/multiphysics/ &#039;&#039;&#039;COMSOL Multiphysics&#039;&#039;&#039;] application suite&lt;br /&gt;
is available for Mac, Windows, and Linux.&lt;br /&gt;
[[Image:HPC Comsol licensed modules.png|right|450px|thumb|COMSOL features licensed at CNM as of 2024-10.]]&lt;br /&gt;
&lt;br /&gt;
== Access ==&lt;br /&gt;
=== COMSOL Multiphysics ===&lt;br /&gt;
Access to COMSOL&#039;s main graphical user interface application and its batch computing capabilities&lt;br /&gt;
can be granted&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;upon request&#039;&#039;&#039;&#039;&#039;&amp;amp;thinsp;&lt;br /&gt;
to&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Argonne employees&#039;&#039;&#039;&#039;&#039;&amp;amp;thinsp;&lt;br /&gt;
in the following roles:&lt;br /&gt;
* &#039;&#039;CNM Facility Users&#039;&#039;, under an active proposal with COMSOL in scope — please see [[HPC/FAQ#Access_and_proposals]].&lt;br /&gt;
* &#039;&#039;NST staff&#039;&#039; (including PostDocs, joint appointments, and students).&lt;br /&gt;
&lt;br /&gt;
Of the available features, we have licensed a subset, shown at right.&lt;br /&gt;
* To have a native desktop version installed on your Argonne-owned computer (laptop or desktop), please contact [mailto:help@anl.gov?Subject=COMSOL%20license%20access%20request CNM support]. Make sure to review [http://www.comsol.com/support/updates/ Product Updates].&lt;br /&gt;
* To run COMSOL on Carbon itself, as GUI or as batch computing jobs, your proposal must have Carbon access in scope.&lt;br /&gt;
&lt;br /&gt;
=== COMSOL Server ===&lt;br /&gt;
&#039;&#039;CNM Facility Users&#039;&#039; who are not Argonne employees are not eligible to access&lt;br /&gt;
the full &#039;&#039;&#039;COMSOL Multiphysics&#039;&#039;&#039; product, in compliance with its licensing terms and conditions.&lt;br /&gt;
However, the [https://www.comsol.com/comsol-server &#039;&#039;&#039;COMSOL Server&#039;&#039;&#039;] product offers an alternative&lt;br /&gt;
albeit more narrow means of access.&lt;br /&gt;
&lt;br /&gt;
All users, including &#039;&#039;&#039;&#039;&#039;non-Argonne users&#039;&#039;&#039;&#039;&#039; may be able to run, over a web interface in their browser,&lt;br /&gt;
pre-parameterized &amp;quot;fixed-model&amp;quot; simulations that were made with the &#039;&#039;&#039;COMSOL Application Builder&#039;&#039;&#039; (requires Windows).&lt;br /&gt;
&lt;br /&gt;
To inquire about using COMSOL server applications,&lt;br /&gt;
please contact us.&lt;br /&gt;
&amp;lt;!-- [mailto:cnm_useroffice@anl.gov?Subject=COMSOL%20server%20usage Support]. --&amp;gt;&lt;br /&gt;
We will review possible purchase paths for COMSOL Server, and the &#039;&#039;considerable effort&#039;&#039; likely required by users and the CNM to develop and deploy a COMSOL application.&lt;br /&gt;
&lt;br /&gt;
== Support ==&lt;br /&gt;
* For questions on how to run or start COMSOL:&lt;br /&gt;
*: Submit an [[HPC/Support | &#039;&#039;&#039;IT support request&#039;&#039;&#039;]]&lt;br /&gt;
* For questions related to most COMSOL data or scripts, contact COMSOL support at:&lt;br /&gt;
*: [mailto:support@comsol.com &#039;&#039;&#039;support&#039;&#039;&#039;@comsol.com]&lt;br /&gt;
* &#039;&#039;&#039;Exception:&#039;&#039;&#039; If your support question might contain data that is subject to &#039;&#039;&#039;US Export Control&#039;&#039;&#039; regulations, contact instead:&lt;br /&gt;
*: [mailto:us-export-control@us.comsol.com &#039;&#039;&#039;us-export-control&#039;&#039;&#039;@&#039;&#039;&#039;us&#039;&#039;&#039;.comsol.com]&lt;br /&gt;
&lt;br /&gt;
== The modes to run COMSOL ==&lt;br /&gt;
There are several ways of running COMSOL.&lt;br /&gt;
&lt;br /&gt;
=== Running the desktop application ===&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
# Run on Carbon, display on your desktop using the [http://en.wikipedia.org/wiki/X_Window_System X Window system (X11)].&lt;br /&gt;
#* Requires an &#039;&#039;X11 Server&#039;&#039; application running on your client machine, and SSH X11 forwarding.&lt;br /&gt;
#* The X11 protocol can be slow over LAN.&lt;br /&gt;
# Run on Carbon within a [[HPC/Network Access/Virtual Desktop | virtual desktop environment (VNC)]].&lt;br /&gt;
#* Requires a VNC client on your machine.&lt;br /&gt;
#* It can be confusing where VNC and the app runs.&lt;br /&gt;
#* The virtual desktop presents a (deliberatly) sparse windowing environment – Copy&amp;amp;Paste can be difficult to use.&lt;br /&gt;
# Run on your own computer, remotely checking out Carbon&#039;s license.&lt;br /&gt;
#* Requires a full installation of COMSOL on your desktoo or laptop computer.&lt;br /&gt;
#* 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.&lt;br /&gt;
&lt;br /&gt;
=== Running a batch calculation ===&lt;br /&gt;
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.&lt;br /&gt;
See the [[#Batch jobs|section below]].&lt;br /&gt;
&lt;br /&gt;
== Use with X11 ==&lt;br /&gt;
For casual use, and with [[HPC/Network Access/SSH Tunnel Setup on Linux and MacOS | X11 tunneling to Carbon]] set up, simply add to your &amp;lt;code&amp;gt;~/.bashrc&amp;lt;/code&amp;gt; file on Carbon:&lt;br /&gt;
 module load comsol&lt;br /&gt;
&lt;br /&gt;
Then, from the command line on a Carbon login node, start the COMSOL GUI:&lt;br /&gt;
 comsol &amp;amp;&lt;br /&gt;
&lt;br /&gt;
License configuration is automatic on Carbon.&lt;br /&gt;
&lt;br /&gt;
Comsol will use a number of cores to run calculations multithreaded by default. (On Carbon, COMSOL_NUM_THREADS is set.)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Quit the application&#039;&#039;&#039; as soon as you are done. Only one user can use Comsol at a time.&lt;br /&gt;
&lt;br /&gt;
== Use with VNC ==&lt;br /&gt;
See general  [[HPC/Network Access/Virtual Desktop | instructions on using VNC]], and the COMSOL example therein.&lt;br /&gt;
&lt;br /&gt;
== Native desktop version ==&lt;br /&gt;
&lt;br /&gt;
To get the fastest response from the COMSOL GUI, run a native COMSOL version on your desktop machine or laptop, called &#039;&#039;client machine&#039;&#039; below.&lt;br /&gt;
&lt;br /&gt;
Enter license details either in the COMSOL Setup configuration dialog.&lt;br /&gt;
&lt;br /&gt;
== Native desktop version — License configuration ==&lt;br /&gt;
A client&#039;s COMSOL license needs to be configured depending on how the client reaches CNM network resources. Follow the appropriate section:&lt;br /&gt;
* [[#License configuration when inside CNM or using VPN]]&lt;br /&gt;
* [[#License configuration when outside CNM and using SSH Tunneling]]&lt;br /&gt;
&lt;br /&gt;
=== License configuration when inside CNM or using VPN ===&lt;br /&gt;
==== &amp;lt;span style=&amp;quot;color:#A00;&amp;quot;&amp;gt;Ensure correct DNS search domains&amp;lt;/span&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
* Inspect the client machine&#039;s network configuration.&lt;br /&gt;
* Ensure that &#039;&#039;&#039;two&#039;&#039;&#039; entries are listed as DNS Search Domains for the current network profile:&lt;br /&gt;
 nst.anl.gov&lt;br /&gt;
 cnm.anl.gov&lt;br /&gt;
: (The order of entries does not matter for the purposes considered here.)&lt;br /&gt;
* If the client machine is &#039;&#039;wired to CNM networks&#039;&#039;, the domains are normally provided correctly by DHCP.&lt;br /&gt;
* If the client machine is &#039;&#039;connected over VPN&#039;&#039;, you may need edit the respective network profile.&lt;br /&gt;
:* 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 &amp;quot;Advanced…&amp;quot;. It appears that those changes are being saved and will be activated automatically the next time that this VPN session gets started.&lt;br /&gt;
: [[Image:VNC_add_cnm_to_DNS_1.png|400px]] [[Image:VNC_add_cnm_to_DNS_2.png|400px]]&lt;br /&gt;
:* On Windows or Linux machines, take &#039;&#039;analogous&#039;&#039; steps, using the platform&#039;s own configuration tools.&lt;br /&gt;
&lt;br /&gt;
* Exclude license manager components from client desktop installation. (Those are all handled server-side.)&lt;br /&gt;
&lt;br /&gt;
==== License format ====&lt;br /&gt;
* Floating Network License (FNL), &amp;quot;Three-server redundancy&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==== License servers ====&lt;br /&gt;
* On client machines, while running the COMSOL installer or license configuration, specify license servers and ports as follows:&lt;br /&gt;
 clicense1    1718&lt;br /&gt;
 clicense2    1718&lt;br /&gt;
 clicense3    1718&lt;br /&gt;
: &#039;&#039;&#039;Note:&#039;&#039;&#039; Use &#039;&#039;short host name&#039;&#039; form exactly as given here. (Technical Reason: The license must be usable both on Carbon&#039;s internal network as well as on divisional networks that are outside of Carbon).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Advanced:&#039;&#039;&#039; A client machine&#039;s COMSOL license file &amp;lt;code&amp;gt;&amp;amp;lt;COMSOLDIR&amp;amp;gt;/Multiphysics/license/license.dat&amp;lt;/code&amp;gt; should look as follows:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;make&amp;quot;&amp;gt;&lt;br /&gt;
SERVER clicense1 ANY 1718&lt;br /&gt;
SERVER clicense2 ANY 1718&lt;br /&gt;
SERVER clicense3 ANY 1718&lt;br /&gt;
USE_SERVER&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;amp;lt;COMSOLDIR&amp;amp;gt;&amp;lt;/code&amp;gt; is located by default at:&lt;br /&gt;
* &#039;&#039;&#039;Windows&#039;&#039;&#039;: C:\Program files\COMSOL\COMSOL&#039;&#039;nn&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Linux&#039;&#039;&#039;: /usr/local/comsol&#039;&#039;nn&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Mac&#039;&#039;&#039;: /Applications/COMSOL&#039;&#039;nn&#039;&#039;&lt;br /&gt;
(&amp;quot;&#039;&#039;nn&#039;&#039;&amp;quot; is the application&#039;s abbreviated version number.)&lt;br /&gt;
&lt;br /&gt;
==== Network Troubleshooting ====&lt;br /&gt;
When using the license access model descibed here (as opposed to tunneled over SSH), ensure the following:&lt;br /&gt;
* Verify that short host names can be resolved to IP addresses. Either one of the following commands should produce sensible output:&lt;br /&gt;
 host clicense1&lt;br /&gt;
: or:&lt;br /&gt;
 ping -c 3 clicense1&lt;br /&gt;
* Verify that &#039;&#039;both license ports on the same server&#039;&#039; can be reached from your client machine:&lt;br /&gt;
 telnet &#039;&#039;&#039;clicense1&#039;&#039;&#039; 1718&lt;br /&gt;
 telnet &#039;&#039;&#039;clicense1&#039;&#039;&#039; 1719&lt;br /&gt;
: or:&lt;br /&gt;
 telnet &#039;&#039;&#039;clicense2&#039;&#039;&#039; 1718&lt;br /&gt;
 telnet &#039;&#039;&#039;clicense2&#039;&#039;&#039; 1719&lt;br /&gt;
: A &#039;&#039;successful&#039;&#039; connection looks like:&lt;br /&gt;
 Trying 146.139.x.y...&lt;br /&gt;
 Connected to clicense1.cnm.anl.gov.&lt;br /&gt;
 Escape character is &#039;^]&#039;.&lt;br /&gt;
:: Do not enter any data. Instead,  close each connection by hitting &amp;lt;code&amp;gt;Ctrl&amp;lt;/code&amp;gt;&amp;lt;code&amp;gt;]&amp;lt;/code&amp;gt; (closing square bracket), followed by &amp;lt;code&amp;gt;Ctrl&amp;lt;/code&amp;gt;&amp;lt;code&amp;gt;D&amp;lt;/code&amp;gt;.&lt;br /&gt;
: A &#039;&#039;failed&#039;&#039; connection gives one of these errors:&lt;br /&gt;
 telnet: connect to address 146.139.x.y: Operation timed out&lt;br /&gt;
: or:&lt;br /&gt;
 telnet: connect to address 146.139.x.y: Connection refused&lt;br /&gt;
:: In these cases, ask that your IP firewall configuration be reviewed and changed.&lt;br /&gt;
&lt;br /&gt;
=== License configuration when outside CNM and using SSH Tunneling ===&lt;br /&gt;
If you&#039;re comfortable with ssh and tunneling, configure client licensing as follows:&lt;br /&gt;
&lt;br /&gt;
==== License format ====&lt;br /&gt;
* Floating Network License (FNL), &amp;quot;Port number and Hostname&amp;quot;&lt;br /&gt;
: &#039;&#039;&#039;Note:&#039;&#039;&#039; Three-server redundancy cannot be accessed over SSH tunneling. Instead, the user must configure just one server, and if needed in rare situations manually reconfigure to use the other server if the first one fails.&lt;br /&gt;
&lt;br /&gt;
==== License server ====&lt;br /&gt;
* Enter into the COMSOL license file:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;make&amp;quot;&amp;gt;&lt;br /&gt;
SERVER 127.0.0.1 ANY 1718&lt;br /&gt;
USE_SERVER&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
: &#039;&#039;&#039;Note:&#039;&#039;&#039; Do not use &amp;quot;localhost&amp;quot;, as this will be directly (and incorrectly) interpreted by COMSOL to mean that the current machine actually &#039;&#039;is&#039;&#039; a license server.&lt;br /&gt;
&lt;br /&gt;
Connect to &amp;lt;code&amp;gt;mega&amp;lt;/code&amp;gt; or a Carbon login node with one of the following ssh commands:&lt;br /&gt;
* First, set up a tunnel to the primary license server:&lt;br /&gt;
 ssh  -L 1718:&#039;&#039;&#039;clicense1&#039;&#039;&#039;:1718  -L 1719:&#039;&#039;&#039;clicense1&#039;&#039;&#039;:1719  mega&lt;br /&gt;
* Start COMSOL.&lt;br /&gt;
: If you get an error that the number of licenses is exhausted, that is at least confirmation that you correctly reached the license server.&lt;br /&gt;
&lt;br /&gt;
If the above attempt takes a long time or hangs entirely, it may be because the license service currently runs on the secondary server.&lt;br /&gt;
* Connect to the alternate license server:&lt;br /&gt;
 ssh  -L 1718:&#039;&#039;&#039;clicense2&#039;&#039;&#039;:1718  -L 1719:&#039;&#039;&#039;clicense2&#039;&#039;&#039;:1719  mega&lt;br /&gt;
* Start COMSOL.&lt;br /&gt;
&lt;br /&gt;
== License Troubleshooting ==&lt;br /&gt;
The following are typical error messages.&lt;br /&gt;
=== Could not obtain license for COMSOL Multiphysics GUI ===&lt;br /&gt;
* Error details:&lt;br /&gt;
 License error: -4.&lt;br /&gt;
 &#039;&#039;&#039;Licensed number of users already reached.&#039;&#039;&#039;&lt;br /&gt;
 Feature:       COMSOLGUI&lt;br /&gt;
 License path:  /Users/stern/Applications/COMSOL52a/license/license.dat:&lt;br /&gt;
 FlexNet Licensing error:-4,132&lt;br /&gt;
* Reason: The connection to the license server succeeded, but the license token(s) you requested are in use.&lt;br /&gt;
* Solution: Wait a bit, or [http://carbonmgmt/ganglia/lic.php identify who&#039;s using COMSOL] and politely ask the user when they might be finished with their work.&lt;br /&gt;
&lt;br /&gt;
=== License server machine is down or not responding ===&lt;br /&gt;
* Error details:&lt;br /&gt;
  License error: -96.&lt;br /&gt;
  See the system administrator about starting the license server system, or&lt;br /&gt;
  make sure you&#039;re referring to the right host (see LM_LICENSE_FILE).&lt;br /&gt;
 Feature:       SERIAL&lt;br /&gt;
 Hostname:      clicense3&lt;br /&gt;
 License path:  /Users/stern/Applications/COMSOL52a/license/license.dat:&lt;br /&gt;
 FlexNet Licensing error:-96,7&lt;br /&gt;
* Reason: The license servers cannot be reached at all. The &amp;lt;code&amp;gt;ping&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;host&amp;lt;/code&amp;gt; tests mentioned above fail.&lt;br /&gt;
* Solution: Review the client license file and DNS lookup domains.&lt;br /&gt;
&lt;br /&gt;
=== License file does not support this version ===&lt;br /&gt;
* Error details:&lt;br /&gt;
  Feature: SERIAL&lt;br /&gt;
 &#039;&#039;&#039;Application version &amp;gt; License version: 5.21 &amp;gt; 3.5&#039;&#039;&#039;&lt;br /&gt;
 License path: /Users/stern/Applications/COMSOL52a/license/license.dat:&lt;br /&gt;
 FlexNet Licensing error:-21,126&lt;br /&gt;
* 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&#039;re connected to.&lt;br /&gt;
* Solution: When using SSH, try &amp;lt;code&amp;gt;clicense2&amp;lt;/code&amp;gt; instead of  &amp;lt;code&amp;gt;clicense1&amp;lt;/code&amp;gt;, or vice versa. Revisit your &amp;lt;code&amp;gt;~/.ssh/config&amp;lt;/code&amp;gt; file or use the alternate command line as shown in the SSH section above.&lt;br /&gt;
&lt;br /&gt;
== Multiple CPU cores ==&lt;br /&gt;
Ways to start multi-core (from http://www.comsol.com/support/knowledgebase/1096/)&lt;br /&gt;
 comsol -np 8&lt;br /&gt;
&lt;br /&gt;
 export COMSOL_NUM_THREADS=8    # automatically provided on &#039;&#039;Carbon&#039;&#039;&lt;br /&gt;
 comsol&lt;br /&gt;
* COMSOL does not benefit from hyperthreading (oversubscribing the physical core count).&lt;br /&gt;
&lt;br /&gt;
== Batch jobs ==&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
 comsol -clustersimple batch -inputfile input.mph -outputfile output.mph &lt;br /&gt;
&lt;br /&gt;
 &amp;lt;strike&amp;gt;comsol –nn 8 mpd boot&lt;br /&gt;
 comsol –nn 8 batch –inputfile in.mph&lt;br /&gt;
 comsol mpd allexit&amp;lt;/strike&amp;gt;&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
* http://www.comsol.com/support/knowledgebase/1001/ .&lt;br /&gt;
* [[Media:HPC 2012-05-16 Comsol parallel usage.pdf]] (Modified from http://www.comsol.com/support/knowledgebase/1001/files/4027/cluster_install_linux_42a.pptx – Appendix slide, PBS)&lt;br /&gt;
* &#039;&#039;&#039;Note:&#039;&#039;&#039; MPD is not supported on Carbon (I patched the main comsol script), and no longer necessary at all in Comsol-4.3.&lt;br /&gt;
&lt;br /&gt;
=== Sample Job file ===&lt;br /&gt;
See:&lt;br /&gt;
 $COMSOL_HOME/sample.job&lt;br /&gt;
&lt;br /&gt;
== Important COMSOL Support Articles ==&lt;br /&gt;
* Toplevel suport page: https://www.comsol.com/support&lt;br /&gt;
&lt;br /&gt;
=== KB Articles ===&lt;br /&gt;
* [https://www.comsol.com/support/knowledgebase/1001 Running COMSOL® in parallel on clusters]&lt;br /&gt;
* [https://www.comsol.com/support/knowledgebase/1250 Running parametric sweeps, batch sweeps, and cluster sweeps from the command line]&lt;br /&gt;
* [https://www.comsol.com/support/knowledgebase/1255 Reducing the amount of solution data stored in a model]&lt;br /&gt;
* [https://www.comsol.com/support/knowledgebase/830 Handling large models]&lt;br /&gt;
&lt;br /&gt;
=== Blog-style articles ===&lt;br /&gt;
* [https://www.comsol.com/blogs/the-power-of-the-batch-sweep/ The Power of the Batch Sweep]&lt;br /&gt;
* [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]&lt;/div&gt;</summary>
		<author><name>Stern</name></author>
	</entry>
	<entry>
		<id>https://wiki.anl.gov/wiki_cnm/index.php?title=HPC/Applications/comsol&amp;diff=7462</id>
		<title>HPC/Applications/comsol</title>
		<link rel="alternate" type="text/html" href="https://wiki.anl.gov/wiki_cnm/index.php?title=HPC/Applications/comsol&amp;diff=7462"/>
		<updated>2025-08-07T15:06:19Z</updated>

		<summary type="html">&lt;p&gt;Stern: /* Introduction */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
The [http://www.comsol.com/products/multiphysics/ COMSOL Multiphysics] product is available for Mac, Windows, and Linux.&lt;br /&gt;
[[Image:HPC Comsol licensed modules.png|right|450px|thumb|COMSOL features licensed at CNM as of 2024-10.]]&lt;br /&gt;
&lt;br /&gt;
== Access ==&lt;br /&gt;
=== COMSOL Multiphysics ===&lt;br /&gt;
CNM&#039;s license for&lt;br /&gt;
[http://www.comsol.com/products/multiphysics/ &#039;&#039;&#039;COMSOL Multiphysics&#039;&#039;&#039;]&lt;br /&gt;
(the main graphical user interface application with batch computing capabilities)&lt;br /&gt;
is available&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;upon request&#039;&#039;&#039;&#039;&#039;&amp;amp;thinsp;&lt;br /&gt;
to&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Argonne employees&#039;&#039;&#039;&#039;&#039;&amp;amp;thinsp;&lt;br /&gt;
in the following roles:&lt;br /&gt;
* &#039;&#039;CNM Facility Users&#039;&#039;, under an active proposal with COMSOL in scope — please see [[HPC/FAQ#Access_and_proposals]].&lt;br /&gt;
* &#039;&#039;NST staff&#039;&#039; (including PostDocs, joint appointments, and students).&lt;br /&gt;
&lt;br /&gt;
Of the available features, we have licensed a subset, shown at right.&lt;br /&gt;
* To have a native desktop version installed on your Argonne-owned computer (laptop or desktop), please contact [mailto:help@anl.gov?Subject=COMSOL%20license%20access%20request CNM support]. Make sure to review [http://www.comsol.com/support/updates/ Product Updates].&lt;br /&gt;
* To run COMSOL on Carbon itself, as GUI or as batch computing jobs, your proposal must have Carbon access in scope.&lt;br /&gt;
&lt;br /&gt;
=== COMSOL Server ===&lt;br /&gt;
CNM Facility Users who are not Argonne employees are not eligible to access the full &#039;&#039;&#039;COMSOL Multiphysics&#039;&#039;&#039; product,&lt;br /&gt;
in compliance with its licensing terms and conditions.&lt;br /&gt;
However, the [https://www.comsol.com/comsol-server &#039;&#039;&#039;COMSOL Server&#039;&#039;&#039;] product offers an alternative but more narrow means of access.&lt;br /&gt;
&lt;br /&gt;
All users, including &#039;&#039;&#039;&#039;&#039;non-Argonne users&#039;&#039;&#039;&#039;&#039; may be able to run, over a web interface in their browser,&lt;br /&gt;
pre-parameterized &amp;quot;fixed-model&amp;quot; simulations that were made with the &#039;&#039;&#039;COMSOL Application Builder&#039;&#039;&#039; (requires Windows).&lt;br /&gt;
&lt;br /&gt;
To inquire about using COMSOL server applications,&lt;br /&gt;
please contact us.&lt;br /&gt;
&amp;lt;!-- [mailto:cnm_useroffice@anl.gov?Subject=COMSOL%20server%20usage Support]. --&amp;gt;&lt;br /&gt;
We will review possible purchase paths for COMSOL Server, and the &#039;&#039;considerable effort&#039;&#039; likely required by users and the CNM to develop and deploy a COMSOL application.&lt;br /&gt;
&lt;br /&gt;
== Support ==&lt;br /&gt;
* For questions on how to run or start COMSOL:&lt;br /&gt;
*: Submit an [[HPC/Support | &#039;&#039;&#039;IT support request&#039;&#039;&#039;]]&lt;br /&gt;
* For questions related to most COMSOL data or scripts, contact COMSOL support at:&lt;br /&gt;
*: [mailto:support@comsol.com &#039;&#039;&#039;support&#039;&#039;&#039;@comsol.com]&lt;br /&gt;
* &#039;&#039;&#039;Exception:&#039;&#039;&#039; If your support question might contain data that is subject to &#039;&#039;&#039;US Export Control&#039;&#039;&#039; regulations, contact instead:&lt;br /&gt;
*: [mailto:us-export-control@us.comsol.com &#039;&#039;&#039;us-export-control&#039;&#039;&#039;@&#039;&#039;&#039;us&#039;&#039;&#039;.comsol.com]&lt;br /&gt;
&lt;br /&gt;
== The modes to run COMSOL ==&lt;br /&gt;
There are several ways of running COMSOL.&lt;br /&gt;
&lt;br /&gt;
=== Running the desktop application ===&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
# Run on Carbon, display on your desktop using the [http://en.wikipedia.org/wiki/X_Window_System X Window system (X11)].&lt;br /&gt;
#* Requires an &#039;&#039;X11 Server&#039;&#039; application running on your client machine, and SSH X11 forwarding.&lt;br /&gt;
#* The X11 protocol can be slow over LAN.&lt;br /&gt;
# Run on Carbon within a [[HPC/Network Access/Virtual Desktop | virtual desktop environment (VNC)]].&lt;br /&gt;
#* Requires a VNC client on your machine.&lt;br /&gt;
#* It can be confusing where VNC and the app runs.&lt;br /&gt;
#* The virtual desktop presents a (deliberatly) sparse windowing environment – Copy&amp;amp;Paste can be difficult to use.&lt;br /&gt;
# Run on your own computer, remotely checking out Carbon&#039;s license.&lt;br /&gt;
#* Requires a full installation of COMSOL on your desktoo or laptop computer.&lt;br /&gt;
#* 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.&lt;br /&gt;
&lt;br /&gt;
=== Running a batch calculation ===&lt;br /&gt;
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.&lt;br /&gt;
See the [[#Batch jobs|section below]].&lt;br /&gt;
&lt;br /&gt;
== Use with X11 ==&lt;br /&gt;
For casual use, and with [[HPC/Network Access/SSH Tunnel Setup on Linux and MacOS | X11 tunneling to Carbon]] set up, simply add to your &amp;lt;code&amp;gt;~/.bashrc&amp;lt;/code&amp;gt; file on Carbon:&lt;br /&gt;
 module load comsol&lt;br /&gt;
&lt;br /&gt;
Then, from the command line on a Carbon login node, start the COMSOL GUI:&lt;br /&gt;
 comsol &amp;amp;&lt;br /&gt;
&lt;br /&gt;
License configuration is automatic on Carbon.&lt;br /&gt;
&lt;br /&gt;
Comsol will use a number of cores to run calculations multithreaded by default. (On Carbon, COMSOL_NUM_THREADS is set.)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Quit the application&#039;&#039;&#039; as soon as you are done. Only one user can use Comsol at a time.&lt;br /&gt;
&lt;br /&gt;
== Use with VNC ==&lt;br /&gt;
See general  [[HPC/Network Access/Virtual Desktop | instructions on using VNC]], and the COMSOL example therein.&lt;br /&gt;
&lt;br /&gt;
== Native desktop version ==&lt;br /&gt;
&lt;br /&gt;
To get the fastest response from the COMSOL GUI, run a native COMSOL version on your desktop machine or laptop, called &#039;&#039;client machine&#039;&#039; below.&lt;br /&gt;
&lt;br /&gt;
Enter license details either in the COMSOL Setup configuration dialog.&lt;br /&gt;
&lt;br /&gt;
== Native desktop version — License configuration ==&lt;br /&gt;
A client&#039;s COMSOL license needs to be configured depending on how the client reaches CNM network resources. Follow the appropriate section:&lt;br /&gt;
* [[#License configuration when inside CNM or using VPN]]&lt;br /&gt;
* [[#License configuration when outside CNM and using SSH Tunneling]]&lt;br /&gt;
&lt;br /&gt;
=== License configuration when inside CNM or using VPN ===&lt;br /&gt;
==== &amp;lt;span style=&amp;quot;color:#A00;&amp;quot;&amp;gt;Ensure correct DNS search domains&amp;lt;/span&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
* Inspect the client machine&#039;s network configuration.&lt;br /&gt;
* Ensure that &#039;&#039;&#039;two&#039;&#039;&#039; entries are listed as DNS Search Domains for the current network profile:&lt;br /&gt;
 nst.anl.gov&lt;br /&gt;
 cnm.anl.gov&lt;br /&gt;
: (The order of entries does not matter for the purposes considered here.)&lt;br /&gt;
* If the client machine is &#039;&#039;wired to CNM networks&#039;&#039;, the domains are normally provided correctly by DHCP.&lt;br /&gt;
* If the client machine is &#039;&#039;connected over VPN&#039;&#039;, you may need edit the respective network profile.&lt;br /&gt;
:* 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 &amp;quot;Advanced…&amp;quot;. It appears that those changes are being saved and will be activated automatically the next time that this VPN session gets started.&lt;br /&gt;
: [[Image:VNC_add_cnm_to_DNS_1.png|400px]] [[Image:VNC_add_cnm_to_DNS_2.png|400px]]&lt;br /&gt;
:* On Windows or Linux machines, take &#039;&#039;analogous&#039;&#039; steps, using the platform&#039;s own configuration tools.&lt;br /&gt;
&lt;br /&gt;
* Exclude license manager components from client desktop installation. (Those are all handled server-side.)&lt;br /&gt;
&lt;br /&gt;
==== License format ====&lt;br /&gt;
* Floating Network License (FNL), &amp;quot;Three-server redundancy&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==== License servers ====&lt;br /&gt;
* On client machines, while running the COMSOL installer or license configuration, specify license servers and ports as follows:&lt;br /&gt;
 clicense1    1718&lt;br /&gt;
 clicense2    1718&lt;br /&gt;
 clicense3    1718&lt;br /&gt;
: &#039;&#039;&#039;Note:&#039;&#039;&#039; Use &#039;&#039;short host name&#039;&#039; form exactly as given here. (Technical Reason: The license must be usable both on Carbon&#039;s internal network as well as on divisional networks that are outside of Carbon).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Advanced:&#039;&#039;&#039; A client machine&#039;s COMSOL license file &amp;lt;code&amp;gt;&amp;amp;lt;COMSOLDIR&amp;amp;gt;/Multiphysics/license/license.dat&amp;lt;/code&amp;gt; should look as follows:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;make&amp;quot;&amp;gt;&lt;br /&gt;
SERVER clicense1 ANY 1718&lt;br /&gt;
SERVER clicense2 ANY 1718&lt;br /&gt;
SERVER clicense3 ANY 1718&lt;br /&gt;
USE_SERVER&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;amp;lt;COMSOLDIR&amp;amp;gt;&amp;lt;/code&amp;gt; is located by default at:&lt;br /&gt;
* &#039;&#039;&#039;Windows&#039;&#039;&#039;: C:\Program files\COMSOL\COMSOL&#039;&#039;nn&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Linux&#039;&#039;&#039;: /usr/local/comsol&#039;&#039;nn&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Mac&#039;&#039;&#039;: /Applications/COMSOL&#039;&#039;nn&#039;&#039;&lt;br /&gt;
(&amp;quot;&#039;&#039;nn&#039;&#039;&amp;quot; is the application&#039;s abbreviated version number.)&lt;br /&gt;
&lt;br /&gt;
==== Network Troubleshooting ====&lt;br /&gt;
When using the license access model descibed here (as opposed to tunneled over SSH), ensure the following:&lt;br /&gt;
* Verify that short host names can be resolved to IP addresses. Either one of the following commands should produce sensible output:&lt;br /&gt;
 host clicense1&lt;br /&gt;
: or:&lt;br /&gt;
 ping -c 3 clicense1&lt;br /&gt;
* Verify that &#039;&#039;both license ports on the same server&#039;&#039; can be reached from your client machine:&lt;br /&gt;
 telnet &#039;&#039;&#039;clicense1&#039;&#039;&#039; 1718&lt;br /&gt;
 telnet &#039;&#039;&#039;clicense1&#039;&#039;&#039; 1719&lt;br /&gt;
: or:&lt;br /&gt;
 telnet &#039;&#039;&#039;clicense2&#039;&#039;&#039; 1718&lt;br /&gt;
 telnet &#039;&#039;&#039;clicense2&#039;&#039;&#039; 1719&lt;br /&gt;
: A &#039;&#039;successful&#039;&#039; connection looks like:&lt;br /&gt;
 Trying 146.139.x.y...&lt;br /&gt;
 Connected to clicense1.cnm.anl.gov.&lt;br /&gt;
 Escape character is &#039;^]&#039;.&lt;br /&gt;
:: Do not enter any data. Instead,  close each connection by hitting &amp;lt;code&amp;gt;Ctrl&amp;lt;/code&amp;gt;&amp;lt;code&amp;gt;]&amp;lt;/code&amp;gt; (closing square bracket), followed by &amp;lt;code&amp;gt;Ctrl&amp;lt;/code&amp;gt;&amp;lt;code&amp;gt;D&amp;lt;/code&amp;gt;.&lt;br /&gt;
: A &#039;&#039;failed&#039;&#039; connection gives one of these errors:&lt;br /&gt;
 telnet: connect to address 146.139.x.y: Operation timed out&lt;br /&gt;
: or:&lt;br /&gt;
 telnet: connect to address 146.139.x.y: Connection refused&lt;br /&gt;
:: In these cases, ask that your IP firewall configuration be reviewed and changed.&lt;br /&gt;
&lt;br /&gt;
=== License configuration when outside CNM and using SSH Tunneling ===&lt;br /&gt;
If you&#039;re comfortable with ssh and tunneling, configure client licensing as follows:&lt;br /&gt;
&lt;br /&gt;
==== License format ====&lt;br /&gt;
* Floating Network License (FNL), &amp;quot;Port number and Hostname&amp;quot;&lt;br /&gt;
: &#039;&#039;&#039;Note:&#039;&#039;&#039; Three-server redundancy cannot be accessed over SSH tunneling. Instead, the user must configure just one server, and if needed in rare situations manually reconfigure to use the other server if the first one fails.&lt;br /&gt;
&lt;br /&gt;
==== License server ====&lt;br /&gt;
* Enter into the COMSOL license file:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;make&amp;quot;&amp;gt;&lt;br /&gt;
SERVER 127.0.0.1 ANY 1718&lt;br /&gt;
USE_SERVER&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
: &#039;&#039;&#039;Note:&#039;&#039;&#039; Do not use &amp;quot;localhost&amp;quot;, as this will be directly (and incorrectly) interpreted by COMSOL to mean that the current machine actually &#039;&#039;is&#039;&#039; a license server.&lt;br /&gt;
&lt;br /&gt;
Connect to &amp;lt;code&amp;gt;mega&amp;lt;/code&amp;gt; or a Carbon login node with one of the following ssh commands:&lt;br /&gt;
* First, set up a tunnel to the primary license server:&lt;br /&gt;
 ssh  -L 1718:&#039;&#039;&#039;clicense1&#039;&#039;&#039;:1718  -L 1719:&#039;&#039;&#039;clicense1&#039;&#039;&#039;:1719  mega&lt;br /&gt;
* Start COMSOL.&lt;br /&gt;
: If you get an error that the number of licenses is exhausted, that is at least confirmation that you correctly reached the license server.&lt;br /&gt;
&lt;br /&gt;
If the above attempt takes a long time or hangs entirely, it may be because the license service currently runs on the secondary server.&lt;br /&gt;
* Connect to the alternate license server:&lt;br /&gt;
 ssh  -L 1718:&#039;&#039;&#039;clicense2&#039;&#039;&#039;:1718  -L 1719:&#039;&#039;&#039;clicense2&#039;&#039;&#039;:1719  mega&lt;br /&gt;
* Start COMSOL.&lt;br /&gt;
&lt;br /&gt;
== License Troubleshooting ==&lt;br /&gt;
The following are typical error messages.&lt;br /&gt;
=== Could not obtain license for COMSOL Multiphysics GUI ===&lt;br /&gt;
* Error details:&lt;br /&gt;
 License error: -4.&lt;br /&gt;
 &#039;&#039;&#039;Licensed number of users already reached.&#039;&#039;&#039;&lt;br /&gt;
 Feature:       COMSOLGUI&lt;br /&gt;
 License path:  /Users/stern/Applications/COMSOL52a/license/license.dat:&lt;br /&gt;
 FlexNet Licensing error:-4,132&lt;br /&gt;
* Reason: The connection to the license server succeeded, but the license token(s) you requested are in use.&lt;br /&gt;
* Solution: Wait a bit, or [http://carbonmgmt/ganglia/lic.php identify who&#039;s using COMSOL] and politely ask the user when they might be finished with their work.&lt;br /&gt;
&lt;br /&gt;
=== License server machine is down or not responding ===&lt;br /&gt;
* Error details:&lt;br /&gt;
  License error: -96.&lt;br /&gt;
  See the system administrator about starting the license server system, or&lt;br /&gt;
  make sure you&#039;re referring to the right host (see LM_LICENSE_FILE).&lt;br /&gt;
 Feature:       SERIAL&lt;br /&gt;
 Hostname:      clicense3&lt;br /&gt;
 License path:  /Users/stern/Applications/COMSOL52a/license/license.dat:&lt;br /&gt;
 FlexNet Licensing error:-96,7&lt;br /&gt;
* Reason: The license servers cannot be reached at all. The &amp;lt;code&amp;gt;ping&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;host&amp;lt;/code&amp;gt; tests mentioned above fail.&lt;br /&gt;
* Solution: Review the client license file and DNS lookup domains.&lt;br /&gt;
&lt;br /&gt;
=== License file does not support this version ===&lt;br /&gt;
* Error details:&lt;br /&gt;
  Feature: SERIAL&lt;br /&gt;
 &#039;&#039;&#039;Application version &amp;gt; License version: 5.21 &amp;gt; 3.5&#039;&#039;&#039;&lt;br /&gt;
 License path: /Users/stern/Applications/COMSOL52a/license/license.dat:&lt;br /&gt;
 FlexNet Licensing error:-21,126&lt;br /&gt;
* 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&#039;re connected to.&lt;br /&gt;
* Solution: When using SSH, try &amp;lt;code&amp;gt;clicense2&amp;lt;/code&amp;gt; instead of  &amp;lt;code&amp;gt;clicense1&amp;lt;/code&amp;gt;, or vice versa. Revisit your &amp;lt;code&amp;gt;~/.ssh/config&amp;lt;/code&amp;gt; file or use the alternate command line as shown in the SSH section above.&lt;br /&gt;
&lt;br /&gt;
== Multiple CPU cores ==&lt;br /&gt;
Ways to start multi-core (from http://www.comsol.com/support/knowledgebase/1096/)&lt;br /&gt;
 comsol -np 8&lt;br /&gt;
&lt;br /&gt;
 export COMSOL_NUM_THREADS=8    # automatically provided on &#039;&#039;Carbon&#039;&#039;&lt;br /&gt;
 comsol&lt;br /&gt;
* COMSOL does not benefit from hyperthreading (oversubscribing the physical core count).&lt;br /&gt;
&lt;br /&gt;
== Batch jobs ==&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
 comsol -clustersimple batch -inputfile input.mph -outputfile output.mph &lt;br /&gt;
&lt;br /&gt;
 &amp;lt;strike&amp;gt;comsol –nn 8 mpd boot&lt;br /&gt;
 comsol –nn 8 batch –inputfile in.mph&lt;br /&gt;
 comsol mpd allexit&amp;lt;/strike&amp;gt;&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
* http://www.comsol.com/support/knowledgebase/1001/ .&lt;br /&gt;
* [[Media:HPC 2012-05-16 Comsol parallel usage.pdf]] (Modified from http://www.comsol.com/support/knowledgebase/1001/files/4027/cluster_install_linux_42a.pptx – Appendix slide, PBS)&lt;br /&gt;
* &#039;&#039;&#039;Note:&#039;&#039;&#039; MPD is not supported on Carbon (I patched the main comsol script), and no longer necessary at all in Comsol-4.3.&lt;br /&gt;
&lt;br /&gt;
=== Sample Job file ===&lt;br /&gt;
See:&lt;br /&gt;
 $COMSOL_HOME/sample.job&lt;br /&gt;
&lt;br /&gt;
== Important COMSOL Support Articles ==&lt;br /&gt;
* Toplevel suport page: https://www.comsol.com/support&lt;br /&gt;
&lt;br /&gt;
=== KB Articles ===&lt;br /&gt;
* [https://www.comsol.com/support/knowledgebase/1001 Running COMSOL® in parallel on clusters]&lt;br /&gt;
* [https://www.comsol.com/support/knowledgebase/1250 Running parametric sweeps, batch sweeps, and cluster sweeps from the command line]&lt;br /&gt;
* [https://www.comsol.com/support/knowledgebase/1255 Reducing the amount of solution data stored in a model]&lt;br /&gt;
* [https://www.comsol.com/support/knowledgebase/830 Handling large models]&lt;br /&gt;
&lt;br /&gt;
=== Blog-style articles ===&lt;br /&gt;
* [https://www.comsol.com/blogs/the-power-of-the-batch-sweep/ The Power of the Batch Sweep]&lt;br /&gt;
* [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]&lt;/div&gt;</summary>
		<author><name>Stern</name></author>
	</entry>
</feed>