KVSlab / VaMPy

A collection of tools for pre-processing, simulating, and post-processing vascular morphologies.
https://kvslab.github.io/VaMPy
GNU General Public License v3.0
15 stars 8 forks source link

`print_mesh_summary` wrong with MPI #143

Closed keiyamamo closed 6 months ago

keiyamamo commented 6 months ago

https://github.com/KVSlab/VaMPy/blob/6c6468a4d8fcda89c330c9b01cea253e1bd3c8c3/src/vampy/simulation/simulation_common.py#L31

I noticed that print_mesh_summary is not correct when running with MPI. There are two problems in this function

  1. We are taking sum of information gathered from all the processors, but taking sum for computing minimum and maximum values of coordinate is simply wrong. We need switch to MPI.reduce or take minimum/maximum after gathering information.

  2. Number of faces, faces, facets, and vertices are wrong due to ghost boundary. We are counting the shared boundary twice. Fixing this issue is not immediately clear to me although I’m also not sure if the number of facets and vertices are that important...

Finally, VaSP also has this functionality ( which also has the same problem as I described). So perhaps, we can have this function in one place?

What’s your opinion on this @johannesring ?

keiyamamo commented 6 months ago

This was meant to be posted in VaSP... my mistake.