Skip to content

Commit

Permalink
Possible MPI driver bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
charleskawczynski committed Jul 23, 2024
1 parent 74e48e1 commit d06e82b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
16 changes: 8 additions & 8 deletions examples/hybrid/driver.jl
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,10 @@ walltime = @elapsed sol = OrdinaryDiffEq.solve!(integrator)
any(isnan, sol.u[end]) && error("NaNs found in result.")

if is_distributed # replace sol.u on the root processor with the global sol.u
global_Y_c_1 =
DataLayouts.gather(comms_ctx, Fields.field_values(sol.u[1].c))
global_Y_f_1 =
DataLayouts.gather(comms_ctx, Fields.field_values(sol.u[1].f))
if ClimaComms.iamroot(comms_ctx)
global_h_space = make_horizontal_space(
horizontal_mesh,
Expand All @@ -194,14 +198,10 @@ if is_distributed # replace sol.u on the root processor with the global sol.u
)
global_center_space, global_face_space =
make_hybrid_spaces(global_h_space, z_max, z_elem; z_stretch)
global_Y_c_type = Fields.Field{
typeof(Fields.field_values(Y.c)),
typeof(global_center_space),
}
global_Y_f_type = Fields.Field{
typeof(Fields.field_values(Y.f)),
typeof(global_face_space),
}
global_Y_c_type =
Fields.Field{typeof(global_Y_c_1), typeof(global_center_space)}
global_Y_f_type =
Fields.Field{typeof(global_Y_f_1), typeof(global_face_space)}
global_Y_type = Fields.FieldVector{
FT,
NamedTuple{(:c, :f), Tuple{global_Y_c_type, global_Y_f_type}},
Expand Down
2 changes: 1 addition & 1 deletion ext/cuda/data_layouts_copyto.jl
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ Base.copyto!(dest::IFH{S, Ni, Nh}, bc::DataLayouts.BroadcastedUnionIFH{S,
Base.copyto!(dest::IJF{S, Nij}, bc::DataLayouts.BroadcastedUnionIJF{S, Nij}, ::ToCUDA) where {S, Nij} = cuda_copyto!(dest, bc)
Base.copyto!(dest::IF{S, Ni}, bc::DataLayouts.BroadcastedUnionIF{S, Ni}, ::ToCUDA) where {S, Ni} = cuda_copyto!(dest, bc)
Base.copyto!(dest::VIFH{S, Nv, Ni, Nh}, bc::DataLayouts.BroadcastedUnionVIFH{S, Nv, Ni, Nh}, ::ToCUDA) where {S, Nv, Ni, Nh} = cuda_copyto!(dest, bc)
# Base.copyto!(dest::VIJFH{S, Nv, Nij}, bc::DataLayouts.BroadcastedUnionVIJFH{S, Nv, Nij, Nh}, ::ToCUDA) where {S, Nv, Nij, Nh} = cuda_copyto!(dest, bc)
# Base.copyto!(dest::VIJFH{S, Nv, Nij, Nh}, bc::DataLayouts.BroadcastedUnionVIJFH{S, Nv, Nij, Nh}, ::ToCUDA) where {S, Nv, Nij, Nh} = cuda_copyto!(dest, bc)
# Base.copyto!(dest::VF{S, Nv}, bc::DataLayouts.BroadcastedUnionVF{S, Nv}, ::ToCUDA) where {S, Nv} = cuda_copyto!(dest, bc)
# Base.copyto!(dest::DataF{S}, bc::DataLayouts.BroadcastedUnionDataF{S}, ::ToCUDA) where {S} = cuda_copyto!(dest, bc)
#! format: on

0 comments on commit d06e82b

Please sign in to comment.