Skip to content

WTF MCMC?!

February 14, 2013

I’ve recently written my first R package using RcppArmadillo, but there are a few things about the performance of my code that puzzle me:

  • I switched from using the Hadamard (element-wise) product to taking the log and then summing, a common statistical practice. This appeared to make my code 50% slower, so I’ve backed out the change.
  • I compiled R from source using the Intel C, C++ & Fortran compilers on Linux and also replaced Rblas with MKL. The resulting code runs slower on my university’s SGI Altix cluster than the R compiled with gcc that was already available via PBS.
  • Most of the compute nodes in the SGI cluster are dual-CPU, Xeon E5-2670 (8 cores @2.66GHz), therefore I can run up to 16 compute threads on a single node. However, 16 threads is actually slower than 6 threads.

parallel

The relationship one would expect to see is that the elapsed time halves when the number of cores doubles (excluding some parallel overhead) while the CPU time remains constant (plus overhead). However, according to these CPU usage figures, the addition of more threads adds nothing but overhead:

parallel2

Yep, looks pretty linear…

Advertisements

From → R

One Comment

Trackbacks & Pingbacks

  1. Numerical stability | Matt Moores

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Let's Look at the Figures

David Firth's blog

Nicholas Tierney

Computational Bayesian statistics

One weiRd tip

Computational Bayesian statistics

Series B'log

discussion blog for JRSS Series B papers

Mad (Data) Scientist

Musings, useful code etc. on R and data science

R-bloggers

R news and tutorials contributed by (750) R bloggers

Another Astrostatistics Blog

The random musings of a reformed astronomer ...

Darren Wilkinson's research blog

Statistics, computing, data science, Bayes, stochastic modelling, systems biology and bioinformatics

CHANCE

Computational Bayesian statistics

StatsLife - Significance magazine

Computational Bayesian statistics

(badness 10000)

Computational Bayesian statistics

Igor's Blog

Computational Bayesian statistics

Statisfaction

I can't get no

Xi'an's Og

an attempt at bloggin, nothing more...

Sam Clifford

Postdoctoral Fellow, Bayesian Statistics, Aerosol Science

Bayesian Research & Applications Group

Frontier Research in Bayesian Methodology & Computation

%d bloggers like this: