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

Throw error if CUDA-aware MPI is not found for distributed GPU architecture #3883

Closed
wants to merge 8 commits into from
29 changes: 29 additions & 0 deletions src/DistributedComputations/distributed_architectures.jl
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,35 @@ function Distributed(child_architecture = CPU();
MPI.Init()
end

# Make sure that we have CUDA-aware MPI.
if child_architecture isa GPU
try
if !(MPI.has_cuda())
msg = """We found that MPI.has_cuda() == false: your MPI library does not appear to be CUDA-aware.
Oceananigans requires CUDA-aware MPI, which is not currently available automatically
through jll artifacts. See

https://juliaparallel.org/MPI.jl/stable/usage/#CUDA-aware-MPI-support

for more information about configuring CUDA-aware MPI.
"""

error(msg)
end
catch err
msg = """Calling MPI.has_cuda() returned an error. Oceananigans requires CUDA-aware MPI,
which is not currently available automatically through jll artifacts. See

https://juliaparallel.org/MPI.jl/stable/usage/#CUDA-aware-MPI-support

for more information about configuring CUDA-aware MPI.
"""

@warn msg
throw(err)
end
end

if isnothing(communicator) # default communicator
communicator = MPI.COMM_WORLD
end
Expand Down