#! /bin/bash

# Processor: Intel i7-2600, 3.4 GHz, 8MB L3 Cache
# Running with 4 cores and 8 threads (HT on)
# Board / Chipset: Intel DQ67SWB3 / Q67
# Memory: 4 * 4GB DDR3 1333 MHz 

# OS is an Ubuntu 11.04 64Bit
# uname -a gives:
# Linux halbacht 2.6.38-8-generic #42-Ubuntu SMP Mon Apr 11 03:31:24 UTC 2011 x86_64 x86_64 x86_64 GNU/Linux


# gcc -V gives:
# gcc (Ubuntu/Linaro 4.5.2-8ubuntu4) 4.5.2
# Copyright (C) 2010 Free Software Foundation, Inc.
# ...

gcc -O3 stream.c -o stream-single
gcc -O3 -fopenmp stream.c -o stream-openmp

echo Running single threaded:
time ./stream-single >stream-single.txt 2>&1

for OMP_NUM_THREADS in 1 2 3 4 5 6 7 8 256; do
    echo Running OpenMP using $OMP_NUM_THREADS threads:
    export OMP_NUM_THREADS
    time ./stream-openmp >stream-openmp-${OMP_NUM_THREADS}.txt 2>&1
done
