Hi All
I am running approximate Bayesian Computing (ABC) using Sequential Monte Carlo in R with the package ‘EasyABC’. The function I’m using (ABC_sequential) has an argument within it that allows the function to be parallelized across cores (it draws on the package ‘cluster’ to do this).
http://cran.r-project.org/web/packages/EasyABC/EasyABC.pdf
This works fine on my desktop and uses the cores fully. However, I am not sure how to get it to work on the HPC. I have tried but it says it “cannot open the connection”. I’ve also tried setting the function so it is not parallelized and instead specifying use of multiple cores within the PBS script used to submit the R job to the HPC – this doesn’t work either.
Sample code is available within the vignette http://cran.r-project.org/web/packages/EasyABC/vignettes/EasyABC.pdf (my own code is not really simple enough to provide here as an example)
Has anyone managed to use the HPC to run jobs parallelized within the R function rather than through PBS + bash scripts? If so, I would really appreciate some enlightenment on this because my models are taking a LOOOOOOOONG time to run!
Thanks
Sal
--
An R group for questions, tips and tricks relevant to spatial ecology and climate change.
All R questions welcome.
---
You received this message because you are subscribed to the Google Groups "Tropical R" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tropical-r+...@googlegroups.com.
To post to this group, send an email to tropi...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/tropical-r/784FB8B78AB80245ACF1783D83A15249203F4440%40HKXPRD0610MB352.apcprd06.prod.outlook.com.
For more options, visit https://groups.google.com/groups/opt_out.
Hi Jeremy
Thanks for the response. Although the code to run on 4 clusters works for the mcmc function, when I modify it for use with the sequential function it returns the error below (NB: the single core version of this sequential code works fine). Perhaps Wayne Mallet will be able to decipher this for me!
Thanks
Sal
ABC_2<-ABC_sequential(method="Beaumont", model=toy_model,,nb_simul=10,tolerance_tab=c(1.25,0.75),
prior=toy_prior,summary_stat_target=sum_stat_obs,n_cluster=4,use_seed=TRUE) ##modified to use 4 cores
Error in socketConnection("localhost", port = port, server = TRUE, blocking = TRUE, :
cannot open the connection
Calls: ABC_sequential ... makePSOCKcluster -> newPSOCKnode -> socketConnection
In addition: Warning message:
In socketConnection("localhost", port = port, server = TRUE, blocking = TRUE, :
port 10187 cannot be opened
Execution halted
To view this discussion on the web, visit https://groups.google.com/d/msgid/tropical-r/CAJyyApvMA%2BuaX81CKR6cvTAoApxd0vZP-t0ThVKWQ014x0nySg%40mail.gmail.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/tropical-r/784FB8B78AB80245ACF1783D83A15249203F4E0A%40HKXPRD0610MB352.apcprd06.prod.outlook.com.
Hi All
Now I have got it working, here’s what I have discovered. It may be useful for others.
If it is a problem with the HPC, as Wayne says “A system error would abruptly take you out of R and there would be no reference to R functions/methods” within the ‘.out’ file.
When I went back to check my R code again, turns out I hadn’t changed the file path of one of the files that one of the functions was trying to call since testing it on my desktop. This led to the rather uninformative error message:
Error in checkForRemoteErrors(val) :
4 nodes produced errors; first error: cannot open the connection
Calls: ABC_sequential ... clusterApplyLB -> dynamicClusterApply -> checkForRemoteErrors
Execution halted
Moral of the story – if you get the above error message, it means there is something wrong in the R code, NOT on the HPC.
Thanks Jeremy and Wayne!
Cheers
Sal
To view this discussion on the web, visit https://groups.google.com/d/msgid/tropical-r/CAJyyApvNwQRuK5NaEd-5UNbJZwj%3DyC-WdPYT9QuverXVKmGX9Q%40mail.gmail.com.