CIL icon indicating copy to clipboard operation
CIL copied to clipboard

cil.utilities.multiprocessing.NUM_THREADS not always available

Open hrobarts opened this issue 2 months ago • 1 comments

Description

cil.utilities.multiprocessing.NUM_THREADS calculates the number of CPUs on the current machine, then returns around half the number which is assumed to be a number of available threads. Elsewhere in CIL we use this number to initiate multiprocessing. However, the number of threads might not actually be available which can cause errors.

Places where cil.utilities.multiprocessing.NUM_THREADS is used

  • IndicatorBox
  • FluxNormaliser
  • TransmissionAbsorptionConvertor
  • GradientOperator
  • DataContainer sapyb _axpby

Environment

import cil, sys
print(cil.version.version, cil.version.commit_hash, sys.version, sys.platform)

hrobarts avatar Oct 10 '25 15:10 hrobarts

@paskino to check the environment variables for Numba and OMP number of threads on the DTU system. Our calculation of number of threads to use should be capped by this.

gfardell avatar Oct 29 '25 16:10 gfardell