【问题标题】:Stan code works fine but fails on Linux clusterStan 代码工作正常,但在 Linux 集群上失败
【发布时间】:2019-10-14 23:22:54
【问题描述】:

我有一个 stan 模型,它在我自己的笔记本电脑(Ubuntu 16.04)上运行良好,但在集群上运行时失败(Centos 7.3)。

这是我收到的错误消息:

Loading R/3.5.3
  Loading requirement: java/1.8.0_171-oracle
Loading required package: ggplot2
Loading required package: StanHeaders

 *** caught illegal operation ***
address 0x2b87c71f0061, cause 'illegal operand'

Traceback:
 1: get_rng(0)
 2: assign(x, value, envir = ns, inherits = FALSE)
 3: assignInMyNamespace("RNG", value = get_rng(0))
 4: fun(libname, pkgname)
 5: doTryCatch(return(expr), name, parentenv, handler)
 6: tryCatchOne(expr, names, parentenv, handlers[[1L]])
 7: tryCatchList(expr, classes, parentenv, handlers)
 8: tryCatch(fun(libname, pkgname), error = identity)
 9: runHook(".onLoad", env, package.lib, package)
10: loadNamespace(package, lib.loc)
11: doTryCatch(return(expr), name, parentenv, handler)
12: tryCatchOne(expr, names, parentenv, handlers[[1L]])
13: tryCatchList(expr, classes, parentenv, handlers)
14: tryCatch({    attr(package, "LibPath") <- which.lib.loc    ns <- loadNamespace(package, lib.loc)    env <- attachNamespace(ns, pos = pos, deps)}, error = function(e) {    P <- if (!is.null(cc <- conditionCall(e)))         paste(" in", deparse(cc)[1L])    else ""    msg <- gettextf("package or namespace load failed for %s%s:\n %s",         sQuote(package), P, conditionMessage(e))    if (logical.return)         message(paste("Error:", msg), domain = NA)    else stop(msg, call. = FALSE, domain = NA)})
15: library(rstan)
An irrecoverable exception occurred. R is aborting now ...
/opt/sge_spool/8.5.4/dn110/job_scripts/695494: line 9: 31202 Illegal instruction     Rscript MLDS_stan_v3.R

我不明白问题出在哪里,因为相同的脚本在我的笔记本电脑上运行正常。有什么建议吗?

【问题讨论】:

标签: r cluster-computing stan


【解决方案1】:

正如 cmets 中所建议的,问题出在用于安装 RStan 的编译标志中。在我的情况下,问题是通过在单独的库文件夹中重新安装 RStan 和 Rcpp 并使用正确的编译标志来解决的。具体来说,在我的案例中,~/.R/Makevars 文件的内容设置为

CXX14 = g++ -std=c++1y
CXX14FLAGS = -O3 -Wno-unused-variable -Wno-unused-function -fPIC

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-03-01
    • 2015-03-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多