A user encountered a segfault with Array::fill() in a user code w/ a CUDA config (on LC's rzvector).
The code works as expected in other configs, so this seems like a memory-related issue w/ CUDA.
They found the following workaround:
diff --git a/src/tribol/search/InterfacePairFinder.cpp b/src/tribol/search/InterfacePairFinder.cpp
index 469457c..272832e 100644
--- a/src/tribol/search/InterfacePairFinder.cpp
+++ b/src/tribol/search/InterfacePairFinder.cpp
@@ -121,7 +121,8 @@ class CartesianProduct : public SearchBase {
auto& contactPairs = m_coupling_scheme->getInterfacePairs();
contactPairs.resize( countArray_host[0] );
- countArray.fill( 0 );
+ int zero = 0;
+ axom::copy(countArray.data(), &zero, sizeof(int));
https://github.com/llnl/Tribol/blob/12031d198ecf1cdccbf1faaac9b0c20c06735225/src/tribol/search/InterfacePairFinder.cpp#L125-L128
We should investigate and fix this.
A user encountered a segfault with
Array::fill()in a user code w/ a CUDA config (on LC's rzvector).The code works as expected in other configs, so this seems like a memory-related issue w/ CUDA.
They found the following workaround:
https://github.com/llnl/Tribol/blob/12031d198ecf1cdccbf1faaac9b0c20c06735225/src/tribol/search/InterfacePairFinder.cpp#L125-L128
We should investigate and fix this.