#define _GNU_SOURCE #include #include #include #include #include #include #include /* sleep() */ #include #include #include #define CHUNKSIZE 128 #define N 128000 #define Ninner 2000 #define gettid() syscall(SYS_gettid) #define ALIGN(n) __attribute__((aligned(n))) float a[N] ALIGN(128), b[N] ALIGN(128), c[N] ALIGN(128); void process(int threads) { int chunk; clock_t c0, c1; struct timeval t0, t1; /* Some initializations */ for (int i=0; i < N; i++) a[i] = b[i] = i * 1.0; chunk = CHUNKSIZE; // printf("running with %i threads: ",threads); c0 = clock(); gettimeofday(&t0,NULL); #pragma omp parallel num_threads(threads) shared(a,b,c,chunk) { int i, j; #pragma omp for schedule(dynamic,chunk) nowait for (i=0; i < N; i++) { for (j=0; j