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

Use MPI_Exscan to compute offsets? #42

Open
adammoody opened this issue Nov 8, 2022 · 0 comments
Open

Use MPI_Exscan to compute offsets? #42

adammoody opened this issue Nov 8, 2022 · 0 comments

Comments

@adammoody
Copy link
Contributor

Just browsing through code, I noticed this pattern:

VELOC/src/lib/client.cpp

Lines 194 to 199 in c857688

long offset = 0, next_offset = file_size(current_ckpt.filename(cfg.get("scratch")));
if (rank > 0)
MPI_Recv(&offset, 1, MPI_LONG, rank - 1, 0, comm, MPI_STATUS_IGNORE);
next_offset += offset;
if (rank + 1 < no_ranks)
MPI_Send(&next_offset, 1, MPI_LONG, rank + 1, 0, comm);

I suspect you might be able to replace that code segment with an MPI_Scan or MPI_Exscan, which takes O(log P) time instead of O(P).

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

1 participant