Cmdstan
Overview
Stan: Stan is a state-of-the-art platform for statistical modeling and high-performance statistical computation.
Stan Interfaces:
The Stan modeling language and statistical algorithms are exposed through interfaces into many popular computing environments:
CmdStan: the shell interface to Stan: User Guide.
Using
Use the module name cmdstan
to discover versions available and to load the application.
General Process: There are three core steps to using cmdstan
:
Convert a
.stan
program into a.hpp
file usingstanc
.For example:
stanc src/bernoulli.stan
will generatesrc/bernoulli.hpp
Build the
.hpp
into an executable using make.You will need to use:
make -C $CMDSTAN $(pwd)/src/bernoulli
The
$CMDSTAN
environment variable is set by loading the module and points to themakefile
that comes with the installation, which links to the stan core and math include/libraries which are part of the installation.The
$(pwd)/src/bernoulli
allows you to build the executable within the home/project folder you are currently in.
Running the executable. Since this has been built with
openmpi
, you can't just run this executable, you will need to:Create an interactive
salloc
or submit ansbatch
job.The call:
srun ./src/bernoulli ...
If you fail to use srun
, you will observe the following output:
Multicore
cmdstan
has been built with mpi
capabilities. Due to the domain expertise required to use Stan, this has not been fully tested.
There is a section on Parallelization. Please note, cmdstan
has been built with TBB and MPI capabilities, but not OpenCL.