Skip to content

Commit

Permalink
better benchmarking
Browse files Browse the repository at this point in the history
  • Loading branch information
tknopp committed Aug 16, 2020
1 parent cf21fac commit b24b60c
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 7 deletions.
2 changes: 2 additions & 0 deletions benchmark1/latex/reco_images.tex
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
12 changes: 9 additions & 3 deletions benchmark1/recoBrainBart.m
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions benchmark1/recoBrainMRIReco.jl
Original file line number Diff line number Diff line change
@@ -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])
Expand Down
4 changes: 0 additions & 4 deletions benchmark1/runBenchmark.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b24b60c

Please sign in to comment.