File tree Expand file tree Collapse file tree 1 file changed +17
-6
lines changed Expand file tree Collapse file tree 1 file changed +17
-6
lines changed Original file line number Diff line number Diff line change @@ -631,17 +631,17 @@ void F4GB::gauss_reduce(bool diagonalize)
631631 }
632632 }
633633
634- #if defined(WITH_TBB)
635- // #if 0
636-
637634 for (int i = 0 ; i < nrows; ++i)
638635 {
639636 if (not is_pivot_row (i))
640637 spair_rows.push_back (i);
641638 }
642-
643- std::mutex cout_guard;
639+
644640 t0 = mtbb::tick_count::now ();
641+
642+ #if defined(WITH_TBB)
643+
644+ std::mutex cout_guard;
645645 using threadLocalDense_t = mtbb::enumerable_thread_specific<ElementArray>;
646646 // create a dense array for each thread
647647 threadLocalDense_t threadLocalDense ([&]() {
@@ -677,9 +677,20 @@ void F4GB::gauss_reduce(bool diagonalize)
677677 });
678678 for (auto tlDense : threadLocalDense)
679679 mVectorArithmetic ->deallocateElementArray (tlDense);
680+
681+ #else
682+
683+ ElementArray my_dense { mVectorArithmetic ->allocateElementArray (ncols) };
684+
685+ for (int i = 0 ; i < INTSIZE (spair_rows); ++i)
686+ gauss_reduce_row (spair_rows[i], my_dense);
687+
688+ mVectorArithmetic ->deallocateElementArray (my_dense);
689+
690+ #endif
691+
680692 t1 = mtbb::tick_count::now ();
681693 mParallelGaussTime += (t1-t0).seconds ();
682- #endif
683694
684695 if (M2_gbTrace >= 2 )
685696 std::cout << " About to do serial loop, n_newpivots = " << n_newpivots << std::endl;
You can’t perform that action at this time.
0 commit comments