Skip to content

Commit

Permalink
fix prof
Browse files Browse the repository at this point in the history
  • Loading branch information
PierreMartinon committed Aug 27, 2024
1 parent 24e8053 commit 4de620a
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions benchmark/prof.jl
Original file line number Diff line number Diff line change
@@ -1,24 +1,23 @@
# Profiling
include("../test/deps.jl")

#using BenchmarkTools
using BenchmarkTools
#using Traceur
#using Profile
#using PProf
using JET

precompile = true

test_time = false
test_time = true
#test = :objective
test = :constraints
test_code_warntype = true
test_jet = true
test_code_warntype = false
test_jet = false

# define OCP
prob = include("../problems/fuller.jl")
#prob = include("../problems/jackson.jl")
#prob = include("../problems/goddard.jl")
include("../test/problems/goddard.jl")
prob = goddard_all()
ocp = prob[:ocp]
grid_size = 100
docp, nlp = direct_transcription(ocp, grid_size = grid_size)
Expand All @@ -28,10 +27,11 @@ println("Load problem ", prob[:name])
if test_time
if precompile
println("Precompilation")
solve(ocp, grid_size = grid_size, display = false, max_iter = 2)
direct_solve(ocp, grid_size = grid_size, display = false, max_iter = 2)
end
println("Timed solve")
@timev sol = solve(ocp, grid_size = grid_size, print_level = 0)
@timev sol = direct_solve(ocp, grid_size = grid_size, display=false)
@btime sol = direct_solve(ocp, grid_size = grid_size, display=false)
end

if precompile
Expand Down

0 comments on commit 4de620a

Please sign in to comment.