Running COMSOL Multiphysics > Running COMSOL in Parallel > Running COMSOL in Parallel on Clusters

Running COMSOL in Parallel on Clusters
You control the options for running COMSOL Multiphysics on a cluster from the Study node in the Model Builder. To enable the cluster computing feature, click the Show button () and select Advanced Study Options. Then in the Model Builder, right-click a Study node and select Cluster Computing (). You must have a floating network license (FNL) to run COMSOL Multiphysics in distributed-memory parallel mode.
The Micromixer—Cluster Version and Joule Heating of a Microactuator—Distributed Parameter Version models show how to set up a model for running COMSOL Multiphysics in parallel on a cluster: in one case for faster solution of a large fluid flow model using distributed solver jobs and in another case for a distributed parametric sweep.
The following sections describe how to run cluster jobs on Windows and Linux.
Running a Cluster Job on Windows
This section outlines the main steps for running a cluster job on Windows®. Before you start, check that the installation of COMSOL Multiphysics follows these guidelines:
To run a cluster job, follow these steps:
1
2
In a complete model, right-click the Study node and select Cluster Computing ().
3
In the Settings window for Cluster Computing, select HPCS 2008 from the Cluster type list. This provides access to all parameters that you need for communication with the cluster.
4
5
You can define more details in the Settings window for the Cluster Computing node ().under Job Configurations (). When you submit a job, COMSOL Multiphysics adds a Cluster Computing node. If you want to change or inspect its settings before submitting the first job, right-click the Study node () and select Show Default Solver ().
6
After submitting the job to the cluster, you can monitor the progress in the Progress window and the Log window. The Progress window shows the progress of the batch data and external processes, and the Log window contains a log with information about the solver operations for each parameter in a parametric sweep, for example. You can also get details about a cluster job in the Windows Job Manager, which is available in the HPC Pack.
You can do the same cluster simulation from the command line using, for example, a scheduler script.
This command launches a COMSOL MPI job on a cluster without involving the scheduler:
mpiexec -n 2 comsolclusterbatch.exe -inputfile comsoltest.mph -outfile output.mph -batchlog b.log
You can use the command job submit to launch COMSOL Multiphysics to the Windows scheduler.
For additional information about running COMSOL Multiphysics on clusters from the command line, see the section COMSOL Cluster Commands for Windows.
Running a Cluster Job on Linux
Before you begin, make sure that the license manager is up and running and reachable from all compute nodes and the head node. Skip the steps 1 and 3 if you are running COMSOL Multiphysics on the machine from where you want to start the cluster job.
1
Start the COMSOL Multiphysics server on the Linux® system with the command comsol mphserver. Notice the port number that is displayed (for example, COMSOL 5.2a started listening on port 2036).
2
3
From the File menu, choose COMSOL Multiphysics Server>Connect to Server (). In the Connect to Server dialog box, use the login credentials that you entered at the startup of the COMSOL Multiphysics server.
4
In a complete model, right-click the Study node and select Cluster Computing ().
5
In the Settings window for Cluster Computing, select General from the Cluster type list for Linux clusters. This provides access to all parameters that you need for communication with the cluster.
6
7
You can define more details in the Settings window for the Cluster Computing node () under Job Configurations (). When you submit a job, COMSOL Multiphysics adds a Cluster Computing node. If you want to change or inspect its settings before submitting the first job, right-click the Study node () and select Show Default Solver ().
8
After submitting the job to the cluster, you can monitor the progress in the Progress window and the Log window. The Progress window shows the progress of the batch data and external processes, and the Log window contains a log with information about the solver operations for each parameter in a parametric sweep, for example.
You can do the same cluster simulation from the command line using, for example, a scheduler script.
This command launches a COMSOL MPI job on a cluster without involving the scheduler:
comsol -nn 2 batch -inputfile comsoltest.mph -outfile output.mph -batchlog b.log
For additional information about running COMSOL Multiphysics on clusters from the command line, see the section COMSOL Cluster Commands for Linux.
Cluster License Handling
To run COMSOL Multiphysics simulations in distributed-memory parallel mode (on a cluster), you must have a floating network license (FNL). Look for the keyword CLUSTERNODE in your license file. When running a cluster job, COMSOL Multiphysics uses the following license components and license check-out procedures:
Stopping and outputting the solution running a Cluster Job or Batch Job
If you have a model running on a cluster in batch mode, for example, you can monitor the solver log. If you notice that the solver starts diverging, you may want to stop the solution process and output the available solutions. To do so, use one of the following commands, for example:
echo "Cancel" > outputfile.mph.status
to cancel the solution, or
echo "Stop 2" > outputfile.mph.status
to stop the solution on progress level 2.
In those commands, replace outputfile with inputfile if they are the same.