Skip to content

Commit de1fe46

Browse files
committed
Include serial gaussian reduction loop for when TBB is disabled
1 parent 00d5312 commit de1fe46

File tree

1 file changed

+17
-6
lines changed

1 file changed

+17
-6
lines changed

M2/Macaulay2/e/f4/f4.cpp

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff 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;

0 commit comments

Comments
 (0)