From 7bb590f2496e29278ec13e576b1d20ac76f892d3 Mon Sep 17 00:00:00 2001 From: dwarning Date: Fri, 5 Feb 2021 18:32:45 +0100 Subject: [PATCH] New trial: OpenMP to spClear to parallelize the loop --- src/maths/sparse/spbuild.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/maths/sparse/spbuild.c b/src/maths/sparse/spbuild.c index 0536bf624..8ee62b2da 100644 --- a/src/maths/sparse/spbuild.c +++ b/src/maths/sparse/spbuild.c @@ -105,6 +105,9 @@ spClear(MatrixPtr Matrix) /* Clear matrix. */ if (Matrix->PreviousMatrixWasComplex || Matrix->Complex) { +#ifdef USE_OMP +#pragma omp parallel for private(pElement) +#endif for (I = Matrix->Size; I > 0; I--) { pElement = Matrix->FirstInCol[I]; @@ -118,6 +121,9 @@ spClear(MatrixPtr Matrix) } else { +#ifdef USE_OMP +#pragma omp parallel for private(pElement) +#endif for (I = Matrix->Size; I > 0; I--) { pElement = Matrix->FirstInCol[I];