Skip to content
Branch: master
Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
..
Failed to load latest commit information.
lv.data.R
lv.stan
lv_group.stan
lv_pmx.stan
mpi_n_1_sample.csv
mpi_n_2_sample.csv
mpi_n_4_sample.csv
mpi_n_8_sample.csv
pmx_sample.csv
readme.md
readme.org
stan_sample.csv

readme.md

Predator-Prey model based on https://mc-stan.org/users/documentation/case-studies/lotka-volterra-predator-prey.html

Build

Edit/Add cmdstan/make/local

TORSTEN_MPI = 1                                         # flag on torsten's MPI solvers
CXXFLAGS += -isystem /usr/local/include                 # path to MPI library's headers

Build in cmdstan

make ../example-models/lotka_volterra_ode_group_model/lv_group

Run

mpiexec -n 2 lv_group sample data file=lv_group.data.R

Results

Three binaries are built and used to run:

  • sequential run using Stan's rk45 integrator.
  • sequential run using Torsten's rk45 integrator.
  • MPI run using Torsten's rk45 group integrator(with 2, 4, 8 processes, respectively).

The wall time of sequential runs and MPI runs(in seconds) with ODE group size 16.

run wall time(s)
Sequential stan 2135
sequential pmx 2570
MPI pmx (nproc=1) 2107
MPI pmx (nproc=2) 1187
MPI pmx (nproc=4) 715
MPI pmx (nproc=8) 467
You can’t perform that action at this time.