fix opencl ilu jacobi threadcopy

This commit is contained in:
Razvan Nane 2024-06-24 12:52:28 +02:00
parent 7ce693ba06
commit deeb8a8582

View File

@ -31,6 +31,12 @@
#include <sstream>
#if HAVE_OPENMP
#include <thread>
#include <omp.h>
extern std::shared_ptr<std::thread> copyThread;
#endif //HAVE_OPENMP
namespace Opm::Accelerator {
using Dune::Timer;
@ -189,6 +195,14 @@ create_preconditioner(BlockedMatrix<Scalar>* mat, BlockedMatrix<Scalar>* jacMat)
auto *matToDecompose = jacMat ? jacMat : mat;
if (jacMat) {
#if HAVE_OPENMP
if (omp_get_max_threads() > 1) {
copyThread->join();
}
#endif
}
// TODO: remove this copy by replacing inplace ilu decomp by out-of-place ilu decomp
Timer t_copy;
memcpy(LUmat->nnzValues, matToDecompose->nnzValues,