Repository navigation
This is a maintenance release, the C/C++ API is fully backwards compatible with primecount-9.0.
Packaging primecount
primecount 9.1 replaces OpenMP with a thread pool built on std::thread from the C++ standard library. Packages built with GCC require no changes. For Clang builds, we recommend dropping the now-redundant libomp dependency.
ChangeLog
ThreadPool.cpp: New thread pool designed for primecount, replaces OpenMP.ThreadPool.cpp: Prevent unloadinglibprimecount(e.g.dlclose(),FreeLibrary()) once the thread pool is used.pin_library.cmake: Check fordladdr()anddlopen()withRTLD_NODELETE.- CMake: Remove
WITH_OPENMPoption, primecount is always multi-threaded. D.cpp: Tune threads, up to 1.5x faster, much faster for non-default alpha.AC_*.hpp: Extract AC workers with per-thread state and enable ARM SVE helper inlining.phi.cpp: Tune threads for Legendre and Meissel, up to 2.5x fasterpi_legendre(x).Phi0.cpp: Limit threads tosqrt(y) / 160, up to 2x fasterPhi0(x, y).S2_hard.cpp: Tune threads, up to 3.5x fasterpi_deleglise_rivat(x)for large alpha.S2_easy.cpp: Limit threads tox^(1/3) / 500, up to 1.3x fasterS2_easy(x, y).P3.cpp: Increase number of threads, up to 1.5x fasterP3(x, a).FactorTable.hpp: Usesqrt(y) / 100threads, up to 1.25x fasterpi(x)for x ~ 1e15.FactorTable.hpp: Reuse the primes andPiTableof the caller, up to 2.5x faster initialization.FactorTable.hpp: Initialize the factor table in L2 cache sized segments, up to 2.5x faster.PiTable.cpp: Usesqrt(x) / 300threads inget_primes(), up to 1.05x fasterpi(x).PiTable.cpp: Usesqrt(x) / 400threads to initialize thePiTable, up to 1.03x fasterpi(x).AC_fastdivider.hpp: Usesqrt(primes) / 60threads to initializeFastDivider, up to 1.05x fasterpi(x).doc/StatusS2-tuning.md: Remove OpenMP from the logging patch.nth_prime_sieve.cpp: Use nested parallel jobs instead of OpenMP tasks.nth_prime_sieve.cpp: Round up threads per segment, up to 1.2x faster sieving.- Update to primesieve-12.18 library which fixes GCC < 14 crashes on ARM64 CPUs without ARM SVE.
actions.lock: Lock GitHub Actions to exact commits to prevent supply chain attacks.test/StatusS2.cpp: Fix broken test on i586 OpenSUSE.LogarithmicIntegral.cpp: Usemax()instead ofinfinity()for-ffast-mathcompatibility.RiemannR.cpp: Usemax()instead ofinfinity()for-ffast-mathcompatibility.int128_t.hpp: Removepstd::numeric_limits<T>::infinity().util.cpp: Fix ambiguouslog()andsqrt()calls withint128_tin strict C++14 builds.- Windows build scripts: Use primecount-9.0 archives for
README.txt.