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

Differentiate local vs global layout in the field metadata #2795

Open
bartgol opened this issue Apr 23, 2024 · 0 comments
Open

Differentiate local vs global layout in the field metadata #2795

bartgol opened this issue Apr 23, 2024 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers infrastructure

Comments

@bartgol
Copy link
Contributor

bartgol commented Apr 23, 2024

I'm running into a few scenarios where we would need global layout information rather than rank-local layout information (e.g., when printing the DAG, we prob don't care about the layout on rank-0). Here, with global I mean "the layout that the field would have without MPI".

Possible strategies (both bwd compatible):

  • store two layouts in FieldIdentifier, and allow calling fid.get_global_layout() to get global layout information.
  • use grid and layout to get the global one (so that we don't store it, and only retrieve it upon request). E.g., something like grid->get_global_layout(my_local_layout);. Internally, the grid will do something like
FieldLayout AbstractGrid::get_global_layout(const FieldLayout& lcl) {
  FieldLayout glb (lcl);
  // Last arg=false, since if tag not found, it's fine (lcl == glb);
  return glb.reset_dim(get_partitioned_dim_tag(),get_partitioned_dim_global_size(),false);
}

I think I like option 2 better. The places where we need global layouts are very few, and we don't want to have to know both local/global layouts every time we create a FieldIdentifier.

@bartgol bartgol added enhancement New feature or request good first issue Good for newcomers infrastructure labels Apr 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers infrastructure
Projects
None yet
Development

No branches or pull requests

1 participant