pylfi.utils.check_and_set_jobs¶
- pylfi.utils.check_and_set_jobs(n_jobs, logger=None)[source]¶
Check and set passed number of jobs.
Checks whether passed
n_jobshas correct type and value, raises if not.If n_jobs exceeds the number of available CPUs found by
Pathos(this might include hardware threads),n_jobsis set to the number found byPathos.If
n_jobs=-1, then n_jobs is set to half of the CPUs found byPathos(we assume half of the CPUs are only hardware threads and ignore those).- Parameters
- n_jobs
int Number of processes (workers) passed by user.
- logger
logging.Logger Logger object.
- n_jobs
- Returns
- n_jobs
int Possibly corrected number of processes (workers).
- n_jobs