From f1aa0bc310b0964707efb335848d4c7bf53f311f Mon Sep 17 00:00:00 2001 From: "Fernando P. Panadero" Date: Wed, 4 Jun 2025 15:46:50 +0200 Subject: [PATCH 1/3] Small change: Removed warning, details force_flw. --- src/YM/YMact.jl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/YM/YMact.jl b/src/YM/YMact.jl index fa6fdae..3060df4 100644 --- a/src/YM/YMact.jl +++ b/src/YM/YMact.jl @@ -1165,11 +1165,12 @@ Computes the force for the gauge flow with Open Boundaries. An aditional factor is included, see M. Luescher, S. Schaefer: "Lattice QCD with open boundary conditions and twisted-mass reweighting", Comput.Phys.Commun. 184 (2013) 519, - for more details. +This function is not called inside the code, instead the function rescale_bnd() is called after computing the forces. + """ -function force_gauge_flw(ymws::YMworkspace, U, c0, cG, gp::GaugeParm, lp::SpaceParm{N,M,BC_OPEN,D}) where {NI,N,M,D} +function force_gauge_flw(ymws::YMworkspace, U, c0, cG, gp::GaugeParm, lp::SpaceParm{N,M,BC_OPEN,D}) where {N,M,D} ztw = ztwist(gp, lp) if abs(c0-1) < 1.0E-10 From fdb262bdec6e26c8fc3f2e8049b1d9b201d39439 Mon Sep 17 00:00:00 2001 From: "Fernando P. Panadero" Date: Mon, 23 Jun 2025 15:12:23 +0200 Subject: [PATCH 2/3] Bug in zeuther flow for fermions. --- src/Dirac/Diracflow.jl | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/Dirac/Diracflow.jl b/src/Dirac/Diracflow.jl index cfd2c65..908d332 100644 --- a/src/Dirac/Diracflow.jl +++ b/src/Dirac/Diracflow.jl @@ -21,7 +21,7 @@ function flw(U, psi, int::FlowIntr{NI,T}, ns::Int64, eps, gp::GaugeParm, dpar::D force_gauge(ymws, U, int.c0, 1, gp, lp) if int.add_zth - add_zth_term(ymws::YMworkspace, U, lp) + YM.add_zth_term(ymws::YMworkspace, U, lp) end Nablanabla!(dws.sAp, U, psi, dpar, dws, lp) @@ -34,7 +34,7 @@ function flw(U, psi, int::FlowIntr{NI,T}, ns::Int64, eps, gp::GaugeParm, dpar::D force_gauge(ymws, U, int.c0, 1, gp, lp) if int.add_zth - add_zth_term(ymws::YMworkspace, U, lp) + YM.add_zth_term(ymws::YMworkspace, U, lp) end Nablanabla!(dws.sp, U, psi, dpar, dws, lp) @@ -57,7 +57,7 @@ function flw(U, psi, int::FlowIntr{NI,T}, ns::Int64, eps, gp::GaugeParm, dpar::D force_gauge(ymws, U, int.c0, 1, gp, lp) if int.add_zth - add_zth_term(ymws::YMworkspace, U, lp) + YM.add_zth_term(ymws::YMworkspace, U, lp) end rescale_bnd(ymws, lp) @@ -71,7 +71,7 @@ function flw(U, psi, int::FlowIntr{NI,T}, ns::Int64, eps, gp::GaugeParm, dpar::D force_gauge(ymws, U, int.c0, 1, gp, lp) if int.add_zth - add_zth_term(ymws::YMworkspace, U, lp) + YM.add_zth_term(ymws::YMworkspace, U, lp) end rescale_bnd(ymws, lp) @@ -162,7 +162,7 @@ function bflw_step!(psi, U, eps, int::FlowIntr, gp::GaugeParm, dpar::DiracParam force_gauge(ymws, U, int.c0, 1, gp, lp) if int.add_zth - add_zth_term(ymws::YMworkspace, U, lp) + YM.add_zth_term(ymws::YMworkspace, U, lp) end ymws.mom .= ymws.frc1 @@ -171,7 +171,7 @@ function bflw_step!(psi, U, eps, int::FlowIntr, gp::GaugeParm, dpar::DiracParam force_gauge(ymws, U, int.c0, 1, gp, lp) if int.add_zth - add_zth_term(ymws::YMworkspace, U, lp) + YM.add_zth_term(ymws::YMworkspace, U, lp) end ymws.mom .= int.e0[1].*ymws.mom .+ int.e1[1].*ymws.frc1 @@ -184,7 +184,7 @@ function bflw_step!(psi, U, eps, int::FlowIntr, gp::GaugeParm, dpar::DiracParam force_gauge(ymws, U, int.c0, 1, gp, lp) if int.add_zth - add_zth_term(ymws::YMworkspace, U, lp) + YM.add_zth_term(ymws::YMworkspace, U, lp) end U .= expm.(U, ymws.frc1, 2*eps*int.r) @@ -210,7 +210,7 @@ function bflw_step!(psi, U, eps, int::FlowIntr, gp::GaugeParm, dpar::DiracParam force_gauge(ymws, U, int.c0, 1, gp, lp) if int.add_zth - add_zth_term(ymws::YMworkspace, U, lp) + YM.add_zth_term(ymws::YMworkspace, U, lp) end rescale_bnd(ymws, lp) @@ -219,7 +219,7 @@ function bflw_step!(psi, U, eps, int::FlowIntr, gp::GaugeParm, dpar::DiracParam force_gaugew(ymws, U, int.c0, 1, gp, lp) if int.add_zth - add_zth_term(ymws::YMworkspace, U, lp) + YM.add_zth_term(ymws::YMworkspace, U, lp) end rescale_bnd(ymws, lp) @@ -232,7 +232,7 @@ function bflw_step!(psi, U, eps, int::FlowIntr, gp::GaugeParm, dpar::DiracParam force_gauge(ymws, U, int.c0, 1, gp, lp) if int.add_zth - add_zth_term(ymws::YMworkspace, U, lp) + YM.add_zth_term(ymws::YMworkspace, U, lp) end rescale_bnd(ymws, lp) From d2adc5c8c545c343f652fe60e2bbfacbe0221f42 Mon Sep 17 00:00:00 2001 From: "Fernando P. Panadero" Date: Tue, 24 Jun 2025 15:46:12 +0200 Subject: [PATCH 3/3] Option to store cpu src field in propagator func. --- src/Solvers/Propagators.jl | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Solvers/Propagators.jl b/src/Solvers/Propagators.jl index 62301f8..cd0ecbf 100644 --- a/src/Solvers/Propagators.jl +++ b/src/Solvers/Propagators.jl @@ -43,7 +43,7 @@ function propagator!(pro, U, dpar::DiracParam{T}, dws::DiracWorkspace, lp::Space return niter end -function propagator!(pro, U, dpar::DiracParam{T}, dws::DiracWorkspace, lp::SpaceParm, maxiter::Int64, tol::Float64, time::Int64) where {T} +function propagator!(pro, U, dpar::DiracParam{T}, dws::DiracWorkspace, lp::SpaceParm, maxiter::Int64, tol::Float64, time::Int64, psi0 = nothing) where {T} function krnlg5!(src) b=Int64(CUDA.threadIdx().x) @@ -57,6 +57,10 @@ function propagator!(pro, U, dpar::DiracParam{T}, dws::DiracWorkspace, lp::Space pfrandomize!(dws.sp,lp,time) + if !isnothing(psi0) + psi0 .= Array(dws.sp) + end + CUDA.@sync begin CUDA.@cuda threads=lp.bsz blocks=lp.rsz krnlg5!(dws.sp) end