Mercurial > repos > public > sbplib_julia
changeset 86:34fd86e9d0b9 patch_based_test
Change benchmarkTest from function to script since @benchmark does not work within functions
author | Vidar Stiernström <vidar.stiernstrom@it.uu.se> |
---|---|
date | Fri, 25 Jan 2019 10:10:30 +0100 |
parents | 7f72e7e14659 |
children | 38733e84ef1a |
files | benchmarkTest.jl |
diffstat | 1 files changed, 12 insertions(+), 14 deletions(-) [+] |
line wrap: on
line diff
--- a/benchmarkTest.jl Thu Jan 24 14:58:22 2019 +0100 +++ b/benchmarkTest.jl Fri Jan 25 10:10:30 2019 +0100 @@ -1,21 +1,19 @@ -include("sbp.jl") using BenchmarkTools using Profile using ProfileView - -function benchmarkTest(m,n) - g = sbp.Grid.EquidistantGrid((m,n), (0.0, 0.0), (2pi, 3/2*pi)) - op = sbp.readOperator("d2_4th.txt","h_4th.txt") - Laplace = sbp.Laplace(g, 1.0, op) - - init(x,y) = sin(x) + cos(y) - v = sbp.Grid.evalOn(g,init) +m = 1000; +n = 450; +g = sbp.Grid.EquidistantGrid((m,n), (0.0, 0.0), (2pi, 3/2*pi)) +op = sbp.readOperator("d2_4th.txt","h_4th.txt") +Laplace = sbp.Laplace(g, 1.0, op) - u = zeros(eltype(v),length(v)) +init(x,y) = sin(x) + cos(y) +v = sbp.Grid.evalOn(g,init) - sbp.apply!(Laplace,u,v) +u = zeros(eltype(v),length(v)) - @time sbp.apply!(Laplace,u,v) +sbp.apply!(Laplace,u,v) - #@benchmark sbp.apply!(Laplace,u,v) -end +#@time sbp.apply!(Laplace,u,v) + +@benchmark sbp.apply!(Laplace,u,v)