do.dcall.Rd
Abstract function application for a distributed object.
do.dcall(what, args, balance = FALSE)
d(what)
Function to apply.
List of arguments, including distributed objects.
Logical, to balance results over cluster.
do.dcall
asynchronously requests the function application over a distributed object, with the remote nodes taking care of argument location and transfers.
d
wraps do.dcall
, returning a distributed function.
Returns a distributed version of the input function. Function application returns a DistributedObject.
DistributedObject.
d.model.matrix <- d(model.matrix)
d.model.matrix(object=~ a + b, dd)
#> Error in do.dcall(what, args = list(...)): object 'dd' not found
##---- Should be DIRECTLY executable !! ----
##-- ==> Define data, use random,
##-- or do help(data=index) for the standard data sets.
## The function is currently defined as
function (what, args, balance = FALSE)
{
if (inherits(args, "DistributedObject"))
stop("Requires list for argument, not distributed object")
prealigned_args <- lapply(args, prealign)
aligned_args <- do.call(mapply, c(list, prealigned_args,
SIMPLIFY = FALSE, USE.NAMES = FALSE))
chunks <- chunknet::do.ccall(rep(list(what), length(aligned_args)),
aligned_args, balance = balance)
DistributedObject(chunks)
}
#> function (what, args, balance = FALSE)
#> {
#> if (inherits(args, "DistributedObject"))
#> stop("Requires list for argument, not distributed object")
#> prealigned_args <- lapply(args, prealign)
#> aligned_args <- do.call(mapply, c(list, prealigned_args,
#> SIMPLIFY = FALSE, USE.NAMES = FALSE))
#> chunks <- chunknet::do.ccall(rep(list(what), length(aligned_args)),
#> aligned_args, balance = balance)
#> DistributedObject(chunks)
#> }
#> <environment: 0x55b7a942b198>