工作者初始化失败:并行处理中没有包 [英] worker initialization failed: there is no package in parallel processing
问题描述
我正在尝试使用来自'spatial.tools'R包的R函数 focal_hpc 并行化R中的一个函数.我在SLURM服务器中使用此脚本. 这是我跑步的例子.
I'm trying to parallelise a function in R using the R function focal_hpc from the 'spatial.tools' R package. I'm using this script in a SLURM server. This is an example of what I have run.
f_mean = function(x){mean(x)}
sfQuickInit(cpus=6)
res_mean<-focal_hpc(x=raster,fun=f_mean,window_dims=c(7,7))[[1]]
sfQuickStop()
但是,我确实收到以下错误,但我不明白为什么:
However, I do get the following error and I do not understand why:
Error in e$fun(obj, substitute(ex), parent.frame(), e$data) :
worker initialization failed: there is no package called ‘spatial.tools’
Calls: system.time ... focal_hpc_focal_processing -> %dopar% -> <Anonymous>
我已经在服务器内的本地库中安装了"spatial.tools"软件包,所以我的猜测是该功能无法从本地库加载该软件包.
I have installed the 'spatial.tools' package in a local library within the server, so my guess is that the function is not able to load the package from the local library.
您怎么看?
推荐答案
您是否可以从计算节点加载spatial.tools
程序包?您应该尝试使用命令salloc
分配计算资源,然后启动R并尝试查看是否可以加载程序包spatial.tools
.无论您安装了什么,都需要确保所有计算节点都可以访问(至少具有读取访问权限).
Are you able to load the spatial.tools
package from a compute node? You should try by allocating compute resources with the command salloc
and then start R and try to see if you can load the package spatial.tools
. Whatever you install you need to make sure that all the compute nodes have access (read access at least) to it.
这篇关于工作者初始化失败:并行处理中没有包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!