Skip to content

Commit

Permalink
Issue 116 fix
Browse files Browse the repository at this point in the history
- Aggressive vectorization required a larger tolerance
  • Loading branch information
Rohit-Kakodkar committed Oct 22, 2024
1 parent a142a3c commit 2475a76
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .jenkins/intel_compiler_checks.gvy
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ pipeline{
}
axis{
name 'SIMD'
values 'SIMD_NONE;-DENABLE_SIMD=OFF'
values 'SIMD_NONE;-DENABLE_SIMD=OFF', 'SIMD_NATIVE;-DENABLE_SIMD=ON -DKokkos_ARCH_NATIVE=ON -DKokkos_ENABLE_AGGRESSIVE_VECTORIZATION=ON'
}
}
stages {
Expand Down
3 changes: 0 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@ set(NUM_VECTOR_LANES 1)

if(CMAKE_CXX_COMPILER_ID STREQUAL "IntelLLVM")
set(CMAKE_CXX_FLAGS "-fp-model=precise")
if (ENABLE_SIMD)
message(FATAL_ERROR "SIMD is not supported with IntelLLVM compiler, please clear the Cmake cache and 1. Please disable SIMD by setting ENABLE_SIMD to OFF or 2. Use GNU compiler")
endif()
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
message("-- Detected Intel classic compiler which will be deprecated soon.")
message("-- It is recommended you use IntelLLVM compiler.")
Expand Down
12 changes: 8 additions & 4 deletions include/compute/coupled_interfaces/interface_container.tpp
Original file line number Diff line number Diff line change
Expand Up @@ -377,22 +377,26 @@ compute_edge_factors_and_normals(
true, false>;

const auto [i1, j1] = edge1_points[ipoint];
const specfem::point::index<specfem::dimension::type::dim2> edge1_index(ispec1, j1, i1);
const specfem::point::index<specfem::dimension::type::dim2> edge1_index(
ispec1, j1, i1);
PointPartialDerivativesType edge1_derivatives;
specfem::compute::load_on_host(edge1_index, partial_derivatives,
edge1_derivatives);

const auto [i2, j2] = edge2_points[ipoint];
const specfem::point::index<specfem::dimension::type::dim2> edge2_index(ispec2, j2, i2);
const specfem::point::index<specfem::dimension::type::dim2> edge2_index(
ispec2, j2, i2);
PointPartialDerivativesType edge2_derivatives;
specfem::compute::load_on_host(edge2_index, partial_derivatives,
edge2_derivatives);

const auto edge1_normal = edge1_derivatives.compute_normal(edge1);
const auto edge2_normal = edge2_derivatives.compute_normal(edge2);

if (std::abs(edge1_normal(0) + edge2_normal(0)) > 1.e-10 &&
std::abs(edge1_normal(1) + edge2_normal(1)) > 1.e-10) {
if ((std::abs(edge1_normal(0) + edge2_normal(0)) >
1.e-4 * (std::abs(edge1_normal(0) - edge2_normal(0)) / 2)) &&
(std::abs(edge1_normal(1) + edge2_normal(1)) >
1.e-4 * (std::abs(edge1_normal(1) - edge2_normal(1)) / 2))) {
throw std::runtime_error("Edge normals need to be opposite in direction");
}

Expand Down

0 comments on commit 2475a76

Please sign in to comment.