clusterSize | R Documentation |
These functions help in optimizing workload for the workers if problems are of different size.
clusterSize(size)
plotClusterSize(n, size,
balancing = c("none", "load", "size", "both"),
plot = TRUE, col = NA, xlim = NULL, ylim = NULL,
main, ...)
n |
Number of workers. |
size |
Vector of problem sizes (recycled if needed).
The default |
balancing |
Character, type of balancing to perform, one of
|
plot |
Logical, if a plot should be drawn. |
col |
Color of the polygons for work load pieces. |
xlim, ylim |
Limits for the x and the y axis, respectively (optional). |
main |
Title of the plot, can be missing. |
... |
Other arguments passed to |
These functions help determine the optimal number of workers needed for different sized problems ('size' indicates approximate processing time here). The number of workers needed depends on the type of balancing.
For the description of the balancing types, see
parDosa
.
clusterSize
returns a data frame with approximate
processing time as the function of
the number of workers (rows, in 1:length(size)
) and
the type of balancing (c("none", "load", "size", "both")
).
Approximate processing time is calculated from values in size
without taking into account any communication overhead.
plotClusterSize
invisibly returns the total
processing time needed for a setting given
its arguments. As a side effect, a plot is produced
(if plot = TRUE
).
Peter Solymos, solymos@ualberta.ca
## determine the number of workers needed
clusterSize(1:5)
## visually compare balancing options
opar <- par(mfrow=c(2, 2))
plotClusterSize(2,1:5, "none")
plotClusterSize(2,1:5, "load")
plotClusterSize(2,1:5, "size")
plotClusterSize(2,1:5, "both")
par(opar)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.