Skip to content

Commit

Permalink
update problem sizes for examples/
Browse files Browse the repository at this point in the history
Some of the problem sizes were too small (checked-in earlier inadvertently).
Data set sizes are now reasonably large (don't fit in a typical L3 cache)

Signed-off-by: Uday Bondhugula <udayreddy@gmail.com>
  • Loading branch information
bondhugula committed Jun 22, 2012
1 parent 6de9fc9 commit f7beb37
Show file tree
Hide file tree
Showing 16 changed files with 105 additions and 92 deletions.
4 changes: 2 additions & 2 deletions examples/covcol/covcol.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@

#define my_sqrt_array(x,j) sqrt(x[j])

#define N 1000
#define M 1000
#define N 1500
#define M 1500

float float_n = (float) N;
float eps = 0.005;
Expand Down
2 changes: 1 addition & 1 deletion examples/dsyr2k/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
SRC= dsyr2k

PLCFLAGS = --context=100 #--unroll --ufactor=2
PLCFLAGS = --unroll --ufactor=4
TILEFLAGS = #--l2tile

include ../common.mk
Expand Down
2 changes: 1 addition & 1 deletion examples/dsyr2k/dsyr2k.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include <math.h>
#include <sys/time.h>

#define NMAX 4096
#define NMAX 2048

#pragma declarations
double a[NMAX][NMAX], b[NMAX][NMAX], c[NMAX][NMAX];
Expand Down
2 changes: 1 addition & 1 deletion examples/dsyrk/dsyrk.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include <unistd.h>
#include <sys/time.h>

#define NMAX 3000
#define NMAX 2000
#pragma declarations
double a[NMAX][NMAX], c[NMAX][NMAX];
#pragma enddeclarations
Expand Down
2 changes: 1 addition & 1 deletion examples/fdtd-2d/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
SRC=fdtd-2d

PLCFLAGS += #--context=32 #--unroll
PLCFLAGS += #--context=32 --unroll
TILEFLAGS = #--l2tile

include ../common.mk
Expand Down
4 changes: 2 additions & 2 deletions examples/fdtd-2d/fdtd-2d.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
#endif

#define tmax 128
#define nx 4000
#define ny 4000
#define nx 3000
#define ny 3000

#pragma declarations
double ex[nx][ny+1];
Expand Down
6 changes: 3 additions & 3 deletions examples/jacobi-1d-imper/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ include ../common.mk
$(SRC).sched.c:
$(PLC) $(SRC).c --sched --tile --parallel $(TILEFLAGS) $(PLCFLAGS) -o $(SRC).sched.c

sched: $(SRC).sched.c decls.h papi_defs.h util.h
sched: $(SRC).sched.c papi_defs.h util.h
$(CC) $(OPT_FLAGS) -openmp -lm $(SRC).sched.c -o sched

sched_test: $(SRC).sched.c decls.h papi_defs.h util.h
sched_test: $(SRC).sched.c papi_defs.h util.h
$(CC) $(OPT_FLAGS) -openmp -lm $(SRC).sched.c -o sched_test -DTEST

limlam: $(SRC).limlam.c decls.h papi_defs.h util.h
limlam: $(SRC).limlam.c papi_defs.h util.h
$(CC) $(OPT_FLAGS) -openmp -lm $(SRC).limlam.c -o limlam

4 changes: 2 additions & 2 deletions examples/jacobi-1d-imper/jacobi-1d-imper.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

#include "util.h"

#define N 1000
#define T 50
#define N 2000000
#define T 1000

#pragma declarations
double a[N];
Expand Down
9 changes: 8 additions & 1 deletion examples/jacobi-1d-imper/jacobi-1d-imper.limlam.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,14 @@
#include <math.h>

#include <assert.h>
#include "decls.h"

#define N 2000000
#define T 1000

#pragma declarations
double a[N];
double b[N];
#pragma enddeclarations

#ifdef PERFCTR
#include <papi.h>
Expand Down
32 changes: 30 additions & 2 deletions examples/jacobi-1d-imper/jacobi-1d-imper.sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,37 @@
#include <papi.h>
#endif

#include "decls.h"
#define N 2000000
#define T 1000

#pragma declarations
double a[N];
double b[N];
#pragma enddeclarations

double t_start, t_end;

void init_array()
{
int j;

for (j=0; j<N; j++) {
a[j] = ((double)j)/N;
}
}


void print_array()
{
int j;

for (j=0; j<N; j++) {
fprintf(stdout, "%lf ", a[j]);
if (j%80 == 20) fprintf(stdout, "\n");
}
fprintf(stdout, "\n");
}

#include "util.h"

#define ceild(n,d) ceil(((double)(n))/((double)(d)))
#define floord(n,d) floor(((double)(n))/((double)(d)))
Expand Down
2 changes: 1 addition & 1 deletion examples/jacobi-2d-imper/jacobi-2d-imper.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include <assert.h>

#define N 2000
#define T 2000
#define T 1000

#pragma declarations
double a[N][N];
Expand Down
52 changes: 49 additions & 3 deletions examples/lu/lu.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,62 @@

#include <omp.h>

#define N 1024
#define N 2000

#pragma declarations
double a[N][N+13];
double a[N][N];
//double v_a[32][35];
//double v_b[32][32];
//double v_c[32][33];
#pragma enddeclarations

#include "util.h"
#include <unistd.h>
#include <sys/time.h>
#include <math.h>

#ifdef TIME
#define IF_TIME(foo) foo;
#else
#define IF_TIME(foo)
#endif

void init_array()
{
int i, j, k;

for (i=0; i<N; i++) {
for (j=0; j<N; j++) {
for (k=0; k<N; k++) {
a[i][j] += (i+k+1)*(k+j+1);//i==j?1:0;
}
}
}
}


void print_array()
{
int i, j;

for (i=0; i<N; i++) {
for (j=0; j<N; j++) {
fprintf(stdout, "%lf ", round(a[i][j]));
if (j%80 == 79) fprintf(stdout, "\n");
}
fprintf(stdout, "\n");
}
fprintf(stdout, "\n");
}

double rtclock()
{
struct timezone Tzp;
struct timeval Tp;
int stat;
stat = gettimeofday (&Tp, &Tzp);
if (stat != 0) printf("Error return from gettimeofday: %d",stat);
return(Tp.tv_sec + Tp.tv_usec*1.0e-6);
}

int main()
{
Expand Down
68 changes: 0 additions & 68 deletions examples/lu/util.h

This file was deleted.

4 changes: 2 additions & 2 deletions examples/seidel/seidel.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

#include <assert.h>

#define N 1000
#define T 500
#define N 2000
#define T 200

#pragma declarations
double a[N][N];
Expand Down
2 changes: 1 addition & 1 deletion examples/ssymm/ssymm.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include <math.h>
#include <sys/time.h>

#define NMAX 500
#define NMAX 2000

#pragma declarations
double a[NMAX][NMAX], b[NMAX][NMAX], c[NMAX][NMAX];
Expand Down
2 changes: 1 addition & 1 deletion examples/strmm/strmm.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include <math.h>
#include <sys/time.h>

#define NMAX 1000
#define NMAX 2000

#pragma declarations
double a[NMAX][NMAX], b[NMAX][NMAX], c[NMAX][NMAX];
Expand Down

0 comments on commit f7beb37

Please sign in to comment.