Using 2147483647 threads in g*h
four:~/Projects/gmp-ecm$ echo '(2^499-1)/20959' | OMP_NUM_THREADS=8 ./ecm -v -pm1 1e6 1e12
GMP-ECM 7.0.6-dev [configured with GMP 6.2.0, --enable-asm-redc, --enable-openmp] [P-1]
...
Computing F from factored S_1 took 2493ms (544ms real)
Computing h using 8 threads took 283ms (63ms real)
Computing DCT-I of h using 2147483647 threads took 539ms (86ms real)
Multi-point evaluation 1 of 3:
Computing g_i using 8 threads took 1052ms (169ms real)
Computing g*h (A) using 2147483647 threads took 1011ms (146ms real)
Computing gcd of coefficients and N using 8 threads took 274ms (37ms real)
...
Step 2 took 10337ms (1878ms real)
Peak memory usage: 1082MB
2147483647 comes from omp_get_thread_limit()
instead of omp_get_num_threads()
. Should the calls to get_thread_limit()
be changed to get_num_threads()
?