首页 > 解决方案 > 如何将 ff 对象传递给集群/节点

问题描述

我有我的数据作为 ff 数组并完美地存储在磁盘上,我正在尝试使用并行计算。数组的名称存储在数据框 DATA.wind 的 Smoothed_name 列中

DATA.wind<-subset(DATA,DATA$variable=="u"|DATA$variable=="v")
# Calculate the number of cores
no_cores <- detectCores() - 1
cl <- makeCluster(no_cores)
#Exporting functions and environment to cluster
clusterExport(cl, list("five_points_smoother","DATA.wind"),envir=globalenv())
 
parLapply(cl,
      1:length(DATA.wind$No),function(x){
        medium1<-five_points_smoother(get(DATA.wind$var_name[x]))
        assign(DATA.wind$Smoothed_name[x],ff(medium1,dim =dim(medium1))) 
      })

当我运行 parLapply 时,我收到此错误:

`  Error in checkForRemoteErrors(val) : 
   one node produced an error: object 'u_1088632800' not found `

知道'u_1088632800'是存储在df中的数组名称之一。

标签: rdoparallelff

解决方案


推荐阅读