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

Support for multiple global grids using a switch function #88

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Dvegrod
Copy link

@Dvegrod Dvegrod commented Jul 25, 2024

Added the possibility of supporting several global grids in the same execution by switching the current "focused" grid that the package functions operate with, by using a switch method.

Added the possibility of supporting several global grids in the same execution by switching the current "focused" grid that the package functions operate with, by using a switch method.
Copy link
Collaborator

@omlins omlins left a comment

Choose a reason for hiding this comment

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

I think this could be done a bit easier by taking an approach as follows:

  • remove the library initialization from init_global_grid (means simply to make cuda_functional etc always do the actual check instead of storing it the first time - currently anyway used only once if removed from select_device)
  • decompose init_global_grid into init_mpi, create_global_grid::GlobalGrid and set_global_grid
  • then expose the new functions create_global_grid and activate_global_grid to the user
  • allow update_halo to take a keyword global_grid and finalize_global_grid a positional argument (finalize_global_grid should also accept multiple grids)

Working with multiple grids work then as follows:

  1. create grids using create_global_grid
  2. activate the grids as needed using activate_global_grid
  3. finalize all the grids

It needs to be verified and that the original usage and the error messages remain fully consistent.

Best start a new PR in order to include also the latest code changes from #87

@Dvegrod Dvegrod marked this pull request as draft July 29, 2024 12:13
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

Successfully merging this pull request may close these issues.

2 participants