allocateJobs: Divide tasks among workers

Description Usage Arguments Details Value Author(s) Examples

Description

This function calculates an even splitting of a given number of tasks among a given number of workers (threads).

Usage

1
allocateJobs(nTasks, nWorkers)

Arguments

nTasks

number of tasks to be divided

nWorkers

number of workers

Details

Tasks are labeled consecutively 1,2,..., nTasks. The tasks are split in contiguous blocks as evenly as possible.

Value

A list with one component per worker giving the task indices to be worked on by each worker. If there are more workers than tasks, the tasks for the extra workers are 0-length numeric vectors.

Author(s)

Peter Langfelder

Examples

1
2
allocateJobs(10, 3);
allocateJobs(2,4);


Search within the WGCNA package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.