-
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
Initial MIR component #1438
base: develop
Are you sure you want to change the base?
Initial MIR component #1438
Conversation
using MaterialID = int; | ||
using MaterialIDArray = axom::Array<MaterialID>; | ||
using MaterialIDView = axom::ArrayView<MaterialID>; | ||
using MaterialVF = float; |
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.
Is float
a design choice over double
?
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.
Yes, but I think I could change it to use the material view's FloatType for MaterialVF so it stays true to the types specified in the material view. I think I had some compiler problems in this code but I could try again.
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.
Continuing to make my way through this PR... this review covers the MIR examples.
When you get a chance, could please share some performance results and visualizations?
std::cout << "a={"; | ||
for(axom::IndexType i = 0; i < a.size(); i++) | ||
{ | ||
if(i > 0) std::cout << ", "; |
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.
Note:
Our clang-format
can't enforce this until we go past clang-10
, but we require braces around single line conditionals/loops
Since we're on clang-14 for our clang-format, we should update our rules to automatically add braces around single line conditionals
src/axom/CMakeLists.txt
Outdated
# Add MIR if the prerequisites are found. | ||
if(RAJA_FOUND AND UMPIRE_FOUND AND CONDUIT_FOUND) | ||
axom_add_component(COMPONENT_NAME mir | ||
DEFAULT_STATE ${AXOM_ENABLE_ALL_COMPONENTS}) | ||
else() | ||
message(STATUS "Axom Component MIR turned off due to missing RAJA, UMPIRE, or Conduit.") | ||
set(AXOM_ENABLE_MIR OFF CACHE BOOL "") | ||
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.
I wonder if we should add lines to our spack package to disable MIR when RAJA
and Conduit
are not present.
And similarly, to disable Sidre, Inlet and Klee when axom is configured without conduit
.
For your specific question, I think we'd need to add -DAXOM_ENABLE_MIR=OFF
to the *_noraja*
CI configs, e.g. here
Line 48 in e5b5707
CMAKE_EXTRA_FLAGS: '-DBUILD_SHARED_LIBS=ON -DAXOM_QUEST_ENABLE_EXTRA_REGRESSION_TESTS:BOOL=ON -U RAJA_DIR' |
…x OpenMP macro in example program.
… from writing output files during CI tests. I/O might be causing the failures.
I added a script that will make BASH scripts to run the mir_concentric_circles example program on various platforms and gather the caliper data results. I plotted the MIR runtime and some things look good, some very bad at the moment. I think SEQ mode could be optimized more to bring it down, likely bringing down time in the other modes too. OMP has inexplicably bad performance. I've seen some hints of this before during development but focused more on GPU so far. I'll need to profile OMP and see what's the matter.
|
void conduit_debug_err_handler(const std::string &s1, const std::string &s2, int i1) | ||
{ | ||
std::cout << "s1=" << s1 << ", s2=" << s2 << ", i1=" << i1 << std::endl; | ||
// This is on purpose. |
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.
Thank you: this is a necessary comment.
src/axom/core/memory_management.hpp
Outdated
inline int getAllocatorIDForAddress(void* ptr) | ||
{ | ||
umpire::ResourceManager& rm = umpire::ResourceManager::getInstance(); | ||
return rm.getAllocator(ptr).getId(); |
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.
What if ptr
was not Umpire-allocated? A check that the allocator could be found would be helpful to avoid crashing. Would it make sense to return INVALID_ALLOCATOR_ID
in that case?
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.
Good suggestion. I added a test that calls getAllocatorIDForAddress()
with a pointer not allocated by Umpire, which made Umpire throw an exception. I added exception handling and return INVALID_ALLOCATOR_ID in that case.
…h a pointer not allocated by umpire. Added test.
…mall changes too.
* | ||
* \note The coordset view must agree with the coordset in n_input. We pass both | ||
* a view and the coordset node since the view may not be able to contain | ||
* come coordset metadata and remain trivially copyable. |
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.
"come coordset metadata" Should this be "some coordset metadata"?
This PR is adds an initial MIR component to Axom. EquiZ MIR was implemented as the first algorithm because it was more familiar and my first goal was to shake out problems with infrastructure for writing algorithms against Blueprint data. The MIR algorithm takes Blueprint input and generates Blueprint output.
This PR does the following:
NOTE: