Use of memory bandwidth test-stream

Source: Internet
Author: User

One: The origin of the stream

The Stream test tool was presented and completed by Professor John McCalpin of the University of Delaware, USA, and now with the change of Professor John McCalpin's work, the stream is responsible for The maintenance and improvement of all staff were also transferred to the Department of Computer Science at Virginia University.

Two: the use of stream

Stream is a set of comprehensive performance test assemblies, written in Fortran and C two advanced and efficient languages, due to the high efficiency of the two languages in mathematical computing, the stream test routines can give full play to the memory capacity. STREAM tests the maximum amount of memory bandwidth that can be run sustainably, rather than the theoretical maximum provided by a typical hardware vendor.

Three: Software Environment preparation

With the latest kernel version of Linux, when testing the system boot to single user mode, you can edit the/etc/inittab file by editing the
Id:5:initdefault
Edit as
Id:3:initdefault
Removing some unnecessary system daemons, you can run the NTSYSV command to turn off system service processes other than irqbalance and Messagebus, as well as conserve system resources.

Four: how to use Stream

1. Download Stream source program Stream.tar (http://www.nersc.gov/users/computational-systems/cori/nersc-8-procurement/ trinity-nersc-8-rfp/nersc-8-trinity-benchmarks/stream/)

2, decompression Stream.tar, into the directory stream;

3. Open the makefile file (e.g.), modify the compiler according to the platform, and open the required compilation options, for example: open #cflags + =-fopenmp compile option with multithreading, etc.


Compile make;

4, implementation (results such as)

./stream_c.exe


5. Implementation result Description

The above tests are the default single-threaded test results.

There are four main types of array operations that test the performance of memory bandwidth, respectively:
The array is copied (copy), the array's scale transforms (scales), the vector summation (ADD) of the array, and the compound vector summation (Triad) of the array.
Size of array: array size= 20000000

V: Data dimension n Definition

where STREAM array_size has a large impact on test results . Modifies the size of the array, the number of iterations, the offset of the array, and so on in the source file. Where the offset of the array is best aligned (for example).


where n Specifies the size of the a[],b[],c[] Three array in the calculation , and the value of the array is double-precision (8 bytes). The following points need to be noted when defining the dimension n of an array:

First, to fully consider the requirements of memory capacity, a rough estimate is Nx8 (double precision) x3 (three arrays) <= 0.6*m;m is the user's available memory.
Second, to ensure that the test process, the use of memory capacity is greater than the cache within the processor, only in this way there will be memory operations, not just the operation of the cache within the processor.
Third, in order to ensure that the test can last for a period of time, the memory bandwidth can reach a certain maximum value, so as not to get the actual maximum peak, if the four test has a completion time of less than 20 microseconds, it is necessary to increase the size of the test array dimension N.

In addition, it should be noted that:-mcmodel=medium; when a single Memory Array Size is greater than 2GB, you need to add this parameter to the compilation option, or compile an error.


Use of memory bandwidth test-stream

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.