Hello everyone,
I am trying to implement parallel meshing in salome using the example script.But I can’t find documentation regarding the function which is th only function as mentioned in script file:
For example I have a solid ‘Box_1’ on which I want to implement usual parameters oF netgen. I do the following;
smesh = smeshBuilder.New()
par_mesh = smesh.ParallelMesh(Box_1, name=“par_mesh”)
The parallel mesh feature implemented in smesh is based on domain decomposition, so in order for you to see any performance, first you will required to pass a compound geometry that will be decomposed by the mesh algorithm into individual solids to mesh each solid in parallel, therefore, its pointless to pass a single box, see lines 28 to 50 of the example to understand how to create a compound box of individual boxes.
The method CreateHypothesisByAverageLength is a helper method to define a hypothesis, you can use the returned object from this method to setup the parameters you required, this is:
Note that all the individual solids that you passed to the mesh libraries will be meshed with the same parameters. Please note that you will require to define the parallelism setting too:
par_mesh.SetParallelismMethod(smeshBuilder.MULTITHREAD)
param = par_mesh.GetParallelismSettings()
param.SetNbThreads(6) #in this case run with 6 threads
Hi,
Very much thanks for the reply.
I have a few queries.
You said that the parallel mesh needs a compound of solids to be effective.
Could I use a partition of solids instead which is exploded into solids? And assign different parameters of the exploded solids?
The reason I want to use a partition is because I want a coherent mesh at contact boundary of exploded solids.
Also if the parallel mesh when computed again with a tweak of parameters creates a new mesh or modifies the old one?
Can we use the usual compute button in GUI to recompute a parallel mesh?
Does multithreading refer to threads or physical cores(the ones used by Code Aster MPI for example)
Yes, I think you can pass the result from a partition operation, always that it would be possible to decompose it into individuals solids, the mesh will be compute in parallel on those solids.
Unfortunately you will not have fine grained control over the parameter set for each mesh in each solid, the hypothesis is applied globally to all solids.
The parallel mesh will take care of mesh coherence in common faces and edges.
If the parallel mesh is computed again after change of hypothesis parameters everything will be recomputed, there is not fine grained control over which part of the mesh/solid you want to recompute.
This feature is only available in TUI not in GUI yet. The multithread version uses std version of threads and the multinode option uses QProcess. So no MPI implementation (not sure if QProcess uses MPI behind, probably yes), nevertheless, in my understanding, you should be able to run in multiple nodes, but this is something that I have not try yet.
…(parallel meshing) This feature is only available in TUI not in GUI yet.
When you say “not in GUI”, do you mean the GUI release; so even with the Python console ? If I wanted parallel smesh, I would have to recompile the GUI version with parallel enabled and would only be available via the Python console, yes ?
Thanks. There must be something wrong with my script or machine setup.
I adapted the meshing parallel example for my setup and the decomposition block setup and partitioning works just fine, but when I execute Compute() I only see one core in my machine being used; even though I have set nBThreads.
print(“Find imported STEP ‘brep_1’”)
brep_1 = salome.myStudy.FindObject(“brep_1”)
br1 = brep_1.GetObject()
Have you tested re running the original script to see if it’s your script or that it does not work? Also from memory it only works in Linux and not in windows.