Skip to content
nightwnvol edited this page Jul 5, 2024 · 5 revisions

Fitting threads

By default, AMICO uses all the available cores on your machine to speed up the fitting process. However, you can specify the number of threads to use with the nthreads configuration parameter:

import amico

ae = amico.Evaluation()
ae.set_config('nthreads', 4)

Important

The nthreads parameter can be set to any positive integer value. If you set it to -1, AMICO will use all the available CPUs on your machine.

BLAS threads

AMICO limits to 1 the number of threads used in the threadpool-backend of common BLAS implementations (e.g. OpenBLAS). This is done optimize light computations and avoid oversubscription of resources when using multithreaded methods of other packages (e.g. numpy.linalg). You can change this behaviour by setting the BLAS_nthreads configuration parameter:

import amico

ae = amico.Evaluation()
ae.set_config('BLAS_nthreads', 4)

Important

The BLAS_nthreads parameter can be set to any positive integer value. If you set it to -1, AMICO will use all the available CPUs on your machine.