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
|
#DO NOT EDIT BELOW
|
||||||
include $(MAKE_DIR)/config.mk
|
include $(MAKE_DIR)/config.mk
|
||||||
include $(MAKE_DIR)/include_$(TAG).mk
|
include $(MAKE_DIR)/include_$(TAG).mk
|
||||||
|
include $(MAKE_DIR)/include_LIKWID.mk
|
||||||
INCLUDES += -I./src/includes
|
INCLUDES += -I./src/includes
|
||||||
|
|
||||||
VPATH = $(SRC_DIR)
|
VPATH = $(SRC_DIR)
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
# Supported: GCC, CLANG, ICC
|
# Supported: GCC, CLANG, ICC
|
||||||
TAG ?= GCC
|
TAG ?= ICC
|
||||||
ENABLE_OPENMP ?= false
|
ENABLE_OPENMP ?= false
|
||||||
|
ENABLE_LIKWID ?= false
|
||||||
|
|
||||||
#Feature options
|
#Feature options
|
||||||
OPTIONS = -DSIZE=40000000ull
|
OPTIONS = -DSIZE=100000000ull
|
||||||
OPTIONS += -DNTIMES=10
|
OPTIONS += -DNTIMES=10
|
||||||
OPTIONS += -DARRAY_ALIGNMENT=64
|
OPTIONS += -DARRAY_ALIGNMENT=64
|
||||||
#OPTIONS += -DVERBOSE_AFFINITY
|
#OPTIONS += -DVERBOSE_AFFINITY
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ ifeq ($(ENABLE_OPENMP),true)
|
|||||||
OPENMP = -qopenmp
|
OPENMP = -qopenmp
|
||||||
endif
|
endif
|
||||||
|
|
||||||
CFLAGS = -qopt-report -Ofast -xHost -std=c99 -ffreestanding $(OPENMP)
|
CFLAGS = -Ofast -xHost -std=c99 -ffreestanding $(OPENMP)
|
||||||
LFLAGS = $(OPENMP)
|
LFLAGS = $(OPENMP)
|
||||||
DEFINES = -D_GNU_SOURCE
|
DEFINES = -D_GNU_SOURCE
|
||||||
INCLUDES =
|
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 <timing.h>
|
||||||
|
#include <likwid_markers.h>
|
||||||
|
|
||||||
double copy(
|
double copy(
|
||||||
double * restrict a,
|
double * restrict a,
|
||||||
@@ -36,9 +37,14 @@ double copy(
|
|||||||
double S, E;
|
double S, E;
|
||||||
|
|
||||||
S = getTimeStamp();
|
S = getTimeStamp();
|
||||||
#pragma omp parallel for
|
#pragma omp parallel
|
||||||
|
{
|
||||||
|
LIKWID_MARKER_START("COPY");
|
||||||
|
#pragma omp for
|
||||||
for (int i=0; i<N; i++) {
|
for (int i=0; i<N; i++) {
|
||||||
a[i] = b[i];
|
a[i] = b[i];
|
||||||
|
}
|
||||||
|
LIKWID_MARKER_STOP("COPY");
|
||||||
}
|
}
|
||||||
E = getTimeStamp();
|
E = getTimeStamp();
|
||||||
|
|
||||||
|
|||||||
@@ -26,6 +26,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <timing.h>
|
#include <timing.h>
|
||||||
|
#include <likwid_markers.h>
|
||||||
|
|
||||||
double daxpy(
|
double daxpy(
|
||||||
double * restrict a,
|
double * restrict a,
|
||||||
@@ -37,9 +38,14 @@ double daxpy(
|
|||||||
double S, E;
|
double S, E;
|
||||||
|
|
||||||
S = getTimeStamp();
|
S = getTimeStamp();
|
||||||
#pragma omp parallel for
|
#pragma omp parallel
|
||||||
|
{
|
||||||
|
LIKWID_MARKER_START("DAXPY");
|
||||||
|
#pragma omp for
|
||||||
for (int i=0; i<N; i++) {
|
for (int i=0; i<N; i++) {
|
||||||
a[i] = a[i] + scalar * b[i];
|
a[i] = a[i] + scalar * b[i];
|
||||||
|
}
|
||||||
|
LIKWID_MARKER_STOP("DAXPY");
|
||||||
}
|
}
|
||||||
E = getTimeStamp();
|
E = getTimeStamp();
|
||||||
|
|
||||||
|
|||||||
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 <timing.h>
|
||||||
|
#include <likwid_markers.h>
|
||||||
|
|
||||||
double init(
|
double init(
|
||||||
double * restrict a,
|
double * restrict a,
|
||||||
@@ -36,9 +37,14 @@ double init(
|
|||||||
double S, E;
|
double S, E;
|
||||||
|
|
||||||
S = getTimeStamp();
|
S = getTimeStamp();
|
||||||
#pragma omp parallel for
|
#pragma omp parallel
|
||||||
|
{
|
||||||
|
LIKWID_MARKER_START("INIT");
|
||||||
|
#pragma omp for
|
||||||
for (int i=0; i<N; i++) {
|
for (int i=0; i<N; i++) {
|
||||||
a[i] = scalar;
|
a[i] = scalar;
|
||||||
|
}
|
||||||
|
LIKWID_MARKER_STOP("INIT");
|
||||||
}
|
}
|
||||||
E = getTimeStamp();
|
E = getTimeStamp();
|
||||||
|
|
||||||
|
|||||||
13
src/main.c
13
src/main.c
@@ -38,6 +38,7 @@
|
|||||||
#include <timing.h>
|
#include <timing.h>
|
||||||
#include <allocate.h>
|
#include <allocate.h>
|
||||||
#include <affinity.h>
|
#include <affinity.h>
|
||||||
|
#include <likwid_markers.h>
|
||||||
|
|
||||||
#define HLINE "----------------------------------------------------------------------------\n"
|
#define HLINE "----------------------------------------------------------------------------\n"
|
||||||
|
|
||||||
@@ -105,6 +106,17 @@ int main (int argc, char** argv)
|
|||||||
{"SDaxpy: ", 4, 2}
|
{"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 );
|
a = (double*) allocate( ARRAY_ALIGNMENT, N * bytesPerWord );
|
||||||
b = (double*) allocate( ARRAY_ALIGNMENT, N * bytesPerWord );
|
b = (double*) allocate( ARRAY_ALIGNMENT, N * bytesPerWord );
|
||||||
c = (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);
|
printf(HLINE);
|
||||||
|
|
||||||
check(a, b, c, d, N);
|
check(a, b, c, d, N);
|
||||||
|
LIKWID_MARKER_CLOSE;
|
||||||
|
|
||||||
return EXIT_SUCCESS;
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,6 +26,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <timing.h>
|
#include <timing.h>
|
||||||
|
#include <likwid_markers.h>
|
||||||
|
|
||||||
double triad(
|
double triad(
|
||||||
double * restrict a,
|
double * restrict a,
|
||||||
@@ -38,10 +39,15 @@ double triad(
|
|||||||
double S, E;
|
double S, E;
|
||||||
|
|
||||||
S = getTimeStamp();
|
S = getTimeStamp();
|
||||||
#pragma omp parallel for
|
#pragma omp parallel
|
||||||
|
{
|
||||||
|
LIKWID_MARKER_START("TRIAD");
|
||||||
|
#pragma omp for
|
||||||
for (int i=0; i<N; i++) {
|
for (int i=0; i<N; i++) {
|
||||||
a[i] = b[i] + scalar * c[i];
|
a[i] = b[i] + scalar * c[i];
|
||||||
}
|
}
|
||||||
|
LIKWID_MARKER_STOP("TRIAD");
|
||||||
|
}
|
||||||
E = getTimeStamp();
|
E = getTimeStamp();
|
||||||
|
|
||||||
return E-S;
|
return E-S;
|
||||||
|
|||||||
@@ -26,6 +26,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <timing.h>
|
#include <timing.h>
|
||||||
|
#include <likwid_markers.h>
|
||||||
|
|
||||||
double update(
|
double update(
|
||||||
double * restrict a,
|
double * restrict a,
|
||||||
@@ -36,9 +37,14 @@ double update(
|
|||||||
double S, E;
|
double S, E;
|
||||||
|
|
||||||
S = getTimeStamp();
|
S = getTimeStamp();
|
||||||
#pragma omp parallel for
|
#pragma omp parallel
|
||||||
|
{
|
||||||
|
LIKWID_MARKER_START("UPDATE");
|
||||||
|
#pragma omp for
|
||||||
for (int i=0; i<N; i++) {
|
for (int i=0; i<N; i++) {
|
||||||
a[i] = a[i] * scalar;
|
a[i] = a[i] * scalar;
|
||||||
|
}
|
||||||
|
LIKWID_MARKER_STOP("UPDATE");
|
||||||
}
|
}
|
||||||
E = getTimeStamp();
|
E = getTimeStamp();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user