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

mwe of halo exchange #744

Draft
wants to merge 1 commit into
base: melt-mpi-metadata
Choose a base branch
from
Draft

mwe of halo exchange #744

wants to merge 1 commit into from

Conversation

TomMelt
Copy link
Contributor

@TomMelt TomMelt commented Nov 25, 2024

Small MWE of halo exchange logic for testing before add the main functionality to nextsim

  • create MWE which demonstrate halo exchange using periodic boundary conditions
  • use meta data files to read neighbour information rather than hardcoding it

@TomMelt TomMelt marked this pull request as draft November 25, 2024 12:22
@TomMelt TomMelt mentioned this pull request Nov 25, 2024
7 tasks
@TomMelt TomMelt changed the title wip Add halo exchange logic Nov 25, 2024
@jwallwork23
Copy link
Contributor

Note that I changed the logic for determining whether the Docker workflow is run. I an attempt to fix the test failure https://github.com/nextsimhub/nextsimdg/actions/runs/12009927720/job/33475689562 might it be feasible to rebase on top of or merge in develop?

Compare https://github.com/nextsimhub/nextsimdg/blob/halo-exchange/.github/workflows/docker.yml vs https://github.com/nextsimhub/nextsimdg/blob/develop/.github/workflows/docker.yml.

This test includes two examples for different grid layouts:

- 3 x 1 grid (3 procs)
- 2 x 2 grid (4 procs)

Makes use of the Slice functionality
@TomMelt TomMelt changed the title Add halo exchange logic mwe of halo exchange Dec 20, 2024
@TomMelt TomMelt self-assigned this Dec 20, 2024
@TomMelt TomMelt added the ICCS Tasks or reviews for the ICCS team label Dec 20, 2024
Comment on lines +103 to +107
template <typename T> T& copyToBuffer(T& buffer, size_t startIndex = 0)
{
// make no especial attempt at efficiency here
SliceIter thisIter(slice, data.dimensions());
auto biter = buffer.begin();
auto biter = std::next(buffer.begin(), startIndex);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@timspainNERSC this was a bit hacky from me. I want to populate the buffer but from a specific starting index. Let me know if there's a better way of doing this.

I was trying to avoid creating temporary arrays for each of the edges.

@@ -142,7 +142,18 @@ class Slice {
}
std::ostream& print(std::ostream& os) const
{
return os << start << ":" << stop << ":" << step;
// TODO remove me before merging into develop
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: remove this before merging this PR. I was using this for debugging purposes

using SliceIter = ArraySlicer::SliceIter;

static const int DG = 3;
static const bool debug = true;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: change this to false before merging

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ICCS Tasks or reviews for the ICCS team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants