ho questo riproducibile R frammentoImpossibile trovare la funzione all'interno clusterApply
rm(list=ls())
library(doSNOW)
f <- function(a, b) a+b
g <- function(c) f(c*c, c+c)
v <- c(1, 2, 3, 4, 5, 6)
cl <- makeMPIcluster(1)
cat(clusterApply(cl, v, g))
stopCluster(cl)
e ottengo il seguente messaggio di errore:
Error in checkForRemoteErrors(val) :
6 nodes produced errors; first error: could not find function "f"
Sto usando R 2.14.1 sotto Ubuntu. MPI è installato e funzionante.
So che esiste un problema simile per il costrutto foreach, ma consente di fare riferimento alle funzioni manualmente tramite il parametro .export. Non ho trovato nulla di simile per clusterApply. C'è una soluzione per questo?
Grazie!