Stan Math Library
5.0.0
Automatic Differentiation
|
|
inline |
Maps jobs of given chunk size to workers and returning a vector of counts.
The returned vector is indexed by the rank of each worker and has size equal to the # of workers. Each count per worker is the product of the number of assigned jobs times the chunk size. The jobs are deterministically assigned to workers. This is used for static scheduling of jobs internally.
So with num_workers workers, then the counts for worker with given rank is
chunks[rank] = floor(num_jobs/num_workers) * chunk_size
The remainder jobs num_jobs % num_workers are assigned to rank >=1 workers such that the root (rank = 0) has a little less assigned chunks unless num_jobs < num_workers in which case the first num_jobs nodes receive a job (including the root).
num_jobs | Total number of jobs to dispatch |
chunk_size | Chunk size per job |
Definition at line 84 of file mpi_cluster.hpp.