xdas.parallel.get_workers_count#

xdas.parallel.get_workers_count(parallel)[source]#

Get the number of cores to use for multithreaded operations.

Parameters:

parallel (int or bool, optional) – if parallel is an integer, that number of cores will be used. if parallel is a bool either single threading (False) will be used or all cores (True). If parallel is not given (None) the default value taken from the global xdas configuration will be used. You can see and update this value with xdas.config.get(“n_workers”) and xdas.config.set(“n_workers”, <your_value>)

Returns:

n_workers – The number of cores to use.

Return type:

int