Skip to content

Commit

Permalink
Make mem and time limit no constats to be set from outside
Browse files Browse the repository at this point in the history
  • Loading branch information
theHenks committed Nov 7, 2024
1 parent fe962f7 commit 7b38a30
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/memory_utils.jl
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@

const optim_max_mem=10.0 # in GB for the whole current process ignoring if things could run in parallel
const optim_time_limit=20.0 # in seconds a single Optim.jl optimization step
optim_max_mem::Float64 = 10.0 # in GB for the whole current process ignoring if things could run in parallel
optim_time_limit::Float64 = 20.0 # in seconds a single Optim.jl optimization step

"""
set_memlimit(gig::Float64)
Set memory limit in GB for the whole current process ignoring if things could run in parallel
"""
function set_memlimit(gig::Real)
function set_memlimit(gig::Float64)
@info "Setting `Optimization.jl` memory limit to $gig GB"
global optim_max_mem=gig
end
Expand All @@ -15,7 +15,7 @@ end
set_timelimit(sec::Float64)
Set time limit in seconds a single Optim.jl optimization step
"""
function set_timelimit(sec::Real)
function set_timelimit(sec::Float64)
@info "Setting `Optimization.jl` time limit to $sec seconds"
global optim_time_limit=sec
end
Expand Down

0 comments on commit 7b38a30

Please sign in to comment.