From f0f25eabe5b374f20a5db30f652f6e994fff3fb3 Mon Sep 17 00:00:00 2001 From: Cyril SIX Date: Fri, 13 Sep 2019 14:32:25 +0200 Subject: Scaling down most of c/ CompCert tests --- test/c/Makefile | 15 ++++++++++----- test/c/Results/chomp | 4 ---- test/c/Results/mandelbrot | Bin 125013 -> 709 bytes test/c/Results/nbody | 2 +- test/c/Results/nsieve | 6 +++--- test/c/Results/nsievebits | 6 +++--- test/c/Results/perlin | 2 +- test/c/Results/spectral | 2 +- test/c/Results/vmach | 4 ++-- test/c/chomp.c | 4 ++-- test/c/mandelbrot.c | 10 +++++++++- test/c/nbody.c | 2 +- test/c/nsieve.c | 2 +- test/c/nsievebits.c | 2 +- test/c/perlin.c | 9 ++++++--- test/c/qsort.c | 2 +- test/c/spectral.c | 2 +- test/c/vmach.c | 19 +++++++++++++------ 18 files changed, 56 insertions(+), 37 deletions(-) (limited to 'test/c') diff --git a/test/c/Makefile b/test/c/Makefile index 9580c8cc..31bf3cd1 100644 --- a/test/c/Makefile +++ b/test/c/Makefile @@ -14,11 +14,16 @@ TIME=time >/dev/null # Otherwise PROGS?=fib integr qsort fft fftsp fftw sha1 sha3 aes almabench \ lists binarytrees fannkuch mandelbrot nbody \ nsieve nsievebits spectral vmach \ - bisect chomp perlin siphash24 - -# Kalray NOTE : removed knucleotide from PROGS, it is hard to edit the input -# to modify its size without resulting in a seg fault, and the base input -# takes a too long time to complete in the simulator. + chomp perlin siphash24 + +## +# Kalray NOTE : +# * removed knucleotide from PROGS, it is hard to edit the input +# to modify its size without resulting in a seg fault, and the base input +# takes a too long time to complete in the simulator. +# * also removed bisect, who is exhibiting different float values on the Kalray +# architecture than using x86 GCC (for both CompCert and GCC ports) (tested with n=10) +## all: $(PROGS:%=%.compcert) diff --git a/test/c/Results/chomp b/test/c/Results/chomp index 145b603a..fb4d17a1 100644 --- a/test/c/Results/chomp +++ b/test/c/Results/chomp @@ -1,8 +1,4 @@ player 0 plays at (1,1) -player 1 plays at (6,0) -player 0 plays at (0,6) -player 1 plays at (5,0) -player 0 plays at (0,5) player 1 plays at (4,0) player 0 plays at (0,4) player 1 plays at (3,0) diff --git a/test/c/Results/mandelbrot b/test/c/Results/mandelbrot index b81e96bf..e6eb3e50 100644 Binary files a/test/c/Results/mandelbrot and b/test/c/Results/mandelbrot differ diff --git a/test/c/Results/nbody b/test/c/Results/nbody index 41b648fd..e43de06f 100644 --- a/test/c/Results/nbody +++ b/test/c/Results/nbody @@ -1,2 +1,2 @@ -0.169075164 --0.169086185 +-0.169026909 diff --git a/test/c/Results/nsieve b/test/c/Results/nsieve index bb9b87dc..69643235 100644 --- a/test/c/Results/nsieve +++ b/test/c/Results/nsieve @@ -1,3 +1,3 @@ -Primes up to 5120000 356244 -Primes up to 2560000 187134 -Primes up to 1280000 98610 +Primes up to 102400 9805 +Primes up to 51200 5239 +Primes up to 25600 2818 diff --git a/test/c/Results/nsievebits b/test/c/Results/nsievebits index bb9b87dc..e2d08319 100644 --- a/test/c/Results/nsievebits +++ b/test/c/Results/nsievebits @@ -1,3 +1,3 @@ -Primes up to 5120000 356244 -Primes up to 2560000 187134 -Primes up to 1280000 98610 +Primes up to 80000 7837 +Primes up to 40000 4203 +Primes up to 20000 2262 diff --git a/test/c/Results/perlin b/test/c/Results/perlin index 4503fc1c..1d3be5f8 100644 --- a/test/c/Results/perlin +++ b/test/c/Results/perlin @@ -1 +1 @@ --4.0543e+03 +-2.9375e+01 diff --git a/test/c/Results/spectral b/test/c/Results/spectral index 1e35f7e0..2ad8d778 100644 --- a/test/c/Results/spectral +++ b/test/c/Results/spectral @@ -1 +1 @@ -1.274224148 +1.273394737 diff --git a/test/c/Results/vmach b/test/c/Results/vmach index 9caa2e51..a95237a6 100644 --- a/test/c/Results/vmach +++ b/test/c/Results/vmach @@ -1,2 +1,2 @@ -fib(30) = 1346269 -tak(18, 12, 6) = 7 +fib(15) = 987 +tak(12, 9, 6) = 9 diff --git a/test/c/chomp.c b/test/c/chomp.c index 728e7a01..a2d0d627 100644 --- a/test/c/chomp.c +++ b/test/c/chomp.c @@ -338,8 +338,8 @@ int main(void) struct _play *tree; - ncol = 7; - nrow = 7; + ncol = 5; + nrow = 5; tree = make_play(1); /* create entire tree structure, not just the */ player = 0; /* needed part for first move */ current = make_data(nrow,ncol); /* start play at full board */ diff --git a/test/c/mandelbrot.c b/test/c/mandelbrot.c index 032e7d75..d2afcad1 100644 --- a/test/c/mandelbrot.c +++ b/test/c/mandelbrot.c @@ -22,7 +22,7 @@ int main (int argc, char **argv) double Zr, Zi, Cr, Ci, Tr, Ti; if (argc < 2) { - w = h = 1000; + w = h = 50; } else { w = h = atoi(argv[1]); } @@ -51,14 +51,22 @@ int main (int argc, char **argv) if(bit_num == 8) { + printf("%c", byte_acc); putc(byte_acc,stdout); +#ifdef __K1C__ // stdout isn't flushed enough when --syscall=libstd_scalls.so is passed to the simulator k1-cluster + fflush(stdout); +#endif byte_acc = 0; bit_num = 0; } else if(x == w-1) { byte_acc <<= (8-w%8); + printf("%c", byte_acc); putc(byte_acc,stdout); +#ifdef __K1C__ // stdout isn't flushed enough when --syscall=libstd_scalls.so is passed to the simulator k1-cluster + fflush(stdout); +#endif byte_acc = 0; bit_num = 0; } diff --git a/test/c/nbody.c b/test/c/nbody.c index 530c41fa..207184f7 100644 --- a/test/c/nbody.c +++ b/test/c/nbody.c @@ -140,7 +140,7 @@ void setup_bodies(void) int main(int argc, char ** argv) { - int n = argc < 2 ? 1000000 : atoi(argv[1]); + int n = argc < 2 ? 200 : atoi(argv[1]); int i; setup_bodies(); diff --git a/test/c/nsieve.c b/test/c/nsieve.c index 819d47f1..49fe385f 100644 --- a/test/c/nsieve.c +++ b/test/c/nsieve.c @@ -32,7 +32,7 @@ int main(int argc, char * argv[]) { int m = argc < 2 ? 9 : atoi(argv[1]); int i, j; for (i = 0; i < 3; i++) { - int n = 10000 << (m-i); + int n = 200 << (m-i); unsigned count; for (j = 0; j < NITER; j++) { count = nsieve(n); } printf("Primes up to %8d %8u\n", n, count); diff --git a/test/c/nsievebits.c b/test/c/nsievebits.c index 743a5ffd..3a2e8b8b 100644 --- a/test/c/nsievebits.c +++ b/test/c/nsievebits.c @@ -48,7 +48,7 @@ main(int ac, char **av) { unsigned int n; - n = ac < 2 ? 9 : atoi(av[1]); + n = ac < 2 ? 3 : atoi(av[1]); test(n); if (n >= 1) test(n - 1); diff --git a/test/c/perlin.c b/test/c/perlin.c index e7bbd22d..b853aeed 100644 --- a/test/c/perlin.c +++ b/test/c/perlin.c @@ -63,13 +63,16 @@ static void init(void) { p[256+i] = p[i] = permutation[i]; } +#define INCREMENT 0.5 +#define MIN -5.0 +#define MAX 5.0 int main(int argc, char ** argv) { init(); double x, y, z, sum = 0.0; - for (x = -5.0; x < 5.0; x += 0.1) - for (y = -5.0; y < 5.0; y += 0.1) - for (z = -5.0; z < 5.0; z += 0.1) + for (x = MIN; x < MAX; x += INCREMENT) + for (y = MIN; y < MAX; y += INCREMENT) + for (z = MIN; z < MAX; z += INCREMENT) sum += noise(x, y, z); printf("%.4e\n", sum); diff --git a/test/c/qsort.c b/test/c/qsort.c index a9d5757a..a157f283 100644 --- a/test/c/qsort.c +++ b/test/c/qsort.c @@ -34,7 +34,7 @@ int main(int argc, char ** argv) int n, i, j; int * a, * b; - if (argc >= 2) n = atoi(argv[1]); else n = 10000; + if (argc >= 2) n = atoi(argv[1]); else n = 3000; a = malloc(n * sizeof(int)); b = malloc(n * sizeof(int)); for (j = 0; j < NITER; j++) { diff --git a/test/c/spectral.c b/test/c/spectral.c index f7dc90ee..7e56bf7f 100644 --- a/test/c/spectral.c +++ b/test/c/spectral.c @@ -43,7 +43,7 @@ void eval_AtA_times_u(int N, const double u[], double AtAu[]) int main(int argc, char *argv[]) { int i; - int N = ((argc == 2) ? atoi(argv[1]) : 1000); + int N = ((argc == 2) ? atoi(argv[1]) : 15); double * u, * v, vBv, vv; u = malloc(N * sizeof(double)); v = malloc(N * sizeof(double)); diff --git a/test/c/vmach.c b/test/c/vmach.c index 815cb710..4e6848d2 100644 --- a/test/c/vmach.c +++ b/test/c/vmach.c @@ -159,8 +159,10 @@ long wordcode_interp(unsigned int* code) #define I(a,b,c,d) ((a) + ((b) << 8) + ((c) << 16) + ((d) << 24)) +#define FIBSIZE 15 + unsigned int wordcode_fib[] = { -/* 0 */ I(WCONST, 30, 0, 0), +/* 0 */ I(WCONST, FIBSIZE, 0, 0), /* 1 */ I(WCALL1_pop1, 0, 3-1-1, 0), /* 2 */ I(WSTOP, 0, 1, 0), /* 3 */ I(WCONST, 2, 0, 0), @@ -175,10 +177,15 @@ unsigned int wordcode_fib[] = { /* 12 */ I(WCONST, 1, 0, 0), /* 13 */ I(WRETURN, 0, 2, 0) }; + +#define TAKSIZE1 6 +#define TAKSIZE2 9 +#define TAKSIZE3 12 + unsigned int wordcode_tak[] = { -/* 0 */ I(WCONST, 6, 0, 0), -/* 1 */ I(WCONST, 12, 0, 0), -/* 2 */ I(WCONST, 18, 0, 0), +/* 0 */ I(WCONST, TAKSIZE1, 0, 0), +/* 1 */ I(WCONST, TAKSIZE2, 0, 0), +/* 2 */ I(WCONST, TAKSIZE3, 0, 0), /* 3 */ I(WCALL3, 3, 6-3-2, 0), /* 4 */ I(0, 1, 2, 0), /* 5 */ I(WSTOP, 0, 1, 0), @@ -203,8 +210,8 @@ unsigned int wordcode_tak[] = { int main(int argc, char ** argv) { - printf("fib(30) = %ld\n", wordcode_interp(wordcode_fib)); - printf("tak(18, 12, 6) = %ld\n", wordcode_interp(wordcode_tak)); + printf("fib(%d) = %ld\n", FIBSIZE, wordcode_interp(wordcode_fib)); + printf("tak(%d, %d, %d) = %ld\n", TAKSIZE3, TAKSIZE2, TAKSIZE1, wordcode_interp(wordcode_tak)); return 0; } -- cgit