Use a COMSOL command to start COMSOL products with detailed start-up options.
<command> [
<target>] [
<options>] [
<target arguments>]
where square brackets indicate optional arguments. There are several different commands (See <command> in the command syntax) that can be combined with optional targets to achieve various results. The table below lists the major available commands and targets (if the Availability column is empty, the command is always available):
The commands are available in the bin\win64 subdirectory in the COMSOL installation directory. The COMSOL installer sets up a few of the possible commands on your Start menu and your desktop. In Windows
8, 8.1, and 10, you can click the shortcut
COMSOL Launchers on the Apps screen. This makes a folder with shortcuts to all COMSOL commands available.
For each launcher file, there is a corresponding .ini file in the same directory. It is sometimes recommended that these files are edited. For example, you can add options to any of the above commands by modifying the corresponding INI file. To change the option
opt to value
val, add the line
to the file comsol.ini. Change the file
comsolbatch.ini for
comsolbatch, and similarly for the other COMSOL targets.
You can enter various options after the COMSOL command and target. Table 22-2 lists the options (See [
<options>] in the command syntax) available for all COMSOL commands. Always issue these options between the command and the target (if any).
For the -tmpdir option, the COMSOL Multiphysics software uses the specified directory to store temporary files. As an alternative, you can use the
COMSOL_TMPDIR environment variable. Use the
-prefsdir option to specify the directory where COMSOL Multiphysics stores the preference file.
In a default COMSOL installation, the documentation files are located in the directory doc under the installation root directory. You can use the
-docroot option if you want to move the documentation directory to a different location. Similarly, use the
-applicationsroot option if you want to move the Application Libraries root directory
applications from its default location under the COMSOL installation root. Relocating the documentation and Application Libraries root directories can be useful for administering an Application Library update; see
The Application Library Update Window.
Use the option -np to control the number of cores used. The default is to use all available cores (processing units).
Use the option -numasets to control the number of nonuniform memory access (NUMA) node sets that the COMSOL Multiphysics software should take into account. This is usually the number of processor sockets that the hardware is using. Note that
-numasets 1 represents the case where there is only one nonuniform memory access node — that is, the entire computer. If you only set the
-np option, the number of sockets is determined automatically so that sufficient number of sockets are used by default. The
-np flag, together with the
-numasets flag, decides the size of a NUMA set (that is,
-np divided by
-numasets). The purpose of
-numafirst is to decide which processor core number to place the first NUMA set on (that is, the size of the NUMA set times
numafirst).
Use the option -alloc to specify memory allocator type. The default is to use the native memory allocator for computers with less than eight cores and otherwise the scalable memory allocator. The scalable memory allocator can increase performance significantly for computers with many cores but uses more memory.
|
You can also specify the number of cores and sockets and the use of the scalable allocators as preferences on the Multicore and Cluster Computing page in the Preferences dialog box. To specify those numbers manually, select the Number of cores and Number of sockets check boxes to enter a number in the associated text fields. By default, all cores are used and the number of sockets are set automatically. If you lower the number of cores, it is good practice to also lower the number of sockets. The preference option for the scalable allocator is called Optimized for multicore. If you want to choose another memory allocator than the default setting, select the Memory allocator check box and the choose Native or Optimized for multicore.
|
If you want to use a different BLAS library than the ones provided by COMSOL, make sure that COMSOL Multiphysics can find the library. The simplest way for COMSOL Multiphysics to find a library is to put it in /lib/win64 or somewhere in the standard search path. Also provide the path to any sublibraries needed by the library. Set the search path to point to the directory where the library is installed. To do so, use the environment variable
PATH. Your library must support both the standard FORTRAN LAPACK interface and the standard FORTRAN BLAS interface. If your LAPACK and BLAS interface consists of several libraries, use the path to the LAPACK library.
In additions to the options in Table 22-2, the standalone COMSOL command supports the following options on Windows:
For example, use comsol -open myapp.mph to open an application. Applications can be run or edited with the two other options.
|
|
|
|
-login {info} | force | never | auto
|
Ask for login information. info means that only missing information is asked for. force resets the password. never requires that the login information is available. auto automatically creates a new username and password.
|
|
|
|
|
|
Specify a TCP/IP port, <port>, to listen for attempts to connect. The <port> is the server port, or 0 for a random free port.
|
|
|
|
|
|
|
The server computer can be accessed in several ways. You can log in to a machine that is dedicated to a single person. You can also connect to the server computer by using Remote Desktop. Start the COMSOL Multiphysics server from the Start menu. If several people want to access a single Windows computer to run the COMSOL Multiphysics server, you must use Windows Terminal Server or another tool that allows multiple users to log in on the same Windows server. In some Windows versions, Microsoft
® provides a Telnet Server with which you can log in through a terminal window. When using a terminal window to log in on Windows, use the
comsolmphserver command to start the COMSOL Multiphysics server.
where <level> is the level to stop the process on. Set the level to a high value in order to stop as soon as possible. By default, it is set to 100. The
-inputfile option indicates the filename of the model that another process is running. The inputfile arguments should be consistent with the one specified to launch another process. That is, either the same inputfile arguments should be provided or the
-inputfile should be the same as the
-outputfile specified to launch another process.
The -inputfile option indicates the filename of the model that another process is running. The inputfile arguments should be consistent with the one specified to launch another process. That is, either the same inputfile arguments should be provided or the
-inputfile should be the same as the
-outputfile specified to launch another process.
This command starts COMSOL Batch, solves the model in the Model MPH-file with the given filename (in.mph in this example) using the active solver settings in the model, and stores the solution in the
out.mph. You can also use multiple sets of input files and output files, stored in a file using the
-jobfile option.
The -study option directs COMSOL Multiphysics to run a certain study. The study is identified by its tag. In the COMSOL Desktop, select
Show Name and Tag under
Model Builder Node Label to see the tags of the jobs under
Study within curly braces in the Model Builder. In the model object, determine the tags of the jobs by the command
model.study().tags(). You can determine the name of each study by
model.study(<tag>).name() using one of the job tags.
The -job option works similar to the
-study option. It directs COMSOL Multiphysics to start a certain job. The job is identified by its tag. In the model object, determine the tags of the jobs by the command
model.batch().tags(). You can determine the name of each job by
model.batch(<tag>).name() using one of the job tags.
The -usebatchlic option makes COMSOL use batch licenses for the job. This option is equivalent to the
Use batch license check box available in the
Cluster Computing and
Cluster Sweep study nodes. Using batch licenses for a cluster computing or cluster sweep job means that you can continue working in the COMSOL Desktop while the job is running using only a single FNL license.
For the -recover option, the working directory (where all .log, and .status files are generated) will contain the .recovery file, which contains information about the recovery folder in the case that the COMSOL software stops working. If the
-recover option is specified, the model from the recovery directory will be opened. If opening that model succeeds, a continue operation will be performed; otherwise, the input filename model will be simulated.
When -mode is
batch (the default), all Batch and Cluster Computing settings are ignored: that is, Batch and Cluster Computing features will not start any batch jobs as they will do when you click
Compute in the COMSOL Desktop.
When -mode is
desktop, Batch and Cluster Computing settings will be used. This case corresponds to clicking
Compute in the COMSOL Desktop. All paths in the
Batch and
Cluster Computing nodes must correspond to paths that you would set up in the COMSOL Desktop if you started it and clicked
Compute instead of running the COMSOL batch command.
You can provide parameters as parameter names and corresponding values using the -pname and
-plist arguments, respectively. For example,
-pname a,b -plist 1,2 corresponds to
The comsolcompile command compiles a model file for Java for use by the COMSOL batch command or for loading class files into the GUI. With COMSOL Compiler, you can also use it to compile COMSOL apps into standalone executable apps. The Windows syntax for the COMSOL compile command is
|
|
|
|
|
|
|
|
|
|
|
Specify where to store the runtime when running the application. The default option is the platform’s default location. The ask option asks the user for the location of the runtime when running the app. The <path> option provides a location where the runtime should be unpacked and stored. Only specify a path when compiling for a single platform.
|
|
|
|
|
|
|
|
|
Options not given are taken from the application’s Compiler node, except for
-outputdir and
-platforms.
If you need to start COMSOL cluster jobs from the command line, the preferred way is to use the comsolclusterbatch command because the
comsolclustermphserver and
comsolcluster commands require TCP/IP access from your client computer to the cluster node where COMSOL Multiphysics runs.
•
|
Make sure that the Windows HPC Server working directory is set to point to the comsol command directory ( <path to COMSOL install directory> \bin\win64). The install directory must be shared between the nodes on your cluster. In some network configurations, the firewall prevents you from starting MPI on a shared executable. To register the executable with the firewall, use the clusrun command to execute the hpcfwutil command on all nodes (for instance, to register comsolclusterbatch) use clusrun /all hpcfwutil register comsolclusterbatch.exe <shared path to COMSOL install directory>\bin\win64\comsolclusterbatch.exe
|
which is located in the Microsoft MPI installation subfolder Bin, as the user that will run the MPI job. You can then start the distributed mode by replacing the previous
mpiexec -n <number of nodes> syntax with
Here the mpiexec command is located in the same folder as
smpd, and the local node should be listed first in the list of computer names if you want to run interactively. To start COMSOL Desktop in distributed mode, use the syntax
mpiexec -hosts <number of nodes> <list of computer names> comsolcluster.exe
<options> [
<target arguments>]
to run a COMSOL batch job on a number of computational nodes given by mpiexec. For further information about the
mpiexec command and Windows HPC Server, consult the documentation that was shipped with the product and the online manuals.
where <prefsdir> is a preference directory
common to all nodes.
-Dcs.rundir=<Where the model file is located on the cluster>
These two lines add commands prior to the comsol command and after the
comsol command, respectively. You can add
{nn} or
{perhost} to any of these pre- and postcommands, which configures the Cluster Computing study to use the number of nodes and number of nodes on each host from the corresponding settings for the Cluster Computing study. For more information, see
Cluster Computing.
Use the COMSOL matlab command to access the COMSOL API through MATLAB. Enter the following command: