[mathicgb] 40/393: Added a -threadCount option that sets the number of parallel threads used during reduction. The tests also use this.
Doug Torrance
dtorrance-guest at moszumanska.debian.org
Fri Apr 3 15:58:30 UTC 2015
This is an automated email from the git hooks/post-receive script.
dtorrance-guest pushed a commit to branch upstream
in repository mathicgb.
commit 3e3fdf395bf73f8160add8237b78936ed56dfbb6
Author: Bjarke Hammersholt Roune <bjarkehr.code at gmail.com>
Date: Fri Sep 28 21:43:38 2012 +0200
Added a -threadCount option that sets the number of parallel threads used during reduction. The tests also use this.
---
Makefile.am | 5 +-
src/cli/GBMain.cpp | 9 +-
src/mathicgb/BuchbergerAlg.cpp | 2 +
src/mathicgb/BuchbergerAlg.hpp | 5 +
src/mathicgb/F4MatrixReducer.cpp | 11 +-
src/mathicgb/F4MatrixReducer.hpp | 3 +
src/mathicgb/F4Reducer.cpp | 17 ++-
src/mathicgb/F4Reducer.hpp | 6 +-
src/mathicgb/Reducer.cpp | 6 +-
src/mathicgb/Reducer.hpp | 8 +-
src/mathicgb/TypicalReducer.cpp | 4 +
src/mathicgb/TypicalReducer.hpp | 2 +
src/test/gb-test.cpp | 276 ++++++++++++++++++++-------------------
src/test/pict.in | 1 +
14 files changed, 204 insertions(+), 151 deletions(-)
diff --git a/Makefile.am b/Makefile.am
index 00b0d9a..32c45f0 100755
--- a/Makefile.am
+++ b/Makefile.am
@@ -10,7 +10,8 @@ libmathicgb_la_CPPFLAGS = $(DEPS_CFLAGS)
noinst_LTLIBRARIES = libmathicgb.la
# set the C++ compiler to include src/
-AM_CXXFLAGS=-I$(top_srcdir)/src/ -std=gnu++0x
+AM_CXXFLAGS=-I$(top_srcdir)/src/ -std=gnu++0x -fopenmp
+AM_LDFLAGS=-fopenmp
# libraries that are needed by this library
libmathicgb_la_LIBADD= $(DEPS_LIBS)
@@ -83,7 +84,7 @@ unittest_CPPFLAGS = $(DEPS_CFLAGS)
unittest_CXXFLAGS=\
-I$(top_srcdir)/libs/gtest/include\
-I$(top_srcdir)/libs/gtest/\
- -I$(top_srcdir)/src/ -std=gnu++0x
+ -I$(top_srcdir)/src/ -std=gnu++0x -fopenmp
unittest_LDADD = $(DEPS_LIBS) libmathicgb.la
test_LIBS=
diff --git a/src/cli/GBMain.cpp b/src/cli/GBMain.cpp
index 8790377..6de45ee 100755
--- a/src/cli/GBMain.cpp
+++ b/src/cli/GBMain.cpp
@@ -119,8 +119,12 @@ public:
"Specifies how many S-pair to reduce at one time. A value of 0 "
"indicates not to group S-pairs together. Only currently relevant "
"for the classic Buchberger algorithm.",
- 0)
+ 0),
+ mThreadCount("threadCount",
+ "Specifies how many threads to use to run the program in parallel.",
+ 1)
+
{
{
std::ostringstream orderOut;
@@ -193,6 +197,7 @@ public:
alg.setBreakAfter(mBreakAfter.value());
alg.setPrintInterval(mPrintInterval.value());
alg.setSPairGroupSize(mSPairGroupSize.value());
+ alg.setThreadCount(mThreadCount.value());
alg.setUseAutoTopReduction(mAutoTopReduce.value());
alg.setUseAutoTailReduction(mAutoTailReduce.value());
@@ -279,6 +284,7 @@ public:
parameters.push_back(&mModuleOrder);
parameters.push_back(&mProjectName);
parameters.push_back(&mSPairGroupSize);
+ parameters.push_back(&mThreadCount);
// we do not expose the strategy parameter - it is only here to
// support the old format of using direct numeric parameters to
@@ -305,6 +311,7 @@ private:
mic::StringParameter mProjectName;
mic::IntegerParameter mStrategy;
mic::IntegerParameter mSPairGroupSize;
+ mic::IntegerParameter mThreadCount;
};
int oldmain(int argc, char **argv);
diff --git a/src/mathicgb/BuchbergerAlg.cpp b/src/mathicgb/BuchbergerAlg.cpp
index d9efa37..e9a3125 100755
--- a/src/mathicgb/BuchbergerAlg.cpp
+++ b/src/mathicgb/BuchbergerAlg.cpp
@@ -17,6 +17,7 @@ BuchbergerAlg::BuchbergerAlg(
mBreakAfter(0),
mPrintInterval(0),
mSPairGroupSize(0),
+ mThreadCount(0),
mUseAutoTopReduction(true),
mUseAutoTailReduction(false),
mRing(*ideal.getPolyRing()),
@@ -121,6 +122,7 @@ void BuchbergerAlg::insertReducedPoly(
}
void BuchbergerAlg::computeGrobnerBasis() {
+ mReducer->setThreadCount(mThreadCount);
size_t counter = 0;
mTimer.reset();
mRing.resetCoefficientStats();
diff --git a/src/mathicgb/BuchbergerAlg.hpp b/src/mathicgb/BuchbergerAlg.hpp
index 4b15b19..47c4e60 100755
--- a/src/mathicgb/BuchbergerAlg.hpp
+++ b/src/mathicgb/BuchbergerAlg.hpp
@@ -49,6 +49,10 @@ public:
mSPairGroupSize = groupSize;
}
+ void setThreadCount(size_t threadCount) {
+ mThreadCount = threadCount;
+ }
+
void setUseAutoTopReduction(bool value) {
mUseAutoTopReduction = value;
}
@@ -61,6 +65,7 @@ private:
unsigned int mBreakAfter;
unsigned int mPrintInterval;
unsigned int mSPairGroupSize;
+ size_t mThreadCount;
bool mUseAutoTopReduction;
bool mUseAutoTailReduction;
diff --git a/src/mathicgb/F4MatrixReducer.cpp b/src/mathicgb/F4MatrixReducer.cpp
index b9131e1..aea7a76 100755
--- a/src/mathicgb/F4MatrixReducer.cpp
+++ b/src/mathicgb/F4MatrixReducer.cpp
@@ -11,6 +11,10 @@
#include <string>
#include <cstdio>
+#ifdef _OPENMP
+#include <omp.h>
+#endif
+
template<class T>
class DenseRow {
public:
@@ -367,7 +371,7 @@ void myReduceToEchelonForm5
size_t const reducerCount = reduced.rowCount();
//std::cout << "reducing " << reduced.rowCount() << " out of " << toReduce.rowCount() << std::endl;
- //#pragma omp parallel for num_threads(threadCount) schedule(dynamic)
+#pragma omp parallel for num_threads(threadCount) schedule(dynamic)
for (size_t row = 0; row < rowCount; ++row) {
MATHICGB_ASSERT(leadCols[row] <= colCount);
DenseRow<uint64>& denseRow = dense[row];
@@ -761,7 +765,6 @@ void F4MatrixReducer::reduce
if (ring.charac() > std::numeric_limits<SparseMatrix::Scalar>::max())
throw std::overflow_error("Too large modulus in F4 matrix computation.");
- const int threadCount = 1;
SparseMatrix::Scalar modulus = ring.charac();
SparseMatrix reducedD;
@@ -779,10 +782,10 @@ void F4MatrixReducer::reduce
concatenateMatricesHorizontal
(matrix.bottomLeft, matrix.bottomRight, matrixCD);
- myReduce(matrixCD, matrixAB, modulus, reducedD, threadCount);
+ myReduce(matrixCD, matrixAB, modulus, reducedD, mThreadCount);
reducedD.trimLeadingZeroColumns(pivotColCount);
}
- myReduceToEchelonForm5(reducedD, modulus, threadCount);
+ myReduceToEchelonForm5(reducedD, modulus, mThreadCount);
sortRowsByIncreasingPivots(reducedD, newPivots);
}
diff --git a/src/mathicgb/F4MatrixReducer.hpp b/src/mathicgb/F4MatrixReducer.hpp
index 17a4771..f50006a 100755
--- a/src/mathicgb/F4MatrixReducer.hpp
+++ b/src/mathicgb/F4MatrixReducer.hpp
@@ -9,10 +9,13 @@ class PolyRing;
answer you get is the submatrix that contains new pivots. */
class F4MatrixReducer {
public:
+ F4MatrixReducer(size_t threadCount = 1): mThreadCount(threadCount) {}
+
void reduce
(const PolyRing& ring, QuadMatrix& matrix, SparseMatrix& newPivots);
private:
+ size_t mThreadCount;
};
#endif
diff --git a/src/mathicgb/F4Reducer.cpp b/src/mathicgb/F4Reducer.cpp
index ce36501..0b4b41a 100755
--- a/src/mathicgb/F4Reducer.cpp
+++ b/src/mathicgb/F4Reducer.cpp
@@ -4,8 +4,12 @@
#include "F4MatrixBuilder.hpp"
#include "F4MatrixReducer.hpp"
-F4Reducer::F4Reducer(const PolyRing& ring, std::unique_ptr<Reducer> fallback):
- mFallback(std::move(fallback)), mRing(ring) {
+F4Reducer::F4Reducer(
+ const PolyRing& ring,
+ std::unique_ptr<Reducer> fallback
+):
+ mFallback(std::move(fallback)),
+ mRing(ring) {
}
std::unique_ptr<Poly> F4Reducer::classicReduce
@@ -40,7 +44,7 @@ std::unique_ptr<Poly> F4Reducer::classicReduceSPoly
SparseMatrix reduced;
{
- F4MatrixReducer red;
+ F4MatrixReducer red(mThreadCount);
red.reduce(basis.ring(), qm, reduced);
}
@@ -76,13 +80,14 @@ void F4Reducer::classicReduceSPolyGroup
// there has to be something to reduce
MATHICGB_ASSERT(qm.bottomLeft.rowCount() > 0);
}
- F4MatrixReducer().reduce(basis.ring(), qm, reduced);
+ F4MatrixReducer(mThreadCount).reduce(basis.ring(), qm, reduced);
monomials = std::move(qm.rightColumnMonomials);
}
for (SparseMatrix::RowIndex row = 0; row < reduced.rowCount(); ++row) {
auto p = make_unique<Poly>(&basis.ring());
reduced.rowToPolynomial(row, monomials, *p);
+
reducedOut.push_back(std::move(p));
}
}
@@ -98,6 +103,10 @@ Poly* F4Reducer::regularReduce
return p;
}
+void F4Reducer::setThreadCount(size_t threadCount) {
+ mThreadCount = threadCount;
+}
+
std::string F4Reducer::description() const {
return "F4 reducer";
}
diff --git a/src/mathicgb/F4Reducer.hpp b/src/mathicgb/F4Reducer.hpp
index c7f2e6c..83b9878 100755
--- a/src/mathicgb/F4Reducer.hpp
+++ b/src/mathicgb/F4Reducer.hpp
@@ -6,7 +6,8 @@
class F4Reducer : public Reducer {
public:
- F4Reducer(const PolyRing& ring, std::unique_ptr<Reducer> fallback);
+ F4Reducer(const PolyRing& ring,
+ std::unique_ptr<Reducer> fallback);
virtual std::unique_ptr<Poly> classicReduce
(const Poly& poly, const PolyBasis& basis);
@@ -28,12 +29,15 @@ public:
size_t basisElement,
const GroebnerBasis& basis);
+ virtual void setThreadCount(size_t threadCount);
+
virtual std::string description() const;
virtual size_t getMemoryUse() const;
private:
std::unique_ptr<Reducer> mFallback;
const PolyRing& mRing;
+ size_t mThreadCount;
};
#endif
diff --git a/src/mathicgb/Reducer.cpp b/src/mathicgb/Reducer.cpp
index 2bc262e..1cd6057 100755
--- a/src/mathicgb/Reducer.cpp
+++ b/src/mathicgb/Reducer.cpp
@@ -35,7 +35,8 @@ std::unique_ptr<Reducer> Reducer::makeReducer(
ReducerType type,
PolyRing const& ring
) {
- std::unique_ptr<Reducer> reducer = makeReducerNullOnUnknown(type, ring);
+ std::unique_ptr<Reducer> reducer =
+ makeReducerNullOnUnknown(type, ring);
if (reducer.get() == 0) {
std::ostringstream error;
error << "Unknown or unimplemented reducer type " << type << ".\n";
@@ -111,7 +112,8 @@ std::unique_ptr<Reducer> Reducer::makeReducerNullOnUnknown(
case Reducer_F4:
{
std::unique_ptr<Reducer> fallback = makeReducer(Reducer_BjarkeGeo, ring);
- return std::unique_ptr<Reducer>(new F4Reducer(ring, std::move(fallback)));
+ return std::unique_ptr<Reducer>
+ (new F4Reducer(ring, std::move(fallback)));
}
default:
diff --git a/src/mathicgb/Reducer.hpp b/src/mathicgb/Reducer.hpp
index bd0bab4..d693a88 100755
--- a/src/mathicgb/Reducer.hpp
+++ b/src/mathicgb/Reducer.hpp
@@ -54,6 +54,10 @@ public:
size_t basisElement,
const GroebnerBasis& basis) = 0;
+ /** Sets how many parallel threads to use for reduction - if the
+ reducer supports it. */
+ virtual void setThreadCount(size_t threadCount) = 0;
+
// ***** Kinds of reducers and creating a Reducer
enum ReducerType {
@@ -90,10 +94,10 @@ public:
};
static std::unique_ptr<Reducer> makeReducer
- (ReducerType t, PolyRing const& ring);
+ (ReducerType t, PolyRing const& ring);
static std::unique_ptr<Reducer> makeReducerNullOnUnknown
- (ReducerType t, PolyRing const& ring);
+ (ReducerType t, PolyRing const& ring);
static ReducerType reducerType(int typ);
static void displayReducerTypes(std::ostream &o);
diff --git a/src/mathicgb/TypicalReducer.cpp b/src/mathicgb/TypicalReducer.cpp
index a2be4ba..ba1db91 100755
--- a/src/mathicgb/TypicalReducer.cpp
+++ b/src/mathicgb/TypicalReducer.cpp
@@ -145,6 +145,10 @@ void TypicalReducer::classicReduceSPolyGroup
}
}
+void TypicalReducer::setThreadCount(size_t threadCount) {
+ // multithreading not supported here (yet!)
+}
+
std::unique_ptr<Poly> TypicalReducer::classicReduce
(std::unique_ptr<Poly> result, const PolyBasis& basis) {
const PolyRing& ring = basis.ring();
diff --git a/src/mathicgb/TypicalReducer.hpp b/src/mathicgb/TypicalReducer.hpp
index 33846ed..2ffa597 100755
--- a/src/mathicgb/TypicalReducer.hpp
+++ b/src/mathicgb/TypicalReducer.hpp
@@ -38,6 +38,8 @@ public:
const PolyBasis& basis,
std::vector<std::unique_ptr<Poly> >& reducedOut);
+ virtual void setThreadCount(size_t threadCount);
+
protected:
// These are the methods that sub-classes define in order to carry
// out sub-steps in the reduction.
diff --git a/src/test/gb-test.cpp b/src/test/gb-test.cpp
index 9ffabe0..5267a53 100755
--- a/src/test/gb-test.cpp
+++ b/src/test/gb-test.cpp
@@ -49,138 +49,138 @@ void testGB(int freeModuleOrder,
// all pairs of parameters are covered by at least one test. See
// pict.in for details.
#define MATHICGB_ESCAPE_MULTILINE_STRING(str) #str
- char const allPairsTests[] = MATHICGB_ESCAPE_MULTILINE_STRING(
-spairQueue reducerType divLookup monTable buchberger postponeKoszul useBaseDivisors autoTailReduce autoTopReduce preferSparseReducers useSingularCriterionEarly sPairGroupSize
-1 19 2 2 1 0 0 0 0 0 0 1
-2 2 1 0 0 1 1 0 0 1 1 1
-0 14 1 1 1 0 0 1 1 1 0 2
-3 7 2 1 0 0 1 0 0 0 1 10
-2 23 2 0 1 0 0 1 1 0 0 0
-3 8 1 2 1 0 0 1 1 1 0 10
-0 1 1 2 0 1 0 0 0 0 1 10
-1 11 2 1 1 0 0 1 1 1 0 1
-1 15 1 0 1 0 0 1 0 1 0 10
-1 13 2 2 0 1 1 0 0 1 1 0
-3 14 2 1 0 1 1 0 0 0 1 0
-0 12 2 0 0 1 1 0 0 0 1 2
-2 4 2 2 1 0 0 0 1 0 0 10
-2 21 1 2 1 0 0 1 0 1 0 2
-2 3 2 1 1 0 0 1 1 1 0 10
-3 1 2 0 1 0 0 1 1 1 0 100
-3 13 1 0 1 0 0 1 1 0 0 2
-3 10 2 0 0 1 1 0 0 0 0 10
-0 6 1 0 0 0 1 0 0 1 1 0
-1 24 1 2 1 0 0 0 1 0 0 2
-1 12 1 2 0 0 0 0 0 0 1 100
-1 8 2 0 0 1 1 0 0 0 1 2
-2 22 1 1 1 0 0 0 1 0 0 100
-0 2 2 1 1 0 0 1 1 0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 1 0 0
-3 4 2 0 1 0 0 0 1 1 0 2
-3 5 1 2 0 1 1 0 0 1 1 100
-0 7 1 1 0 0 1 0 0 0 1 1
-0 18 2 1 1 0 0 1 1 1 0 0
-0 10 2 2 1 0 0 1 0 1 0 100
-2 7 1 0 0 1 1 0 0 1 1 100
-1 10 1 1 1 0 0 1 1 1 0 2
-3 25 1 1 1 0 0 1 0 1 0 100
-1 0 1 2 0 1 1 0 0 1 0 1
-1 22 1 1 1 0 0 0 1 0 0 0
-3 24 1 2 1 0 0 1 1 0 0 0
-2 25 1 0 0 1 1 0 0 1 1 1
-1 21 1 0 0 0 0 0 0 0 1 100
-1 9 2 2 1 0 0 0 0 1 0 10
-1 18 1 0 0 1 0 0 0 0 1 1
-1 3 1 0 0 0 0 0 0 0 1 2
-2 6 1 1 0 0 1 0 0 1 1 1
-0 24 1 2 1 0 0 1 0 1 0 1
-0 11 1 1 0 1 0 0 0 1 1 100
-0 3 2 2 1 0 0 0 1 0 0 100
-2 11 2 2 1 0 0 1 0 0 0 0
-1 23 1 2 1 0 0 0 1 0 0 10
-2 20 2 2 0 1 0 0 0 1 0 100
-2 1 1 0 1 0 0 1 1 1 0 0
+char const allPairsTests[] = MATHICGB_ESCAPE_MULTILINE_STRING(
+spairQueue reducerType divLookup monTable buchberger postponeKoszul useBaseDivisors autoTailReduce autoTopReduce preferSparseReducers useSingularCriterionEarly sPairGroupSize threadCount
+2 12 1 0 0 0 0 0 0 0 0 1 1
+3 4 2 1 0 1 1 0 0 1 1 100 8
+0 11 2 2 1 0 0 1 1 0 0 100 2
+1 24 1 2 0 1 0 0 0 1 1 2 2
+0 8 2 0 0 0 1 0 0 1 1 100 1
+1 6 1 1 1 0 0 1 1 0 0 10 8
+3 15 1 0 1 0 0 1 1 1 0 100 1
+2 0 2 1 0 1 1 0 0 0 1 1 2
+2 6 2 2 0 1 1 0 0 1 1 0 1
+2 0 1 0 1 0 0 1 0 1 0 10 1
+0 3 2 2 1 0 0 0 1 1 0 1 8
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0 2 2
+3 14 1 0 0 0 0 0 0 0 0 100 2
+0 2 2 0 1 0 0 0 1 0 0 2 8
+0 15 1 1 0 0 0 0 0 1 1 2 2
+0 18 1 0 1 0 0 1 0 0 0 0 8
+1 1 2 1 0 0 1 0 0 1 1 0 8
);
std::istringstream tests(allPairsTests);
// skip the initial line with the parameter names.
@@ -189,7 +189,7 @@ spairQueue reducerType divLookup monTable buchberger postponeKoszul useBaseDivis
"spairQueue", "reducerType", "divLookup", "monTable",
"buchberger", "postponeKoszul", "useBaseDivisors", "autoTailReduce",
"autoTopReduce", "preferSparseReducers", "useSingularCriterionEarly",
- "sPairGroupSize"};
+ "sPairGroupSize", "threadCount"};
std::string paramName;
size_t const paramCount = sizeof(params) / sizeof(*params);
@@ -260,6 +260,10 @@ spairQueue reducerType divLookup monTable buchberger postponeKoszul useBaseDivis
tests >> sPairGroupSize;
MATHICGB_ASSERT(0 <= sPairGroupSize);
+ int threadCount;
+ tests >> threadCount;
+ MATHICGB_ASSERT(0 <= threadCount);
+
// Rule out combinations of parameter values that do not make sense.
// These are asserts because pict should have already removed these
// combinations.
@@ -277,11 +281,13 @@ spairQueue reducerType divLookup monTable buchberger postponeKoszul useBaseDivis
(Reducer::makeReducerNullOnUnknown(red, I->ring()).get() != 0);
if (buchberger) {
- BuchbergerAlg alg(
- *I, freeModuleOrder, Reducer::reducerType(reducerType), divLookup, preferSparseReducers, spairQueue);
+ BuchbergerAlg alg
+ (*I, freeModuleOrder, Reducer::reducerType(reducerType),
+ divLookup, preferSparseReducers, spairQueue);
alg.setUseAutoTopReduction(autoTopReduce);
alg.setUseAutoTailReduction(autoTailReduce);
alg.setSPairGroupSize(sPairGroupSize);
+ alg.setThreadCount(threadCount);
alg.computeGrobnerBasis();
std::unique_ptr<Ideal> initialIdeal =
alg.basis().initialIdeal();
diff --git a/src/test/pict.in b/src/test/pict.in
index 59e0e71..0eb81ff 100755
--- a/src/test/pict.in
+++ b/src/test/pict.in
@@ -34,6 +34,7 @@ autoTopReduce: 0,1
preferSparseReducers: 0,1
useSingularCriterionEarly: 0, 1
sPairGroupSize: 0, 1, 2, 10, 100
+threadCount: 1, 2, 8
##############################################################
# PICT submodels go here.
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/mathicgb.git
More information about the debian-science-commits
mailing list