Based on the install manual, there are a number of ways to compile JAGS
against different BLAS libraries. I have tried a number of them, but I am
still unable to get JAGS to to run multiple chains on multiple cores. Has
anyone successfully had JAGS running on multiple cores, short of starting
multiple instances of JAGS?
Yes, I have successfully run JAGS on multiple cores on a Gentoo GNU/Linux
using the Atlas BLAS library and compiling JAGS against it.
Which OS do you use? Which "configure" command do you run? Please, specify
more details so that we can help you.
I am running 64-bit Ubuntu (lucid) with an AMD processor. I have tried a
couple of different "configure" commands, all based on what is recommended in
the manual. For example, I tried to use the AMD math libraries with:
CXXFLAGS="-O2 -g -fopenmp" ./configure --with-blas="-lacml_mp -lacml_mv
I have also used the GOTO BLAS libraries, using the stock "./configure" after
replacing the default BLAS libraries with GOTO. I know the GOTO BLAS libraries
are multi-core, as it works under R.
Thanks for any help
A few points:
I have not tried the ACML, but I have successfully build jags to run with
GotoBLAS2, with multiple chains. I use:
LDFLAGS="-L/usr/local/GotoBLAS2" ./configure CFLAGS="-march=core2 -O2 -fomit-
frame-pointer" FFLAGS="-march=core2 -O2 -fomit-frame-pointer"
CXXFLAGS="-march=core2 -O2 -fomit-frame-pointer"
make BINARY=64 TARGET=CORE2 USE_THREAD=1
As martyn_plummer points out, probably BLAS is not the bottleneck, even if it
can make some differences.
I just tested JAGS compiled against ACML on my quad-core desktop using the
model "birats2.bug" from the classic bugs examples, volume 1. It does run
multi-threaded, but in performance terms, single threaded is the best!
All the multi-threaded runs take between 25-30 seconds, as opposed to 15
seconds from the single threaded version. As we add more threads, the "user"
time increases (this is the sum of the different cores) but the real time does
Thank you for the useful replies. I have just acquired a quad-core processor,
so as soon as I get that installed and running, I can begin to test these