Learn R Programming

doRedis (version 2.0.0)

setChunkSize: Set the default granularity of distributed tasks.

Description

A job is the collection of all tasks in a foreach loop. A task is a collection of loop iterations of at most size chunkSize. R workers are assigned work by task in blocks of at most chunkSize loop iterations per task. The default value is one iteration per task. Setting the default chunk size larger for shorter-running jobs can substantially improve performance. Setting this value too high can negatively impact load-balancing across workers, however.

Usage

setChunkSize(value = 1)

Arguments

value

positive integer chunk size setting

Value

value is invisibly returned.

Examples

Run this code
# NOT RUN {
setChunkSize(5)
foreach(j=1:10) %dopar% j
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab