Hi R-INLA group,
I need your help to solve a problem I'm facing.
I'm encountering an issue when running the inla() function in parallel using mclapply (from the parallel package) on a computing cluster. More precisely, I'm using mclapply to run multiple inla() calls in parallel on different datasets. INLA itself also uses internal parallelism, so I reserved half the cores for that purpose. The same inla() model, runned serially (i.e., outside of mclapply), works fine on my local machine but seems to fail on the cluster (even if I execute it serially). However, this issue doesn't occur for all datasets. For some dataframes, the model fails both locally and on the cluster, while others work as expected.
Here are some details:
- Local setup: R version 4.4.3 (2024.12.1) on Windows
- Cluster setup: R version 4.5 (2025.05.0)
- INLA installation command (used both locally and on the cluster): install.packages("INLA", repos = c(getOption("repos"), INLA = "
https://inla.r-inla-download.org/R/stable"), dep = TRUE)
I'm fitting a random error spatial joint model with a Poisson likelihood. The model formula is as follows:
formula <- y ~ -1 + Intercept +
f(sp.1, model = "bym2", scale.model = TRUE, graph = graph) +
f(sp.2, copy = "sp.idx1", hyper = list(beta = list(fixed = TRUE))) +
f(s.2, model = "iid")
inla(formula, data = df, family = "poisson",
control.predictor = list(compute = TRUE), E = E,
control.compute = list(config = TRUE, waic = TRUE), verbose = T)
When running this on the cluster using mclapply and allocating half of the available cores for INLA, I receive the following error:
GitId: b2abbedea53ff456149dbe37d7be47fdd0cfdf9f - Wed Dec 11 22:31:59 2024 +0300
Error:12 Reason: The Newton-Raphson optimizer did not converge
Message: Condition ‘lambda < 1.0 / lambda_lim’ is not TRUE
Line:1026 Function: GMRFLib_init_GMRF_approximation_store__intern
I get the same error for certain datasets even when running locally. I’ve attached one such dataframe that reproduces the issue both on the cluster and on my machine.
Has anyone experienced similar behavior when using INLA with mclapply on a cluster? Could this be related to characteristics of specific datasets, or a version/environment mismatch? Any suggestions for debugging or resolving this would be greatly appreciated.
I could provide supplementary code and datasets if needed.
Thanks in advance!
Best regards,
Florine