Skip to content

Commit

Permalink
Some cleanup (trixi-framework#1408)
Browse files Browse the repository at this point in the history
* link to SummationByPartsOperators.jl package

* clarify that static_length is from StaticArrayInterface

* describe options to save precompilation time

* Apply suggestions from code review

Co-authored-by: Michael Schlottke-Lakemper <[email protected]>

---------

Co-authored-by: Michael Schlottke-Lakemper <[email protected]>
  • Loading branch information
ranocha and sloede authored Apr 24, 2023
1 parent 7b5b0bd commit d952106
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 5 deletions.
2 changes: 2 additions & 0 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ SimpleUnPack = "ce78b400-467f-4804-87d8-8f486da07d0a"
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
StartUpDG = "472ebc20-7c99-4d4b-9470-8fde4e9faa0f"
Static = "aedffcd0-7271-4cad-89d0-dc628f76c6d3"
StaticArrayInterface = "0d7ed370-da01-4f52-bd93-41d350b8b718"
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
StrideArrays = "d1fa6d79-ef01-42a6-86c9-f7c551f8593b"
StructArrays = "09ab397b-f2b6-538f-b94a-2f83cf4a842a"
Expand Down Expand Up @@ -63,6 +64,7 @@ Setfield = "0.8, 1"
SimpleUnPack = "1.1"
StartUpDG = "0.16"
Static = "0.3, 0.4, 0.5, 0.6, 0.7, 0.8"
StaticArrayInterface = "1.4"
StaticArrays = "1"
StrideArrays = "0.1.18"
StructArrays = "0.6"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ installation and postprocessing procedures. Its features include:
* Kinetic energy-preserving and entropy-stable methods based on flux differencing
* Entropy-stable shock capturing
* Positivity-preserving limiting
* Finite difference summation by parts (SBP) methods
* [Finite difference summation by parts (SBP) methods](https://github.com/ranocha/SummationByPartsOperators.jl)
* Compatible with the [SciML ecosystem for ordinary differential equations](https://diffeq.sciml.ai/latest/)
* [Explicit low-storage Runge-Kutta time integration](https://diffeq.sciml.ai/latest/solvers/ode_solve/#Low-Storage-Methods)
* [Strong stability preserving methods](https://diffeq.sciml.ai/latest/solvers/ode_solve/#Explicit-Strong-Stability-Preserving-Runge-Kutta-Methods-for-Hyperbolic-PDEs-(Conservation-Laws))
Expand Down
2 changes: 1 addition & 1 deletion docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ installation and postprocessing procedures. Its features include:
* Kinetic energy-preserving and entropy-stable methods based on flux differencing
* Entropy-stable shock capturing
* Positivity-preserving limiting
* Finite difference summation by parts (SBP) methods
* [Finite difference summation by parts (SBP) methods](https://github.com/ranocha/SummationByPartsOperators.jl)
* Compatible with the [SciML ecosystem for ordinary differential equations](https://diffeq.sciml.ai/latest/)
* [Explicit low-storage Runge-Kutta time integration](https://diffeq.sciml.ai/latest/solvers/ode_solve/#Low-Storage-Methods)
* [Strong stability preserving methods](https://diffeq.sciml.ai/latest/solvers/ode_solve/#Explicit-Strong-Stability-Preserving-Runge-Kutta-Methods-for-Hyperbolic-PDEs-(Conservation-Laws))
Expand Down
42 changes: 41 additions & 1 deletion docs/src/troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Julia packages via the package manager, e.g., by running
```julia
julia> import Pkg; Pkg.update()
```
If you do not use the latest stable release of Julia from the
If you do not use the latest stable release of Julia from the
[official website](https://julialang.org/downloads/#current_stable_release),
consider updating your Julia installation.

Expand Down Expand Up @@ -148,3 +148,43 @@ are kept on the same MPI rank to be able to coarsen them easily. This might caus
distribution of cells on different ranks. For 2D meshes, this also means that *initially* each rank will
at least own 4 cells, and for 3D meshes, *initially* each rank will at least own 8 cells.
See [issue #1329](https://github.com/trixi-framework/Trixi.jl/issues/1329).



## Installing and updating everything takes a lot of time

Julia compiles code to get good (C/Fortran-like) performance. At the same time,
Julia provides a dynamic environment and usually compiles code just before using
it. Over time, Julia has improved its caching infrastructure, allowing to store
and reuse more results from (pre-)compilation. This often results in an
increased time to install/update packages, in particular when updating
to Julia v1.8 or v1.9 from older versions.

Some packages used together with [Trixi.jl](https://github.com/trixi-framework/Trixi.jl)
provide options to configure the amount of precompilation. For example,
[OrdinaryDiffEq.jl](https://github.com/SciML/OrdinaryDiffEq.jl) precompiles
many ODE solvers for a good runtime experience of average users. Currently,
[Trixi.jl](https://github.com/trixi-framework/Trixi.jl) does not use all of
the available solvers. Thus, you can save some time at every update by setting
their [precompilation options](https://docs.sciml.ai/DiffEqDocs/stable/features/low_dep/).

At the time of writing, this could look as follows. First, you need to activate
the environment where you have installed
[OrdinaryDiffEq.jl](https://github.com/SciML/OrdinaryDiffEq.jl). Then, you need
to execute the following Julia code.

```julia
using Preferences, UUIDs
set_preferences!(UUID("1dea7af3-3e70-54e6-95c3-0bf5283fa5ed"), "PrecompileNonStiff" => true)
set_preferences!(UUID("1dea7af3-3e70-54e6-95c3-0bf5283fa5ed"), "PrecompileStiff" => false)
set_preferences!(UUID("1dea7af3-3e70-54e6-95c3-0bf5283fa5ed"), "PrecompileAutoSwitch" => false)
set_preferences!(UUID("1dea7af3-3e70-54e6-95c3-0bf5283fa5ed"), "PrecompileLowStorage" => true)
set_preferences!(UUID("1dea7af3-3e70-54e6-95c3-0bf5283fa5ed"), "PrecompileDefaultSpecialize" => true)
set_preferences!(UUID("1dea7af3-3e70-54e6-95c3-0bf5283fa5ed"), "PrecompileAutoSpecialize" => false)
set_preferences!(UUID("1dea7af3-3e70-54e6-95c3-0bf5283fa5ed"), "PrecompileFunctionWrapperSpecialize" => false)
set_preferences!(UUID("1dea7af3-3e70-54e6-95c3-0bf5283fa5ed"), "PrecompileNoSpecialize" => false)
```

This disables precompilation of all implicit methods. This should usually not affect
the runtime latency with [Trixi.jl](https://github.com/trixi-framework/Trixi.jl)
since most setups use explicit time integration methods.
4 changes: 2 additions & 2 deletions src/Trixi.jl
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ using HDF5: h5open, attributes
using IfElse: ifelse
using LinearMaps: LinearMap
using LoopVectorization: LoopVectorization, @turbo, indices
using LoopVectorization.ArrayInterface: static_length
using StaticArrayInterface: static_length # used by LoopVectorization
using MPI: MPI
using MuladdMacro: @muladd
using Octavian: Octavian, matmul!
Expand Down Expand Up @@ -133,7 +133,7 @@ export AcousticPerturbationEquations2D,
LinearScalarAdvectionEquation1D, LinearScalarAdvectionEquation2D, LinearScalarAdvectionEquation3D,
InviscidBurgersEquation1D,
LatticeBoltzmannEquations2D, LatticeBoltzmannEquations3D,
ShallowWaterEquations1D, ShallowWaterEquations2D,
ShallowWaterEquations1D, ShallowWaterEquations2D,
ShallowWaterTwoLayerEquations1D, ShallowWaterTwoLayerEquations2D,
LinearizedEulerEquations2D

Expand Down

0 comments on commit d952106

Please sign in to comment.