Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.1k views
in Technique[技术] by (71.8m points)

parallel processing - Error in checkForRemoteErrors(val) : 2 nodes produced errors; first error: subscript out of bounds

I am new in R. I am trying to use the covmat package. I think the problem in parallel process. This is the code

cl <- makeCluster(detectCores())
  clusterExport(cl, varlist = c("lower", "upper", ".obj", "optimx","R"), 
                envir = environment())
  registerDfoParallel(cl)  
  
  objmin <- parRapply(cl, start, function (x)
    try(optimx(x, .obj, lower = lower, upper = upper, method = method, R = R , 
               y.hat = y.hat, Sigma.hat = Sigma.hat, startup_period = startup_period, 
               training_period = training_period, lambda = lambda), silent=TRUE))
  
  fit <- objmin[[unique(which.min(parSapply(cl, objmin, '[[', "value")))]]
  
  stopCluster(cl)
  registerDoSEQ()

And the error is

Error in checkForRemoteErrors(val) : 2 nodes produced errors; first error: subscript out of bounds

And the debug script

function (val) 
{
    count <- 0
    firstmsg <- NULL
    for (v in val) {
        if (inherits(v, "try-error")) {
            count <- count + 1
            if (count == 1) 
                firstmsg <- v
        }
    }
    if (count == 1) 
        stop("one node produced an error: ", firstmsg, domain = NA)
    ***else if (count > 1) 
        stop(count, " nodes produced errors; first error: ", 
            firstmsg, domain = NA)***
    val
}

I dont know how to solve it. Please help me. Thank you

question from:https://stackoverflow.com/questions/65871880/error-in-checkforremoteerrorsval-2-nodes-produced-errors-first-error-subsc

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...