From b24b60ca512589ec6284b31d8e7c07628c2c5886 Mon Sep 17 00:00:00 2001 From: Tobias Date: Sun, 16 Aug 2020 15:35:54 +0000 Subject: [PATCH] better benchmarking --- benchmark1/latex/reco_images.tex | 2 ++ benchmark1/recoBrainBart.m | 12 +++++++++--- benchmark1/recoBrainMRIReco.jl | 4 ++++ benchmark1/runBenchmark.sh | 4 ---- 4 files changed, 15 insertions(+), 7 deletions(-) diff --git a/benchmark1/latex/reco_images.tex b/benchmark1/latex/reco_images.tex index 184fcee..4f5adf0 100755 --- a/benchmark1/latex/reco_images.tex +++ b/benchmark1/latex/reco_images.tex @@ -68,6 +68,8 @@ \node[rotate=90, left = 2mm of conc1, xshift=8mm]{MRIReco}; + + \node[inner sep=1pt, below = 2pt of conc1] (conc1) {\includegraphics[width=0.2\textwidth]{../reco/imgCG_diff_mrireco_rf1.png}}; \node[right = 1pt of conc1, nodewhite] (conc2) diff --git a/benchmark1/recoBrainBart.m b/benchmark1/recoBrainBart.m index 4b45f2f..cd6153b 100755 --- a/benchmark1/recoBrainBart.m +++ b/benchmark1/recoBrainBart.m @@ -29,12 +29,18 @@ rf = [1,2,3,4]; times = zeros(1, length(rf)); img_cg = {}; +numTrials = 20; + for i=1:length(rf) traj_sub = trajectory(:,:,1:rf(i):nSpokes); rawdata_sub = rawdata(:,:,1:rf(i):nSpokes,:); - tic(); - img_cg{i} = bart('pics -l2 -r 0.001 -i 20 -t', traj_sub, rawdata_sub, smaps); - times(i) = toc(); + timesTrials = zeros(1, numTrials); + for k=1:numTrials + tic(); + img_cg{i} = bart('pics -l2 -r 0.001 -i 20 -t', traj_sub, rawdata_sub, smaps); + timesTrials(k) = toc(); + end + times(i) = min(timesTrials); end %% write output images and reco times to files diff --git a/benchmark1/recoBrainMRIReco.jl b/benchmark1/recoBrainMRIReco.jl index 37d4abd..6e0fd6b 100755 --- a/benchmark1/recoBrainMRIReco.jl +++ b/benchmark1/recoBrainMRIReco.jl @@ -1,5 +1,9 @@ using HDF5, MRIReco, DelimitedFiles, BenchmarkTools +# change BenchmarkTools settings to match what we do in the Matlab script +BenchmarkTools.DEFAULT_PARAMETERS.seconds = 10000 +BenchmarkTools.DEFAULT_PARAMETERS.samples = 20 + filename = "./data/rawdata_brain_radial_96proj_12ch.h5" data = permutedims(h5read(filename, "rawdata"),[3,2,1,4]) traj = permutedims(h5read(filename, "trajectory"),[3,2,1]) diff --git a/benchmark1/runBenchmark.sh b/benchmark1/runBenchmark.sh index e8cdc54..71cd480 100755 --- a/benchmark1/runBenchmark.sh +++ b/benchmark1/runBenchmark.sh @@ -12,10 +12,6 @@ do julia-1.5 --threads=${t} recoBrainMRIReco.jl & wait export TOEPLITZ=0 - export OVERSAMPLING=2.0 - julia-1.5 --threads=${t} recoBrainMRIReco.jl & - wait - export TOEPLITZ=0 export OVERSAMPLING=1.25 julia-1.5 --threads=${t} recoBrainMRIReco.jl & wait