Skip to content

Commit b24b60c

Browse files
committed
better benchmarking
1 parent cf21fac commit b24b60c

File tree

4 files changed

+15
-7
lines changed

4 files changed

+15
-7
lines changed

benchmark1/latex/reco_images.tex

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@
6868
\node[rotate=90, left = 2mm of conc1, xshift=8mm]{MRIReco};
6969

7070

71+
72+
7173
\node[inner sep=1pt, below = 2pt of conc1] (conc1)
7274
{\includegraphics[width=0.2\textwidth]{../reco/imgCG_diff_mrireco_rf1.png}};
7375
\node[right = 1pt of conc1, nodewhite] (conc2)

benchmark1/recoBrainBart.m

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,18 @@
2929
rf = [1,2,3,4];
3030
times = zeros(1, length(rf));
3131
img_cg = {};
32+
numTrials = 20;
33+
3234
for i=1:length(rf)
3335
traj_sub = trajectory(:,:,1:rf(i):nSpokes);
3436
rawdata_sub = rawdata(:,:,1:rf(i):nSpokes,:);
35-
tic();
36-
img_cg{i} = bart('pics -l2 -r 0.001 -i 20 -t', traj_sub, rawdata_sub, smaps);
37-
times(i) = toc();
37+
timesTrials = zeros(1, numTrials);
38+
for k=1:numTrials
39+
tic();
40+
img_cg{i} = bart('pics -l2 -r 0.001 -i 20 -t', traj_sub, rawdata_sub, smaps);
41+
timesTrials(k) = toc();
42+
end
43+
times(i) = min(timesTrials);
3844
end
3945

4046
%% write output images and reco times to files

benchmark1/recoBrainMRIReco.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
using HDF5, MRIReco, DelimitedFiles, BenchmarkTools
22

3+
# change BenchmarkTools settings to match what we do in the Matlab script
4+
BenchmarkTools.DEFAULT_PARAMETERS.seconds = 10000
5+
BenchmarkTools.DEFAULT_PARAMETERS.samples = 20
6+
37
filename = "./data/rawdata_brain_radial_96proj_12ch.h5"
48
data = permutedims(h5read(filename, "rawdata"),[3,2,1,4])
59
traj = permutedims(h5read(filename, "trajectory"),[3,2,1])

benchmark1/runBenchmark.sh

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,6 @@ do
1212
julia-1.5 --threads=${t} recoBrainMRIReco.jl &
1313
wait
1414
export TOEPLITZ=0
15-
export OVERSAMPLING=2.0
16-
julia-1.5 --threads=${t} recoBrainMRIReco.jl &
17-
wait
18-
export TOEPLITZ=0
1915
export OVERSAMPLING=1.25
2016
julia-1.5 --threads=${t} recoBrainMRIReco.jl &
2117
wait

0 commit comments

Comments
 (0)