Adam M. Wilson - 2014-10-02

If all you want is a few chains run in parallel, it's pretty easy to do this (with foreach package):

:::r

results=foreach(ch=1:nchains) %dopar% {

hSDM.ZIB(...,seed=sample(1:1e6,1)) }

the advantage of foreach is you can set up many different types of backends that work on just about any machine... It probably wouldn't be too hard to wrap this loop inside the call with something like this:

:::r

hSDM.ZIB.parallel(...,chains=3) {

if(chains>1) {

results=foreach(ch=1:nchains) %dopar%

hSDM.ZIB(...,seed=sample(1:1e6,1))

One idea to facilitate saving full posterior predictions over large regions is to use the netcdf library to write samples to disk every so often as you go (so you don't have to hold it all in memory. Netcdf supports parallel writes, so the parallel chains could write to the same file at the same time safely. That would go well with my idea that netcdf is a nice container to hold hSDM output...