JuliaParallel / Dagger.jl

A framework for out-of-core and parallel execution
Other
621 stars 67 forks source link

API Request: number of processors (including threads) #474

Closed schlichtanders closed 4 months ago

schlichtanders commented 5 months ago

I saw that shard is able to compute the number of processors, optionally also including threads.

https://github.com/JuliaParallel/Dagger.jl/blob/cec17a14f75523bdcae3a6b00ede6c22d1d0fe9f/src/chunks.jl#L176-L198

It would be great if this could be available via an API like Dagger.nprocs

jpsamaroo commented 5 months ago

We now have Dagger.all_processors() and Dagger.compatible_processors(scope::Dagger.AbstractScope) for getting the set of processors, and so we could implement a Dagger.num_processors() that does what you ask. I would avoid overloading nprocs, since Distributed exports that as well (and we use it in Dagger internally).