Skip to content
This repository has been archived by the owner on Mar 1, 2023. It is now read-only.

Commit

Permalink
delete copy_stack_field_down! code
Browse files Browse the repository at this point in the history
  • Loading branch information
blallen committed Jun 30, 2020
1 parent 5cbae2c commit 59f4828
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 76 deletions.
38 changes: 0 additions & 38 deletions src/Numerics/DGMethods/DGModel.jl
Original file line number Diff line number Diff line change
Expand Up @@ -894,44 +894,6 @@ function courant(
MPI.Allreduce(rank_courant_max, max, topology.mpicomm)
end

function copy_stack_field_down!(
dg::DGModel,
m::BalanceLaw,
state_auxiliary::MPIStateArray,
fldin,
fldout,
elems = topology.elems,
)
device = array_device(state_auxiliary)

grid = dg.grid
topology = grid.topology

dim = dimensionality(grid)
N = polynomialorder(grid)
Nq = N + 1
Nqk = dim == 2 ? 1 : Nq

# do integrals
nelem = length(elems)
nvertelem = topology.stacksize
horzelems = fld1(first(elems), nvertelem):fld1(last(elems), nvertelem)

event = Event(device)
event = kernel_copy_stack_field_down!(device, (Nq, Nqk))(
Val(dim),
Val(N),
Val(nvertelem),
state_auxiliary.data,
horzelems,
Val(fldin),
Val(fldout);
ndrange = (length(horzelems) * Nq, Nqk),
dependencies = (event,),
)
wait(device, event)
end

function MPIStateArrays.MPIStateArray(dg::DGModel)
balance_law = dg.balance_law
grid = dg.grid
Expand Down
38 changes: 0 additions & 38 deletions src/Numerics/DGMethods/DGModel_kernels.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1921,44 +1921,6 @@ end
end
end

# TODO: Generalize to more than one field?
@kernel function kernel_copy_stack_field_down!(
::Val{dim},
::Val{N},
::Val{nvertelem},
state_auxiliary,
elems,
::Val{fldin},
::Val{fldout},
) where {dim, N, nvertelem, fldin, fldout}
DFloat = eltype(state_auxiliary)

Nq = N + 1
Nqj = dim == 2 ? 1 : Nq

_eh = @index(Group, Linear)
i, j = @index(Local, NTuple)

# note that k is the second not 4th index (since this is scratch memory and k
# needs to be persistent across threads)
@inbounds begin
# Initialize the constant state at zero
ijk = i + Nq * ((j - 1) + Nqj * (Nq - 1))
eh = elems[_eh]
et = nvertelem + (eh - 1) * nvertelem
val = state_auxiliary[ijk, fldin, et]

# Loop up the stack of elements
for ev in 1:nvertelem
e = ev + (eh - 1) * nvertelem
@unroll for k in 1:Nq
ijk = i + Nq * ((j - 1) + Nqj * (k - 1))
state_auxiliary[ijk, fldout, e] = val
end
end
end
end

@kernel function volume_divergence_of_gradients!(
balance_law::BalanceLaw,
::Val{dim},
Expand Down

0 comments on commit 59f4828

Please sign in to comment.