Skip to content

Commit

Permalink
Fix CI and docs
Browse files Browse the repository at this point in the history
  • Loading branch information
GianlucaFuwa committed Sep 21, 2024
1 parent 7e22d12 commit 11407fb
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 25 deletions.
12 changes: 8 additions & 4 deletions benchmark/bench_dirac.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ ops = (
WilsonDiracOperator,
# WilsonEOPreDiracOperator,
StaggeredDiracOperator,
# StaggeredEOPreDiracOperator,
StaggeredEOPreDiracOperator,
)

Random.seed!(1234)
Expand All @@ -24,12 +24,16 @@ for dirac in ops
for T in (Float32, Float64)
U = Gaugefield{CPU,T,WilsonGaugeAction}(N, N, N, N, 6.0)
D = dirac(U, 0.01; csw=1.0)
ϕ = Fermionfield(D.temp)
ψ = Fermionfield(D.temp)
ϕ = Spinorfield(D.temp)
ψ = Spinorfield(D.temp)

random_gauges!(U)
gaussian_pseudofermions!(ϕ)
D_U = D(U)
if dirac === StaggeredEOPreDiracOperator
D_U = MetaQCD.DiracOperators.DdaggerD(D(U))
else
D_U = D(U)
end

s["$(T)"] = @benchmarkable(mul!($ψ, $D_U, $ϕ))
end
Expand Down
2 changes: 1 addition & 1 deletion docs/src/dirac.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ and a Boolean indicating whether there are antiperiodic boundary conditions in t
direction (yes, only periodic and antiperiodic BCs are supported so far).

To create a Dirac operator, the constructors below are used. One thing to note is that dirac
operators can be constructed using any `Abstractfield` and so the gauge background is always
operators can be constructed using any `AbstractField` and so the gauge background is always
set to `nothing` on construction. In order to then add a gauge background you must use the
dirac operator as a functor on a `Gaugefield`, like `D_U = D_free(U)`. This does not
overwrite the `U` in `D_free` but creates a new dirac operator, that references the same
Expand Down
10 changes: 5 additions & 5 deletions docs/src/gaugefields.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,22 +38,22 @@ is to define the fields on the even sites. While we haven't tested whether the f
actually more performant, we map all even sites to the first half of the array to have
contiguous memory accesses. The function `eo_site` does exactly this mapping.

`Fermionfield`s are created in the same way as `Gaugefield`s with the gauge action type
parameter being replaced by the number of Dirac indices. For `Fermionfield`s we have the
`Spinorfield`s are created in the same way as `Gaugefield`s with the gauge action type
parameter being replaced by the number of Dirac indices. For `Spinorfield`s we have the
`ones!` and `gaussian_pseudofermions!` methods to init them.

```@docs
Gaugefield
```

```@docs
Fermionfield
Colorfield
```

```@docs
Colorfield
Expfield
```

```@docs
Expfield
Spinorfield
```
2 changes: 2 additions & 0 deletions src/diracoperators/wilson.jl
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ function (D::WilsonDiracOperator{B,T})(U::Gaugefield{B,T}) where {B,T}
end

@inline has_clover_term(::WilsonDiracOperator{B,T,C}) where {B,T,C} = C
@inline has_clover_term(::Daggered{W}) where {B,T,C,W<:WilsonDiracOperator{B,T,C}} = C
@inline has_clover_term(::DdaggerD{W}) where {B,T,C,W<:WilsonDiracOperator{B,T,C}} = C

struct WilsonFermionAction{Nf,TD,CT,RI1,RI2,RT,TX} <: AbstractFermionAction{Nf}
D::TD
Expand Down
2 changes: 2 additions & 0 deletions src/diracoperators/wilson_eo.jl
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ function (D::WilsonEOPreDiracOperator{B,T})(U::Gaugefield{B,T}) where {B,T}
end

@inline has_clover_term(::WilsonEOPreDiracOperator{B,T,C}) where {B,T,C} = C
@inline has_clover_term(::Daggered{W}) where {B,T,C,W<:WilsonEOPreDiracOperator{B,T,C}} = C
@inline has_clover_term(::DdaggerD{W}) where {B,T,C,W<:WilsonEOPreDiracOperator{B,T,C}} = C

struct WilsonEODiagonal{B,T,M,C,A} <: AbstractField{B,T,M,A} # So we can overload LinearAlgebra.det on the even-odd diagonal
U::A
Expand Down
30 changes: 15 additions & 15 deletions templates/parameters_fermions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,22 @@ numsteps = 10
initial = "cold"
update_method = "hmc"
parity_update = false
numprocs_cart = [2, 2, 1, 1]
numprocs_cart = [1, 1, 1, 1]
halo_width = 1

# ["Dynamical Fermion Settings"]
# fermion_action = "staggered"
# eo_precon = false
# Nf = [2]
# mass = [0.01]
# wilson_csw = 1.0
# cg_tol_action = 1e-16
# cg_tol_md = 1e-16
# cg_maxiters_action = 5000
# cg_maxiters_md = 5000
# rhmc_spectral_bound = [0.0001, 6.0]
# rhmc_prec_action = 64
# rhmc_prec_md = 64
["Dynamical Fermion Settings"]
fermion_action = "staggered"
eo_precon = true
Nf = [2]
mass = [0.01]
wilson_csw = 1.0
cg_tol_action = 1e-16
cg_tol_md = 1e-16
cg_maxiters_action = 5000
cg_maxiters_md = 5000
rhmc_spectral_bound = [0.0001, 6.0]
rhmc_prec_action = 64
rhmc_prec_md = 64

["HMC Settings"]
hmc_trajectory = 1
Expand All @@ -36,7 +36,7 @@ float_type = "double"
ensemble_dir = "/home/gialuf/data/MetaQCD/test_fermions"
randomseed = 0
overwrite = true
save_checkpoint_every = 100
save_checkpoint_every = 10
verboselevel = 1
log_to_console = true
# load_checkpoint_fromfile = true
Expand Down

0 comments on commit 11407fb

Please sign in to comment.