[Gmsh] Multi threading calls to GModel

Pablo Antolin pablo.antolin at epfl.ch
Thu Dec 7 18:41:09 CET 2017

Hello everybody,

I am using Gmsh inside my own code, through the API, to mesh a lot of very
small geometries that are independent one from the other. My goal is to
produce for every geometry the coarsest mesh possible.

In order to speedup the process, I've tried to create a single GModel for
every geometry and to process them in parallel (using openmp). However, due
to certain runtime errors I am getting, it seems that either I am doing
something wrong in my code or it is not thread-safe to create multiple
instances of the GModel class and to work with them in parallel.

On the other hand, I've seen that Gmsh offers multithreading
My question is: can I benefit from that?
If different regions (corresponding to different geometries) are meshed in
parallel, my code would speedup; if the parallelism is perform inside the
mesh process of every region/geometry, probably the code would remain
mostly serial.

After meshing all the geometries, I check them, looking for possible
negative jacobians. For the ones that present negative jacobians I either
refined them or use the high-order optimization algorithm. But this process
is only executed for the geometries presenting negative jacobians.

So, my second question is: after meshing the first GModel (hopefully in
parallel), can I remove or deactivate some of the regions / elements
(present in the first GModel) that are already valid (their jacobians are
positive everywhere)? Then, I would refine/optimize only the ones that
present negative jacobians.

Thanks for the support.
Best regards,


Pablo Antolin
Chair of Numerical Modelling and Simulation
Institute of Mathematics
Ecole polytechnique fédérale de Lausanne
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://onelab.info/pipermail/gmsh/attachments/20171207/76d7510b/attachment-0001.html>

More information about the gmsh mailing list