hermann on Sun, 03 Dec 2023 12:47:20 +0100


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

PARI/GP pthread questions


1)
single threaded I can measure runtime:

    my(t0=getabstime());
    foursquares(2^p-1);
    print(getabstime()-t0,"ms");

How can I measure runtime in a thread executed with parforeach(...)?
I want to output the results a thread computed, with its own thread runtime. I tried getabstime() asa above, but that reported always icreasing deltas.


2)
Under 3.4.22 nbthreads
...
* pthread: number of threads (unlimited, default: number of cores)
...

On 16C/32T AMD 7950X CPU I see 3200% CPU in top when starting
GP script with parforeach.

So should above doc be corrected to

"default: #cores * #threads_per_cor"

or better to be correct for multi-CPU systems:

"default: #cpus * #cores * #threads_per_core" ?


Regards,

Hermann.