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

Outputting information to aide particle concatenation #405

Open
mabruzzo opened this issue Jul 3, 2024 · 3 comments
Open

Outputting information to aide particle concatenation #405

mabruzzo opened this issue Jul 3, 2024 · 3 comments

Comments

@mabruzzo
Copy link
Collaborator

mabruzzo commented Jul 3, 2024

To efficiently particle files, we need to know the total number of particles.

Currently, that means we load every file once before in order to allocate space in the resulting file (which can be very slow). It would be faster if we recorded the total number of particles when writing outputs.

In fact, it would actually be even better if we recorded the total number of particles per file in one centralized location (maybe just in file 0). That way, we could better parallelize concatenation (when using an arbitrary number of processes for concatenation that is totally unrelated to the number of processes used in the original simulation)

@bvillasen
Copy link
Collaborator

as far as I remember, the header of each file has the number of local particles, this means that you just need to read that value from the header of each file and not the entire data to compute the total number of particles. This shouldn't be a significant overhead.

@mabruzzo
Copy link
Collaborator Author

mabruzzo commented Jul 3, 2024

Your recollection is correct about what is stored. That is exactly what we currently do.

With that said, standard posix file operations can be extremely slow on parallel file systems. The overhead of simply opening and closing a file can be shockingly large (especially when other people are using the file system). This is most problematic when you have many thousands of files.

In my experience, the parallel systems on the Oakridge systems usually aren't bad. But I have had awful experiences with the LUSTRE filesystem on Frontera

@bvillasen
Copy link
Collaborator

I see. I haven't had the pleasure of using Frontera, but I always hear lovely things about it.
In that case, I agree that doing an MPI_Allreduce to get n_particles_total when writing the header of the output files is a good idea.

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