View source: R/parallelisingWrappers.R
parallelWrapper | R Documentation |
Parallelising calls to R functions in this package while using the pointer-passing interface requires some care: the getPointerToJumpTransform
and getPointerToGenerator
functions have to be called on the cluster; a call such as parLapply(cl = myCluster, X = uMat.list, fun = affineCF, params.Q = params.Q, params.P = params.P, t.vec = 0.15, v.0 = matrix(0.025,1,1), N.factors = 1, mod.type ='standard', jumpTransform = getPointerToJumpTransform('kouExpJumpTransform'))
will fail because of invalid pointers. This interface delays evaluation of the pointer functions by wrapping the call appropriately.
parallelWrapper(foo, ptrFoo, ptrArg, argName, ptrElem = NULL, ...)
foo |
function to be wrapped |
ptrFoo |
function that finds pointer, takes a single argument |
ptrArg |
argument to ptrFoo |
argName |
character, name of the pointer argument in foo; for example |
ptrElem |
character, if |
Further functions are ready parallel versions of the CF callers.
Returns a function that which should be called with the same arguments as foo
except for the pointer arguments.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.