Hi,
In
https://trac.sagemath.org/ticket/27444 we are exposing the parallel versions (using OpenMP) of
fflas-ffpack routines used in SageMath. This is only about multicore parallelism, based on OpenMP.
We would like to discuss on the best design to expose them to the end user:
1. Should the default behaviour be sequential or parallel ?
2. If the default is parallel, how many cores should be used by default? I guess the default should
be whatever value openmp_get_numthreads() returns, which is usually the number of cores, however, in
most systems where hyperthreading is enabled, this means that we will use twice as many cores as the
number of real cores, which will slow down the computation.
3. What interface do we want for the sage user who wants to
3a switch between sequential and parallel,
3b specify the number of cores to be used ?
Should there be some kind of environment variable containing such informations?
Note that passing an extra argument is not (always) an option, as we would like that the * operator
for matrices benefits from this parallization.
In its current status, the branch on #27444 calls parallel fgemm when multiplying two modn_dense
matrices over the maximal number of available OMP threads. It currently possible to use a specified
number of threads by exporting OMP_NUM_THREADS=XXX before lauching sage.
Thanks for your feedback.
Clément