JAGS 2.1.0 リリース & GCD 対応パッチ [Mac]
JAGS News: JAGS 2.1.0 and rjags 2.1.0 are released
Mac OS X用のGrand Central Dispatch対応パッチはそのままつかえた。
GCD対応パッチ
configure
Mac OS X用のGrand Central Dispatch対応パッチはそのままつかえた。
GCD対応パッチ
*** JAGS-2.1.0/src/lib/sampler/ParallelSampler.cc.orig 2010-01-06 00:22:15.000000000 +0900 --- JAGS-2.1.0/src/lib/sampler/ParallelSampler.cc 2010-05-18 18:05:14.000000000 +0900 *************** *** 5,10 **** --- 5,12 ---- #include <stdexcept> + #include <dispatch/dispatch.h> + using std::vector; using std::logic_error; using std::string; *************** *** 29,37 **** void ParallelSampler::update(std::vector<RNG*> const &rngs) { ! for (unsigned int ch = 0; ch < rngs.size(); ++ch) { _methods[ch]->update(rngs[ch]); ! } } bool ParallelSampler::adaptOff() --- 31,40 ---- void ParallelSampler::update(std::vector<RNG*> const &rngs) { ! dispatch_queue_t gq = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0); ! dispatch_apply(rngs.size(), gq, ^(size_t ch) { _methods[ch]->update(rngs[ch]); ! }); } bool ParallelSampler::adaptOff()
configure
#!/bin/sh CFLAGS='-arch x86_64 -O2 -framework vecLib -g' \ CXXFLAGS='-arch x86_64 -O2 -framework vecLib -g' \ FFLAGS='-arch x86_64 -O2 -framework vecLib -g' \ LDFLAGS='-arch x86_64' \ ./configure --with-blas='-lblas' --with-lapack='-llapack'
コメント 0