Use the comsol command to start COMSOL products with detailed start-up options.
comsol [<target>] [
<options>] [
<target arguments>]
where square brackets indicate optional arguments. The comsol command can be combined with optional targets to achieve various results. The table below lists the command and targets:
The comsol command is located in the
bin folder in the COMSOL installation directory.
There is a number of .ini files in the subdirectories
glnx86 and
glnxa64 in the
bin directory. It is sometimes recommended that you edit these files. 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
comsol batch, and similarly for the other COMSOL targets.
You can enter various options after the comsol command and target.
Table 21-14 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. Use the
-prefsdir option to specify the directory where COMSOL Multiphysics stores the preference file.
In a default COMSOL Multiphysics 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 Multiphysics installation root. Relocating the documentation and Application Libraries root directories can be useful for administering 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 Non-uniform memory access (NUMA) node sets that the COMSOL software should take into account. This is usually the number of processor sockets that the hardware is using. If you only set the -np option, the number of sockets is determined automatically so that sufficient number of sockets are used by default.
|
|
You can also specify the number of cores and sockets as a preference 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.
|
If you want to use a different BLAS library than the default, 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/ARCH, where
ARCH is the architecture (
glnx86 or
glnxa64), or somewhere in the standard search path. You must also provide the path to any sublibraries needed by the library. You can also set the search path to point to the directory where the library is installed. To do so, use the environment variable
LD_LIBRARY_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 21-14, the standalone COMSOL command supports the following option.
comsol [<options>] mphserver [
<target arguments>]
|
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
|
|
comsol [<options>] mphclient [
<target arguments>]
comsol [<options>] batch [
<target arguments>]
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 comsol compile command compiles a model file for Java for use by the COMSOL batch command or for loading class files into the GUI. The syntax for the
comsol compile command is
comsol [<options>] compile [
<target arguments>] <file>.java
Use the comsol command with the option
-nn <no. of nodes> to run COMSOL on clusters.
comsol -nn <no. of nodes> [<options>] [<target>] [<target arguments>]
comsol -nn <number of compute nodes> -f
<filename>
The file <filename> should contain the hostnames of the compute nodes that you intend to use. You can find out the hostname of each node from the
hostname command. Each node should be listed on a separate line in the file. You can also list the IP address of each node. The file can contain more compute nodes than you intend to use.
•
|
Use the switch -mpibootstrapexec to set the path to the remote node access mechanism such as /usr/bin/ssh.
|
•
|
The option -mpidebug sets the output level from MPI. The default is level 4.
|
•
|
Use -mpienablex to enable Xlib forwarding. Xlib forwarding is off by default.
|
In order to start MPI, have a file named .mpd.conf in your home directory to which you alone have access. This file should contain the single line
comsol -nn <number of compute nodes> mpd boot -f
<filename>
The file <filename> should contain the hostnames of the compute nodes that you intend to use. You can find out the hostname of each node from the Linux command
hostname. Each node should be listed on a separate line in the file. You can also list the IP address of each node. The file can contain more compute nodes than you actually intend to use. As an alternative to using the
-f <filename> option, you can put the list of compute nodes in a file named
mpd.hosts in your home directory. You can set the protocol that is used for connecting using the switch
-mpirsh. The valid options are
rsh and
ssh. This is important if the cluster only supports
ssh because
rsh is the default protocol used. Make sure that all nodes were booted by listing them with the command
comsol -nn <number of computational nodes> -mpd mphserver
to start a COMSOL Multiphysics server running on a specific number of computational nodes. The number of computational nodes can exceed the number of compute nodes. Use the -nnhost option if you want to force several computational nodes on a compute node. Avoid starting more computational nodes than the total number of cores that you have available on a compute node. When you have finished using distributed COMSOL, you should take down all the MPDs. Enter the command
to stop all MPDs. To obtain more information about the comsol mpd commands, add the
-h option to the commands, for example,
comsol mpd boot -h.
You can also start COMSOL Multiphysics with the -clustersimple option. This option automatically starts and terminates the MPD daemon. It uses the
mpd.hosts file in your home directory to determine what computational nodes to use.
A simplified version is used when the -clustersimple switch is set or the Hydra launcher is used. An example follows. Start four computational nodes on hosts listed in the file
hosts using distributed COMSOL and simplified start:
where -clustersimple is optional for Hydra.
Start three MPDs on the compute nodes with hostnames defined in the file myhosts. Each line in the file should specify the host address or IP-address of a node. Make sure the MPDs were correctly booted. Then start a distributed COMSOL Multiphysics server on three computational nodes, and finally stop the MPDs. First make sure that you can connect to all the computers with
ssh without having to use your password (see the manual pages for
ssh). Also make sure that all computers have access to the same COMSOL installation and that they are using the same Linux version. There are two options for starting a session. One more detailed and one shorthand version. An example of the detailed version:
There are several implementations of MPI. COMSOL Multiphysics is shipped with the Intel MPI library but also supports most MPI implementations based on MPICH2. It is recommended that you use the default Intel MPI library. For running COMSOL Multiphysics on a computer that has MPICH2 installed, the COMSOL software also has a compatibility mode that you can activate by adding the option -mpi mpich2. When using this option, both the variables
PATH and
LD_LIBRARY_PATH must include your MPI implementation. It is also possible to use other MPI libraries based on MPICH2 using the option
-mpipath <path to shared library> and
-mpiroot <path to root of mpi library installation>.
Table 21-14 lists the MPI related options,
-mpi,
-mpipath,
-scalapack, and
-scalapackpath. Additionally, the COMSOL MPI arguments are configurable inside the COMSOL start script. To configure COMSOL to work with a job scheduler through the Cluster Computing study, you can set the options
in the comsol.ini file. This adds commands prior to the
comsol command and after the
comsol command. You can add
{nn} or
{perhost} to any of these pre- or postcommands. This 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.
comsol [<options>] hydra [
<Hydra command>] [
<target arguments>]
Use the -h switch for more information about each command, typing, for example,
comsol -h hydra cleanup.
COMSOL Multiphysics ships with the Intel MPI library but should be compatible with most MPICH2 compatible MPI libraries. To download the latest version of Intel MPI library runtime visit http://software.intel.com/en-us/intel-mpi-library. To run COMSOL Multiphysics with another version of Intel MPI or other MPI library, set
-mpiroot to the root path of the MPI library. In case the downloaded library is not compatible with the version COMSOL uses (this should usually not be the case), also set
-mpipath to the dynamically loaded library that should be used. The default of the Intel MPI library is to use
ssh as communication protocol. If you require another communication protocol, use the option
-mpibootstrap <protocol>. If you are using a scheduler, the Intel MPI library can often detect the environments it is running from using the
-clustersimple switch, and you do not need to set up a hosts file.
•
|
If you are using a PBS or Torque scheduler, add -mpiarg -rmk -mpiarg pbs to the command line in order for Intel MPI to interpret the environment correctly. The Intel MPI library automatically tries to detect the best option for communication and uses InfiniBand if it detects it. To verify that COMSOL is using InfiniBand, check the output from the startup of COMSOL:, it should not mention TCP transfer mode.
|
In some cases it helps if you combine the option with the environment variable PSM_SHAREDCONTEXTS_MAX set to
1. You can control the fabrics used for communication with the option
-mpifabrics fabric1:fabric2, where
fabric1 is equal to
fabric2 or
fabric1 is
shm.
comsol [<options>] mpd [
<MPD command>] [
<target arguments>]
Use -h switch for more information about each command.
When using MPD, use the comsol mpd check command to display important information. For more verbose information about the startup process from the MPD daemon, use the
-v and
-d switches, set the environment variable, or set
-mpidebug to a value greater than the default 4. If the MPD is booted and COMSOL Multiphysics is not starting, make sure that the MPI environment is working by running the
comsol mpd mpitest command, for instance.
Use the COMSOL matlab command to access the COMSOL API through MATLAB
®. Enter: