cpu_count#

caput.util.mpitools.cpu_count(comm: mpi4py.MPI.Comm | None = world, scomm: mpi4py.MPI.Comm | None = None) int | None[source]#

Get the number of CPUs available to each process.

Parameters:
commMPI.Comm | None, optional

MPI communicator.

scommMPI.Comm | None, optional

MPI shared memory communicator.

Returns:
num_coresint | None

Number of cpus available to each process. Returns None if os.cpu_count() is unable to determine the total number of cores.