NAS Parallel Benchmarks Build

You can download NAS Parallel Benchmarks(NPB) at this link.

First, untar the downloaded tar file.

$tar -xvf ./NPB3.3.1.tar.gz

Since NPB uses Fortran, you have to install gfortran.

$sudo apt-get install gfortran

NPB supports MPI, OMP, and SER. After describing how to build NPB-OMP, I’ll explain how to build NPB-MPI.

1. NPB-OMP build
Copy make.def.template and suite.def.template to make.def and suite.def.
* make.def contains definitions for building NPB.
* suite.def has options for benchmarks.

#under NPB3.3-OMP/config directory
cp make.def.template make.def
cp suite.def.template suite.def

You have to modify make.def a little bit (Thanks to Changhyun Park).

#before modification
#F77 = f77
#after modification
F77 = gfortran

#before modification
#after modification
FFLAGS  = -O -ff2c -mcmodel=medium

#before modification
#after modification
FLINKFLAGS = -fopenmp -O -ff2c

Now you can build NPB-OMP using the following command.

#under NPB3.3-OMP directory
$make suite

You can see binaries under ./NPB3.3-OMP/bin.

$ls ./bin
bt.S.x  dc.S.x  is.S.x  lu.S.x  sp.S.x  ua.S.x

Tip. I don’t know why but the OMP version of NPB3.3 are not parallelized properly at least in my experiment environment. I found SNU-NPB and it works well.

2. NPB-MPI build
To build NPB-MPI, you have to install related libraries[5].

apt-get install openmpi-bin libopenmpi-dev

As you have done to build NPB-OMP, you should create proper configuration files.

cp make.def.template make.def
cp suite.def.template suite.def

After that, you have to configure both files properly[5] (Thank you, Thiago Kenji Okada).

#under NPB3.3-MPI/config directory
sed -i -e 's/f77/mpif77/g' -e 's/cc/mpicc/g' -e 's/-O/-O3 -mcmodel=medium/g' make.def

Additionally, you have to set your build options properly at suite.def. The number of processes should be power of 2 except bt and sp. bt and sp allow power of a natural number as the number of processes. Following is one example of suite.def.


You can run your code with the following command

mpirun ./bin/lu.C.32

References :
[1] NASA Paraellel Benchmarks,
[2] NASA Paraellel Benchmarks, Problem Sizes and Parameters in NAS Parallel Benchmarks,
[3] Fortran, Wikipedia,
[4] Daniel MILLOT et al., From OpenMP to MPI: first experiments of the STEP source-to-source transformation tool
[5] Thiago Kenji Okada, NAS Parallel Benchmark setup script on Ubuntu 14.04,

Tagged with: , , , , ,
Posted in 2) Computer Engineering

Leave a Reply

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

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

Google photo

You are commenting using your Google 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 )

Connecting to %s

Recent Posts
누적 방문자 수
  • 155,077 hits
%d bloggers like this: