Use a COMSOL command to start COMSOL products with detailed start-up options.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):
Table 21-1: COMSOL Commands Targets 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, you can click the shortcut COMSOL Launchers on the Apps screen. This makes a folder with shortcuts to all COMSOL commands available.To create additional customized commands, you can create shortcuts including all argument and put them on your desktop. You can also issue COMSOL commands in a command window. To conveniently access the command in a command window, you need to set up the Windows path to include the path bin\win64 in the COMSOL installation directory.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 lineto 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 21-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).
<target> -h -docroot <path> -applicationsroot <path> -np <no. of cores> -numasets <no. of sets> -numafirst <numa number> -blaspath <path> -c <path> -prefsdir <path> -tmpdir <path> -version <target> -autosave {on} | off -recoverydir <path> -data <path> -configuration <path> 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 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 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.
• Depending on how loaded the machine is, you can control how COMSOL Multiphysics uses the available processors with the -mpmode option. The following options are available:
Table 21-3: COMSOL Multiprocessor Mode Options
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.
Table 21-4: COMSOL BLAS Options Use a BLAS library specified using the option -blaspath or the environment variable COMSOL_BLAS_PATH.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/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 21-2, the standalone COMSOL command supports the following option:
Table 21-5: COMSOL command-line arguments For example, comsol -open myapp.mph. If the MPH-file is an application, then depending on the setting for default behavior when starting an application with COMSOL Multiphysics, this command either runs the application or opens the COMSOL Desktop for editing using the Application Builder.Use a COMSOL Multiphysics server command to start a COMSOL process ready to process computational requests. A COMSOL Multiphysics server listens for TCP/IP connections from COMSOL Multiphysics clients. A COMSOL Desktop can become a COMSOL Multiphysics client by connecting to a COMSOL Multiphysics server. The LiveLink™ for MATLAB® also needs to connect to a COMSOL Multiphysics server.
Table 21-6: COMSOL Target command-line arguments -user <user> -port <port> 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. 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.When a COMSOL Multiphysics server is started for the first time, you are asked for a username and password. Select a username and a password, which COMSOL Multiphysics then uses in communications between the COMSOL Multiphysics client and the server. You must also specify a matching username and password in the Connect to Server dialog box. The software writes this login information in the subdirectory .comsol/v52a/login.properties in your Windows home directory.
Always make sure that untrusted users cannot access the COMSOL login information. Protect the file .comsol/v52a/login.properties in your home directory. This is important when running COMSOL Multiphysics in client-server mode. Alternatively, start the COMSOL Multiphysics server with the -passwd nostore option, and clear Remember Password when connecting to the server. This ensures that your login information is not stored on file.To enhance security, you can limit the address range that can access the COMSOL Multiphysics server, both in your firewall and by changing the COMSOL Multiphysics server configuration. To limit the allowed address range in the server, edit the file <COMSOL Installation Directory>\bin\tomcat\conf\server.xml and find the lines:and follow the instructions. The default port for the COMSOL Multiphysics server is 2036. You can change this by using the option -port <port> when launching COMSOL and COMSOL Multiphysics server.To enhance security, you can limit the address range that can access the documentation server, both in your firewall and by changing the documentation server configuration. To limit the allowed address range in the server, edit the file <COMSOL Installation Directory>\doc\help\conf\server.xml and find the lines:and follow the instructions. The default port for the documentation server is 8090. You can change this by using the option -docport <docport> when launching COMSOL Multiphysics.
Table 21-7: COMSOL Target command-line arguments -port <port> -server <server name> -open <file>
Table 21-8: COMSOL BATCH-specific arguments -inputfile <file name> -outputfile <file name> -job <job tag> -study <study tag> -pname <parameter name> -plist <parameter value> -pindex <parameter indices> -paramfile <filename> -batchlog <filename> -checklicense <filename> -error <{on}|off> 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.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.
Table 21-9: COMSOL Cluster Target arguments -jdkroot <path> -classpathadd <classpath>
Table 21-10: COMSOL Cluster Targets
Micromixer—Cluster Version: Application Library path COMSOL_Multiphysics/Tutorials/micromixer_clusterIf 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 2008 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
• Also make sure that the Microsoft Visual Studio 2010 and 2008 Runtimes are installed on all nodes. They are called vcredist_*.exe. You can install them from the root directory of the DVD using the clusrun command, for instance.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 withHere 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 syntaxmpiexec -hosts <number of nodes> <list of computer names> comsolcluster.exe <options> [<target arguments>]to run a COMSOL batch on a number of computational nodes given by mpiexec. For further information about the mpiexec command and Windows HPC Server 2008, consult the documentation that was shipped with the product and the online manuals.When a COMSOL Multiphysics server cluster job is created, a preference directory must be set and be reachable from all nodes to avoid problems with the server login; see The COMSOL Commands and Login Information. The preferences can be generated by starting COMSOL Multiphysics server once on the head node using the commandcomsolmphserver.exe -prefsdir <prefsdir>mpiexec -n 1 comsolmphserver.exe -np 2 -prefsdir <prefsdir> -cluster on :
-n <number of nodes-1> comsolclustermphserver.exe -np 2 -prefsdir <prefsdir>The COMSOL cluster target arguments specify what MPI library to use and what Scalapack version to use. There are several implementations of MPI. COMSOL by default uses the Windows HPC Server 2008 or Windows CCS 2003 MPI libraries. COMSOL also supports most MPI implementations based on MPICH2. It is recommended that the default library is used. COMSOL also has a compatibility mode, which you activate by adding the option -mpi mpich2. When using this option both the variables PATH and LD_LIBRARY_PATH must include the MPI implementation. It is also possible to use other MPI libraries based on MPICH2 using the option -mpipath <path to shared library>. The following target arguments are available for COMSOL cluster commands:
Table 21-11: COMSOL Cluster Target arguments -mpipath <path> -scalapackpath <path> The Cluster Computing study allows you to set up a batch job for submission to a Windows HPC Server 2008 job scheduler or Windows Compute Cluster Server 2003 job scheduler. There are several settings that you can configure in the comsol.ini file to get default settings:-Dcs.scheduler=<IP or network adress>-Dcs.clusteruser=<Username on cluster>-Dcs.rundir=<Where the model file is located on the cluster>-Dcs.comsoldir=<Installation path to comsol on the cluster>-Dcs.precmd=<Command line>-Dcs.postcmd=<Command line>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:The following options are available for the comsolmphserver matlab command:
Table 21-12: COMSOL MATLAB options -mlroot <path> -host <hostname> -port <hostname> Start the server with graphics libraries. This enables plotting on the server. Available only when running comsolmphserver matlab [<options>].