PDF

Joule Heating of a Microactuator — Distributed Parameter 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 takes advantage of the distributed parameter functionality in COMSOL. The model also demonstrates how you can measure the speedup of COMSOL on your cluster. 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 Joule Heating of a Microactuator.
Note: This example model requires a Floating Network License.
Application Library path: COMSOL_Multiphysics/Cluster_and_Batch_Tutorials/thermal_actuator_jh_distributed
Modeling Instructions
Application Libraries
1
From the File menu, choose Application Libraries.
2
In the Application Libraries window, select COMSOL Multiphysics > Multiphysics > thermal_actuator_jh 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
Parametric Sweep
1
In the Study toolbar, click  Parametric Sweep.
2
In the Settings window for Parametric Sweep, locate the Study Settings section.
3
4
5
Click to expand the Advanced Settings section. Select the Distribute parametric sweep checkbox. This setting prepares the model for running a distributed parametric sweep. If you save the model and run it in distributed mode, the compute nodes will work independently in parallel on subsets of the parameters.
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
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.
7
Click  Save as Default.
External Process 1
1
In the Study toolbar, click  Compute.
2
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.
3
In the Model Builder window, under Study 1 > Job Configurations click Batch 1.
4
In the Settings window for Batch, locate the General section.
5
From the Defined by study step list, choose User defined.
6
Select the Number of cores checkbox.
7
Locate the Files section. In the Filename text field, type batchmodel_np_1.
Next, change the filename to create a new External Process node for the run.
8
Locate the Files section. In the Filename text field, enter a name of your choice.
Cluster Computing 1
If you are not using the cluster type Not distributed, make sure to set the Number of nodes to 1.
1
In the Model Builder window, right-click Cluster Computing 1 and choose 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. If you are not using the cluster type Not distributed, the speedup also depends on the number of parameter tuples in the Parametric Sweep node. You can also try to increase the number of parameter tuples to improve the numbers.