SSDM中的socketConnection错误(来自R)

时间:2018-01-26 11:31:19

标签: r parallel-processing cluster-computing bioinformatics

我目前正在使用以下代码通过linux集群运行堆叠物种分布模型:

library(SSDM)

setwd("/home/nikhail1")

Env <- load_var(path = getwd(), files = NULL, format = c(".grd", ".tif", 
".asc",
                                                     ".sdat", ".rst", ".nc", 
".envi", ".bil", ".img"), categorical = "af_anthrome.asc",
            Norm = TRUE, tmp = TRUE, verbose = TRUE, GUI = FALSE)

Occurrences <- load_occ(path = getwd(), Env, file = 
"Final_African_Bird_occurrence_rarefied_points.csv", 
                    Xcol = "decimallon", Ycol = "decimallat", Spcol = 
"species", GeoRes = FALSE,
                    sep = ",", verbose = TRUE, GUI = FALSE)
head(Occurrences)
warnings()
SSDM <- stack_modelling(c("GLM", "GAM", "MARS", "GBM", "RF", "CTA", 
"MAXENT", "ANN", "SVM"), Occurrences, Env, Xcol = "decimallon",
            Ycol = "decimallat", Pcol = NULL, Spcol = "species", rep = 1,
            name = "Stack", save = TRUE, path = getwd(), PA = NULL,
            cv = "holdout", cv.param = c(0.75, 1), thresh = 1001,
            axes.metric = "Pearson", uncertainty = TRUE, tmp = TRUE,
            ensemble.metric = c("AUC", "Kappa", "sensitivity", 
"specificity"), ensemble.thresh = c(0.75, 0.75, 0.75, 0.75), weight = TRUE,
            method = "bSSDM", metric = "SES", range = NULL,
            endemism = NULL, verbose = TRUE, GUI = FALSE, cores = 200)

save.stack(SSDM, name = "Bird", path = getwd(),
       verbose = TRUE, GUI = FALSE)

尝试运行分析时收到以下错误消息:

Error in socketConnection("localhost", port = port, server = TRUE, blocking 
= TRUE,  : 
all connections are in use
Calls: stack_modelling ... makePSOCKcluster -> newPSOCKnode -> 
socketConnection

如何增加最大连接数?我可以在内置SSDM的{​​{1}}包中执行此操作。我是否必须应用其他包中的特定功能以确保我的作业能够跨群集顺利运行?

谢谢你的帮助, Nikhail

1 个答案:

答案 0 :(得分:0)

R中可以拥有的最大打开连接数为125.要增加可以同时打开的连接数,需要从源重建R。看到 https://github.com/HenrikBengtsson/Wishlist-for-R/issues/28