A Revision of the NASA Kernel Benchmark Program

NAS is a C++ program which is a revision of David Bailey's NASA kernel benchmark program.

The NAS benchmark program was developed around 1984, and measured computational performance on a representative range of realistic calculations. One motivation for this benchmark was to move beyond the LINPACK benchmark, which focussed on a single highly structured procedure.

Benchmarking computers has become much more difficult now that memory, I/O, multicores and distributed memory have all become significant factors in computing performance. Nonetheless, the NAS benchmarks provide an interesting insight into the floating point processing power of a system, and so, for this reason, a version of the program has been created that retains the functionality of the original, while being somewhat easier to transfer to other languages.

One might expect comparable numerical performance of C++ and FORTRAN programs. That this does not seem to happen for the C++ and FORTRAN90 versions of NAS reflects, most likely, the fact that the C++ version was "translated" in a fairly straightforward manner, resulting in some awkward and inefficient expressions; in particular, FORTRAN arrays which were multiply-indexed were implemented in C++ as vectors, with the resulting overhead of computing indices explicitly. Thus, it is likely that a more careful revision of the C++ source code would result in substantial performance improvements. I, on the other hand, am simply terribly relieved that the C++ program gets the right answers.


The computer code and data files described and made available on this web page are distributed under the GNU LGPL license.


NAS is available in a C version and a C++ version and a FORTRAN77 version and a FORTRAN90 version and a MATLAB version and a Python version.

Related Data and Programs:

LINPACK_BENCH, a C++ program which measures the time taken by LINPACK to solve a particular linear system.

MATMUL, a C program which is an interactive matrix multiplication benchmark.

MDBNCH, a FORTRAN77 program which is a benchmark molecular simulation calculation.


  1. David Bailey, John Barton,
    The NAS Kernel Benchmark Program,
    Numerical Aerodynamics Simulations Systems Division,
    NASA Ames Research Center,
    13 June 1986.

Source Code:

Examples and Tests:

List of Routines:

You can go up one level to the C++ source codes.

Last revised on 11 November 2010.