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

Enable GPU feature without MPI requirement #140

Merged
merged 1 commit into from
Aug 28, 2024

Conversation

wdeconinck
Copy link
Collaborator

This solves #138 by introducing preprocessor guards around MPI includes and symbols

@wdeconinck wdeconinck linked an issue Aug 27, 2024 that may be closed by this pull request
@wdeconinck wdeconinck added enhancement New feature or request gpu labels Aug 27, 2024
Copy link
Collaborator

@marsdeno marsdeno left a comment

Choose a reason for hiding this comment

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

Looks ok to me.
Indentation of the fortran is getting harder to follow in some places with the number of preprocessor guards we're using, but that is not the fault of this PR!

@wdeconinck
Copy link
Collaborator Author

Once MPI is replaced by MPL we should have access to all symbols again, and the preprocessor guards can be removed.

@samhatfield
Copy link
Collaborator

Looks good. However note that although you can now build ecTrans/GPU without MPI, you still can't run it. So MPI is still effectively required for running on GPUs, even with a single MPI task. Since this is (hopefully) temporary, this is nitpicking.

@wdeconinck
Copy link
Collaborator Author

Looks good. However note that although you can now build ecTrans/GPU without MPI, you still can't run it. So MPI is still effectively required for running on GPUs, even with a single MPI task. Since this is (hopefully) temporary, this is nitpicking.

You will be happy to learn I was successful at running GPU code without linking to any MPI library this way. This is because the calls to MPI are guarded at runtime with IFs that relate to send/receive counts that amount to zero.

@samhatfield
Copy link
Collaborator

That's great! I assumed that TRLTOG/GTOL were not clever enough to handle NPROC=1 without issuing MPI calls, unlike TRLTOM/MTOL which has a separate code path. But clearly I'm wrong.

@wdeconinck wdeconinck merged commit 8d8b825 into ecmwf-ifs:develop Aug 28, 2024
11 checks passed
@wdeconinck wdeconinck deleted the feature/gpu_without_mpi branch August 28, 2024 13:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request gpu
Projects
None yet
Development

Successfully merging this pull request may close these issues.

GPU feature cannot be compiled without MPI
3 participants