Skip to content

Conversation

@simone-silvestri
Copy link
Collaborator

I am starting to dissect #4811 now that the formulation is complete and the tests pass, so that we do not have to merge 2000 lines and 107 files altogether.

This is a very simple start -> a quality of life refactor of the buffer system for distributed computations.

@simone-silvestri
Copy link
Collaborator Author

and splitting some tests to speed up the distributed tests...

@simone-silvestri simone-silvestri changed the title Start refactoring towards timestepper reformulation Refactor the buffer system Nov 14, 2025
@simone-silvestri simone-silvestri changed the title Refactor the buffer system Refactor the buffer system and add methods for synchronize_communication! Nov 14, 2025
recv = on_architecture(arch, zeros(eltype(data), H, size_y, size(parent(data), 3))))
# Either we pass corners or it is a 1D parallelization in x, note that, even for 2D parallelizations, we need a
# buffer that includes the corners (i.e. a OneDBuffer) if we are at the edge of the domain in y since we are not
# passing all the corners in that case
Copy link
Member

Choose a reason for hiding this comment

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

now that we have AI to make things pretty easy, I think it makes sense to convert all these comments to docstrings. This opens the possibility to getting a gist of the program by looking at the docs

on_architecture(arch, zeros(eltype(data), H, size(parent(data), 2), size(parent(data), 3))))
else
return (send = on_architecture(arch, zeros(eltype(data), H, size(grid, 2), size(parent(data), 3))),
recv = on_architecture(arch, zeros(eltype(data), H, size(grid, 2), size(parent(data), 3))))
Copy link
Member

Choose a reason for hiding this comment

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

this named tuple looks like the same thing as OneDBuffer. What's going on here? Do you use the type secretly for dispatch somehow? Do we need to use an explicit type here rather than a named tuple?

A comment might clear this up.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

right it is only for dispatch, I can add another buffer type: TwoDBuffer

@glwagner
Copy link
Member

I'd love if we can take the opportunity of the refactor to clean up the code and make it readable, eg add comments in mysterious parts, use docstrings, and convert golf'd code to a more evocative style

Copy link
Member

@glwagner glwagner left a comment

Choose a reason for hiding this comment

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

damn that looks good

@simone-silvestri
Copy link
Collaborator Author

damn that looks good

github copilot at the rescue :)

@simone-silvestri simone-silvestri merged commit 5bbc2a1 into main Nov 15, 2025
72 checks passed
@simone-silvestri simone-silvestri deleted the ss/some-start-of-refactoe branch November 15, 2025 10:40
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.

3 participants