Abstract function application for a distributed object.

do.dcall(what, args, balance = FALSE)
d(what)

Arguments

what

Function to apply.

args

List of arguments, including distributed objects.

balance

Logical, to balance results over cluster.

Details

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.

Value

d

Returns a distributed version of the input function. Function application returns a DistributedObject.

do.dcall

DistributedObject.

See also

Examples


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>