distributeVector: Distribute a Vector to the Slave Processes

View source: R/collectDistribute.R

distributeVectorR Documentation

Distribute a Vector to the Slave Processes

Description

distributeVector distributes a vector to the slave processes, breaking into the appropriate pieces, in some cases with padded elements. Objects can be distributed to environments and ReferenceClass objects as well as the global environment on the slave processes.

Usage

distributeVector(obj, objName = deparse(substitute(obj)), objPos = '.GlobalEnv', n, h = 1)

Arguments

obj

object on master process to be copied, given either as the name of an object or as a character.

objName

an object name, given as a character string, giving the name to be used for the object on the slave processes. If not provided, will be the same as the name of obj in the calling environment.

objPos

where to do the assignment, given as a character string (unlike assign). This can indicate an environment or a ReferenceClass object.

n

a positive integer, the length of the vector.

h

a positive integer, the block replication factor, h, to be used when distributing the vector.

See Also

push collectVector collectTriangularMatrix collectRectangularMatrix collectDiagonal

Examples

## Not run: 
bigGP.init(3)
n <- 3000
x <- rnorm(n)
distributeVector(x, 'tmp', n = n)
y <- collectVector('tmp', n = n)
identical(x, y)

## End(Not run)

bigGP documentation built on April 26, 2023, 1:16 a.m.