1

When using scipy RBF interpolation routines it seems that all the cores are used by default. This is ideal to speed up the computation but not ideal on machines where there are other jobs running and the resources are shared.

Is there any way to limit the number of CPU cores available to scipy for computation when interpolating?

Droid
  • 441
  • 1
  • 3
  • 18
  • On Linux, you can run your program [under `taskset`](https://man7.org/linux/man-pages/man1/taskset.1.html) so it only sees a number of CPUs... – AKX Sep 11 '22 at 09:55
  • [This answer](https://stackoverflow.com/a/56126088/51685) may also help. – AKX Sep 11 '22 at 09:59
  • Interesting, but how can I know which external library using multiple cores are the interpolate functions exploiting? Not sure openBLAS applies to me in this case – Droid Sep 11 '22 at 10:26

1 Answers1

1

Ok, as suggested doing

os.environ["OPENBLAS_NUM_THREADS"] = "4"

before importing anything else related to numpy or scipy fixed the issue

Droid
  • 441
  • 1
  • 3
  • 18