Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it possible to write a unstructured cell whose connectivity is defined with points at other processor? #157

Closed
Blumenkranz opened this issue Nov 6, 2024 · 5 comments

Comments

@Blumenkranz
Copy link

No description provided.

@jipolanco
Copy link
Member

Hi, I'd need a bit more details and context to be able to answer. What do you mean by other processor? Are you using threads, distributed computing or something else?

@Blumenkranz
Copy link
Author

Sorry, I mean distributed parallelization through MPI. When different ranks are responsible for different parts of the cells, for example, a cell in rank0 may share a point with a cell in rank1. In this case, how should we define the connectivity of these cells? Defining points with the same coordinates in each rank is not feasible, as they will be treated as different points with the same coordinates, which will result in the final generated mesh being split into several parts. This will bring difficulties for further post-processing, such as drawing contours, where the contours will break at the separation points.

@jipolanco
Copy link
Member

jipolanco commented Nov 7, 2024

WriteVTK is not MPI-aware, which means that you need to explicitly exchange data between MPI processes if needed.

But I still don't understand what kind of strategy you want to use for writing files:

  • Do you want a single MPI process to write a VTK file including all cells? In that case you need to explicitly send all data to that process before writing the file in serial. (This doesn't scale very well when you have many processes.)
  • Or do you want each MPI process to write its local cells? In that case, have you looked at the parallel file formats? I haven't tried it myself, but I'd guess that a single MPI process would need to know all the points in a cell (including those belonging to neighbour processes), and then you would get repeated points as you mentioned. But maybe ParaView knows how to handle that? I'd say it's a very common use case.

Personally I haven't used parallel VTK formats a lot, but maybe you need to include some ghost cells (and use the ghost_level parameter) to properly handle the interface between MPI processes?

@Blumenkranz
Copy link
Author

The strategy I want to adopt is the latter. I tried the parallel file format in WriteVTK, and it seems that they do not support ghost cells (I'm not entirely sure, but I tried my best). When I defined the complete list of points in each rank, the mesh separation occurred. Unfortunately, Paraview also encountered troubles here (we indeed did not inform Paraview that these duplicate points are the same points).

@Blumenkranz
Copy link
Author

Anyway, thanks for your advice! I am not very familiar with VTK, and it seems a bit challenging to fully understand it in a short period of time. Single-core read and write might be a good choice for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants