segmentation fault - rstan causing segfault error -
i have following code in rstan 2.16 running on cluster gcc 6.3.0 compiler, being used in loop different inputs each time. however, in random iteration rstan code causes segfault error.
data{ int<lower=0> n; //number of points int<lower=1> d; //dimension int<lower=1> j[n]; //number of observed features each sample int i[d,n]; //observed features matrix[d,n] x; cov_matrix[d] lambda; real<lower=d-1> nu; cov_matrix[d] b; vector[d] m; } parameters{ vector[d] mu; //mean cov_matrix[d] sigma; //covariance } model{ //prior sigma ~ inv_wishart(nu,lambda); mu ~ multi_normal(m,b); //likelihood (i in 1:n){ x[i[1:j[i],i],i] ~ multi_normal(mu[i[1:j[i],i]],sigma[i[1:j[i],i],i[1:j[i],i]]); } }
this error:
* caught segfault * address 0x2afb9e459c60, cause 'memory not mapped'
traceback:
1: .external(list(name = "cppmethod__invoke_notvoid", address = , dll = list(name = "rcpp", path = "/scratch/user/siamak/r_libs/rcpp/libs/rcpp.so", dynamiclookup = true, handle = , info = ), numparameters = -1l), , , .pointer)
2: object@.misc$stan_fit_instance$num_pars_unconstrained()
3: .local(object, ...)
4: get_num_upars(object)
5: get_num_upars(object)
6: throw_sampler_warnings(nfits)
7: .local(object, ...)
8: sampling(sm, data, pars, chains, iter, warmup, thin, seed, init, check_data = true, sample_file = sample_file, diagnostic_file = diagnostic_file, verbose = verbose, algorithm = match.arg(algorithm), control = control, check_unknown_args = false, cores = cores, open_progress = open_progress, include = include, ...)
9: sampling(sm, data, pars, chains, iter, warmup, thin, seed, init, check_data = true, sample_file = sample_file, diagnostic_file = diagnostic_file, verbose = verbose, algorithm = match.arg(algorithm), control = control, check_unknown_args = false, cores = cores, open_progress = open_progress, include = include, ...)
10: stan(file = "obc3.stan", data = dat, fit = fit, iter = iter, warmup = warmup, thin = thin, chains = chains)
11: mcmcstan3(xtrain1, priors1, idx_missing1, warmup, iter, thin, chains, fit1)
an irrecoverable exception occurred. r aborting ...
i appreciate help.
Comments
Post a Comment