Skip to content
Snippets Groups Projects
Commit 55abd01c authored by Christopher Haine's avatar Christopher Haine
Browse files

visualization tools for `pool_local_multi`

parent 89068528
Branches
Tags
No related merge requests found
set terminal png
set output "ju_diff100k.png"
set font "Helvetica"
set title 'Juelich/issue6/1; jupiter; BW; rep1; diff100k; /=decl\_per\_cdo'
set key right
set log y
set xlabel "decl per CDO"
set ylabel "time (ms)"
set style function linespoints
plot 'pool_local_multi.dat' using 2:xtic(1) title "1 thread" with linespoints, '' using 3 title "4 threads" with linespoints, '' using 4 title "8 threads" with linespoints, '' using 5 title "12 threads" with linespoints, '' using 8 title "24 threads" with linespoints
#!/usr/bin/env bash
#
# Post-treatment and visualization of ../tests/check_pool_local_multi
#
# Copyright (C) 2020 Cray Computer GmbH
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# 3. Neither the name of the copyright holder nor the names of its
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
# IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
# PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
output="pool_local_multi.dat"
gnuplot_script="visu_pool_local_multi.p"
../tests/check_pool_local_multi > tmp
# remove the first two lines and the last three lines (written by `cheat`)
head -n -3 tmp | sed -e '1,2d' > $output
gnuplot $gnuplot_script
...@@ -102,7 +102,7 @@ CHEAT_DECLARE( ...@@ -102,7 +102,7 @@ CHEAT_DECLARE(
return NULL; return NULL;
} }
#define MAX_THREADS 9 /* power-of-two + 1 and >1 */ #define MAX_THREADS 25
) )
CHEAT_TEST(cdo_local_pool_works, CHEAT_TEST(cdo_local_pool_works,
...@@ -111,16 +111,25 @@ CHEAT_TEST(cdo_local_pool_works, ...@@ -111,16 +111,25 @@ CHEAT_TEST(cdo_local_pool_works,
srandom(42); srandom(42);
cheat_assert(MSTRO_OK == mstro_init("Tests","POOL",0)); cheat_assert(MSTRO_OK == mstro_init("Tests","POOL",0));
for(size_t numthr=1; numthr<MAX_THREADS; numthr*=2) { fprintf(stdout, "# num_diff=100k; time /= decl_per_cdo");
pthread_t threads[MAX_THREADS];
for(size_t num_diff=1; num_diff<100001; num_diff*=10) {
for(size_t numdecl=1; numdecl<129; numdecl*=2) { for(size_t numdecl=1; numdecl<129; numdecl*=2) {
struct thread_args args; // for(size_t num_diff=1; num_diff<100001; num_diff*=10) {
size_t num_diff = 100000;
struct thread_args args;
args.num_repeats = 100000 / num_diff; args.num_repeats = 100000 / num_diff;
args.num_different_cdos = num_diff; args.num_different_cdos = num_diff;
args.num_max_declares_per_cdo = numdecl; args.num_max_declares_per_cdo = numdecl;
fprintf(stdout, "%8zu ", args.num_max_declares_per_cdo);
for(size_t numthr=1; numthr<MAX_THREADS; numthr+=4) {
if (numthr==5) numthr--; // yes that's ugly
pthread_t threads[MAX_THREADS];
mstro_nanosec_t before = mstro_clock(); mstro_nanosec_t before = mstro_clock();
for(size_t i=0; i<numthr; i++) { for(size_t i=0; i<numthr; i++) {
...@@ -136,12 +145,16 @@ CHEAT_TEST(cdo_local_pool_works, ...@@ -136,12 +145,16 @@ CHEAT_TEST(cdo_local_pool_works,
mstro_nanosec_t after = mstro_clock(); mstro_nanosec_t after = mstro_clock();
double duration = after-before; double duration = after-before;
double ms = duration/(1000.0*1000.0); double ms = duration/(1000.0*1000.0);
fprintf(stdout, "%8zu reps, %8zu different, %8zu per CDO, %3zu threads: %.2f ms\n", /* fprintf(stdout, "%8zu reps, %8zu different, %8zu per CDO, %3zu threads: %.2f ms\n",
args.num_repeats, args.num_different_cdos, args.num_max_declares_per_cdo, args.num_repeats, args.num_different_cdos, args.num_max_declares_per_cdo,
numthr, numthr,
ms); ms);
*/ fprintf(stdout, "%.5f ", ms/(double)args.num_max_declares_per_cdo);
} }
} // }
fprintf(stdout, "\n");
} }
cheat_assert(global_result==MSTRO_OK); cheat_assert(global_result==MSTRO_OK);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment