Merge pull request #106 from JuliaFEM/feature/TimerOutputs.jl

Use TimerOutputs.jl to measure time and memory performance
This commit is contained in:
Jukka Aho
2017-04-11 21:05:54 +07:00
committed by GitHub
4 changed files with 14 additions and 4 deletions
+1
View File
@@ -5,3 +5,4 @@ HDF5 0.7
DataFrames
Formatting
Logging
TimerOutputs
+7
View File
@@ -8,6 +8,13 @@ This is JuliaFEM -- Finite Element Package
"""
module JuliaFEM
using TimerOutputs
const to = TimerOutput()
function print_statistics()
println(to)
end
export print_statistics
import Base: getindex, setindex!, convert, length, size, isapprox, similar,
start, first, next, done, last, endof, vec, ==, +, -, *, /, haskey, copy,
push!, isempty, empty!, append!, sparse, full, read
+4 -4
View File
@@ -673,10 +673,10 @@ function (solver::Solver{Linear})()
info("Starting linear solver")
info("Increment time t=$(round(solver.time, 3))")
info(repeat("-", 80))
initialize!(solver)
assemble!(solver)
solve!(solver)
update!(solver)
@timeit to "initialize solver" initialize!(solver)
@timeit to "assemble problems" assemble!(solver)
@timeit to "solve linear system" solve!(solver)
@timeit to "update problems" update!(solver)
t1 = round(Base.time()-t0, 2)
info("Linear solver ready in $t1 seconds.")
end
@@ -55,3 +55,5 @@ using JuliaFEM.Testing
u3_expected = f/E*[-nu, 1] + g/(2*E)*[-nu, 1]
@test isapprox(u3, u3_expected)
end
print_statistics()