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

Global-local grid indexing #84

Merged
merged 13 commits into from
Apr 16, 2024
Merged

Global-local grid indexing #84

merged 13 commits into from
Apr 16, 2024

Conversation

semi-h
Copy link
Member

@semi-h semi-h commented Apr 5, 2024

Implements support for inidivudal ranks in a 3D decomposition setting to figure out their location in the global grid.

@semi-h semi-h marked this pull request as ready for review April 9, 2024 15:29
Copy link
Member Author

@semi-h semi-h left a comment

Choose a reason for hiding this comment

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

Just wanted to point out a few places so that everyone can take a quick look

@@ -38,15 +38,14 @@ module m_tdsops
end interface tdsops_t

type :: dirps_t
Copy link
Member Author

Choose a reason for hiding this comment

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

We may want to move dirps_t to domain.f90 file instead, what do you think?

Copy link
Member Author

Choose a reason for hiding this comment

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

I think better to leave this for now because #85 will make some changes here.

src/tdsops.f90 Outdated
!! This class contains the preprocessed tridiagonal solvers for operating
!! in each coordinate direction.
class(tdsops_t), allocatable :: der1st, der1st_sym, der2nd, der2nd_sym, &
stagder_v2p, stagder_p2v, interpl_v2p, interpl_p2v
integer :: nrank, nproc, pnext, pprev, n, n_blocks, dir
Copy link
Member Author

Choose a reason for hiding this comment

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

The nrank and nproc here meant to be the directional nrank and directional nproc, but I see that it might be confusing. Maybe its better renaming them nrank_dir, nproc_dir?

Copy link
Member

Choose a reason for hiding this comment

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

I think the suggested change is good

Comment on lines 53 to 55
xdirps%nproc = nproc
ydirps%nproc = nproc
zdirps%nproc = nproc

call set_pprev_pnext( &
xdirps%pprev, xdirps%pnext, &
ydirps%pprev, ydirps%pnext, &
zdirps%pprev, zdirps%pnext, &
xdirps%nproc, ydirps%nproc, zdirps%nproc, nrank &
)
ydirps%nproc = 1
zdirps%nproc = 1
Copy link
Member Author

Choose a reason for hiding this comment

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

For example, I see that the global nproc obtained from MPI is assigned to all local nprocs here, but actually nproc = xdirps%nproc*ydirps%nproc*zdirps%nproc.

Copy link
Member

Choose a reason for hiding this comment

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

Would this be better done by init_dirps and init_globs? I've outlined these in the PETSc branch, based on this code, but we could cherry pick and ensure there's a single correct implementation

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, I think its better. Right now we repeat this in the tests but should move all this to an initialisation function ideally. #85 is probably a better place to work this out though, its already simplifying relevant bits.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, I think its better. Right now we repeat this in the tests but should move all this to an initialisation function ideally. #85 is probably a better place to work this out though, its already simplifying relevant bits.

@semi-h
Copy link
Member Author

semi-h commented Apr 10, 2024

@JamieJQuinn, domain_decomposition subroutine now figures out the n_offset parameter and it is stored in dirps_t. Can be accessed via x/y/zdirps%n_offset. Would this work for you in the io?

@semi-h
Copy link
Member Author

semi-h commented Apr 16, 2024

Merging so that #85 can be rebased and I can continue with cuFFTMp implementation.

@semi-h semi-h merged commit 8024542 into xcompact3d:main Apr 16, 2024
2 checks passed
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