Merge branch 'MARKERS' of github.com:RRZE-HPC/TheBandwidthBenchmark
This commit is contained in:
1
Makefile
1
Makefile
@@ -9,6 +9,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)
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
# Supported: GCC, CLANG, ICC
|
||||
TAG ?= GCC
|
||||
TAG ?= ICC
|
||||
ENABLE_OPENMP ?= false
|
||||
ENABLE_LIKWID ?= false
|
||||
|
||||
#Feature options
|
||||
OPTIONS = -DSIZE=40000000ull
|
||||
OPTIONS = -DSIZE=100000000ull
|
||||
OPTIONS += -DNTIMES=10
|
||||
OPTIONS += -DARRAY_ALIGNMENT=64
|
||||
#OPTIONS += -DVERBOSE_AFFINITY
|
||||
|
||||
@@ -5,7 +5,7 @@ ifeq ($(ENABLE_OPENMP),true)
|
||||
OPENMP = -qopenmp
|
||||
endif
|
||||
|
||||
CFLAGS = -qopt-report -Ofast -xHost -std=c99 -ffreestanding $(OPENMP)
|
||||
CFLAGS = -Ofast -xHost -std=c99 -ffreestanding $(OPENMP)
|
||||
LFLAGS = $(OPENMP)
|
||||
DEFINES = -D_GNU_SOURCE
|
||||
INCLUDES =
|
||||
|
||||
10
include_LIKWID.mk
Normal file
10
include_LIKWID.mk
Normal file
@@ -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
|
||||
@@ -26,6 +26,7 @@
|
||||
*/
|
||||
|
||||
#include <timing.h>
|
||||
#include <likwid_markers.h>
|
||||
|
||||
double copy(
|
||||
double * restrict a,
|
||||
@@ -36,10 +37,15 @@ double copy(
|
||||
double S, E;
|
||||
|
||||
S = getTimeStamp();
|
||||
#pragma omp parallel for
|
||||
#pragma omp parallel
|
||||
{
|
||||
LIKWID_MARKER_START("COPY");
|
||||
#pragma omp for
|
||||
for (int i=0; i<N; i++) {
|
||||
a[i] = b[i];
|
||||
}
|
||||
LIKWID_MARKER_STOP("COPY");
|
||||
}
|
||||
E = getTimeStamp();
|
||||
|
||||
return E-S;
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
*/
|
||||
|
||||
#include <timing.h>
|
||||
#include <likwid_markers.h>
|
||||
|
||||
double daxpy(
|
||||
double * restrict a,
|
||||
@@ -37,10 +38,15 @@ double daxpy(
|
||||
double S, E;
|
||||
|
||||
S = getTimeStamp();
|
||||
#pragma omp parallel for
|
||||
#pragma omp parallel
|
||||
{
|
||||
LIKWID_MARKER_START("DAXPY");
|
||||
#pragma omp for
|
||||
for (int i=0; i<N; i++) {
|
||||
a[i] = a[i] + scalar * b[i];
|
||||
}
|
||||
LIKWID_MARKER_STOP("DAXPY");
|
||||
}
|
||||
E = getTimeStamp();
|
||||
|
||||
return E-S;
|
||||
|
||||
44
src/includes/likwid_markers.h
Normal file
44
src/includes/likwid_markers.h
Normal file
@@ -0,0 +1,44 @@
|
||||
/*
|
||||
* =======================================================================================
|
||||
*
|
||||
* 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 <likwid.h>
|
||||
#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*/
|
||||
@@ -26,6 +26,7 @@
|
||||
*/
|
||||
|
||||
#include <timing.h>
|
||||
#include <likwid_markers.h>
|
||||
|
||||
double init(
|
||||
double * restrict a,
|
||||
@@ -36,10 +37,15 @@ double init(
|
||||
double S, E;
|
||||
|
||||
S = getTimeStamp();
|
||||
#pragma omp parallel for
|
||||
#pragma omp parallel
|
||||
{
|
||||
LIKWID_MARKER_START("INIT");
|
||||
#pragma omp for
|
||||
for (int i=0; i<N; i++) {
|
||||
a[i] = scalar;
|
||||
}
|
||||
LIKWID_MARKER_STOP("INIT");
|
||||
}
|
||||
E = getTimeStamp();
|
||||
|
||||
return E-S;
|
||||
|
||||
13
src/main.c
13
src/main.c
@@ -38,6 +38,7 @@
|
||||
#include <timing.h>
|
||||
#include <allocate.h>
|
||||
#include <affinity.h>
|
||||
#include <likwid_markers.h>
|
||||
|
||||
#define HLINE "----------------------------------------------------------------------------\n"
|
||||
|
||||
@@ -105,6 +106,17 @@ int main (int argc, char** argv)
|
||||
{"SDaxpy: ", 4, 2}
|
||||
};
|
||||
|
||||
LIKWID_MARKER_INIT;
|
||||
#ifdef _OPENMP
|
||||
#pragma omp parallel
|
||||
{
|
||||
#endif
|
||||
LIKWID_MARKER_REGISTER("INIT");
|
||||
LIKWID_MARKER_REGISTER("COPY");
|
||||
#ifdef _OPENMP
|
||||
}
|
||||
#endif
|
||||
|
||||
a = (double*) allocate( ARRAY_ALIGNMENT, N * bytesPerWord );
|
||||
b = (double*) allocate( ARRAY_ALIGNMENT, N * bytesPerWord );
|
||||
c = (double*) allocate( ARRAY_ALIGNMENT, N * bytesPerWord );
|
||||
@@ -200,6 +212,7 @@ int main (int argc, char** argv)
|
||||
printf(HLINE);
|
||||
|
||||
check(a, b, c, d, N);
|
||||
LIKWID_MARKER_CLOSE;
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
12
src/triad.c
12
src/triad.c
@@ -26,6 +26,7 @@
|
||||
*/
|
||||
|
||||
#include <timing.h>
|
||||
#include <likwid_markers.h>
|
||||
|
||||
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<N; i++) {
|
||||
a[i] = b[i] + scalar * c[i];
|
||||
#pragma omp parallel
|
||||
{
|
||||
LIKWID_MARKER_START("TRIAD");
|
||||
#pragma omp for
|
||||
for (int i=0; i<N; i++) {
|
||||
a[i] = b[i] + scalar * c[i];
|
||||
}
|
||||
LIKWID_MARKER_STOP("TRIAD");
|
||||
}
|
||||
E = getTimeStamp();
|
||||
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
*/
|
||||
|
||||
#include <timing.h>
|
||||
#include <likwid_markers.h>
|
||||
|
||||
double update(
|
||||
double * restrict a,
|
||||
@@ -36,10 +37,15 @@ double update(
|
||||
double S, E;
|
||||
|
||||
S = getTimeStamp();
|
||||
#pragma omp parallel for
|
||||
#pragma omp parallel
|
||||
{
|
||||
LIKWID_MARKER_START("UPDATE");
|
||||
#pragma omp for
|
||||
for (int i=0; i<N; i++) {
|
||||
a[i] = a[i] * scalar;
|
||||
}
|
||||
LIKWID_MARKER_STOP("UPDATE");
|
||||
}
|
||||
E = getTimeStamp();
|
||||
|
||||
return E-S;
|
||||
|
||||
Reference in New Issue
Block a user