The Glasgow Parallel Reduction Machine, GPRM, is a task-based parallel programming framework.
The essential prerequisites to build parallel programs using GPRM are a C++11 compliant compiler and the SCons build system.
In principle any C++11-compliant compiler is fine, I use g++
.
For building GPRM-based applications you need scons
:
# `git clone` the repo
The environment variable GPRM_DIR
must be set to full path to the gprm
directory.
$ cd gprm
$ export GPRM_DIR=$PWD
The file etc/gprmc
contains the environment settings for GPRM.
To source it, put
source "$GPRM_DIR/etc/gprmrc"
in your .bashrc
(Linux) or .profile
(Mac)
That's it, you can start using GPRM!
Create a skeleton example gprm-project-skeleton
:
$ gprm -i
Or copy the example from $GPRM_DIR/examples
. To build e.g. the HelloWorld
example with 4 threads:
$ gprm -t HelloTask -n 4
To run it:
$ ./main
There is no real need to build the framework unless you want to tinker with it. In that case you also need:
The actual GPC compiler and bytecode generator is written in Haskell
.
-
ghc >= 7.6.3 to compile the Gannet compiler,
-
Install the Haskell Platform
-
Install the following Haskell packages with
cabal
:$ cabal install lens $ cabal install errors $ cabal install wl-pprint $ cabal install HsSyck
The extensive code generation done by the GPRM build system is done using Perl
.
-
Install the YAML::Syck Perl module from CPAN, the easiest way is to install
cpanm
first, then do$ cpanm YAML::Syck