Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add development and versions #1

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
496 changes: 496 additions & 0 deletions Development/stream.c.5.10

Large diffs are not rendered by default.

20 changes: 20 additions & 0 deletions TO_DO
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
2016-05-18:

* Incorporate the timer code for Microsoft Windows into the mainstream version of stream.c

* Incorporate alternate array allocation into the mainstream version of stream.c
** posix_memalign()
** malloc()
** mmap()
** shmget()/shmat()

* Figure out if the "restrict" keyword can actually be made portable and useful
for C versions....

* Update the Fortran version of STREAM to catch up with the functionality
and features of the C version 5.10
** Updated result checking code with minimal roundoff error.
** Large integer array indices (N > (1<<32)).

* Update the Fortran MPI version of STREAM to catch up with the functionality
and features of the C version 5.10
31 changes: 31 additions & 0 deletions Versions/Experimental/Parallel_jobs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/bin/csh
#
# This program runs multiple copies of the stream_wall benchmark
# to measure how much they interfere with each other....
#
# John D. McCalpin, [email protected]
# Mon May 2 18:51:19 EDT 1994
# set verbose

#switch ($#argv)
#case 1:
# breaksw
#default:
# echo "Usage: $0 <ncpus>"
# exit 1
#endsw

foreach k (1 2 4 6 8)
set NCPU=$k
set i=$k
echo "Starting $i jobs"
while (`expr $i - 1` >= 0)
echo stream_d >P${NCPU}.${i} &
set i=`expr $i - 1`
end
wait
cat P${NCPU}.[1-${NCPU}] >P${NCPU}.out
rm P${NCPU}.[1-${NCPU}]
echo "All jobs done.... Output is in P${NCPU}.out"
end
exit 0
7 changes: 7 additions & 0 deletions Versions/Experimental/do_offsets
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/csh
foreach OFFSET (0 7 8 9 15 16 17 31 32 33 63 64 65)
echo $OFFSET
sed "s/offset=0/offset=${OFFSET}/" <stream_d.f >q.f
make q
q >>LOG
end
143 changes: 143 additions & 0 deletions Versions/Old/1996-08-18/stream_d.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
/*
* Program: Stream
* Programmer: John D. McCalpin
* Revision: 2.1, August 30, 1995
*
* This program measures memory transfer rates in MB/s for simple
* computational kernels coded in Fortran. These numbers reveal the
* quality of code generation for simple uncacheable kernels as well
* as showing the cost of floating-point operations relative to memory
* accesses.
*
* INSTRUCTIONS:
* 1) (fortran-specific, omitted.)
* 2) Stream requires a good bit of memory to run.
* Adjust the Parameter 'N' in the second line of the main
* program to give a 'timing calibration' of at least 20 clicks.
* This will provide rate estimates that should be good to
* about 5% precision.
* 3) Compile the code with full optimization. Many compilers
* generate unreasonably bad code before the optimizer tightens
* things up. If the results are unreasonable good, on the
* other hand, the optimizer might be too smart for me!
* 4) Mail the results to [email protected]
* Be sure to include:
* a) computer hardware model number and software revision
* b) the compiler flags
* c) all of the output from the test case.
* Thanks!
*
* this version was ported from fortran to c by mark hahn, [email protected].
*/

#define N 1000000
#define NTIMES 10

#ifdef __hpux
#define _HPUX_SOURCE 1
#else
#define _INCLUDE_POSIX_SOURCE 1
#endif
#include <limits.h>
#include <sys/time.h>
#include <math.h>
#include <stdio.h>

#ifndef MIN
#define MIN(x,y) ((x)<(y)?(x):(y))
#endif
#ifndef MAX
#define MAX(x,y) ((x)>(y)?(x):(y))
#endif

struct timeval tvStart;

void utimeStart() {
struct timezone tz;
gettimeofday(&tvStart,&tz);
}

float utime() {
struct timeval tv;
struct timezone tz;
float utime;
gettimeofday(&tv,&tz);
utime = 1e6 * (tv.tv_sec - tvStart.tv_sec) + tv.tv_usec - tvStart.tv_usec;
return utime;
}

typedef double real;
static real a[N],b[N],c[N];

int main() {
int j,k;
float times[4][NTIMES];
static float rmstime[4] = {0};
static float mintime[4] = {FLT_MAX,FLT_MAX,FLT_MAX,FLT_MAX};
static float maxtime[4] = {0};
static char *label[4] = {"Assignment:",
"Scaling :",
"Summing :",
"SAXPYing :"};
static float bytes[4] = { 2 * sizeof(real) * N,
2 * sizeof(real) * N,
3 * sizeof(real) * N,
3 * sizeof(real) * N};

/* --- SETUP --- determine precision and check timing --- */
utimeStart();
for (j=0; j<N; j++) {
a[j] = 1.0;
b[j] = 2.0;
c[j] = 0.0;
}
printf("Timing calibration ; time = %f usec.\n",utime());
printf("Increase the size of the arrays if this is < 300000\n"
"and your clock precision is =< 1/100 second.\n");
printf("---------------------------------------------------\n");

/* --- MAIN LOOP --- repeat test cases NTIMES times --- */
for (k=0; k<NTIMES; k++) {
utimeStart();
for (j=0; j<N; j++)
c[j] = a[j];
times[0][k] = utime();

utimeStart();
for (j=0; j<N; j++)
c[j] = 3.0e0*a[j];
times[1][k] = utime();

utimeStart();
for (j=0; j<N; j++)
c[j] = a[j]+b[j];
times[2][k] = utime();

utimeStart();
for (j=0; j<N; j++)
c[j] = a[j]+3.0e0*b[j];
times[3][k] = utime();
}

/* --- SUMMARY --- */
for (k=0; k<NTIMES; k++) {
for (j=0; j<4; j++) {
rmstime[j] = rmstime[j] + (times[j][k] * times[j][k]);
mintime[j] = MIN(mintime[j], times[j][k]);
maxtime[j] = MAX(maxtime[j], times[j][k]);
}
}

printf("Function Rate (MB/s) RMS time Min time Max time\n");
for (j=0; j<4; j++) {
rmstime[j] = sqrt(rmstime[j]/(float)NTIMES);

printf("%s%11.3f %11.3f %11.3f %11.3f\n",
label[j],
bytes[j]/mintime[j],
rmstime[j],
mintime[j],
maxtime[j]);
}
return 0;
}
Loading