You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: docs/Documentation/Applications/comsol.md
+9-3
Original file line number
Diff line number
Diff line change
@@ -37,6 +37,8 @@ However, the performance may be slow and certain display features may behave une
37
37
## Running a Single-Node COMSOL Model in Batch Mode
38
38
You can save your model built in FastX+GUI mode into a file such as `myinputfile.mph`. Once that's available, the following job script shows how to run a single process multithreaded job in batch mode:
39
39
40
+
???+ example "Example Submission Script"
41
+
40
42
```
41
43
#!/bin/bash
42
44
#SBATCH --job-name="comsol-batch-single-node"
@@ -77,6 +79,8 @@ Once this script file (e.g., `submit_single_node_job.sh`) is saved, it can be su
77
79
78
80
## Running a Multi-Node COMSOL Model in Batch Mode
79
81
To configure a COMSOL job with multiple MPI ranks, required for any job where the number of nodes >1, you can build on the following template:
82
+
83
+
???+ example "Example Multiprocess Submission Script"
80
84
81
85
```
82
86
#!/bin/bash
@@ -115,16 +119,18 @@ To configure a COMSOL job with multiple MPI ranks, required for any job where th
115
119
116
120
The job script can be submitted to SLURM just the same as above for the single-node example. The option `-mpibootstrap slurm` helps COMSOL to deduce runtime parameters such as `-nn`, `-nnhost` and `-np`. For large jobs that require more than one node, this approach, which uses MPI and/or OpenMP, can be used to efficiently utilize the available resources. Note that in this case, we choose 32 MPI ranks, 8 per node, and each rank using 13 threads for demonstration purpose, but *not* as an optimal performance recommendation. The optimal configuration depends on your particular problem, workload, and choice of solver, so some experimentation may be required.
117
121
118
-
## Running COMSOL Model with GPU
122
+
## Running a COMSOL Model with GPU
119
123
In COMSOL Multiphysics®, GPU acceleration can significantly increase performance for time-dependent simulations that use the discontinuous Galerkin (dG) method, such as those using the Pressure Acoustics, Time Explicit interface, and for training deep neural network (DNN) surrogate models. The following is a job script example used to run COMSOL jobs on GPU nodes.
120
124
125
+
???+ example "Example GPU Submission Script"
126
+
121
127
```
122
128
#!/bin/bash
123
129
#SBATCH --job-name=comsol-batch-GPUs
124
130
#SBATCH --time=00:20:00
125
131
#SBATCH --gres=gpu:1 # request 1 gpu per node, each gpu has 80 Gb of memory
126
132
#SBATCH --mem-per-cpu=2G # requested memory per CPU core
127
-
#SBATCH --ntasks-per-node=64
133
+
#SBATCH --ntasks-per-node=30
128
134
#SBATCH --nodes=2
129
135
#SBATCH --account=<allocation handle>
130
136
#SBATCH --output=comsol-%j.out
@@ -152,6 +158,6 @@ In COMSOL Multiphysics®, GPU acceleration can significantly increase performanc
Note, When launching a GPU job on Kestrel, be sure to do so from one of its dedicated GPU login nodes (ssh to Kestrel from the NREL network using kestrel-gpu.hpc.nrel.gov).
161
+
Note, when launching a GPU job on Kestrel, be sure to do so from one of its dedicated [GPU login nodes](../Systems/Kestrel/index.md).
156
162
157
163
The Complex Systems Simulation and Optimization group has hosted introductory and advanced COMSOL trainings. The introductory training covered how to use the COMSOL GUI and run COMSOL in batch mode on Kestrel. The advanced training showed how to do a parametric study using different sweeps (running an interactive session is also included) and introduced equation-based simulation and parameter estimation. To learn more about using COMSOL on Kestrel, please refer to the training. The recording can be accessed at [Computational Sciences Tutorials](https://nrel.sharepoint.com/sites/ComputationalSciencesTutorials/Lists/Computational%20Sciences%20Tutorial%20Recordings/AllItems.aspx?viewid=7b97e3fa%2Dedf6%2D48cd%2D91d6%2Df69848525ba4&playlistLayout=playback&itemId=75) and the slides and models used in the training can be downloaded from [Github](https://github.com/NREL/HPC/tree/master/applications/comsol/comsol-training).
0 commit comments