Comsol/Benchmark
For evaluating the parallel efficiency of COMSOL, we performed a scaling study with a model having 150K mesh elements. The result of the study shows (at least for this model that requires a large amount of memory to run), that COMSOL simulations can be heavily memory bound and for certain cases going above 4 cores can be counterproductive.
For this study, we performed the simulation on 1, 2, 4, 6, 8, 12 and 24 cores. All runs were performed twice. The table below shows the run times and the speedup.
Cores | runtime 1 [s] | speedup 1 | runtime 2 [s] | speedup 2 |
---|---|---|---|---|
1 | 26779 | - | 26811 | - |
2 | 15237 | 1.76 | 15193 | 1.76 |
4 | 6743 | 3.97 | 6719 | 3.99 |
6 | 11815 | 2.27 | 11752 | 2.27 |
8 | 13435 | 1.99 | 13421 | 2.00 |
12 | 19369 | 1.38 | 19365 | 1.38 |
24 | 18761 | 1.43 | 18667 | 1.44 |
In this case, the scaling is proportional to the number of memory channels of the CPU (and not to the number of CPU cores as one would expect). When using 4 cores, we see an almost linear scaling which is very close the best case. Using more than 4 cores then increases the run time substantially. Therefore, it is very important to perform a small scaling study (you could try 1, 2, 4 and 8 cores) to find the sweet spot in terms of number of cores for your COMSOL job.