diff --git a/.gitignore b/.gitignore index fa833e1..777f474 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,7 @@ *.opendb *.db-wal *.ipch -.vs/CMake Overview -.vs/ProjectSettings.json -.vs/slnx.sqlite +.vs/* +build/* +out/* +CMakeSettings.json \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index cd40d1a..7e03786 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -15,12 +15,12 @@ project(muParserProject) # Bump versions on release set(MUPARSER_VERSION_MAJOR 2) set(MUPARSER_VERSION_MINOR 2) -set(MUPARSER_VERSION_PATCH 6) +set(MUPARSER_VERSION_PATCH 7) set(MUPARSER_VERSION ${MUPARSER_VERSION_MAJOR}.${MUPARSER_VERSION_MINOR}.${MUPARSER_VERSION_PATCH}) # Build options option(ENABLE_SAMPLES "Build the samples" ON) -option(ENABLE_OPENMP "Enable OpenMP for multithreading" OFF) +option(ENABLE_OPENMP "Enable OpenMP for multithreading" ON) option(BUILD_SHARED_LIBS "Build shared/static libs" ON) if(ENABLE_OPENMP) diff --git a/include/muParserDef.h b/include/muParserDef.h index f25191b..918e11e 100644 --- a/include/muParserDef.h +++ b/include/muParserDef.h @@ -57,6 +57,10 @@ /** \brief Activate this option in order to compile with OpenMP support. OpenMP is used only in the bulk mode it may increase the performance a bit. + + !!! DO NOT ACTIVATE THIS MACRO HERE IS YOU USE CMAKE FOR BUILDING !!! + + use the cmake option instead! */ //#define MUP_USE_OPENMP diff --git a/src/muParserBase.cpp b/src/muParserBase.cpp index 659b9dd..2fdfcc7 100644 --- a/src/muParserBase.cpp +++ b/src/muParserBase.cpp @@ -1750,7 +1750,7 @@ namespace mu int nThreadID = 0, ct = 0; omp_set_num_threads(nMaxThreads); -#pragma omp parallel for schedule(static, nBulkSize/nMaxThreads) private(nThreadID) +#pragma omp parallel for schedule(static, std::max(nBulkSize/nMaxThreads, 1)) private(nThreadID) for (i = 0; i < nBulkSize; ++i) { nThreadID = omp_get_thread_num(); diff --git a/src/muParserTest.cpp b/src/muParserTest.cpp index 5f73483..945dedf 100644 --- a/src/muParserTest.cpp +++ b/src/muParserTest.cpp @@ -162,14 +162,16 @@ namespace mu //--------------------------------------------------------------------------------------------- int ParserTester::TestBulkMode() { +// return 0; + int iStat = 0; mu::console() << _T("testing bulkmode..."); #define EQN_TEST_BULK(EXPR, R1, R2, R3, R4, PASS) \ - { \ - double res[] = { R1, R2, R3, R4 }; \ - iStat += EqnTestBulk(_T(EXPR), res, (PASS)); \ - } + { \ + double res[] = { R1, R2, R3, R4 }; \ + iStat += EqnTestBulk(_T(EXPR), res, (PASS)); \ + } // Bulk Variables for the test: // a: 1,2,3,4 @@ -177,18 +179,18 @@ namespace mu // c: 3,3,3,3 // d: 5,4,3,2 EQN_TEST_BULK("a", 1, 1, 1, 1, false) - EQN_TEST_BULK("a", 1, 2, 3, 4, true) - EQN_TEST_BULK("b=a", 1, 2, 3, 4, true) - EQN_TEST_BULK("b=a, b*10", 10, 20, 30, 40, true) - EQN_TEST_BULK("b=a, b*10, a", 1, 2, 3, 4, true) - EQN_TEST_BULK("a+b", 3, 4, 5, 6, true) - EQN_TEST_BULK("c*(a+b)", 9, 12, 15, 18, true) + EQN_TEST_BULK("a", 1, 2, 3, 4, true) + EQN_TEST_BULK("b=a", 1, 2, 3, 4, true) + EQN_TEST_BULK("b=a, b*10", 10, 20, 30, 40, true) + EQN_TEST_BULK("b=a, b*10, a", 1, 2, 3, 4, true) + EQN_TEST_BULK("a+b", 3, 4, 5, 6, true) + EQN_TEST_BULK("c*(a+b)", 9, 12, 15, 18, true) #undef EQN_TEST_BULK - if (iStat == 0) - mu::console() << _T("passed") << endl; - else - mu::console() << _T("\n failed with ") << iStat << _T(" errors") << endl; + if (iStat == 0) + mu::console() << _T("passed") << endl; + else + mu::console() << _T("\n failed with ") << iStat << _T(" errors") << endl; return iStat; }