Packaging the MADbench2 benchmark

TODO: create a repo with a make make install setup for MB2

Nix Expression

{ stdenv, openmpi }:

stdenv.mkDerivation {
  name = "MADbench2";
  src = ./.;
  buildInputs = [ openmpi ];
  installPhase = ''
    mkdir -p $out/bin
    mpicc -D SYSTEM -D COLUMBIA -D IO -o MADbench2.x MADbench2.c -lm
    mv MADbench2.x $out/bin
  '';
}

Questions:

  • do we make them add to a flake this and import it later?

Try to run the benchmark locally

First, enter a nix shell with the packaged MADbench2 and openmpi.

nix shell .#MADbench2 nixpkgs#openmpi

Once in the shell, you can run the benchmark with:

mpirun -np 4 MADbench2.x 640 8 1 8 8 1 1

It should output the following:

MADbench 2.0 IO-mode
no_pe = 4  no_pix = 640  no_bin = 8  no_gang = 1  sblocksize = 8  fblocksize = 8  r_mod = 1  w_mod = 1
IOMETHOD = POSIX  IOMODE = SYNC  FILETYPE = UNIQUE  REMAP = CUSTOM

S_cc         0.00   [      0.00:      0.00]
S_bw         0.00   [      0.00:      0.00]
S_w          0.01   [      0.01:      0.01]
          -------
S_total      0.01   [      0.01:      0.01]

W_cc         0.00   [      0.00:      0.00]
W_bw         0.12   [      0.12:      0.12]
W_r          0.00   [      0.00:      0.00]
W_w          0.00   [      0.00:      0.00]
          -------
W_total      0.13   [      0.13:      0.13]

C_cc         0.00   [      0.00:      0.00]
C_bw         0.00   [      0.00:      0.00]
C_r          0.00   [      0.00:      0.00]
          -------
C_total      0.00   [      0.00:      0.00]


dC[0] = 0.00000e+00

What interest us in this tutorial is the total time spent writing: W_total.