I am an ecologist beginning to use NIMBLE on a high-performance computing (HPC) system running Ubuntu. My code runs fine on a Windows PC, but I encounter an error related to CAR and automatic differentiation (AD) when running it on the HPC.
I’m using R version 4.3.1 with NIMBLE 1.3.0, and my model includes a CAR prior and a modified "barker" sampler. The R script is attached.
I have tried to search but didn't get any solutions.
> printErrors()
using C++ compiler: ‘x86_64-conda-linux-gnu-c++ (conda-forge gcc 11.2.0-16) 11.2.0’
P_1_CAR_dot_Nmix_dot_B_MID_1_nfCode.cpp: In member function 'virtual CppAD::AD<double> lifted_CAR_calcNumIslands_oPadj_oB1to144_cB_comma_num_oB1to25_cB_cP_L9_UID_9::calculate_ADproxyModel(const indexedNodeInfo&) const':
P_1_CAR_dot_Nmix_dot_B_MID_1_nfCode.cpp:1209:110: error: invalid initialization of reference of type 'NimArr<1, double>&' from expression of type 'NimArr<1, CppAD::AD<double> >'
1209 | (**ADproxyModel_lifted_CAR_calcNumIslands_oPadj_oB1to144_cB_comma_num_oB1to25_cB_cP)[0] = CAR_calcNumIslands(Interm_43, Interm_44);
| ^~~~~~~~~
P_1_CAR_dot_Nmix_dot_B_MID_1_nfCode.cpp:1070:50: note: in passing argument 1 of 'double CAR_calcNumIslands(NimArr<1, double>&, NimArr<1, double>&)'
1070 | double CAR_calcNumIslands ( NimArr<1, double> & ARG1_adj_, NimArr<1, double> & ARG2_num_ ) {
| ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~
P_1_CAR_dot_Nmix_dot_B_MID_1_nfCode.cpp: In member function 'virtual CppAD::AD<double> rho_L9_UID_10::calculate_ADproxyModel(const indexedNodeInfo&) const':
P_1_CAR_dot_Nmix_dot_B_MID_1_nfCode.cpp:1468:54: error: invalid initialization of reference of type 'NimArr<1, double>&' from expression of type 'NimArr<1, CppAD::AD<double> >'
1468 | (**ADproxyModel_logProb_rho)[0] = nimArr_dcar_normal(Interm_74, Interm_75, Interm_76, Interm_77, Interm_78, Interm_79, 1, 1);
| ^~~~~~~~~
In file included from /bimo/anaconda3/envs/r-nimble-gcc11/lib/R/library/nimble/include/nimble/predefinedNimbleLists.h:12,
from /bimo/anaconda3/envs/r-nimble-gcc11/lib/R/library/nimble/include/nimble/nimbleCppAD.h:41,
from P_1_CAR_dot_Nmix_dot_B_MID_1_nfCode.cpp:7:
/bimo/anaconda3/envs/r-nimble-gcc11/lib/R/library/nimble/include/nimble/nimDists.h:63:46: note: in passing argument 1 of 'double nimArr_dcar_normal(NimArr<1, double>&, NimArr<1, double>&, NimArr<1, double>&, NimArr<1, double>&, double, int, int, int)'
63 | double nimArr_dcar_normal(NimArr<1, double> &x, NimArr<1, double> &adj, NimArr<1, double> &wgts, NimArr<1, double> &num, double tau, int c, int zero_mean, int give_log);
| ~~~~~~~~~~~~~~~~~~~^
make: *** [/bimo/anaconda3/envs/r-nimble-gcc11/lib/R/etc/Makeconf:200: P_1_CAR_dot_Nmix_dot_B_MID_1_nfCode.o] Error 1
--
You received this message because you are subscribed to the Google Groups "nimble-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nimble-users...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/nimble-users/c692e9e0-2ef5-4f98-92e4-fd39b997651fn%40googlegroups.com.
Dear Chris,
Sorry, I was rushing to get it done yesterday. I believe the main issue was an incompatibility between Nimble and R. I reinstalled R version 4.4.3, which works on my PC. Both the older version (4.3.1) and the newer version (4.5.1) seemed to cause problems.
I also reinstalled Nimble (v1.3.0) along with all the other necessary packages. However, some R packages—like MCMCvis and mcmcOutput—had to be installed directly through the R console (they couldn't be installed via Ubuntu). In particular, installing MCMCvis took quite a bit of time, possibly due to incompatibility among its dependencies. After reinstalling everything with compatible versions, the model ran fine.
But, I’m still unable to set up parallel processing with Nimble on Ubuntu with doParallel package.
Best,To view this discussion visit https://groups.google.com/d/msgid/nimble-users/f68cf7ac-ac98-402c-8c34-45edcd95ebf7n%40googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/nimble-users/f3bc6e31-86d3-42c4-9e81-25d55cbba2d4n%40googlegroups.com.
Thanks for your information.
I am looking for an example of doing parallel MCMC in R, according to Chris's suggestion. Is there any off-line document that you can share?
Your help would be greatly appreciated.
Dusit
-- ดุสิต งอประเสริฐ Dusit Ngoprasert Conservation Ecology Program, School of Bioresources and Technology, King Mongkut’s University of Technology Thonburi (Bangkhuntien campus) Address: 49 Thakham, Bangkhuntien, Bangkok, 10150 Thailand Tel: +66 81 710 4734 Email: ndu...@gmail.com; dusi...@kmutt.ac.th website: https://cons-ecol-kmutt.weebly.com/ "You cannot hope to build a better world without improving the individuals. To that end, each of us must work for our own improvement", Marie Curie
To view this discussion visit https://groups.google.com/d/msgid/nimble-users/3844da61-ae5d-4611-ad93-e8117a07dad9%40gmail.com.
Dear Chris,
Thank you so much.
Best regards,
Dusit