Is there a `pathos`-specific way to determine the number of CPU cores?

Viewed 331

I want to determine the number of physical CPU cores to size the number of nodes for a ProcessPool accordingly.

from pathos.pools import ProcessPool
process_pool = ProcessPool(nodes=?)

I know that psutil provides this number as described below.

import psutil
process_pool = ProcessPool(nodes=psutil.cpu_count(logical=False))

However, is there a canonical pathos-specific way of adjusting the node parameter?

1 Answers

The usage in pathos is very similar to psutil

>>> import pathos as pa             
>>> pa.helpers.cpu_count()
8
Related