PDF

Micromixer — Cluster Version
Introduction
The purpose of this example is to demonstrate how to access the cluster computing functionality in COMSOL from the COMSOL Desktop and use it to submit a batch job to a cluster through a job scheduler. The model also demonstrates how you can measure the speedup of COMSOL on your computer. The speedup is defined as the quotient between the total runtime using only one physical node and one core of the cluster and the runtime using several physical nodes and all cores of each physical node of the cluster.
For detailed information about the model, see Micromixer. For information about how to set up a COMSOL for running on a cluster, see the COMSOL Multiphysics Installation Guide.
Note: This example model requires a Floating Network License.
Application Library path: COMSOL_Multiphysics/Cluster_and_Batch_Tutorials/micromixer_cluster
Modeling Instructions
Application Libraries
1
From the File menu, choose Application Libraries.
2
In the Application Libraries window, select COMSOL Multiphysics > Fluid Dynamics > micromixer in the tree.
3
Study 1
1
Click the  Show More Options button in the Model Builder toolbar.
2
In the Show More Options dialog, in the tree, select the checkbox for the node Study > Batch and Cluster. With this setting active, Cluster Computing is available from the Study node’s context menu.
3
Cluster Computing
1
In the Study toolbar, click  Cluster and choose Cluster Computing.
2
In the Settings window for Cluster Computing, locate the Batch Settings section.
3
Find the Cluster computing settings subsection. From the Settings list, choose User controlled. With this setting, settings specific to the model will be used instead of preference settings.
4
When applicable, specify the Number of nodes you want to use. If you are testing cluster computing, set the number of nodes to 2 or less first to make sure everything works.
5
Choose Scheduler type from the following options:
-
General: Use the General scheduler if you intend to submit a job to a job scheduler that you have configured COMSOL to run on
-
Microsoft® HPC Pack: Use the Microsoft® HPC Pack scheduler if you intend to submit a job to a Windows HPC Server using the Windows HPC Cluster Manager
-
OGS/GE: Use the OGS/GE scheduler if you intend to submit a job to a Grid Engine scheduler
-
SLURM: Use the SLURM scheduler if you intend to submit a job to a SLURM scheduler
-
PBS: Use the PBS scheduler if you intend to submit a job to a PBS scheduler
-
Not distributed: Use this setting when you have configured COMSOL to run on job scheduler but only intend to run on a single node of the cluster
6
From the Scheduler type list, choose Not distributed.
7
In the Directory text field specify the directory where to store the model.
Make sure you configure the batch directories and COMSOL installation directories correctly. It is good practice to save these values as defaults once you have good settings.
8
Click  Save as Default.
For this test, use a direct solver. You can find a list of solvers that support distributed mode in the COMSOL Multiphysics Reference Manual.
Solver Configurations
In the Model Builder window, expand the Study 1 > Solver Configurations node.
Solution 1 (sol1)
1
In the Model Builder window, expand the Study 1 > Solver Configurations > Solution 1 (sol1) > Stationary Solver 1 node.
2
Right-click Direct and choose Enable.
3
In the Model Builder window, expand the Study 1 > Solver Configurations > Solution 1 (sol1) > Stationary Solver 2 node.
4
Right-click Direct and choose Enable.
External Process 1
1
In the Study toolbar, click  Compute.
In the General section, click Open to open the file containing the model generated by the batch job associated with this external process in a new COMSOL session.
In the Process Status section, the log shows the total solution time. COMSOL automatically takes advantage of all cores; to measure the speedup, set the number of cores to 1 and run a new job.
2
In the Model Builder window, under Study 1 > Job Configurations click Batch 1.
3
In the Settings window for Batch, locate the General section.
4
From the Defined by study step list, choose User defined.
5
Select the Number of cores checkbox. Verify that the setting in the associated text field is 1.
Next, change the filename to create a new External Process node for the run.
6
Locate the Files section. In the Filename text field, enter a name of your choice.
Cluster Computing 1
1
In the Model Builder window, click Cluster Computing 1.
2
If you are not using the cluster type Not distributed, make sure to set the Number of nodes to 1.
3
In the Settings window for Cluster Computing, click  Run.
Batch 1
In the Model Builder window, right-click External Process 2 and choose Attach Job.
External Process
1
Go to the External Process window.
When the process has finished, compare the total time in the log for the new external process with the previous value. The speedup is equal to the previous value divided by the new value. The speedup depends on the mesh size. To improve the numbers, try refining the mesh.