-
Notifications
You must be signed in to change notification settings - Fork 27
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 mesh tester example and add tests #1142
Conversation
c1e8492
to
f1421f2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @bmhan12
Thanks for the fixes, @bmhan12 . I see you test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved, but perhaps we also want to test against AXOM_USE_RAJA
.
@agcapps doesn't RAJA_FOUND imply that AXOM_USE_RAJA is true/defined? |
Hm, this might make things confusing, at least in terms of separation of defines for source code ( In these cases |
Yes, relevant CMake configuration: axom/src/cmake/AxomConfig.cmake Lines 13 to 21 in e809258
|
OK, so in https://github.com/LLNL/axom/blob/develop/src/cmake/AxomConfig.cmake#L16-L21, AXOM_USE_RAJA gets set if RAJA_FOUND is true or the user passed in ENABLE_RAJA. Looking at source code, header and source files seem to test AXOM_USE_RAJA, but CMakeLists.txt files (which is what you're working on, Brian) seem to test RAJA_FOUND. Looks like you are doing the right thing. Sorry for the noise. |
An occasional round of confusion is cleansing.... 😄 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @bmhan12 !
axom::for_all<ExecSpace>( | ||
curr_lvl_count, | ||
AXOM_LAMBDA(axom::IndexType i) { | ||
out[next_lvl + i * lvl_factor + 0] = | ||
new_inscribed_prism(out[curr_lvl + i], Q, T, S, R, pa, pb); | ||
out[next_lvl + i * lvl_factor + 1] = | ||
new_inscribed_prism(out[curr_lvl + i], U, R, Q, P, pa, pb); | ||
OctType *out_ptr = out.data(); | ||
out_ptr[next_lvl + i * lvl_factor + 0] = | ||
new_inscribed_prism(out_ptr[curr_lvl + i], Q, T, S, R, pa, pb); | ||
out_ptr[next_lvl + i * lvl_factor + 1] = | ||
new_inscribed_prism(out_ptr[curr_lvl + i], U, R, Q, P, pa, pb); | ||
if(level == 0) | ||
{ | ||
out[next_lvl + i * lvl_factor + 2] = | ||
new_inscribed_prism(out[curr_lvl + i], S, P, U, T, pa, pb); | ||
out_ptr[next_lvl + i * lvl_factor + 2] = | ||
new_inscribed_prism(out_ptr[curr_lvl + i], S, P, U, T, pa, pb); | ||
} | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm surprised it's necessary to grab a pointer to out, via out.ptr()
before changing values in the array.
That's not how we'd want to have to use ArrayView
.
Would it help if we add the mutable
keyword? E.g.
AXOM_LAMBDA(axom::IndexType i) mutable {
out[ <some_index> ] = new_inscribed_prism(out[ <other_index> ], <params> );
...
}
We do that in a few places in axom, e.g.:
axom/src/axom/spin/tests/spin_bvh.cpp
Line 1404 in e809258
AXOM_LAMBDA(std::int32_t idx) mutable { axom/src/axom/quest/DistributedClosestPoint.hpp
Line 1262 in e809258
AXOM_LAMBDA(std::int32_t idx) mutable {
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kennyweiss Thanks! mutable
works here!
src/tools/CMakeLists.txt
Outdated
# Add unit tests | ||
if(AXOM_ENABLE_TESTS AND AXOM_DATA_DIR AND RAJA_FOUND AND UMPIRE_FOUND) | ||
|
||
# Run the mesh_tester with the plane_simp_problems.stl example and | ||
# different spatial indexes, raja policies | ||
|
||
set(plane_data_dir ${AXOM_DATA_DIR}/quest/plane_simp_problems.stl) | ||
|
||
set(_methods "bvh" "implicit" "uniform") | ||
|
||
set (_policies "raja_seq") | ||
blt_list_append(TO _policies ELEMENTS "raja_omp" IF AXOM_ENABLE_OPENMP) | ||
blt_list_append(TO _policies ELEMENTS "raja_cuda" IF AXOM_ENABLE_CUDA) | ||
|
||
foreach(_method ${_methods}) | ||
foreach(_policy ${_policies}) | ||
|
||
set(_testname "mesh_tester_${_method}_${_policy}") | ||
axom_add_test( | ||
NAME ${_testname} | ||
COMMAND mesh_tester | ||
--infile ${plane_data_dir} | ||
--method ${_method} | ||
--policy ${_policy} | ||
) | ||
|
||
set_tests_properties(${_testname} PROPERTIES | ||
PASS_REGULAR_EXPRESSION "5 intersecting tri pairs") | ||
endforeach() | ||
endforeach() | ||
endif() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Co-authored-by: Chris White <white238@llnl.gov>
This PR:
mesh_tester
executablemesh_tester
for the different spatial indexes and RAJA policies.core_openmp_map
unit test.AXOM_USE_RAJA
was used of instead ofRAJA_FOUND
to guard test inclusion.