PDF

Micromixer — Batch Version
Introduction
The purpose of this example is to demonstrate how to access the batch functionality in COMSOL from the COMSOL Desktop and use it on your computer. 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 core of the machine and the runtime using all cores of the machine.
For detailed information about the model, see Micromixer.
Application Library path: COMSOL_Multiphysics/Cluster_and_Batch_Tutorials/micromixer_batch
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, Batch is available from the Study node’s context menu.
3
Batch
1
In the Study toolbar, click  Batch and choose Batch.
2
In the Settings window for Batch, 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
Clear the Synchronize solutions checkbox. This setting would synchronize the solution, but we will not use it here.
5
In the Directory text field specify the directory where to store the model.
In the Study Settings section of the Settings window for Batch, you specify where to store the model for the batch job:
6
Enter a suitable filename in the Filename text field, and specify a directory by clicking Browse and then making a choice in the Batch Directory dialog or by typing in the directory path directly in the Directory text field.
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 another batch 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 associated text field, enter a name of your choice.
7
8
In the Model Builder window, under Study 1 > Job Configurations > Batch 1 > Batch Data 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 is dependent on the mesh size. To improve the numbers, try refining the mesh.