mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
fix opencl ilu jacobi threadcopy
This commit is contained in:
parent
7ce693ba06
commit
deeb8a8582
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user