diff --git a/src/main.c b/src/main.c index 4ebe0b1..475cb24 100644 --- a/src/main.c +++ b/src/main.c @@ -54,11 +54,10 @@ #define LIKWID_PROFILE(tag,call) \ _Pragma ("omp parallel") \ -{LIKWID_MARKER_START(#tag);} \ -times[tag][k] = call; \ -_Pragma ("omp parallel") \ -{LIKWID_MARKER_STOP(#tag);} - + {LIKWID_MARKER_START(#tag);} \ + times[tag][k] = call; \ + _Pragma ("omp parallel") \ + {LIKWID_MARKER_STOP(#tag);} typedef enum benchmark { INIT = 0, @@ -177,7 +176,6 @@ int main (int argc, char** argv) scalar = 3.0; for ( int k=0; k < NTIMES; k++) { - LIKWID_PROFILE(INIT,init(b, scalar, N)); tmp = a[10]; LIKWID_PROFILE(SUM,sum(a, N)); diff --git a/util/bwBench-likwid.c b/util/bwBench-likwid.c index 06b015a..f043aad 100644 --- a/util/bwBench-likwid.c +++ b/util/bwBench-likwid.c @@ -2,7 +2,7 @@ * ======================================================================================= * * Author: Jan Eitzinger (je), jan.eitzinger@fau.de - * Copyright (c) 2019 RRZE, University Erlangen-Nuremberg + * Copyright (c) 2020 RRZE, University Erlangen-Nuremberg * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -25,6 +25,7 @@ * ======================================================================================= */ +#define _GNU_SOURCE #include #include #include @@ -53,6 +54,13 @@ #define ABS(a) ((a) >= 0 ? (a) : -(a)) #endif +#define LIKWID_PROFILE(tag,call) \ + _Pragma ("omp parallel") \ + {LIKWID_MARKER_START(#tag);} \ + times[tag][k] = call; \ + _Pragma ("omp parallel") \ + {LIKWID_MARKER_STOP(#tag);} + typedef enum benchmark { INIT = 0, COPY, @@ -89,8 +97,8 @@ int main (int argc, char** argv) double E, S; double avgtime[NUMBENCH], - maxtime[NUMBENCH], - mintime[NUMBENCH]; + maxtime[NUMBENCH], + mintime[NUMBENCH]; double times[NUMBENCH][NTIMES]; @@ -139,7 +147,7 @@ int main (int argc, char** argv) } #endif -#pragma omp parallel for +#pragma omp parallel for schedule(static) for (int i=0; i