程序代写 STREAMS EXERCISE

STREAMS EXERCISE

Introduction
• This exercise looks the available memory bandwidth

Copyright By PowCoder代写 加微信 powcoder

• Download streams.tgz from learn
• Extract with tar xvf streams.tgz
• Move into the Streams directory with cd Streams
• Load the compilers module load intel-compilers-19 • Compile using make

• Streams is a standard simple memory bandwidth benchmark
• You may well have already met this code • There are 4 standard tests:
• Copy • Scale • Add • Triad
c[i] = a[i]
b[i] = scalar*c[i]
c[i] = a[i] + b[i]
a[i] = b[i]+scalar*c[i]
• To start with compile and run these standard tests on Cirrus
• The makefile has compiler flags set for large arrays and no- openmp

Additional tests
• Extend the streams code to add more tests
• Introduce a constant for the number of tests
• There are several places where the constant “4” is used
• To add a new test you will have to: • Increase the number of tests constant • Modify the array initialisers
• Add a new benchmark loop
• Add a Strided copy that only adds every-other element of the arrays
• The “bytes” value should be half that of the normal copy

More tests
• Once you have one additional test added it will be easier to add more:
• Things to try:
• Different stride values e.g. 3,4,5, etc. • Strided versions of the other loops
• Indirect addressing.
• Add an array of integers and implement
c[i] = a[idx[i]]
• Start by initialising idx[i] = i but you can also explore the impact of
less local permutations

程序代写 CS代考 加微信: powcoder QQ: 1823890830 Email: powcoder@163.com