Skip to content

Commit 6b58635

Browse files
committed
Move things around a bit
1 parent 2a6f1a9 commit 6b58635

File tree

6 files changed

+37
-18
lines changed

6 files changed

+37
-18
lines changed

docs/LocalPreferences.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[NonlinearSolve]
2+
enable_timer_outputs = true

docs/pages.jl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,12 @@ pages = ["index.md",
2121
"solvers/steady_state_solvers.md",
2222
"solvers/nonlinear_least_squares_solvers.md",
2323
"solvers/fixed_point_solvers.md"],
24-
"Native Solver APIs" => Any["native/solvers.md",
24+
"Native Functionalities" => Any["native/solvers.md",
2525
"native/simplenonlinearsolve.md",
2626
"native/steadystatediffeq.md",
2727
"native/descent.md",
28-
"native/globalization.md"],
28+
"native/globalization.md",
29+
"native/diagnostics.md",],
2930
"Wrapped Solver APIs" => Any["api/fastlevenbergmarquardt.md",
3031
"api/fixedpointacceleration.md",
3132
"api/leastsquaresoptim.md",

docs/src/basics/diagnostics_api.md

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# [Diagnostics API](@id diagnostics_api)
22

3+
Detailed API Documentation is provided at
4+
[Diagonstics API Reference](@ref diagnostics_api_reference).
5+
36
# Logging the Solve Process
47

58
All NonlinearSolve.jl native solvers allow storing and displaying the trace of the nonlinear
@@ -56,11 +59,3 @@ sol.trace
5659

5760
For `iteration == 0` only the `norm(fu, Inf)` is guaranteed to be meaningful. The other
5861
values being meaningful are solver dependent.
59-
60-
## API
61-
62-
```@docs
63-
TraceMinimal
64-
TraceWithJacobianConditionNumber
65-
TraceAll
66-
```

docs/src/native/diagnostics.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# [Diagnostics API](@id diagnostics_api_reference)
2+
3+
## Timer Outputs
4+
5+
These functions are not exported since the names have a potential for conflict.
6+
7+
```@docs
8+
NonlinearSolve.enable_timer_outputs
9+
NonlinearSolve.disable_timer_outputs
10+
NonlinearSolve.@static_timeit
11+
```
12+
13+
## Tracing API
14+
15+
```@docs
16+
TraceAll
17+
TraceWithJacobianConditionNumber
18+
TraceMinimal
19+
```
20+
21+
For details about the arguments refer to the documentation of
22+
[`NonlinearSolve.AbstractNonlinearSolveTraceLevel`](@ref).

src/globalization/trust_region.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ function reinit_cache!(cache::GenericTrustRegionSchemeCache, args...; u0 = nothi
292292
if u0 !== nothing
293293
u0_norm = cache.internalnorm(u0)
294294
cache.trust_region = __initial_trust_radius(cache.alg.initial_trust_radius, T,
295-
cache.alg.method, cache.max_trust_radius, u0_norm) # FIXME: scheme specific
295+
cache.alg.method, cache.max_trust_radius, u0_norm, u0_norm) # FIXME: scheme specific
296296
end
297297
cache.last_step_accepted = false
298298
cache.shrink_counter = 0

src/timer_outputs.jl

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
const TIMER_OUTPUTS_ENABLED = @load_preference("enable_timer_outputs", false)
55

66
@static if TIMER_OUTPUTS_ENABLED
7-
import TimerOutputs
7+
using TimerOutputs
88
end
99

1010
"""
@@ -31,7 +31,7 @@ end
3131

3232
function get_timer_output()
3333
@static if TIMER_OUTPUTS_ENABLED
34-
return TimerOutputs.TimerOutput()
34+
return TimerOutput()
3535
else
3636
return nothing
3737
end
@@ -41,17 +41,16 @@ end
4141
@static_timeit to name expr
4242
4343
Like `TimerOutputs.@timeit_debug` but has zero overhead if `TimerOutputs` is disabled via
44-
`disable_timer_outputs()`.
44+
[`NonlinearSolve.disable_timer_outputs()`](@ref).
4545
"""
4646
macro static_timeit(to, name, expr)
4747
@static if TIMER_OUTPUTS_ENABLED
48-
return TimerOutputs.timer_expr(__module__, true, to, name, expr)
48+
return TimerOutputs.timer_expr(__module__, false, to, name, expr)
4949
else
5050
return esc(expr)
5151
end
5252
end
5353

54-
@inline reset_timer!(::Nothing) = nothing
55-
@static if TIMER_OUTPUTS_ENABLED
56-
@inline reset_timer!(timer::TimerOutputs.TimerOutput) = TimerOutputs.reset_timer!(timer)
54+
@static if !TIMER_OUTPUTS_ENABLED
55+
@inline reset_timer!(::Nothing) = nothing
5756
end

0 commit comments

Comments
 (0)