From 58d9964da4241201f78cb8053b97a8b8ad8bb536 Mon Sep 17 00:00:00 2001 From: Jan Eitzinger Date: Sun, 15 Sep 2019 06:21:39 +0200 Subject: [PATCH 1/8] Remove MemoryHierarchy Bench again and revert to old structure. --- MainMemory/Makefile => Makefile | 0 MemoryHierarchy/Makefile | 45 ---- MemoryHierarchy/bench.pl | 38 --- MemoryHierarchy/bench.plot | 15 -- MemoryHierarchy/bench.py | 78 ------- MemoryHierarchy/src/affinity.c | 89 -------- MemoryHierarchy/src/affinity.h | 36 --- MemoryHierarchy/src/allocate.c | 58 ----- MemoryHierarchy/src/allocate.h | 33 --- MemoryHierarchy/src/likwid_markers.h | 44 ---- MemoryHierarchy/src/main.c | 216 ------------------ MemoryHierarchy/src/striad_seq.c | 57 ----- MemoryHierarchy/src/striad_tp.c | 62 ----- MemoryHierarchy/src/striad_ws.c | 57 ----- MemoryHierarchy/src/timing.c | 49 ---- MemoryHierarchy/src/timing.h | 35 --- MainMemory/bench.pl => bench.pl | 0 MainMemory/bench.py => bench.py | 0 MainMemory/config.mk => config.mk | 0 .../include_CLANG.mk => include_CLANG.mk | 0 MainMemory/include_GCC.mk => include_GCC.mk | 0 MainMemory/include_ICC.mk => include_ICC.mk | 0 {MainMemory/src => src}/affinity.c | 0 {MainMemory/src => src}/allocate.c | 0 {MainMemory/src => src}/copy.c | 0 {MainMemory/src => src}/daxpy.c | 0 {MainMemory/src => src}/includes/affinity.h | 0 {MainMemory/src => src}/includes/allocate.h | 0 {MainMemory/src => src}/includes/timing.h | 0 {MainMemory/src => src}/init.c | 0 {MainMemory/src => src}/main.c | 0 {MainMemory/src => src}/sdaxpy.c | 0 {MainMemory/src => src}/striad.c | 0 {MainMemory/src => src}/sum.c | 0 {MainMemory/src => src}/timing.c | 0 {MainMemory/src => src}/triad.c | 0 {MainMemory/src => src}/update.c | 0 37 files changed, 912 deletions(-) rename MainMemory/Makefile => Makefile (100%) delete mode 100644 MemoryHierarchy/Makefile delete mode 100755 MemoryHierarchy/bench.pl delete mode 100644 MemoryHierarchy/bench.plot delete mode 100755 MemoryHierarchy/bench.py delete mode 100644 MemoryHierarchy/src/affinity.c delete mode 100644 MemoryHierarchy/src/affinity.h delete mode 100644 MemoryHierarchy/src/allocate.c delete mode 100644 MemoryHierarchy/src/allocate.h delete mode 100644 MemoryHierarchy/src/likwid_markers.h delete mode 100644 MemoryHierarchy/src/main.c delete mode 100644 MemoryHierarchy/src/striad_seq.c delete mode 100644 MemoryHierarchy/src/striad_tp.c delete mode 100644 MemoryHierarchy/src/striad_ws.c delete mode 100644 MemoryHierarchy/src/timing.c delete mode 100644 MemoryHierarchy/src/timing.h rename MainMemory/bench.pl => bench.pl (100%) rename MainMemory/bench.py => bench.py (100%) rename MainMemory/config.mk => config.mk (100%) rename MainMemory/include_CLANG.mk => include_CLANG.mk (100%) rename MainMemory/include_GCC.mk => include_GCC.mk (100%) rename MainMemory/include_ICC.mk => include_ICC.mk (100%) rename {MainMemory/src => src}/affinity.c (100%) rename {MainMemory/src => src}/allocate.c (100%) rename {MainMemory/src => src}/copy.c (100%) rename {MainMemory/src => src}/daxpy.c (100%) rename {MainMemory/src => src}/includes/affinity.h (100%) rename {MainMemory/src => src}/includes/allocate.h (100%) rename {MainMemory/src => src}/includes/timing.h (100%) rename {MainMemory/src => src}/init.c (100%) rename {MainMemory/src => src}/main.c (100%) rename {MainMemory/src => src}/sdaxpy.c (100%) rename {MainMemory/src => src}/striad.c (100%) rename {MainMemory/src => src}/sum.c (100%) rename {MainMemory/src => src}/timing.c (100%) rename {MainMemory/src => src}/triad.c (100%) rename {MainMemory/src => src}/update.c (100%) diff --git a/MainMemory/Makefile b/Makefile similarity index 100% rename from MainMemory/Makefile rename to Makefile diff --git a/MemoryHierarchy/Makefile b/MemoryHierarchy/Makefile deleted file mode 100644 index dee5aed..0000000 --- a/MemoryHierarchy/Makefile +++ /dev/null @@ -1,45 +0,0 @@ -#CONFIGURE TOOL CHAIN -CC = gcc -OPENMP = -fopenmp -#CFLAGS = -O3 -xHost -qopt-zmm-usage=high -std=c99 $(OPENMP) -CFLAGS = -O3 -std=c99 $(OPENMP) -LFLAGS = $(OPENMP) -DEFINES = -D_GNU_SOURCE -#DEFINES += -DVERBOSE -#DEFINES += -DLIKWID_PERFMON -DEFINES += -DNTIMES=5 -DEFINES += -DARRAY_ALIGNMENT=64 - -#CONFIGURE BUILD SYSTEM -TARGET = striad -BUILD_DIR = ./build -SRC_DIR = ./src -INCLUDES += -I./src/ - -#DO NOT EDIT BELOW -VPATH = $(SRC_DIR) -ASM = $(patsubst $(SRC_DIR)/%.c, $(BUILD_DIR)/%.s,$(wildcard $(SRC_DIR)/*.c)) -OBJ = $(patsubst $(SRC_DIR)/%.c, $(BUILD_DIR)/%.o,$(wildcard $(SRC_DIR)/*.c)) -CPPFLAGS := $(CPPFLAGS) $(DEFINES) $(INCLUDES) - -${TARGET}: $(BUILD_DIR) $(OBJ) - ${CC} ${LFLAGS} -o $(TARGET) $(OBJ) $(LIBS) - -asm: $(BUILD_DIR) $(ASM) - -$(BUILD_DIR)/%.o: %.c - $(CC) -c $(CPPFLAGS) $(CFLAGS) $< -o $@ - -$(BUILD_DIR)/%.s: %.c - $(CC) -S $(CPPFLAGS) $(CFLAGS) $< -o $@ - -$(BUILD_DIR): - @mkdir $(BUILD_DIR) - -.PHONY: clean - -clean: - @echo "===> CLEAN" - @rm -rf $(BUILD_DIR) - @rm -f $(TARGET) - diff --git a/MemoryHierarchy/bench.pl b/MemoryHierarchy/bench.pl deleted file mode 100755 index d1e91a4..0000000 --- a/MemoryHierarchy/bench.pl +++ /dev/null @@ -1,38 +0,0 @@ -#!/usr/bin/env perl -use strict; -use warnings; -use utf8; - -if ( $#ARGV < 2 ){ - print "Usage: ./bench.pl \n"; - exit; -} - -my $numCores = $ARGV[0]; -my $type = 0; -my $SMT = $ARGV[2] ? $ARGV[2] : 2; -my $N = 100; - - -if ( $ARGV[1] eq 'seq' ){ - $type = 0; -} elsif ( $ARGV[1] eq 'tp' ){ - $type = 1; -} elsif ( $ARGV[1] eq 'ws' ){ - $type = 2; -} - -print("# striad $numCores $SMT $ARGV[1]\n"); -while ( $N < 8000000 ) { - my $result; - my $performance = '0.00'; - - while ( $performance eq '0.00' ){ - $result = `likwid-pin -c E:S0:$numCores:1:$SMT -q ./striad $type $N`; - $result =~ /([0-9.]+) ([0-9.]+)/; - $performance = $2; - } - - print $result; - $N = int($N * 1.2); -} diff --git a/MemoryHierarchy/bench.plot b/MemoryHierarchy/bench.plot deleted file mode 100644 index 08b5ba0..0000000 --- a/MemoryHierarchy/bench.plot +++ /dev/null @@ -1,15 +0,0 @@ -set terminal png size 1024,768 enhanced font ,12 -set output 'striad.png' -set xlabel 'Size [kB]' -set xrange [100:] -set yrange [0:] -set ylabel 'Performance [MFLOP/s]' -cpuname = system("likwid-topology | grep 'CPU name' | cut -d ':' -f2 | sort -u | xargs") -numcores = system("grep 'striad' striad.dat | cut -d ' ' -f 3") -smt = system("grep 'striad' striad.dat | cut -d ' ' -f 4") -type = system("grep 'striad' striad.dat | cut -d ' ' -f 5") -set title sprintf("Benchmark of stream triad A[i] = B[i] + C[i] * D[i]\nType '%s', Threads %s, SMT %s, CPU %s", type, numcores, smt, cpuname) -set logscale x - - -plot 'striad.dat' u 1:2 w linespoints title 'striad' diff --git a/MemoryHierarchy/bench.py b/MemoryHierarchy/bench.py deleted file mode 100755 index 48ec4c3..0000000 --- a/MemoryHierarchy/bench.py +++ /dev/null @@ -1,78 +0,0 @@ -#!/usr/bin/env python3 - -# ======================================================================================= -# -# Author: Thomas Gruber (tg), thomas.gruber@googlemail.com -# Copyright (c) 2019 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 -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in all -# copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. -# -# ======================================================================================= - -import sys, subprocess, re - -default_regex = "([0-9.]+) ([0-9.]+)" -default_smt = 2 -striad_types = {"seq" : 0, - "tp" : 1, - "ws" : 2 - } -start_N = 100 -max_N = 8000000 -scale_N = 1.2 - -if len(sys.argv) < 3 or len(sys.argv) > 4: - print("Usage: {} ()".format(sys.argv[0])) - print("Default value is {}".format(default_smt)) - sys.exit(1) - -numcores = int(sys.argv[1]) -striad_type = sys.argv[2] -striad_t = 0 -if striad_type in striad_types: - striad_t = striad_types.get(striad_type) -else: - print("Invalid type for striad. Available types: {}".format(", ".join(striad_types.keys()))) - sys.exit(1) -smt = int(sys.argv[3]) if len(sys.argv) == 4 else default_smt - -print("# striad {} {} {}".format(numcores, smt, striad_type)) - -N = start_N -while N < max_N: - performance = 0 - result = None - runcmd = "likwid-pin -c E:S0:{}:1:{} -q ./striad {} {}".format(numcores, smt, - striad_t, N) - while performance == 0: - p = subprocess.Popen(runcmd, stdout=subprocess.PIPE, - stderr=subprocess.STDOUT, - shell=True) - p.wait() - if p.returncode == 0: - result = p.stdout.read().decode('utf-8').strip() - m = re.search(default_regex, result) - if m: - performance = float(m.group(2)) - else: - print("Execution failed: {}".format(runcmd)) - break - print(result) - sys.stdout.flush() - N = int(N * scale_N) diff --git a/MemoryHierarchy/src/affinity.c b/MemoryHierarchy/src/affinity.c deleted file mode 100644 index cc361c2..0000000 --- a/MemoryHierarchy/src/affinity.c +++ /dev/null @@ -1,89 +0,0 @@ -/* - * ======================================================================================= - * - * Author: Jan Eitzinger (je), jan.treibig@gmail.com - * Copyright (c) 2019 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 - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - * - * ======================================================================================= - */ - -#ifdef __linux__ -#ifdef _OPENMP -#include -#include -#include -#include -#include -#include -#include - -#define MAX_NUM_THREADS 128 -#define gettid() syscall(SYS_gettid) - -static int -getProcessorID(cpu_set_t* cpu_set) -{ - int processorId; - - for ( processorId = 0; processorId < MAX_NUM_THREADS; processorId++ ) - { - if ( CPU_ISSET(processorId,cpu_set) ) - { - break; - } - } - return processorId; -} - - -int -affinity_getProcessorId() -{ - cpu_set_t cpu_set; - CPU_ZERO(&cpu_set); - sched_getaffinity(gettid(),sizeof(cpu_set_t), &cpu_set); - - return getProcessorID(&cpu_set); -} - -void -affinity_pinThread(int processorId) -{ - cpu_set_t cpuset; - pthread_t thread; - - thread = pthread_self(); - CPU_ZERO(&cpuset); - CPU_SET(processorId, &cpuset); - pthread_setaffinity_np(thread, sizeof(cpu_set_t), &cpuset); -} - -void -affinity_pinProcess(int processorId) -{ - cpu_set_t cpuset; - - CPU_ZERO(&cpuset); - CPU_SET(processorId, &cpuset); - sched_setaffinity(0, sizeof(cpu_set_t), &cpuset); -} -#endif /*__linux__*/ -#endif /*_OPENMP*/ diff --git a/MemoryHierarchy/src/affinity.h b/MemoryHierarchy/src/affinity.h deleted file mode 100644 index 9c7eecf..0000000 --- a/MemoryHierarchy/src/affinity.h +++ /dev/null @@ -1,36 +0,0 @@ -/* - * ======================================================================================= - * - * Author: Jan Eitzinger (je), jan.treibig@gmail.com - * Copyright (c) 2019 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 - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - * - * ======================================================================================= - */ - -#ifndef AFFINITY_H -#define AFFINITY_H - -extern int affinity_getProcessorId(); -extern void affinity_pinProcess(int); -extern void affinity_pinThread(int); - -#endif /*AFFINITY_H*/ - diff --git a/MemoryHierarchy/src/allocate.c b/MemoryHierarchy/src/allocate.c deleted file mode 100644 index eaaa5e3..0000000 --- a/MemoryHierarchy/src/allocate.c +++ /dev/null @@ -1,58 +0,0 @@ -/* - * ======================================================================================= - * - * Author: Jan Eitzinger (je), jan.treibig@gmail.com - * Copyright (c) 2019 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 - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - * - * ======================================================================================= - */ - -#include -#include -#include - -void* allocate (int alignment, size_t bytesize) -{ - int errorCode; - void* ptr; - - errorCode = posix_memalign(&ptr, alignment, bytesize); - - if (errorCode) { - if (errorCode == EINVAL) { - fprintf(stderr, - "Error: Alignment parameter is not a power of two\n"); - exit(EXIT_FAILURE); - } - if (errorCode == ENOMEM) { - fprintf(stderr, - "Error: Insufficient memory to fulfill the request\n"); - exit(EXIT_FAILURE); - } - } - - if (ptr == NULL) { - fprintf(stderr, "Error: posix_memalign failed!\n"); - exit(EXIT_FAILURE); - } - - return ptr; -} diff --git a/MemoryHierarchy/src/allocate.h b/MemoryHierarchy/src/allocate.h deleted file mode 100644 index a6ee561..0000000 --- a/MemoryHierarchy/src/allocate.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - * ======================================================================================= - * - * Author: Jan Eitzinger (je), jan.treibig@gmail.com - * Copyright (c) 2019 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 - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - * - * ======================================================================================= - */ - -#ifndef __ALLOCATE_H_ -#define __ALLOCATE_H_ - -extern void* allocate (int alignment, size_t bytesize); - -#endif diff --git a/MemoryHierarchy/src/likwid_markers.h b/MemoryHierarchy/src/likwid_markers.h deleted file mode 100644 index 76351d2..0000000 --- a/MemoryHierarchy/src/likwid_markers.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - * ======================================================================================= - * - * Author: Jan Eitzinger (je), jan.treibig@gmail.com - * Copyright (c) 2019 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 - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - * - * ======================================================================================= - */ - -#ifndef LIKWID_MARKERS_H -#define LIKWID_MARKERS_H - -#ifdef LIKWID_PERFMON -#include -#else -#define LIKWID_MARKER_INIT -#define LIKWID_MARKER_THREADINIT -#define LIKWID_MARKER_SWITCH -#define LIKWID_MARKER_REGISTER(regionTag) -#define LIKWID_MARKER_START(regionTag) -#define LIKWID_MARKER_STOP(regionTag) -#define LIKWID_MARKER_CLOSE -#define LIKWID_MARKER_GET(regionTag, nevents, events, time, count) -#endif - -#endif /*LIKWID_MARKERS_H*/ diff --git a/MemoryHierarchy/src/main.c b/MemoryHierarchy/src/main.c deleted file mode 100644 index b634e68..0000000 --- a/MemoryHierarchy/src/main.c +++ /dev/null @@ -1,216 +0,0 @@ -/* - * ======================================================================================= - * - * Author: Jan Eitzinger (je), jan.treibig@gmail.com - * Copyright (c) 2019 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 - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - * - * ======================================================================================= - */ - -#include -#include -#include -#include -#include - -#ifdef _OPENMP -#include -#endif - -#include -#include -#include -#include - -#define HLINE "----------------------------------------------------------------------------\n" - - -#ifndef MIN -#define MIN(x,y) ((x)<(y)?(x):(y)) -#endif -#ifndef MAX -#define MAX(x,y) ((x)>(y)?(x):(y)) -#endif -#ifndef ABS -#define ABS(a) ((a) >= 0 ? (a) : -(a)) -#endif - -extern double striad_seq(double*, double*, double*, double*, int, int); -extern double striad_tp(double*, double*, double*, double*, int, int); -extern double striad_ws(double*, double*, double*, double*, int, int); - -typedef double (*testFunc)(double*, double*, double*, double*, int, int); - -int main (int argc, char** argv) -{ - size_t bytesPerWord = sizeof(double); - size_t N; - int type; - size_t iter = 1; - size_t scale = 1; - double *a, *b, *c, *d; - double E, S; - double avgtime, maxtime, mintime; - double times[NTIMES]; - double dataSize; - testFunc func; - char* testname; - - - if ( argc > 2 ) { - type = atoi(argv[1]); - N = atoi(argv[2]); - } else { - printf("Usage: %s \n",argv[0]); - printf("Test types: 0 - sequential, 1 - OpenMP throughput, 2 - OpenMP worksharing\n"); - exit(EXIT_SUCCESS); - } - - LIKWID_MARKER_INIT; - - switch ( type ) { - case 0: - func = striad_seq; - testname = "striad_seq"; - break; - case 1: - func = striad_tp; - testname = "striad_tp"; -#ifdef _OPENMP -#pragma omp parallel - { -#pragma omp single - scale = omp_get_num_threads(); - - - LIKWID_MARKER_REGISTER("BENCH"); - } -#endif - break; - case 2: - func = striad_ws; - testname = "striad_ws"; - break; - default: - printf("Unknown test type: %d\n", type); - exit(EXIT_FAILURE); - } - - a = (double*) allocate( ARRAY_ALIGNMENT, N * bytesPerWord ); - b = (double*) allocate( ARRAY_ALIGNMENT, N * bytesPerWord ); - c = (double*) allocate( ARRAY_ALIGNMENT, N * bytesPerWord ); - d = (double*) allocate( ARRAY_ALIGNMENT, N * bytesPerWord ); - -#ifdef VERBOSE - printf(HLINE); - dataSize = 4.0 * bytesPerWord * N; - - if ( dataSize < 1.0E06 ) { - printf ("Total allocated datasize: %8.2f KB\n", dataSize * 1.0E-03); - } else { - printf ("Total allocated datasize: %8.2f MB\n", dataSize * 1.0E-06); - } -#endif - avgtime = 0; - maxtime = 0; - mintime = FLT_MAX; - -#ifdef VERBOSE -#ifdef _OPENMP - printf(HLINE); -#pragma omp parallel - { - int k = omp_get_num_threads(); - int i = omp_get_thread_num(); - -#pragma omp single - printf ("OpenMP enabled, running with %d threads\n", k); - - printf ("\tThread %d running on processor %d\n", i, affinity_getProcessorId()); - } -#endif -#endif - - S = getTimeStamp(); -#pragma omp parallel for - for (int i=0; i 0.1 ) break; - double factor = 0.2 / (times[0] - times[1]); - iter *= (int) factor; - times[1] = times[0]; - } - -#ifdef VERBOSE - printf ("Using %d iterations \n", iter); -#endif - - for ( int k=0; k < NTIMES; k++) { - times[k] = func(a, b, c, d, N, iter); - } - - for (int k=1; k - -#include -#include - -double striad_seq( - double * restrict a, - const double * restrict b, - const double * restrict c, - const double * restrict d, - int N, - int iter - ) -{ - double S, E; - - S = getTimeStamp(); - LIKWID_MARKER_START("BENCH"); - for(int j = 0; j < iter; j++) { - for (int i=0; i 2000) printf("Ai = %f\n",a[N-1]); - } - LIKWID_MARKER_STOP("BENCH"); - E = getTimeStamp(); - - return E-S; -} diff --git a/MemoryHierarchy/src/striad_tp.c b/MemoryHierarchy/src/striad_tp.c deleted file mode 100644 index 6b5297a..0000000 --- a/MemoryHierarchy/src/striad_tp.c +++ /dev/null @@ -1,62 +0,0 @@ -/* - * ======================================================================================= - * - * Author: Jan Eitzinger (je), jan.treibig@gmail.com - * Copyright (c) 2019 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 - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - * - * ======================================================================================= - */ - -#include - -#include -#include - -double striad_tp( - double * restrict a, - const double * restrict b, - const double * restrict c, - const double * restrict d, - int N, - int iter - ) -{ - double S, E; - -#pragma omp parallel - { - double* al = (double*) allocate( ARRAY_ALIGNMENT, N * sizeof(double)); - -#pragma omp single - S = getTimeStamp(); - for(int j = 0; j < iter; j++) { - for (int i=0; i 2000) printf("Ai = %f\n",al[N-1]); - } -#pragma omp single - E = getTimeStamp(); - } - - return E-S; -} diff --git a/MemoryHierarchy/src/striad_ws.c b/MemoryHierarchy/src/striad_ws.c deleted file mode 100644 index 9ba1374..0000000 --- a/MemoryHierarchy/src/striad_ws.c +++ /dev/null @@ -1,57 +0,0 @@ -/* - * ======================================================================================= - * - * Author: Jan Eitzinger (je), jan.treibig@gmail.com - * Copyright (c) 2019 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 - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - * - * ======================================================================================= - */ - -#include - -#include - -double striad_ws( - double * restrict a, - const double * restrict b, - const double * restrict c, - const double * restrict d, - int N, - int iter - ) -{ - double S, E; - - S = getTimeStamp(); -#pragma omp parallel - { - for(int j = 0; j < iter; j++) { -#pragma omp for - for (int i=0; i 2000) printf("Ai = %f\n",a[N-1]); - } - } - E = getTimeStamp(); - - return E-S; -} diff --git a/MemoryHierarchy/src/timing.c b/MemoryHierarchy/src/timing.c deleted file mode 100644 index 0ed2617..0000000 --- a/MemoryHierarchy/src/timing.c +++ /dev/null @@ -1,49 +0,0 @@ -/* - * ======================================================================================= - * - * Author: Jan Eitzinger (je), jan.treibig@gmail.com - * Copyright (c) 2019 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 - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - * - * ======================================================================================= - */ - -#include -#include - -double getTimeStamp() -{ - struct timespec ts; - clock_gettime(CLOCK_MONOTONIC, &ts); - return (double)ts.tv_sec + (double)ts.tv_nsec * 1.e-9; -} - -double getTimeResolution() -{ - struct timespec ts; - clock_getres(CLOCK_MONOTONIC, &ts); - return (double)ts.tv_sec + (double)ts.tv_nsec * 1.e-9; -} - -double getTimeStamp_() -{ - return getTimeStamp(); -} - diff --git a/MemoryHierarchy/src/timing.h b/MemoryHierarchy/src/timing.h deleted file mode 100644 index 79bdf95..0000000 --- a/MemoryHierarchy/src/timing.h +++ /dev/null @@ -1,35 +0,0 @@ -/* - * ======================================================================================= - * - * Author: Jan Eitzinger (je), jan.treibig@gmail.com - * Copyright (c) 2019 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 - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - * - * ======================================================================================= - */ - -#ifndef __TIMING_H_ -#define __TIMING_H_ - -extern double getTimeStamp(); -extern double getTimeResolution(); -extern double getTimeStamp_(); - -#endif diff --git a/MainMemory/bench.pl b/bench.pl similarity index 100% rename from MainMemory/bench.pl rename to bench.pl diff --git a/MainMemory/bench.py b/bench.py similarity index 100% rename from MainMemory/bench.py rename to bench.py diff --git a/MainMemory/config.mk b/config.mk similarity index 100% rename from MainMemory/config.mk rename to config.mk diff --git a/MainMemory/include_CLANG.mk b/include_CLANG.mk similarity index 100% rename from MainMemory/include_CLANG.mk rename to include_CLANG.mk diff --git a/MainMemory/include_GCC.mk b/include_GCC.mk similarity index 100% rename from MainMemory/include_GCC.mk rename to include_GCC.mk diff --git a/MainMemory/include_ICC.mk b/include_ICC.mk similarity index 100% rename from MainMemory/include_ICC.mk rename to include_ICC.mk diff --git a/MainMemory/src/affinity.c b/src/affinity.c similarity index 100% rename from MainMemory/src/affinity.c rename to src/affinity.c diff --git a/MainMemory/src/allocate.c b/src/allocate.c similarity index 100% rename from MainMemory/src/allocate.c rename to src/allocate.c diff --git a/MainMemory/src/copy.c b/src/copy.c similarity index 100% rename from MainMemory/src/copy.c rename to src/copy.c diff --git a/MainMemory/src/daxpy.c b/src/daxpy.c similarity index 100% rename from MainMemory/src/daxpy.c rename to src/daxpy.c diff --git a/MainMemory/src/includes/affinity.h b/src/includes/affinity.h similarity index 100% rename from MainMemory/src/includes/affinity.h rename to src/includes/affinity.h diff --git a/MainMemory/src/includes/allocate.h b/src/includes/allocate.h similarity index 100% rename from MainMemory/src/includes/allocate.h rename to src/includes/allocate.h diff --git a/MainMemory/src/includes/timing.h b/src/includes/timing.h similarity index 100% rename from MainMemory/src/includes/timing.h rename to src/includes/timing.h diff --git a/MainMemory/src/init.c b/src/init.c similarity index 100% rename from MainMemory/src/init.c rename to src/init.c diff --git a/MainMemory/src/main.c b/src/main.c similarity index 100% rename from MainMemory/src/main.c rename to src/main.c diff --git a/MainMemory/src/sdaxpy.c b/src/sdaxpy.c similarity index 100% rename from MainMemory/src/sdaxpy.c rename to src/sdaxpy.c diff --git a/MainMemory/src/striad.c b/src/striad.c similarity index 100% rename from MainMemory/src/striad.c rename to src/striad.c diff --git a/MainMemory/src/sum.c b/src/sum.c similarity index 100% rename from MainMemory/src/sum.c rename to src/sum.c diff --git a/MainMemory/src/timing.c b/src/timing.c similarity index 100% rename from MainMemory/src/timing.c rename to src/timing.c diff --git a/MainMemory/src/triad.c b/src/triad.c similarity index 100% rename from MainMemory/src/triad.c rename to src/triad.c diff --git a/MainMemory/src/update.c b/src/update.c similarity index 100% rename from MainMemory/src/update.c rename to src/update.c From bf90da4224cb4f62c1d3665e2b4dbef7e632f255 Mon Sep 17 00:00:00 2001 From: Jan Eitzinger Date: Sun, 15 Sep 2019 06:22:27 +0200 Subject: [PATCH 2/8] Make compilation steps verbose --- Makefile | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 14d3e8f..9d6812b 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,3 @@ - #CONFIGURE BUILD SYSTEM TARGET = bwbench-$(TAG) BUILD_DIR = ./$(TAG) @@ -30,12 +29,12 @@ asm: $(BUILD_DIR) $(ASM) $(BUILD_DIR)/%.o: %.c @echo "===> COMPILE $@" - $(Q)$(CC) -c $(CPPFLAGS) $(CFLAGS) $< -o $@ + $(CC) -c $(CPPFLAGS) $(CFLAGS) $< -o $@ $(Q)$(CC) $(CPPFLAGS) -MT $(@:.d=.o) -MM $< > $(BUILD_DIR)/$*.d $(BUILD_DIR)/%.s: %.c @echo "===> GENERATE ASM $@" - $(Q)$(CC) -S $(CPPFLAGS) $(CFLAGS) $< -o $@ + $(CC) -S $(CPPFLAGS) $(CFLAGS) $< -o $@ $(BUILD_DIR)/%.s: %.f90 @echo "===> COMPILE $@" From 7dd895fefcb69150745504c6c92791a9e308e97c Mon Sep 17 00:00:00 2001 From: Jan Eitzinger Date: Sun, 15 Sep 2019 06:47:55 +0200 Subject: [PATCH 3/8] Add markers to all benchmarks. Code review. Add GCC for dependencies. --- Makefile | 3 ++- config.mk | 1 + include_CLANG.mk | 3 ++- include_GCC.mk | 3 ++- include_ICC.mk | 3 ++- include_LIKWID.mk | 10 ++++++++ src/affinity.c | 3 +-- src/copy.c | 12 +++++++--- src/daxpy.c | 12 +++++++--- src/includes/likwid_markers.h | 44 +++++++++++++++++++++++++++++++++++ src/init.c | 12 +++++++--- src/main.c | 19 +++++++++++++-- src/sdaxpy.c | 12 +++++++--- src/striad.c | 12 +++++++--- src/sum.c | 12 +++++++--- src/timing.c | 1 - src/triad.c | 12 +++++++--- src/update.c | 12 +++++++--- 18 files changed, 153 insertions(+), 33 deletions(-) create mode 100644 include_LIKWID.mk create mode 100644 src/includes/likwid_markers.h diff --git a/Makefile b/Makefile index 9d6812b..54527fd 100644 --- a/Makefile +++ b/Makefile @@ -8,6 +8,7 @@ Q ?= @ #DO NOT EDIT BELOW include $(MAKE_DIR)/config.mk include $(MAKE_DIR)/include_$(TAG).mk +include $(MAKE_DIR)/include_LIKWID.mk INCLUDES += -I./src/includes VPATH = $(SRC_DIR) @@ -30,7 +31,7 @@ asm: $(BUILD_DIR) $(ASM) $(BUILD_DIR)/%.o: %.c @echo "===> COMPILE $@" $(CC) -c $(CPPFLAGS) $(CFLAGS) $< -o $@ - $(Q)$(CC) $(CPPFLAGS) -MT $(@:.d=.o) -MM $< > $(BUILD_DIR)/$*.d + $(Q)$(GCC) $(CPPFLAGS) -MT $(@:.d=.o) -MM $< > $(BUILD_DIR)/$*.d $(BUILD_DIR)/%.s: %.c @echo "===> GENERATE ASM $@" diff --git a/config.mk b/config.mk index b5c5f15..78cc540 100644 --- a/config.mk +++ b/config.mk @@ -1,6 +1,7 @@ # Supported: GCC, CLANG, ICC TAG ?= GCC ENABLE_OPENMP ?= false +ENABLE_LIKWID ?= false #Feature options OPTIONS = -DSIZE=40000000ull diff --git a/include_CLANG.mk b/include_CLANG.mk index 43328ee..30945f6 100644 --- a/include_CLANG.mk +++ b/include_CLANG.mk @@ -1,4 +1,5 @@ -CC = clang +CC = clang +GCC = gcc LINKER = $(CC) ifeq ($(ENABLE_OPENMP),true) diff --git a/include_GCC.mk b/include_GCC.mk index d85fe65..4ce8210 100644 --- a/include_GCC.mk +++ b/include_GCC.mk @@ -1,4 +1,5 @@ -CC = gcc +CC = gcc +GCC = gcc LINKER = $(CC) ifeq ($(ENABLE_OPENMP),true) diff --git a/include_ICC.mk b/include_ICC.mk index dd1cb99..210e0c3 100644 --- a/include_ICC.mk +++ b/include_ICC.mk @@ -1,4 +1,5 @@ -CC = icc +CC = icc +GCC = gcc LINKER = $(CC) ifeq ($(ENABLE_OPENMP),true) diff --git a/include_LIKWID.mk b/include_LIKWID.mk new file mode 100644 index 0000000..4ca5456 --- /dev/null +++ b/include_LIKWID.mk @@ -0,0 +1,10 @@ +LIKWID_INC ?= -I/usr/local/include +LIKWID_DEFINES ?= -DLIKWID_PERFMON +LIKWID_LIB ?= -L/usr/local/lib + +ifeq ($(strip $(ENABLE_LIKWID)),true) +INCLUDES += ${LIKWID_INC} +DEFINES += ${LIKWID_DEFINES} +LIBS += -llikwid +LFLAGS += ${LIKWID_LIB} +endif diff --git a/src/affinity.c b/src/affinity.c index cc361c2..787705c 100644 --- a/src/affinity.c +++ b/src/affinity.c @@ -53,7 +53,6 @@ getProcessorID(cpu_set_t* cpu_set) return processorId; } - int affinity_getProcessorId() { @@ -85,5 +84,5 @@ affinity_pinProcess(int processorId) CPU_SET(processorId, &cpuset); sched_setaffinity(0, sizeof(cpu_set_t), &cpuset); } -#endif /*__linux__*/ #endif /*_OPENMP*/ +#endif /*__linux__*/ diff --git a/src/copy.c b/src/copy.c index 7e31a0c..360a388 100644 --- a/src/copy.c +++ b/src/copy.c @@ -26,6 +26,7 @@ */ #include +#include double copy( double * restrict a, @@ -36,9 +37,14 @@ double copy( double S, E; S = getTimeStamp(); -#pragma omp parallel for - for (int i=0; i +#include double daxpy( double * restrict a, @@ -37,9 +38,14 @@ double daxpy( double S, E; S = getTimeStamp(); -#pragma omp parallel for - for (int i=0; i +#else +#define LIKWID_MARKER_INIT +#define LIKWID_MARKER_THREADINIT +#define LIKWID_MARKER_SWITCH +#define LIKWID_MARKER_REGISTER(regionTag) +#define LIKWID_MARKER_START(regionTag) +#define LIKWID_MARKER_STOP(regionTag) +#define LIKWID_MARKER_CLOSE +#define LIKWID_MARKER_GET(regionTag, nevents, events, time, count) +#endif + +#endif /*LIKWID_MARKERS_H*/ diff --git a/src/init.c b/src/init.c index f2164a8..373466e 100644 --- a/src/init.c +++ b/src/init.c @@ -26,6 +26,7 @@ */ #include +#include double init( double * restrict a, @@ -36,9 +37,14 @@ double init( double S, E; S = getTimeStamp(); -#pragma omp parallel for - for (int i=0; i #include #include +#include #define HLINE "----------------------------------------------------------------------------\n" @@ -89,8 +90,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]; @@ -105,6 +106,19 @@ int main (int argc, char** argv) {"SDaxpy: ", 4, 2} }; + LIKWID_MARKER_INIT; +#pragma omp parallel + { + LIKWID_MARKER_REGISTER("INIT"); + LIKWID_MARKER_REGISTER("SUM"); + LIKWID_MARKER_REGISTER("COPY"); + LIKWID_MARKER_REGISTER("UPDATE"); + LIKWID_MARKER_REGISTER("TRIAD"); + LIKWID_MARKER_REGISTER("DAXPY"); + LIKWID_MARKER_REGISTER("STRIAD"); + LIKWID_MARKER_REGISTER("SDAXPY"); + } + a = (double*) allocate( ARRAY_ALIGNMENT, N * bytesPerWord ); b = (double*) allocate( ARRAY_ALIGNMENT, N * bytesPerWord ); c = (double*) allocate( ARRAY_ALIGNMENT, N * bytesPerWord ); @@ -200,6 +214,7 @@ int main (int argc, char** argv) printf(HLINE); check(a, b, c, d, N); + LIKWID_MARKER_CLOSE; return EXIT_SUCCESS; } diff --git a/src/sdaxpy.c b/src/sdaxpy.c index 46f2626..a7c45da 100644 --- a/src/sdaxpy.c +++ b/src/sdaxpy.c @@ -26,6 +26,7 @@ */ #include +#include double sdaxpy( double * restrict a, @@ -37,9 +38,14 @@ double sdaxpy( double S, E; S = getTimeStamp(); -#pragma omp parallel for - for (int i=0; i +#include double striad( double * restrict a, @@ -38,9 +39,14 @@ double striad( double S, E; S = getTimeStamp(); -#pragma omp parallel for - for (int i=0; i +#include double sum( double * restrict a, @@ -36,9 +37,14 @@ double sum( double sum = 0.0; S = getTimeStamp(); -#pragma omp parallel for reduction(+:sum) - for (int i=0; i +#include double triad( double * restrict a, @@ -38,9 +39,14 @@ double triad( double S, E; S = getTimeStamp(); -#pragma omp parallel for - for (int i=0; i +#include double update( double * restrict a, @@ -36,9 +37,14 @@ double update( double S, E; S = getTimeStamp(); -#pragma omp parallel for - for (int i=0; i Date: Sun, 15 Sep 2019 06:52:29 +0200 Subject: [PATCH 4/8] Move docs from git to README --- Makefile | 25 +++++++++++ README.md | 128 +++++++++++++++++++++++++++++++++++++++++++++++++++--- 2 files changed, 147 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 54527fd..dd4f0ef 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,28 @@ +#======================================================================================= +# +# Author: Jan Eitzinger (je), jan.treibig@gmail.com +# Copyright (c) 2019 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 +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. +# +#======================================================================================= + #CONFIGURE BUILD SYSTEM TARGET = bwbench-$(TAG) BUILD_DIR = ./$(TAG) diff --git a/README.md b/README.md index 6119293..3fb7111 100644 --- a/README.md +++ b/README.md @@ -2,12 +2,7 @@ This is a collection of simple streaming kernels for teaching purposes. -It consists of two banchmark applications: - -* [MainMemory](https://github.com/RRZE-HPC/TheBandwidthBenchmark/wiki/MainMemory) -* [MemoryHierarchy](https://github.com/RRZE-HPC/TheBandwidthBenchmark/wiki/MemoryHierarchy) - -Apart from the microbenchmarking functionality this is also a blueprint for other microbenchmarking applications. +Apart from the micro-benchmark functionality this is also a blueprint for other micro-benchmark applications. It contains C modules for: * Aligned data allocation @@ -15,3 +10,124 @@ It contains C modules for: * Accurate timing Moreover the benchmark showcases a simple generic Makefile that can be used in other projects. + +## Overview + +The benchmark is heavily inspired by John McCalpin's https://www.cs.virginia.edu/stream/ benchmark. + +It contains the following streaming kernels with corresponding data access pattern (Notation: S - store, L - load, WA - write allocate). All variables are vectors, s is a scalar: + +* init (S1, WA): Initilize an array: `a = s`. Store only. +* sum (L1): Vector reduction: `s += a`. Load only. +* copy (L1, S1, WA): Classic memcopy: `a = b`. +* update (L1, S1): Update vector: `a = a * scalar`. Also load + store but without write allocate. +* triad (L2, S1, WA): Stream triad: `a = b + c * scalar`. +* daxpy (L2, S1): Daxpy: `a = a + b * scalar`. +* striad (L3, S1, WA): Schoenauer triad: `a = b + c * d`. +* sdaxpy (L3, S1): Schoenauer triad without write allocate: `a = a + b * c`. + +As added benefit the code is a blueprint for a minimal benchmarking application with a generic makefile and modules for aligned array allocation, accurate timing and affinity settings. Those components can be used standalone in your own project. + +## Build + +1. Configure the toolchain and additional options in `config.mk`: +``` +# Supported: GCC, CLANG, ICC +TAG ?= GCC +ENABLE_OPENMP ?= false +ENABLE_LIKWID ?= false + +OPTIONS = -DSIZE=40000000ull +OPTIONS += -DNTIMES=10 +OPTIONS += -DARRAY_ALIGNMENT=64 +#OPTIONS += -DVERBOSE_AFFINITY +#OPTIONS += -DVERBOSE_DATASIZE +#OPTIONS += -DVERBOSE_TIMER +``` + +The verbosity options enable detailed output about affinity settings, allocation sizes and timer resolution. + +2. Build with: +``` +make +``` + +You can build multiple toolchains in the same directory, but notice that the Makefile is only acting on the one currently set. Intermediate build results are located in the `` directory. + +To output the executed commands use: +``` +make Q= +``` + +3. Clean up with: +``` +make clean +``` +to clean intermediate build results. + +``` +make distclean +``` +to clean intermediate build results and binary. + +4. (Optional) Generate assembler: +``` +make asm +``` +The assembler files will also be located in the `` directory. + +## Usage + +To run the benchmark call: +``` +./bwBench- +``` + +The benchmark will output the results similar to the stream benchmark. Results are validated. +For threaded execution it is recommended to control thread affinity. + +We recommend to use likwid-pin for benchmarking: +``` +likwid-pin -c 0-3 ./bwbench-GCC +``` + +Example output for threaded execution: +``` +------------------------------------------------------------- +[pthread wrapper] +[pthread wrapper] MAIN -> 0 +[pthread wrapper] PIN_MASK: 0->1 1->2 2->3 +[pthread wrapper] SKIP MASK: 0x0 + threadid 140271463495424 -> core 1 - OK + threadid 140271455102720 -> core 2 - OK + threadid 140271446710016 -> core 3 - OK +OpenMP enabled, running with 4 threads +---------------------------------------------------------------------------- +Function Rate(MB/s) Rate(MFlop/s) Avg time Min time Max time +Init: 22111.53 - 0.0148 0.0145 0.0165 +Sum: 46808.59 46808.59 0.0077 0.0068 0.0140 +Copy: 30983.06 - 0.0207 0.0207 0.0208 +Update: 43778.69 21889.34 0.0147 0.0146 0.0148 +Triad: 34476.64 22984.43 0.0282 0.0278 0.0305 +Daxpy: 45908.82 30605.88 0.0214 0.0209 0.0242 +STriad: 37502.37 18751.18 0.0349 0.0341 0.0388 +SDaxpy: 46822.63 23411.32 0.0281 0.0273 0.0325 +---------------------------------------------------------------------------- +Solution Validates +``` + +## Benchmarking skript + +A perl wrapper script (bench.pl) is also provided to scan ranges of thread counts and determine the absolute highest sustained main memory bandwidth. In order to use it `likwid-pin` has to be in your path. The script has three required and one optional command line arguments: +``` +$./bench.pl [] +``` +Example usage: +``` +$./bench.pl ./bwbench-GCC 2-8 6 +``` +The script will always use physical cores only, where two SMT threads is the default. For different SMT thread counts use the 4th command line argument. Example for a processor without SMT: +``` +$./bench.pl ./bwbench-GCC 14-24 10 1 +``` + From 7718baedb5a3da02244af1b3a907d5dbea1ffd03 Mon Sep 17 00:00:00 2001 From: moebiusband73 Date: Sun, 15 Sep 2019 06:50:33 +0200 Subject: [PATCH 5/8] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 3fb7111..1fc4fed 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # The Bandwidth Benchmark -This is a collection of simple streaming kernels for teaching purposes. +This is a collection of simple streaming kernels. Apart from the micro-benchmark functionality this is also a blueprint for other micro-benchmark applications. From 0afff6ac2c545089ae8ce88bc6090277d0a1eb90 Mon Sep 17 00:00:00 2001 From: Jan Eitzinger Date: Sun, 15 Sep 2019 07:05:05 +0200 Subject: [PATCH 6/8] Update email in license --- Makefile | 2 +- bench.pl | 26 ++++++++++++++++++++++++++ src/affinity.c | 2 +- src/allocate.c | 2 +- src/copy.c | 2 +- src/daxpy.c | 2 +- src/includes/affinity.h | 3 +-- src/includes/allocate.h | 2 +- src/includes/likwid_markers.h | 2 +- src/includes/timing.h | 2 +- src/init.c | 2 +- src/main.c | 2 +- src/sdaxpy.c | 2 +- src/striad.c | 2 +- src/sum.c | 2 +- src/timing.c | 2 +- src/triad.c | 2 +- src/update.c | 2 +- 18 files changed, 43 insertions(+), 18 deletions(-) diff --git a/Makefile b/Makefile index dd4f0ef..0d7e294 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ #======================================================================================= # -# Author: Jan Eitzinger (je), jan.treibig@gmail.com +# Author: Jan Eitzinger (je), jan.eitzinger@fau.de # Copyright (c) 2019 RRZE, University Erlangen-Nuremberg # # Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/bench.pl b/bench.pl index 69c91eb..207f8ec 100755 --- a/bench.pl +++ b/bench.pl @@ -1,4 +1,30 @@ #!/usr/bin/env perl + +# ======================================================================================= +# +# Author: Jan Eitzinger (je), jan.eitzinger@fau.de +# Copyright (c) 2019 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 +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. +# +# ======================================================================================= + use strict; use warnings; use utf8; diff --git a/src/affinity.c b/src/affinity.c index 787705c..19f4358 100644 --- a/src/affinity.c +++ b/src/affinity.c @@ -1,7 +1,7 @@ /* * ======================================================================================= * - * Author: Jan Eitzinger (je), jan.treibig@gmail.com + * Author: Jan Eitzinger (je), jan.eitzinger@fau.de * Copyright (c) 2019 RRZE, University Erlangen-Nuremberg * * Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/src/allocate.c b/src/allocate.c index eaaa5e3..2ad9236 100644 --- a/src/allocate.c +++ b/src/allocate.c @@ -1,7 +1,7 @@ /* * ======================================================================================= * - * Author: Jan Eitzinger (je), jan.treibig@gmail.com + * Author: Jan Eitzinger (je), jan.eitzinger@fau.de * Copyright (c) 2019 RRZE, University Erlangen-Nuremberg * * Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/src/copy.c b/src/copy.c index 360a388..198da85 100644 --- a/src/copy.c +++ b/src/copy.c @@ -1,7 +1,7 @@ /* * ======================================================================================= * - * Author: Jan Eitzinger (je), jan.treibig@gmail.com + * Author: Jan Eitzinger (je), jan.eitzinger@fau.de * Copyright (c) 2019 RRZE, University Erlangen-Nuremberg * * Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/src/daxpy.c b/src/daxpy.c index 93926ac..9433381 100644 --- a/src/daxpy.c +++ b/src/daxpy.c @@ -1,7 +1,7 @@ /* * ======================================================================================= * - * Author: Jan Eitzinger (je), jan.treibig@gmail.com + * Author: Jan Eitzinger (je), jan.eitzinger@fau.de * Copyright (c) 2019 RRZE, University Erlangen-Nuremberg * * Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/src/includes/affinity.h b/src/includes/affinity.h index 9c7eecf..80f531e 100644 --- a/src/includes/affinity.h +++ b/src/includes/affinity.h @@ -1,7 +1,7 @@ /* * ======================================================================================= * - * Author: Jan Eitzinger (je), jan.treibig@gmail.com + * Author: Jan Eitzinger (je), jan.eitzinger@fau.de * Copyright (c) 2019 RRZE, University Erlangen-Nuremberg * * Permission is hereby granted, free of charge, to any person obtaining a copy @@ -33,4 +33,3 @@ extern void affinity_pinProcess(int); extern void affinity_pinThread(int); #endif /*AFFINITY_H*/ - diff --git a/src/includes/allocate.h b/src/includes/allocate.h index a6ee561..1e83fe0 100644 --- a/src/includes/allocate.h +++ b/src/includes/allocate.h @@ -1,7 +1,7 @@ /* * ======================================================================================= * - * Author: Jan Eitzinger (je), jan.treibig@gmail.com + * Author: Jan Eitzinger (je), jan.eitzinger@fau.de * Copyright (c) 2019 RRZE, University Erlangen-Nuremberg * * Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/src/includes/likwid_markers.h b/src/includes/likwid_markers.h index 76351d2..ab47a0f 100644 --- a/src/includes/likwid_markers.h +++ b/src/includes/likwid_markers.h @@ -1,7 +1,7 @@ /* * ======================================================================================= * - * Author: Jan Eitzinger (je), jan.treibig@gmail.com + * Author: Jan Eitzinger (je), jan.eitzinger@fau.de * Copyright (c) 2019 RRZE, University Erlangen-Nuremberg * * Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/src/includes/timing.h b/src/includes/timing.h index 79bdf95..b7260cb 100644 --- a/src/includes/timing.h +++ b/src/includes/timing.h @@ -1,7 +1,7 @@ /* * ======================================================================================= * - * Author: Jan Eitzinger (je), jan.treibig@gmail.com + * Author: Jan Eitzinger (je), jan.eitzinger@fau.de * Copyright (c) 2019 RRZE, University Erlangen-Nuremberg * * Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/src/init.c b/src/init.c index 373466e..f139697 100644 --- a/src/init.c +++ b/src/init.c @@ -1,7 +1,7 @@ /* * ======================================================================================= * - * Author: Jan Eitzinger (je), jan.treibig@gmail.com + * Author: Jan Eitzinger (je), jan.eitzinger@fau.de * Copyright (c) 2019 RRZE, University Erlangen-Nuremberg * * Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/src/main.c b/src/main.c index 9c85d55..465bf31 100644 --- a/src/main.c +++ b/src/main.c @@ -1,7 +1,7 @@ /* * ======================================================================================= * - * Author: Jan Eitzinger (je), jan.treibig@gmail.com + * Author: Jan Eitzinger (je), jan.eitzinger@fau.de * Copyright (c) 2019 RRZE, University Erlangen-Nuremberg * * Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/src/sdaxpy.c b/src/sdaxpy.c index a7c45da..5de842d 100644 --- a/src/sdaxpy.c +++ b/src/sdaxpy.c @@ -1,7 +1,7 @@ /* * ======================================================================================= * - * Author: Jan Eitzinger (je), jan.treibig@gmail.com + * Author: Jan Eitzinger (je), jan.eitzinger@fau.de * Copyright (c) 2019 RRZE, University Erlangen-Nuremberg * * Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/src/striad.c b/src/striad.c index 6edecf5..c4cf806 100644 --- a/src/striad.c +++ b/src/striad.c @@ -1,7 +1,7 @@ /* * ======================================================================================= * - * Author: Jan Eitzinger (je), jan.treibig@gmail.com + * Author: Jan Eitzinger (je), jan.eitzinger@fau.de * Copyright (c) 2019 RRZE, University Erlangen-Nuremberg * * Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/src/sum.c b/src/sum.c index 111bd56..d3e4879 100644 --- a/src/sum.c +++ b/src/sum.c @@ -1,7 +1,7 @@ /* * ======================================================================================= * - * Author: Jan Eitzinger (je), jan.treibig@gmail.com + * Author: Jan Eitzinger (je), jan.eitzinger@fau.de * Copyright (c) 2019 RRZE, University Erlangen-Nuremberg * * Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/src/timing.c b/src/timing.c index 6b3f07b..2daf260 100644 --- a/src/timing.c +++ b/src/timing.c @@ -1,7 +1,7 @@ /* * ======================================================================================= * - * Author: Jan Eitzinger (je), jan.treibig@gmail.com + * Author: Jan Eitzinger (je), jan.eitzinger@fau.de * Copyright (c) 2019 RRZE, University Erlangen-Nuremberg * * Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/src/triad.c b/src/triad.c index e7336bb..15fefcb 100644 --- a/src/triad.c +++ b/src/triad.c @@ -1,7 +1,7 @@ /* * ======================================================================================= * - * Author: Jan Eitzinger (je), jan.treibig@gmail.com + * Author: Jan Eitzinger (je), jan.eitzinger@fau.de * Copyright (c) 2019 RRZE, University Erlangen-Nuremberg * * Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/src/update.c b/src/update.c index 94d1dc7..e347680 100644 --- a/src/update.c +++ b/src/update.c @@ -1,7 +1,7 @@ /* * ======================================================================================= * - * Author: Jan Eitzinger (je), jan.treibig@gmail.com + * Author: Jan Eitzinger (je), jan.eitzinger@fau.de * Copyright (c) 2019 RRZE, University Erlangen-Nuremberg * * Permission is hereby granted, free of charge, to any person obtaining a copy From 3430c3d6339994ff624c05020d39c61795b6ad0f Mon Sep 17 00:00:00 2001 From: Jan Eitzinger Date: Wed, 22 Apr 2020 10:09:38 +0200 Subject: [PATCH 7/8] Rename likwid marker header. --- src/copy.c | 2 +- src/daxpy.c | 2 +- src/includes/{likwid_markers.h => likwid-marker.h} | 0 src/init.c | 2 +- src/main.c | 2 +- src/sdaxpy.c | 2 +- src/striad.c | 2 +- src/sum.c | 2 +- src/triad.c | 2 +- src/update.c | 2 +- 10 files changed, 9 insertions(+), 9 deletions(-) rename src/includes/{likwid_markers.h => likwid-marker.h} (100%) diff --git a/src/copy.c b/src/copy.c index 198da85..468db8a 100644 --- a/src/copy.c +++ b/src/copy.c @@ -26,7 +26,7 @@ */ #include -#include +#include double copy( double * restrict a, diff --git a/src/daxpy.c b/src/daxpy.c index 9433381..c15a8fd 100644 --- a/src/daxpy.c +++ b/src/daxpy.c @@ -26,7 +26,7 @@ */ #include -#include +#include double daxpy( double * restrict a, diff --git a/src/includes/likwid_markers.h b/src/includes/likwid-marker.h similarity index 100% rename from src/includes/likwid_markers.h rename to src/includes/likwid-marker.h diff --git a/src/init.c b/src/init.c index f139697..193c5b1 100644 --- a/src/init.c +++ b/src/init.c @@ -26,7 +26,7 @@ */ #include -#include +#include double init( double * restrict a, diff --git a/src/main.c b/src/main.c index 465bf31..22682fe 100644 --- a/src/main.c +++ b/src/main.c @@ -38,7 +38,7 @@ #include #include #include -#include +#include #define HLINE "----------------------------------------------------------------------------\n" diff --git a/src/sdaxpy.c b/src/sdaxpy.c index 5de842d..f5c316b 100644 --- a/src/sdaxpy.c +++ b/src/sdaxpy.c @@ -26,7 +26,7 @@ */ #include -#include +#include double sdaxpy( double * restrict a, diff --git a/src/striad.c b/src/striad.c index c4cf806..67b98bd 100644 --- a/src/striad.c +++ b/src/striad.c @@ -26,7 +26,7 @@ */ #include -#include +#include double striad( double * restrict a, diff --git a/src/sum.c b/src/sum.c index d3e4879..7d07c1d 100644 --- a/src/sum.c +++ b/src/sum.c @@ -26,7 +26,7 @@ */ #include -#include +#include double sum( double * restrict a, diff --git a/src/triad.c b/src/triad.c index 15fefcb..df3200a 100644 --- a/src/triad.c +++ b/src/triad.c @@ -26,7 +26,7 @@ */ #include -#include +#include double triad( double * restrict a, diff --git a/src/update.c b/src/update.c index e347680..3c04369 100644 --- a/src/update.c +++ b/src/update.c @@ -26,7 +26,7 @@ */ #include -#include +#include double update( double * restrict a, From 3cb73d5ba01a78dbe5d0ee66e68fbce796f3470c Mon Sep 17 00:00:00 2001 From: Jan Eitzinger Date: Wed, 22 Apr 2020 10:09:59 +0200 Subject: [PATCH 8/8] Update marker header --- src/includes/likwid-marker.h | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/includes/likwid-marker.h b/src/includes/likwid-marker.h index ab47a0f..13d72eb 100644 --- a/src/includes/likwid-marker.h +++ b/src/includes/likwid-marker.h @@ -30,7 +30,16 @@ #ifdef LIKWID_PERFMON #include -#else +#define LIKWID_MARKER_INIT likwid_markerInit() +#define LIKWID_MARKER_THREADINIT likwid_markerThreadInit() +#define LIKWID_MARKER_SWITCH likwid_markerNextGroup() +#define LIKWID_MARKER_REGISTER(regionTag) likwid_markerRegisterRegion(regionTag) +#define LIKWID_MARKER_START(regionTag) likwid_markerStartRegion(regionTag) +#define LIKWID_MARKER_STOP(regionTag) likwid_markerStopRegion(regionTag) +#define LIKWID_MARKER_CLOSE likwid_markerClose() +#define LIKWID_MARKER_RESET(regionTag) likwid_markerResetRegion(regionTag) +#define LIKWID_MARKER_GET(regionTag, nevents, events, time, count) likwid_markerGetRegion(regionTag, nevents, events, time, count) +#else /* LIKWID_PERFMON */ #define LIKWID_MARKER_INIT #define LIKWID_MARKER_THREADINIT #define LIKWID_MARKER_SWITCH @@ -39,6 +48,7 @@ #define LIKWID_MARKER_STOP(regionTag) #define LIKWID_MARKER_CLOSE #define LIKWID_MARKER_GET(regionTag, nevents, events, time, count) -#endif +#define LIKWID_MARKER_RESET(regionTag) +#endif /* LIKWID_PERFMON */ #endif /*LIKWID_MARKERS_H*/