Dear r-sig-hpc,

I am puzzled why my parallel command loses track of my function definitions
during the call.  For instance, consider the following codeblock:


sfInit(parallel=TRUE, cpus=2)
f<- function(x){ dnorm(x, 1, 2) }
g<- function(x){ 2*f(x)}
sfSapply(1:10, g)


This fails to run, giving the error:
Error in checkForRemoteErrors(val) :
  2 nodes produced errors; first error: could not find function "f"

even though it runs fine in serial, with sfInit(parallel=F). Why does the
package loose track of f?  This becomes quite problematic when writing
functions such as g that depend on functions provided by other packages,
etc.  Any suggestions or possible workarounds?

Thanks for your help,

Carl

-- 
Carl Boettiger
Population Biology, UC Davis
http://two.ucdavis.edu/~cboettig

	[[alternative HTML version deleted]]

