We’ve recently had several questions regarding parallel mesh generation with Coreform Cubit, including these two on our forum.
In my response to the first post, I mention that there is some limited functionality in Coreform Cubit for parallel mesh generation. However, in response to a recent customer inquiry I’ve created a GitHub project that demonstrates one approach to parallelization of meshing with Coreform Cubit by utilizing Python.
Essentially, the approach uses process-based parallelization on individual *.cub5
files, where each file contains an independent portion of the overall assembly / meshing task. The parallel execution is handled by Python’s multiprocessing
module to map
each temporary file to a worker within a Pool
.
Please note that this is a very basic overview that is meant to provide a skeleton for users to build out their own script. For example, in parallel operations it’s critical to properly load-balance as the overall performance is limited by the most expensive task. So you may want to write your own distribute()
method (see the examples) that attempts to produce a well-balanced workload. Furthermore, if you have merged entities for which a contiguous mesh is desired, you will need to make sure those end up in the same .cub5
file. You’ll want to use the Cubit-Python API and probably some “graph” library (such as NetworkX – I gave a demonstration of using NetworkX with Coreform Cubit here ) to determine the connected components.
I’ll try to add some of these more complicated examples to the repository in the future, but if you happen to write one feel free to share it here and/or submit a pull request to the GitHub repository!