diff options
author | 2019-10-04 22:34:46 +0200 | |
---|---|---|
committer | 2019-10-04 22:34:46 +0200 | |
commit | 43cac214a40f1d61d4a04c3727687b1f70b2c13d (patch) | |
tree | a3a97dd067534653b7e206518120169e7135da31 /src/lib/netlist/plib/pomp.h | |
parent | 7fc40fc9585c1488bb089f3bbe217ec996f5caed (diff) |
netlist: code maintenance (nw)
- Fix SUBMODEL
- move to strongly typed matrix sort constant
- extend maximum matrix size to 512x512
- optionally do parallel processing based on total operations
- templatize GMRES solver loops
Diffstat (limited to 'src/lib/netlist/plib/pomp.h')
-rw-r--r-- | src/lib/netlist/plib/pomp.h | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/src/lib/netlist/plib/pomp.h b/src/lib/netlist/plib/pomp.h index ecd9eacc41b..400fbee9e64 100644 --- a/src/lib/netlist/plib/pomp.h +++ b/src/lib/netlist/plib/pomp.h @@ -22,18 +22,29 @@ namespace plib { namespace omp { template <typename I, class T> -void for_static(const I start, const I end, const T &what) +void for_static(std::size_t numops, const I start, const I end, const T &what) { -#if HAS_OPENMP && USE_OPENMP - #pragma omp parallel -#endif + if (numops>1000) { -#if HAS_OPENMP && USE_OPENMP - #pragma omp for //schedule(static) -#endif + #if HAS_OPENMP && USE_OPENMP + #pragma omp parallel for schedule(static) + #endif for (I i = start; i < end; i++) what(i); } + else + for (I i = start; i < end; i++) + what(i); +} + +template <typename I, class T> +void for_static(const I start, const I end, const T &what) +{ +#if HAS_OPENMP && USE_OPENMP + #pragma omp parallel for schedule(static) +#endif + for (I i = start; i < end; i++) + what(i); } template <typename I, class T> |