diff options
Diffstat (limited to 'TRNS')
| -rw-r--r-- | TRNS/Makefile | 8 | ||||
| -rwxr-xr-x | TRNS/benchmark-scripts/ccmcc25-sim.sh | 53 | ||||
| -rwxr-xr-x | TRNS/benchmark-scripts/ccmcc25.sh | 32 | ||||
| -rw-r--r-- | TRNS/dpu/task.c | 2 | ||||
| -rw-r--r-- | TRNS/host/app.c | 9 | ||||
| -rw-r--r--[-rwxr-xr-x] | TRNS/include/common.h (renamed from TRNS/support/common.h) | 0 | ||||
| -rw-r--r-- | TRNS/include/dfatool_host.ah | 36 | ||||
| -rw-r--r-- | TRNS/include/params.h (renamed from TRNS/support/params.h) | 4 | ||||
| -rw-r--r-- | TRNS/include/timer.h | 5 | ||||
| -rwxr-xr-x | TRNS/run-fgbs24a.sh | 29 | ||||
| -rwxr-xr-x | TRNS/run-paper-strong-full.sh | 30 | ||||
| -rwxr-xr-x | TRNS/run-paper-strong-rank.sh | 29 | ||||
| -rwxr-xr-x | TRNS/run-paper-weak.sh | 28 | ||||
| -rwxr-xr-x | TRNS/run-rank.sh | 32 | ||||
| -rwxr-xr-x | TRNS/run.sh | 32 | ||||
| -rw-r--r-- | TRNS/support/dfatool_host.ah | 101 | ||||
| -rwxr-xr-x | TRNS/support/timer.h | 86 |
17 files changed, 138 insertions, 378 deletions
diff --git a/TRNS/Makefile b/TRNS/Makefile index 427a332..302fcd6 100644 --- a/TRNS/Makefile +++ b/TRNS/Makefile @@ -2,7 +2,6 @@ NR_DPUS ?= 1 NR_TASKLETS ?= 16 ENERGY ?= 0 -COMMON_INCLUDES := support HOST_SOURCES := $(wildcard host/*.c) DPU_SOURCES := $(wildcard dpu/*.c) @@ -12,12 +11,12 @@ dfatool_timing ?= 1 HOST_CC := ${CC} -COMMON_FLAGS := -Wall -Wextra -g -I${COMMON_INCLUDES} +COMMON_FLAGS := -Wall -Wextra -g -Iinclude HOST_FLAGS := ${COMMON_FLAGS} -O3 -march=native `dpu-pkg-config --cflags --libs dpu` -DNR_TASKLETS=${NR_TASKLETS} -DNR_DPUS=${NR_DPUS} -DENERGY=${ENERGY} -DDFATOOL_TIMING=${dfatool_timing} -DASPECTC=${aspectc} DPU_FLAGS := ${COMMON_FLAGS} -O2 -DNR_TASKLETS=${NR_TASKLETS} ifeq (${aspectc_timing}, 1) - ASPECTC_HOST_FLAGS += -a support/dfatool_host.ah + ASPECTC_HOST_FLAGS += -ainclude/dfatool_host_dpu.ah -ainclude/dfatool_host.ah endif ASPECTC_HOST_FLAGS ?= -a0 @@ -39,8 +38,11 @@ all: bin/host_code bin/dpu_code bin: ${QUIET}mkdir -p bin +# cp/rm are needed to work around AspectC++ not liking symlinks bin/host_code: ${HOST_SOURCES} ${COMMON_INCLUDES} bin + ${QUIET}cp ../include/dfatool_host_dpu.ah include ${QUIET}${HOST_CC} -o $@ ${HOST_SOURCES} ${HOST_FLAGS} + ${QUIET}rm -f include/dfatool_host_dpu.ah bin/dpu_code: ${DPU_SOURCES} ${COMMON_INCLUDES} bin ${QUIET}dpu-upmem-dpurte-clang ${DPU_FLAGS} -o $@ ${DPU_SOURCES} diff --git a/TRNS/benchmark-scripts/ccmcc25-sim.sh b/TRNS/benchmark-scripts/ccmcc25-sim.sh new file mode 100755 index 0000000..a7aa79c --- /dev/null +++ b/TRNS/benchmark-scripts/ccmcc25-sim.sh @@ -0,0 +1,53 @@ +#!/bin/bash + +mkdir -p log/$(hostname) + +# Args: -m m -n n -o M_ -p N_ +# +# Input: (M_ * m) × (N_ * n) matrix +# Output: (N_* n) × (M_ * m) matrix +# Step 1: transpose (M_ * m) × N_ matrix that consists of tiles of size n +# CPU version: explicit +# DPU version: implicit (M_ * m write operations of #DPUs * n elements to DPUs) +# Step 2: transpose m × n matrix; this happens N_ * M_ times. +# DPU version: Each tasklet transposes a single m × n matrix / tile. +# (16 × 8 tile takes up 1 KiB WRAM) +# Step 3: Transpose M_ × n matrix that consists of tiles of size m. +# +# Note for DPU version: if M_ > #DPUs, steps 1 through 3 are repeated. +# Number of repetitions == ceil(M_ / #DPUS) +# For Hetsim benchmarks, we set M_ == #DPUs to simplify the task graph (no repetitions that depend on the number of available DPUs). +# Just in case, there is also a configuration with M_ == 2048 independent of #DPUs +# +# input size: uint64(DPU)/double(CPU) * M_ * m * N_ * n +# output size: uint64(DPU)/double(CPU) * M_ * m * N_ * n -- on DPU only; CPU version operates in-place +# Upstream DPU version uses int64_t, -p 2048 -o 12288 -x 1 [implicit -m 16 -n 8] +# Upstream CPU version uses double, -p 2556 -o 4096 -m 16 -n 8 and fails with -o 12288 (allocation error) +# +# -p 2048 -o 2048 -m 16 -n 8 -> matrix size: 4 GiB +# -p [64 .. 2304] -o 2048 -m 16 -n 8 -> matrix size: 128 MiB .. 4.5 GiB + +run_benchmark_nmc() { + local "$@" + set -e + make -B NR_DPUS=${nr_dpus} NR_TASKLETS=${nr_tasklets} \ + aspectc=1 aspectc_timing=1 dfatool_timing=0 + bin/host_code -w 0 -e 2 -p ${cols} -o ${rows} -m ${tile_rows} -n ${tile_cols} +} + +export -f run_benchmark_nmc + +fn=log/$(hostname)/ccmcc25-sdk${sdk}-sim + +source ~/lib/local/upmem/upmem-2025.1.0-Linux-x86_64/upmem_env.sh simulator + +echo "prim-benchmarks TRNS $(git describe --all --long) $(git rev-parse HEAD) $(date -R)" >> ${fn}.txt + +parallel -j1 --eta --joblog ${fn}.joblog --resume --header : \ + run_benchmark_nmc nr_dpus={nr_dpus} nr_tasklets=16 cols={cols} rows={rows} tile_cols={tile_cols} tile_rows={tile_rows} \ + ::: nr_dpus 1 4 16 32 64 \ + ::: rows 64 128 256 512 \ + ::: cols 64 128 256 512 \ + ::: tile_rows 16 \ + ::: tile_cols 8 \ +>> ${fn}.txt diff --git a/TRNS/benchmark-scripts/ccmcc25.sh b/TRNS/benchmark-scripts/ccmcc25.sh new file mode 100755 index 0000000..7c66306 --- /dev/null +++ b/TRNS/benchmark-scripts/ccmcc25.sh @@ -0,0 +1,32 @@ +#!/bin/bash + +mkdir -p log/$(hostname) + +run_benchmark_nmc() { + local "$@" + set -e + sudo limit_ranks_to_numa_node ${numa_rank} + make -B NR_DPUS=${nr_dpus} NR_TASKLETS=${nr_tasklets} dfatool_timing=0 aspectc=1 aspectc_timing=1 + bin/host_code -w 0 -e 4 -p ${cols} -o ${rows} -m ${tile_rows} -n ${tile_cols} +} + +export -f run_benchmark_nmc + +for sdk in 2023.2.0 2024.1.0 2024.2.0 2025.1.0; do + + fn=log/$(hostname)/ccmcc25-sdk${sdk} + + source /opt/upmem/upmem-${sdk}-Linux-x86_64/upmem_env.sh + + echo "prim-benchmarks TRNS $(git describe --all --long) $(git rev-parse HEAD) $(date -R)" >> ${fn}.txt + + parallel -j1 --eta --joblog ${fn}.joblog --resume --header : \ + run_benchmark_nmc nr_dpus={nr_dpus} nr_tasklets=16 numa_rank=any cols={cols} rows={rows} tile_cols={tile_cols} tile_rows={tile_rows} \ + ::: nr_dpus 64 128 256 512 768 1024 1536 2048 2304 \ + ::: rows 1024 2048 4096 \ + ::: cols 64 128 256 512 768 1024 1536 2048 2304 \ + ::: tile_rows 16 \ + ::: tile_cols 8 \ + >> ${fn}.txt + +done diff --git a/TRNS/dpu/task.c b/TRNS/dpu/task.c index 0f5e4be..9c0e0a8 100644 --- a/TRNS/dpu/task.c +++ b/TRNS/dpu/task.c @@ -12,7 +12,7 @@ #include <mutex.h> #include <barrier.h> -#include "../support/common.h" +#include "common.h" __host dpu_arguments_t DPU_INPUT_ARGUMENTS; diff --git a/TRNS/host/app.c b/TRNS/host/app.c index 735d2a9..c178a19 100644 --- a/TRNS/host/app.c +++ b/TRNS/host/app.c @@ -30,9 +30,9 @@ extern "C" { #include <assert.h> #include <math.h> -#include "../support/common.h" -#include "../support/timer.h" -#include "../support/params.h" +#include "common.h" +#include "timer.h" +#include "params.h" #define XSTR(x) STR(x) #define STR(x) #x @@ -47,7 +47,6 @@ static T* A_host; static T* A_backup; static T* A_result; -struct Params p; unsigned int kernel = 0; // Create input arrays @@ -77,7 +76,7 @@ static void trns_host(T* input, unsigned int A, unsigned int B, unsigned int b){ // Main of the Host Application int main(int argc, char **argv) { - p = input_params(argc, argv); + struct Params p = input_params(argc, argv); struct dpu_set_t dpu_set, dpu; uint32_t nr_of_dpus; diff --git a/TRNS/support/common.h b/TRNS/include/common.h index 6a94c62..6a94c62 100755..100644 --- a/TRNS/support/common.h +++ b/TRNS/include/common.h diff --git a/TRNS/include/dfatool_host.ah b/TRNS/include/dfatool_host.ah new file mode 100644 index 0000000..72978cc --- /dev/null +++ b/TRNS/include/dfatool_host.ah @@ -0,0 +1,36 @@ +#pragma once + +#include <sys/time.h> +#include "dfatool_host_dpu.ah" + +aspect DfatoolHostTiming : public DfatoolHostDPUTiming { + + unsigned int n_rows_outer, n_rows_tile, n_cols_outer, n_cols_tile; + unsigned int element_size; + + virtual int getKernel() { return kernel; } + + DfatoolHostTiming() { + element_size = sizeof(T); + } + + advice call("% input_params(...)") : after() { + Params* p = tjp->result(); + /* + * Input: (M_ * m) × (N_ * n) matrix + */ + n_rows_outer = p->M_; + n_rows_tile = p->m; + n_cols_outer = p->N_; + n_cols_tile = p->n; + printf("[>>] TRNS | n_dpus=%u n_rows_outer=%u n_rows_tile=%u n_cols_outer=%u n_cols_tile=%u\n", NR_DPUS, n_rows_outer, n_rows_tile, n_cols_outer, n_cols_tile); + } + + advice call("% trns_host(...)") : after() { + printf("[--] TRNS | n_dpus=%u n_rows_outer=%u n_rows_tile=%u n_cols_outer=%u n_cols_tile=%u\n", NR_DPUS, n_rows_outer, n_rows_tile, n_cols_outer, n_cols_tile); + } + + advice execution("% main(...)") : after() { + printf("[<<] TRNS | n_dpus=%u n_rows_outer=%u n_rows_tile=%u n_cols_outer=%u n_cols_tile=%u\n", NR_DPUS, n_rows_outer, n_rows_tile, n_cols_outer, n_cols_tile); + } +}; diff --git a/TRNS/support/params.h b/TRNS/include/params.h index 6b7e6f2..385490e 100644 --- a/TRNS/support/params.h +++ b/TRNS/include/params.h @@ -21,7 +21,7 @@ static void usage() { "\n -h help" "\n -w <W> # of untimed warmup iterations (default=1)" "\n -e <E> # of timed repetition iterations (default=3)" - "\n -x <X> Weak (0) or strong (1) scaling (default=0)" + "\n -x <X> Weak (0) or strong (1) scaling (default=1)" "\n" "\nBenchmark-specific options:" "\n -m <I> m (default=16 elements)" @@ -39,7 +39,7 @@ struct Params input_params(int argc, char **argv) { p.n = 8; p.n_warmup = 1; p.n_reps = 3; - p.exp = 0; + p.exp = 1; int opt; while((opt = getopt(argc, argv, "hw:e:x:m:n:o:p:")) >= 0) { diff --git a/TRNS/include/timer.h b/TRNS/include/timer.h new file mode 100644 index 0000000..8d5c3d5 --- /dev/null +++ b/TRNS/include/timer.h @@ -0,0 +1,5 @@ +#pragma once + +#define N_TIMERS 10 +#include "../../include/timer_base.h" +#undef N_TIMERS diff --git a/TRNS/run-fgbs24a.sh b/TRNS/run-fgbs24a.sh deleted file mode 100755 index 6ba8993..0000000 --- a/TRNS/run-fgbs24a.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/bash - -set -e - -mkdir -p $(hostname) - -# BL: use 2^(BL) B blocks for MRAM <-> WRAM transfers on PIM module -# T: data type -# -w: number of un-timed warmup iterations -# -e: number of timed iterations -# -i; ignored, always uses 262144 elements - -( - -echo "prim-benchmarks TRNS strong-full (dfatool fgbs24a edition)" -echo "Started at $(date)" -echo "Revision $(git describe --always)" - -for nr_dpus in 2304 2048 2543; do - for nr_tasklets in 16; do - echo - if make -B NR_DPUS=${nr_dpus} NR_TASKLETS=${nr_tasklets}; then - # upstream uses -p 2048, but then the number of DPUs is always constant... - timeout --foreground -k 1m 180m bin/host_code -w 0 -e 100 -p $nr_dpus -o 12288 -x 1 || true - fi - done -done -echo "Completed at $(date)" -) | tee "$(hostname)/fgbs24a.txt" diff --git a/TRNS/run-paper-strong-full.sh b/TRNS/run-paper-strong-full.sh deleted file mode 100755 index 9d3792c..0000000 --- a/TRNS/run-paper-strong-full.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/bash - -set -e - -# BL: use 2^(BL) B blocks for MRAM <-> WRAM transfers on PIM module -# T: data type -# -w: number of un-timed warmup iterations -# -e: number of timed iterations -# -i; ignored, always uses 262144 elements - -( - -echo "prim-benchmarks TRNS strong-full (dfatool edition)" -echo "Started at $(date)" -echo "Revision $(git describe --always)" - -# >2048 is not in upstream -for nr_dpus in 2543 2304 256 512 1024 2048; do - for nr_tasklets in 1 2 4 8 16; do - echo - if make -B NR_DPUS=${nr_dpus} NR_TASKLETS=${nr_tasklets}; then - # upstream uses -p 2048, but then the number of DPUs is always constant... - timeout --foreground -k 1m 90m bin/host_code -w 0 -e 40 -p $nr_dpus -o 12288 -x 1 || true - fi - done -done - -echo "Completed at $(date)" - -) | tee "log-$(hostname)-prim-strong-full.txt" diff --git a/TRNS/run-paper-strong-rank.sh b/TRNS/run-paper-strong-rank.sh deleted file mode 100755 index f5f00cb..0000000 --- a/TRNS/run-paper-strong-rank.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/bash - -set -e - -# BL: use 2^(BL) B blocks for MRAM <-> WRAM transfers on PIM module -# T: data type -# -w: number of un-timed warmup iterations -# -e: number of timed iterations -# -i; ignored, always uses 262144 elements - -( - -echo "prim-benchmarks TRNS strong-rank (dfatool edition)" -echo "Started at $(date)" -echo "Revision $(git describe --always)" - -for nr_dpus in 1 4 16 64; do - for nr_tasklets in 1 2 4 8 16; do - echo - if make -B NR_DPUS=${nr_dpus} NR_TASKLETS=${nr_tasklets}; then - # upstream uses -p 64, but then the number of DPUs is always constant... - timeout --foreground -k 1m 60m bin/host_code -w 0 -e 40 -p $nr_dpus -o 12288 -x 1 || true - fi - done -done - -echo "Completed at $(date)" - -) | tee "log-$(hostname)-prim-strong-rank.txt" diff --git a/TRNS/run-paper-weak.sh b/TRNS/run-paper-weak.sh deleted file mode 100755 index f02d7d6..0000000 --- a/TRNS/run-paper-weak.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/bash - -set -e - -# BL: use 2^(BL) B blocks for MRAM <-> WRAM transfers on PIM module -# T: data type -# -w: number of un-timed warmup iterations -# -e: number of timed iterations -# -i; ignored, always uses 262144 elements - -( - -echo "prim-benchmarks TRNS weak (dfatool edition)" -echo "Started at $(date)" -echo "Revision $(git describe --always)" - -for nr_dpus in 1 4 16 64; do - for nr_tasklets in 1 2 4 8 16; do - echo - if make -B NR_DPUS=${nr_dpus} NR_TASKLETS=${nr_tasklets}; then - timeout --foreground -k 1m 60m bin/host_code -w 0 -e 40 -p 1 -o 12288 -x 0 || true - fi - done -done | tee log-paper-weak.txt - -echo "Completed at $(date)" - -) | tee "log-$(hostname)-prim-weak.txt" diff --git a/TRNS/run-rank.sh b/TRNS/run-rank.sh deleted file mode 100755 index 00f6898..0000000 --- a/TRNS/run-rank.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/bash - -set -e - -# BL: use 2^(BL) B blocks for MRAM <-> WRAM transfers on PIM module -# T: data type -# -w: number of un-timed warmup iterations -# -e: number of timed iterations -# -i: input size (number of elements, not number of bytes!) - -( - -echo "prim-benchmarks TRNS (dfatool edition)" -echo "Started at $(date)" -echo "Revision $(git describe --always)" - -for nr_dpus in 1 4 8 16 32 48 64; do - for nr_tasklets in 8 12 16; do - # 12288 run-paper-weak, run-paper-strong-full - for i in 12288; do - echo - if make -B NR_DPUS=${nr_dpus} NR_TASKLETS=${nr_tasklets}; then - # upstream uses -p 2048 in strong-full, but then the number of DPUs is always constant... - timeout --foreground -k 1m 90m bin/host_code -w 0 -e 40 -p 1 -o 12288 -x 0 || true - fi - done - done -done - -echo "Completed at $(date)" - -) | tee "log-$(hostname)-rank.txt" diff --git a/TRNS/run.sh b/TRNS/run.sh deleted file mode 100755 index 8d574a9..0000000 --- a/TRNS/run.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/bash - -set -e - -# BL: use 2^(BL) B blocks for MRAM <-> WRAM transfers on PIM module -# T: data type -# -w: number of un-timed warmup iterations -# -e: number of timed iterations -# -i: input size (number of elements, not number of bytes!) - -( - -echo "prim-benchmarks TRNS (dfatool edition)" -echo "Started at $(date)" -echo "Revision $(git describe --always)" - -for nr_dpus in 2542 2304 1 4 8 16 32 64 128 256 512 768 1024 1536 2048; do - for nr_tasklets in 8 12 16; do - # 12288 run-paper-weak, run-paper-strong-full - for i in 12288; do - echo - if make -B NR_DPUS=${nr_dpus} NR_TASKLETS=${nr_tasklets}; then - # upstream uses -p 2048 in strong-full, but then the number of DPUs is always constant... - timeout --foreground -k 1m 90m bin/host_code -w 0 -e 40 -p $nr_dpus -o 12288 -x 1 || true - fi - done - done -done - -echo "Completed at $(date)" - -) | tee "log-$(hostname).txt" diff --git a/TRNS/support/dfatool_host.ah b/TRNS/support/dfatool_host.ah deleted file mode 100644 index c884c9d..0000000 --- a/TRNS/support/dfatool_host.ah +++ /dev/null @@ -1,101 +0,0 @@ -#pragma once - -#include <sys/time.h> - -aspect DfatoolHostTiming { - struct timeval starttime; - struct timeval stoptime; - uint32_t n_ranks = 0; - uint32_t n_dpus = 0; - - double const M_to_Mi = 1.048576; /* 2^20 / 1e6 */ - - advice call("% dpu_get_nr_dpus(...)") : after() { - n_dpus = **(tjp->arg<1>()); - } - - advice call("% dpu_get_nr_ranks(...)") : after() { - n_ranks = **(tjp->arg<1>()); - } - - advice call("% dpu_alloc(...)") : around() { - gettimeofday(&starttime, NULL); - tjp->proceed(); - gettimeofday(&stoptime, NULL); - n_dpus = *(tjp->arg<0>()); - printf("[::] dpu_alloc | n_dpus=%u | latency_us=%f\n", - n_dpus, - (stoptime.tv_sec - starttime.tv_sec) * 1000000.0 + (stoptime.tv_usec - starttime.tv_usec) - ); - } - - advice call("% dpu_alloc_ranks(...)") : around() { - gettimeofday(&starttime, NULL); - tjp->proceed(); - gettimeofday(&stoptime, NULL); - n_ranks = *(tjp->arg<0>()); - printf("[::] dpu_alloc_ranks | n_ranks=%u | latency_us=%f\n", - n_ranks, - (stoptime.tv_sec - starttime.tv_sec) * 1000000.0 + (stoptime.tv_usec - starttime.tv_usec) - ); - } - - advice call("% dpu_load(...)") : around() { - gettimeofday(&starttime, NULL); - tjp->proceed(); - gettimeofday(&stoptime, NULL); - printf("[::] dpu_load | n_dpus=%u n_ranks=%u | latency_us=%f\n", - n_dpus, n_ranks, - (stoptime.tv_sec - starttime.tv_sec) * 1000000.0 + (stoptime.tv_usec - starttime.tv_usec) - ); - } - - advice call("% dpu_free(...)") : around() { - gettimeofday(&starttime, NULL); - tjp->proceed(); - gettimeofday(&stoptime, NULL); - printf("[::] dpu_free | n_dpus=%u n_ranks=%u | latency_us=%f\n", - n_dpus, n_ranks, - (stoptime.tv_sec - starttime.tv_sec) * 1000000.0 + (stoptime.tv_usec - starttime.tv_usec) - ); - } - - advice call("% dpu_launch(...)") : around() { - gettimeofday(&starttime, NULL); - tjp->proceed(); - gettimeofday(&stoptime, NULL); - double latency_us = (stoptime.tv_sec - starttime.tv_sec) * 1000000.0 + (stoptime.tv_usec - starttime.tv_usec); - unsigned long input_size = p.M_ * p.m * p.N_ * p.n; - printf("[::] dpu_launch | n_dpus=%u n_ranks=%u e_kernel=kernel%d n_elements=%lu | latency_us=%f throughput_Mrps=%f throughput_MiBps=%f\n", - n_dpus, n_ranks, - kernel + 1, - input_size, - latency_us, - input_size / latency_us, - input_size * sizeof(T) / (latency_us * M_to_Mi) - ); - } - - advice call("% dpu_push_xfer(...)") : around() { - size_t payload_size = *(tjp->arg<4>()); - gettimeofday(&starttime, NULL); - tjp->proceed(); - gettimeofday(&stoptime, NULL); - double time_us = (stoptime.tv_sec - starttime.tv_sec) * 1000000.0 + (stoptime.tv_usec - starttime.tv_usec); - if (*(tjp->arg<1>()) == DPU_XFER_TO_DPU) { - printf("[::] dpu_push_to_dpu | n_dpus=%u n_ranks=%u total_payload_B=%lu dpu_payload_B=%lu | latency_us=%f throughput_MiBps=%f\n", - n_dpus, n_ranks, - payload_size * n_dpus, payload_size, - time_us, - payload_size * n_dpus / (time_us * M_to_Mi) - ); - } else if (*(tjp->arg<1>()) == DPU_XFER_FROM_DPU) { - printf("[::] dpu_push_from_dpu | n_dpus=%u n_ranks=%u total_payload_B=%lu dpu_payload_B=%lu | latency_us=%f throughput_MiBps=%f\n", - n_dpus, n_ranks, - payload_size * n_dpus, payload_size, - time_us, - payload_size * n_dpus / (time_us * M_to_Mi) - ); - } - } -}; diff --git a/TRNS/support/timer.h b/TRNS/support/timer.h deleted file mode 100755 index e04a202..0000000 --- a/TRNS/support/timer.h +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright (c) 2016 University of Cordoba and University of Illinois - * All rights reserved. - * - * Developed by: IMPACT Research Group - * University of Cordoba and University of Illinois - * http://impact.crhc.illinois.edu/ - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * with 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: - * - * > Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimers. - * > Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimers in the - * documentation and/or other materials provided with the distribution. - * > Neither the names of IMPACT Research Group, University of Cordoba, - * University of Illinois nor the names of its contributors may be used - * to endorse or promote products derived from this Software without - * specific prior written permission. - * - * 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 - * CONTRIBUTORS 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 WITH - * THE SOFTWARE. - * - */ - -#include <sys/time.h> - -#if DFATOOL_TIMING - -typedef struct Timer { - - struct timeval startTime[10]; - struct timeval stopTime[10]; - double time[10]; - -} Timer; - -#define dfatool_printf(fmt, ...) do { printf(fmt, __VA_ARGS__); } while (0) - -void start(Timer *timer, int i, int rep) -{ - if (rep == 0) { - timer->time[i] = 0.0; - } - gettimeofday(&timer->startTime[i], NULL); -} - -void stop(Timer *timer, int i) -{ - gettimeofday(&timer->stopTime[i], NULL); - timer->time[i] += - (timer->stopTime[i].tv_sec - - timer->startTime[i].tv_sec) * 1000000.0 + - (timer->stopTime[i].tv_usec - timer->startTime[i].tv_usec); -} - -#else - -#define dfatool_printf(fmt, ...) do {} while (0) - -typedef int Timer; - -void start(Timer *timer, int i, int rep) -{ - (void)timer; - (void)i; - (void)rep; -} - -void stop(Timer *timer, int i) -{ - (void)timer; - (void)i; -} - -#endif |
