compomics / DeepLC

DeepLC: Retention time prediction for (modified) peptides using Deep Learning.
https://iomics.ugent.be/deeplc
Apache License 2.0
52 stars 18 forks source link

DeepLC (tensorflow) does not seem to obey num_jobs #19

Closed RalfG closed 3 years ago

RalfG commented 3 years ago

DeepLC (tensorflow) does not seem to obey num_jobs, as NUMEXPR_MAX_THREADS env variable is not set.

2021-02-05 08:57:40 // INFO // numexpr.utils // Note: NumExpr detected 32 cores but "NUMEXPR_MAX_THREADS" not set, so enforcing safe limit of 8.
2021-02-05 08:57:40 // INFO // numexpr.utils // NumExpr defaulting to 8 threads.

I would propose to first check if NUMEXPR_MAX_THREADS has already been set, and if not, we can set it to the num_jobs parameter that was passed to DeepLC.

RobbinBouwmeester commented 3 years ago

Dislike doing this... Still did set the NUMEXPR_MAX_THREADS. Should not be done system-wide. The way it is added now will cause bugs/problems in the future.

DeepLC@a69e996

RalfG commented 3 years ago

Strange that it did not work in my case... I'd have to look into what happened.

What do you mean, system-wide? Changes with os.environ() only affect the current process and child-processes (e.g. os.system()), see https://docs.python.org/3/library/os.html#os.putenv.