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

Fix GCL on GPU #1311

Merged
merged 1 commit into from
Sep 24, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions src/ngp_algorithms/GeometryAlgDriver.C
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,8 @@ GeometryAlgDriver::pre_work()
void
GeometryAlgDriver::mesh_motion_prework()
{
using MeshIndex = nalu_ngp::NGPMeshTraits<stk::mesh::NgpMesh>::MeshIndex;

const auto& meta = realm_.meta_data();
const auto& meshInfo = realm_.mesh_info();
const auto ngpMesh = meshInfo.ngp_mesh();
Expand Down Expand Up @@ -176,9 +178,15 @@ GeometryAlgDriver::mesh_motion_prework()
stk::topology::EDGE_RANK, "edge_swept_face_volume");
const stk::mesh::Selector sel =
stk::mesh::selectField(*sweptVolEdge) & meta.locally_owned_part();
nalu_ngp::field_axpby(
ngpMesh, sel, (gamma1 + gamma2) / dt, ngpSweptVolEdgeN, 0.0,
ngpFaceVelMag, 1, stk::topology::EDGE_RANK);

const auto alpha = (gamma1 + gamma2) / dt;
ngpFaceVelMag.sync_to_device();
nalu_ngp::run_entity_algorithm(
"ngp_field_axpby", ngpMesh, stk::topology::EDGE_RANK, sel,
KOKKOS_LAMBDA(const MeshIndex& mi) {
ngpFaceVelMag.get(mi, 0) = alpha * ngpSweptVolEdgeN.get(mi, 0);
});
ngpFaceVelMag.modify_on_device();
}
}

Expand Down
Loading