From aecb6b0ae8c702a93b40b7c01f210a4993eba7ca Mon Sep 17 00:00:00 2001 From: Rodrigo Arias Mallo Date: Mon, 13 Mar 2023 18:33:08 +0100 Subject: [PATCH 1/7] Add readywave test --- Makefile | 3 +- src/readywave.c | 124 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 126 insertions(+), 1 deletion(-) create mode 100644 src/readywave.c diff --git a/Makefile b/Makefile index 1f0a786..0ce8ec8 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,8 @@ CFLAGS=-O3 -fompss-2 BENCHMARKS=\ sched_get \ sched_add \ - register_deps + register_deps \ + readywave BIN=$(addprefix bench6.,$(BENCHMARKS)) DATA=$(addsuffix .csv, $(addprefix data/,$(BENCHMARKS))) diff --git a/src/readywave.c b/src/readywave.c new file mode 100644 index 0000000..181ef6c --- /dev/null +++ b/src/readywave.c @@ -0,0 +1,124 @@ +/* Copyright (c) 2023 Barcelona Supercomputing Center (BSC) + * SPDX-License-Identifier: GPL-3.0-or-later */ + +#define _DEFAULT_SOURCE + +#include "bench6.h" + +#include +#include +#include +#include +#include +#include + +static int ncpus = -1; +static long nruns = 300L; +static long ntasks_per_cpu = 5000L; +static double taskwork_us = 10.0; + +static double t0; + +#define M_WORK 10000000L + +static void +busywork(long loops) +{ + for (volatile long j = 0; j < loops; j++); +} + +static double +get_time_ms(void) +{ + struct timespec ts; + clock_gettime(CLOCK_MONOTONIC, &ts); + return (double) ts.tv_sec + (double) ts.tv_nsec * 1.0e-9; +} + +static void +dummy_work(double ms) +{ + double end = get_time_ms() + ms * 1e-3; + while (get_time_ms() < end); +} + +static void +do_run(int run) +{ + /* Warm up all the threads */ + for (long i = 0L; i < ncpus; i++) { + #pragma oss task label("warmup") + dummy_work(20.0); + } + + #pragma oss taskwait + + int flag = 0; + + /* Delay task start so we can create lots of tasks */ + #pragma oss task inout(flag) label("trigger") + { + dummy_work(10.0); + busywork(M_WORK); /* So we can see it in perf */ + t0 = get_time(); + } + + for (long i = 0L; i < ntasks_per_cpu * ncpus; i++) { + #pragma oss task in(flag) label("quickie") + dummy_work(taskwork_us * 1e-3); + } + + /* When trigger finishes all small tasks will become ready */ + #pragma oss taskwait + double t1 = get_time(); + printf("%d,%ld,%d,%.3f,%.3f\n", run, ntasks_per_cpu, ncpus, taskwork_us, (t1 - t0) * 1e3); +} + +static int +usage(char *argv[]) +{ + fprintf(stderr, "Bench6: A set of Nanos6 micro-benchmarks\n"); + fprintf(stderr, "Usage: %s [-r NRUNS] [-t NTASKS_PER_CPU] [-w TASKWORK_US]\n", argv[0]); + fprintf(stderr, "\n"); + fprintf(stderr, +"Creates NTASKS_PER_CPU tasks per CPU that become ready at the\n" +"same time, like a wave. The time between the moment they become\n" +"ready and when the all end is measured. Tasks run for TASKWORK_US\n" +"microseconds. The test is repeated NRUNS times.\n"); + fprintf(stderr, "\n"); + fprintf(stderr, "Defaults: NRUNS=%ld NTASKS_PER_CPU=%ld TASKWORK_US=%.3f\n", + nruns, ntasks_per_cpu, taskwork_us); + + return -1; +} + +int +main(int argc, char *argv[]) +{ + int opt; + + while ((opt = getopt(argc, argv, "hr:t:")) != -1) { + switch (opt) { + case 'r': + nruns = atol(optarg); + break; + case 't': + ntasks_per_cpu = atol(optarg); + break; + case 'w': + taskwork_us = atof(optarg); + break; + case 'h': /* Fall through */ + default: /* '?' */ + return usage(argv); + } + } + + ncpus = get_ncpus(); + + printf("%s,%s,%s,%s,%s\n", "run", "ntasks_per_cpu", "ncpus", "taskwork_us", "time_ms"); + for (int run = 0; run < nruns; run++) + do_run(run); + + return 0; +} -- GitLab From 08d67b1a62025edc87e1aa85f387d35f5f0c2f60 Mon Sep 17 00:00:00 2001 From: Rodrigo Arias Mallo Date: Tue, 14 Mar 2023 10:20:43 +0100 Subject: [PATCH 2/7] Fix -w option --- src/readywave.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/readywave.c b/src/readywave.c index 181ef6c..0706098 100644 --- a/src/readywave.c +++ b/src/readywave.c @@ -97,7 +97,7 @@ main(int argc, char *argv[]) { int opt; - while ((opt = getopt(argc, argv, "hr:t:")) != -1) { + while ((opt = getopt(argc, argv, "hr:t:w:")) != -1) { switch (opt) { case 'r': nruns = atol(optarg); -- GitLab From 6832d0e6276e0ac02e590018398fc61e16d302f5 Mon Sep 17 00:00:00 2001 From: Rodrigo Arias Mallo Date: Tue, 14 Mar 2023 10:21:01 +0100 Subject: [PATCH 3/7] Use 100 runs by default --- src/readywave.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/readywave.c b/src/readywave.c index 0706098..3aa0fef 100644 --- a/src/readywave.c +++ b/src/readywave.c @@ -13,7 +13,7 @@ #include static int ncpus = -1; -static long nruns = 300L; +static long nruns = 100L; static long ntasks_per_cpu = 5000L; static double taskwork_us = 10.0; -- GitLab From 7f2903d404ffd2c14af48554cb94b78814c4c347 Mon Sep 17 00:00:00 2001 From: Rodrigo Arias Mallo Date: Tue, 14 Mar 2023 10:21:27 +0100 Subject: [PATCH 4/7] Add readywave plot script --- plot/readywave.R | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 plot/readywave.R diff --git a/plot/readywave.R b/plot/readywave.R new file mode 100644 index 0000000..2f937f8 --- /dev/null +++ b/plot/readywave.R @@ -0,0 +1,26 @@ +library(ggplot2) +library(dplyr, warn.conflicts = FALSE) +library(scales) +library(jsonlite) +library(readr) + +# Load the arguments (argv) +args = commandArgs(trailingOnly=TRUE) + +input_file = args[1] + +df = read_delim(input_file, delim=",", show_col_types = FALSE) + +dpi = 96 +h = 2 +w = 6 + +# --------------------------------------------------------------------- + +p = ggplot(df, aes(time_ms)) + + geom_histogram(bins=80) + + theme_bw() + + labs(x = "Time (ms)", title="Nanos6: readywave time") + # TODO: Add ntasks and taskwork to labels + +ggsave(sprintf("%s.png", input_file), plot=p, width=w, height=h, dpi=dpi) -- GitLab From 45b23dceba3e0a54e396c62edd7fc5a5d059cf34 Mon Sep 17 00:00:00 2001 From: Rodrigo Arias Mallo Date: Tue, 14 Mar 2023 10:22:31 +0100 Subject: [PATCH 5/7] Add shell.nix --- shell.nix | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 shell.nix diff --git a/shell.nix b/shell.nix new file mode 100644 index 0000000..c04b746 --- /dev/null +++ b/shell.nix @@ -0,0 +1,15 @@ +let + pkgs = import (builtins.fetchTarball + "https://pm.bsc.es/gitlab/rarias/bscpkgs/-/archive/master/bscpkgs-master.tar.gz"); + + rWrapper = pkgs.rWrapper.override { + packages = with pkgs.rPackages; [ tidyverse rjson jsonlite egg viridis ]; + }; +in + pkgs.mkShell { + nativeBuildInputs = [ + pkgs.bsc.clangOmpss2 + pkgs.bsc.nanos6 + rWrapper + ]; + } -- GitLab From 0f4db94ea19b9f5fada1c842f624a0489d9fa5f2 Mon Sep 17 00:00:00 2001 From: Rodrigo Arias Mallo Date: Tue, 14 Mar 2023 10:56:57 +0100 Subject: [PATCH 6/7] Add readywave plot to README --- README.md | 2 ++ examples/readywave-instr.csv.png | Bin 0 -> 20169 bytes 2 files changed, 2 insertions(+) create mode 100644 examples/readywave-instr.csv.png diff --git a/README.md b/README.md index 68e6f47..7ed7f9b 100644 --- a/README.md +++ b/README.md @@ -11,3 +11,5 @@ Examples: + + diff --git a/examples/readywave-instr.csv.png b/examples/readywave-instr.csv.png new file mode 100644 index 0000000000000000000000000000000000000000..c6747d395f6957b6773447d07daf1fe2850eb0ee GIT binary patch literal 20169 zcmb_^1z1%5*X`IKARq{cAfl8=iF7;C(gFgKN{e*2GN6EjNJw{sw1AW#NOwy~cX!`C z`2PR5zVANYbMNJO-WP{CbLO01?7j9{Yaeep88Muzq*oCL1dfEbumS>ckraVA$AEDj z{xXp)MghMt&Bax%5C~#?^nd4?Xf_2Ah&u=g;m3;hQA;BZ+St3Nf@{0#PI?90)U`Ld zI#3rWp5rg{1>9Xo%g9JPPMDkS4s}%%C{zn3nts-Eh0#aZH$hTf@o9AWJ>fzW*F8&$ z$cmZW`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>`=?YwD?8nv^9@Ly5jfm-$@5O zGBO%t|K;dLyP#KiHz^q-rk;= zNcg%4eCKuV^2*ACz62f$im`c zX7>Kx9+#jX1qlfRQA3t%h>jkrNxeG=cYQlcOICOT<03rgD!YwGKmdfwtCu|v4-b{W zY_s$chJ+E>zYS`wvp{U~^uggFW9!Dgv$ycX$;s%l?F-V2h+OX5w&&f6I{W&*<>xEV zhwSX^FyKh0c6$rgEN*vEBM?zC2%$x~5J{%6Oce&OZjhe3zVU= zp=WVt3M-3u<{4WpmGI9?xNry(RDatSKc}5NsqMe?<~;86l+>wOqi9!j?vxOb5&nwQ He)r!1h~qj- literal 0 HcmV?d00001 -- GitLab From 88c2434e1338fe7399b2d59c52e43120096fcd71 Mon Sep 17 00:00:00 2001 From: Rodrigo Arias Mallo Date: Tue, 14 Mar 2023 12:39:49 +0100 Subject: [PATCH 7/7] Remove get_time_ms() and use get_time() --- src/readywave.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/readywave.c b/src/readywave.c index 3aa0fef..bec436c 100644 --- a/src/readywave.c +++ b/src/readywave.c @@ -27,19 +27,11 @@ busywork(long loops) for (volatile long j = 0; j < loops; j++); } -static double -get_time_ms(void) -{ - struct timespec ts; - clock_gettime(CLOCK_MONOTONIC, &ts); - return (double) ts.tv_sec + (double) ts.tv_nsec * 1.0e-9; -} - static void dummy_work(double ms) { - double end = get_time_ms() + ms * 1e-3; - while (get_time_ms() < end); + double end = get_time() + ms * 1e-3; + while (get_time() < end); } static void -- GitLab