Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
F
FerFlow.jl
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Fernando Pérez Panadero
FerFlow.jl
Commits
2da4146e
Commit
2da4146e
authored
Sep 20, 2024
by
Fernando Pérez Panadero
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
First test for quark mass
parent
974c3fce
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
96 additions
and
7 deletions
+96
-7
src/io.jl
src/io.jl
+9
-0
src/meas.jl
src/meas.jl
+54
-3
src/utils.jl
src/utils.jl
+33
-4
No files found.
src/io.jl
View file @
2da4146e
...
...
@@ -146,10 +146,19 @@ function save_data()
for
fl
in
1
:
length
(
flow_times
)
BDIO_write!
(
fb
,
pp_corr_t
[
:
,
noi
,
fl
])
BDIO_write!
(
fb
,
ap_corr_t
[
:
,
noi
,
fl
])
BDIO_write!
(
fb
,
pp_corr_tfl
[
:
,
noi
,
fl
])
BDIO_write!
(
fb
,
ap_corr_tfl
[
:
,
noi
,
fl
])
BDIO_write!
(
fb
,
Quark_cond
[
:
,
noi
,
fl
])
BDIO_write!
(
fb
,
Quark_cond_cfl
[
:
,
noi
,
fl
])
BDIO_write!
(
fb
,
Quark_cond2
[
:
,
noi
,
fl
])
BDIO_write!
(
fb
,
Quark_cond2_cfl
[
:
,
noi
,
fl
])
BDIO_write!
(
fb
,
ChiDchi
[
:
,
noi
,
fl
])
BDIO_write!
(
fb
,
ChiDchi_cfl
[
:
,
noi
,
fl
])
BDIO_write!
(
fb
,[
phat_t
[
noi
,
fl
]])
end
end
...
...
src/meas.jl
View file @
2da4146e
...
...
@@ -11,6 +11,7 @@ function load_fields()
global
U_CPU
=
Array
(
U
)
global
psi
=
scalar_field
(
Spinor
{
4
,
SU3fund
{
Float64
}},
lp
)
global
psi_CPU
=
Array
(
psi
)
global
psit_CPU
=
Array
(
psi
)
global
pp_density
=
Array
{
Float64
}(
undef
,
lp
.
bsz
,
lp
.
rsz
);
global
ap_density
=
Array
{
Complex
{
Float64
}}(
undef
,
lp
.
bsz
,
lp
.
rsz
);
...
...
@@ -31,6 +32,12 @@ function load_fields()
global
Quark_cond
=
Array
{
Complex
{
Float64
}}(
undef
,
lp
.
iL
[
4
],
N_noise
,
length
(
flow_times
));
global
Quark_cond_cfl
=
Array
{
Complex
{
Float64
}}(
undef
,
lp
.
iL
[
4
],
N_noise
,
length
(
flow_times
));
global
Quark_cond2
=
Array
{
Complex
{
Float64
}}(
undef
,
lp
.
iL
[
4
],
N_noise
,
length
(
flow_times
));
global
Quark_cond2_cfl
=
Array
{
Complex
{
Float64
}}(
undef
,
lp
.
iL
[
4
],
N_noise
,
length
(
flow_times
));
global
ChiDchi
=
Array
{
Complex
{
Float64
}}(
undef
,
lp
.
iL
[
4
],
N_noise
,
length
(
flow_times
));
global
ChiDchi_cfl
=
Array
{
Complex
{
Float64
}}(
undef
,
lp
.
iL
[
4
],
N_noise
,
length
(
flow_times
));
return
nothing
end
...
...
@@ -124,6 +131,7 @@ function one_pt()
## The change in the field before randomize should be moved to the package
psi
.=
0.0
*
psi
pfrandomize!
(
psi
,
lp
,
params
[
"Fermion"
][
"tsource"
])
@timeit
"GPU to CPU"
psit_CPU
.=
Array
(
psi
)
backflow
(
psi
,
U
,
flow_times
[
fl
],
params
[
"Measurements"
][
"Nsaves"
],
gp
,
dpar
,
lp
,
ymws
,
dws
)
...
...
@@ -139,14 +147,14 @@ function one_pt()
println
(
log_file
,
"CG converged after "
,
niter
,
" iterations with residue "
,
CUDA
.
mapreduce
(
x
->
norm2
(
x
),
+
,
dws
.
sr
))
flush
(
log_file
)
@timeit
"CPU to GPU"
copyto!
(
dws
.
s
p
,
psi_CPU
)
@timeit
"CPU to GPU"
copyto!
(
dws
.
s
t
,
psi_CPU
)
Quark_cond
[
:
,
noi
,
fl
]
.=
zero
(
ComplexF64
)
Quark_cond_cfl
[
:
,
noi
,
fl
]
.=
zero
(
ComplexF64
)
for
t
in
1
:
lp
.
iL
[
4
]
for
i
in
1
:
lp
.
iL
[
1
]
for
j
in
1
:
lp
.
iL
[
2
]
for
k
in
1
:
lp
.
iL
[
3
]
b
,
r
=
point_index
(
CartesianIndex
{
lp
.
ndim
}((
i
,
j
,
k
,
t
)),
lp
)
CUDA
.
@allowscalar
Quark_cond
[
t
,
noi
,
fl
]
+=
dot
(
dws
.
s
p
[
b
,
r
],
psi
[
b
,
r
])
CUDA
.
@allowscalar
Quark_cond_cfl
[
t
,
noi
,
fl
]
+=
-
norm2
(
dws
.
s
p
[
b
,
r
])
CUDA
.
@allowscalar
Quark_cond
[
t
,
noi
,
fl
]
+=
dot
(
dws
.
s
t
[
b
,
r
],
psi
[
b
,
r
])
CUDA
.
@allowscalar
Quark_cond_cfl
[
t
,
noi
,
fl
]
+=
-
norm2
(
dws
.
s
t
[
b
,
r
])
end
end
end
end
...
...
@@ -162,6 +170,43 @@ function one_pt()
end
end
end
end
@timeit
"CPU to GPU"
copyto!
(
U
,
U_CPU
)
@timeit
"ChiDchi"
begin
flw_adapt
(
U
,
psi
,
int
,
flow_times
[
fl
],
gp
,
dpar
,
lp
,
ymws
,
dws
)
Dw!
(
dws
.
sp
,
U
,
psi
,
dpar
,
dws
,
lp
)
@timeit
"CPU to GPU"
copyto!
(
dws
.
st
,
psit_CPU
)
ChiDchi
[
:
,
noi
,
fl
]
.=
zero
(
Float64
)
Quark_cond2
[
:
,
noi
,
fl
]
.=
zero
(
ComplexF64
)
for
t
in
1
:
lp
.
iL
[
4
]
for
i
in
1
:
lp
.
iL
[
1
]
for
j
in
1
:
lp
.
iL
[
2
]
for
k
in
1
:
lp
.
iL
[
3
]
b
,
r
=
point_index
(
CartesianIndex
{
lp
.
ndim
}((
i
,
j
,
k
,
t
)),
lp
)
CUDA
.
@allowscalar
ChiDchi
[
t
,
noi
,
fl
]
+=
dot
(
dws
.
st
[
b
,
r
],
dws
.
sp
[
b
,
r
])
CUDA
.
@allowscalar
Quark_cond2
[
t
,
noi
,
fl
]
+=
dot
(
dws
.
st
[
b
,
r
],
psi
[
b
,
r
])
end
end
end
end
@timeit
"CPU to GPU"
copyto!
(
U
,
U_CPU
)
@timeit
"CPU to GPU"
copyto!
(
psi
,
psi_CPU
)
flw_adapt
(
U
,
psi
,
int
,
flow_times
[
fl
],
gp
,
dpar
,
lp
,
ymws
,
dws
)
Dw!
(
dws
.
sp
,
U
,
psi
,
dpar
,
dws
,
lp
)
Quark_cond2_cfl
[
:
,
noi
,
fl
]
.=
zero
(
ComplexF64
)
ChiDchi_cfl
[
:
,
noi
,
fl
]
.=
zero
(
ComplexF64
)
for
t
in
1
:
lp
.
iL
[
4
]
for
i
in
1
:
lp
.
iL
[
1
]
for
j
in
1
:
lp
.
iL
[
2
]
for
k
in
1
:
lp
.
iL
[
3
]
b
,
r
=
point_index
(
CartesianIndex
{
lp
.
ndim
}((
i
,
j
,
k
,
t
)),
lp
)
CUDA
.
@allowscalar
ChiDchi_cfl
[
t
,
noi
,
fl
]
+=
dot
(
dws
.
st
[
b
,
r
],
dws
.
sp
[
b
,
r
])
CUDA
.
@allowscalar
Quark_cond2_cfl
[
t
,
noi
,
fl
]
+=
dot
(
dws
.
st
[
b
,
r
],
psi
[
b
,
r
])
end
end
end
end
end
@timeit
"CPU to GPU"
copyto!
(
U
,
U_CPU
)
...
...
@@ -174,6 +219,12 @@ function one_pt()
pp_corr_tfl
.=
pp_corr_tfl
./
prod
(
lp
.
iL
[
1
:
3
])
ap_corr_tfl
.=
ap_corr_tfl
./
prod
(
lp
.
iL
[
1
:
3
])
ChiDchi
.=
ChiDchi
./
prod
(
lp
.
iL
[
1
:
3
])
Quark_cond2
.=
Quark_cond2
./
prod
(
lp
.
iL
[
1
:
3
])
ChiDchi_cfl
.=
ChiDchi_cfl
./
prod
(
lp
.
iL
[
1
:
3
])
Quark_cond2_cfl
.=
Quark_cond2_cfl
./
prod
(
lp
.
iL
[
1
:
3
])
println
(
log_file
,
"Finished measuring 1pt"
)
return
nothing
...
...
src/utils.jl
View file @
2da4146e
...
...
@@ -41,8 +41,12 @@ function read_ff(name::String)
pp_corr_tfl
=
Array
{
Float64
}(
undef
,
1
,
iL
[
4
],
N_noise
,
nflow
);
ap_corr_tfl
=
Array
{
ComplexF64
}(
undef
,
1
,
iL
[
4
],
N_noise
,
nflow
);
Sigma
=
Array
{
ComplexF64
}(
undef
,
1
,
iL
[
4
],
N_noise
,
nflow
);
Phat_t
=
Array
{
Float64
}(
undef
,
1
,
N_noise
,
nflow
);
Sigma_cfl
=
Array
{
ComplexF64
}(
undef
,
1
,
iL
[
4
],
N_noise
,
nflow
);
Sigma2
=
Array
{
ComplexF64
}(
undef
,
1
,
iL
[
4
],
N_noise
,
nflow
);
Sigma2_cfl
=
Array
{
ComplexF64
}(
undef
,
1
,
iL
[
4
],
N_noise
,
nflow
);
ChiDchi
=
Array
{
ComplexF64
}(
undef
,
1
,
iL
[
4
],
N_noise
,
nflow
);
ChiDchi_cfl
=
Array
{
ComplexF64
}(
undef
,
1
,
iL
[
4
],
N_noise
,
nflow
);
Phat_t
=
Array
{
Float64
}(
undef
,
1
,
N_noise
,
nflow
);
Eoft
=
Array
{
Complex
{
Float64
}}(
undef
,
1
,
1
+
nflow
,
iL
[
4
]);
pp_corr_mc
=
Array
{
Float64
}(
undef
,
0
,
iL
[
4
],
N_noise
);
...
...
@@ -52,8 +56,12 @@ function read_ff(name::String)
pp_corr_tfl_mc
=
Array
{
Float64
}(
undef
,
0
,
iL
[
4
],
N_noise
,
nflow
);
ap_corr_tfl_mc
=
Array
{
ComplexF64
}(
undef
,
0
,
iL
[
4
],
N_noise
,
nflow
);
Sigma_mc
=
Array
{
ComplexF64
}(
undef
,
0
,
iL
[
4
],
N_noise
,
nflow
);
Phat_t_mc
=
Array
{
Float64
}(
undef
,
0
,
N_noise
,
nflow
);
Sigma_cfl_mc
=
Array
{
ComplexF64
}(
undef
,
0
,
iL
[
4
],
N_noise
,
nflow
);
Sigma2_mc
=
Array
{
ComplexF64
}(
undef
,
0
,
iL
[
4
],
N_noise
,
nflow
);
Sigma2_cfl_mc
=
Array
{
ComplexF64
}(
undef
,
0
,
iL
[
4
],
N_noise
,
nflow
);
ChiDchi_mc
=
Array
{
ComplexF64
}(
undef
,
0
,
iL
[
4
],
N_noise
,
nflow
);
ChiDchi_cfl_mc
=
Array
{
ComplexF64
}(
undef
,
0
,
iL
[
4
],
N_noise
,
nflow
);
Phat_t_mc
=
Array
{
Float64
}(
undef
,
0
,
N_noise
,
nflow
);
Eoft_mc
=
Array
{
Complex
{
Float64
}}(
undef
,
0
,
1
+
nflow
,
iL
[
4
]);
while
BDIO_get_uinfo
(
file
)
!=
8
...
...
@@ -86,6 +94,17 @@ function read_ff(name::String)
Sigma
[
1
,
:
,
noi
,
fl
]
.=
TvecC
BDIO_read
(
file
,
TvecC
)
Sigma_cfl
[
1
,
:
,
noi
,
fl
]
.=
TvecC
BDIO_read
(
file
,
TvecC
)
Sigma2
[
1
,
:
,
noi
,
fl
]
.=
TvecC
BDIO_read
(
file
,
TvecC
)
Sigma2_cfl
[
1
,
:
,
noi
,
fl
]
.=
TvecC
BDIO_read
(
file
,
TvecC
)
ChiDchi
[
1
,
:
,
noi
,
fl
]
.=
TvecC
BDIO_read
(
file
,
TvecC
)
ChiDchi_cfl
[
1
,
:
,
noi
,
fl
]
.=
TvecC
BDIO_read
(
file
,
RN
)
Phat_t
[
1
,
noi
,
fl
]
=
RN
[
1
]
end
...
...
@@ -104,6 +123,10 @@ function read_ff(name::String)
ap_corr_tfl_mc
=
[
ap_corr_tfl_mc
;
ap_corr_tfl
]
Sigma_mc
=
[
Sigma_mc
;
Sigma
]
Sigma_cfl_mc
=
[
Sigma_cfl_mc
;
Sigma_cfl
]
Sigma2_mc
=
[
Sigma2_mc
;
Sigma2
]
Sigma2_cfl_mc
=
[
Sigma2_cfl_mc
;
Sigma2_cfl
]
ChiDchi_mc
=
[
ChiDchi_mc
;
ChiDchi
]
ChiDchi_cfl_mc
=
[
ChiDchi_cfl_mc
;
ChiDchi_cfl
]
Phat_t_mc
=
[
Phat_t_mc
;
Phat_t
]
BDIO_seek!
(
file
)
...
...
@@ -112,7 +135,7 @@ function read_ff(name::String)
BDIO_close!
(
file
)
return
Eoft_mc
,
pp_corr_mc
,
ap_corr_mc
,
pp_corr_t_mc
,
ap_corr_t_mc
,
pp_corr_tfl_mc
,
ap_corr_tfl_mc
,
Sigma_mc
,
Sigma_cfl_mc
,
Phat_t_mc
return
Eoft_mc
,
pp_corr_mc
,
ap_corr_mc
,
pp_corr_t_mc
,
ap_corr_t_mc
,
pp_corr_tfl_mc
,
ap_corr_tfl_mc
,
Sigma_mc
,
Sigma_cfl_mc
,
Sigma2_mc
,
Sigma2_cfl_mc
,
ChiDchi_mc
,
ChiDchi_cfl_mc
,
Phat_t_mc
end
...
...
@@ -123,7 +146,7 @@ Loads in the variables 'Eoft', 'pp_corr', 'ap_corr', 'pp_corr_t','ap_corr_t', 'S
'uwreal' quantities. The indices are, when corresponding, eucliden time and flow times
"""
function
uwff
(
file
::
String
)
Eoft_mc
,
pp_corr_mc
,
ap_corr_mc
,
pp_corr_t_mc
,
ap_corr_t_mc
,
pp_corr_tfl_mc
,
ap_corr_tfl_mc
,
Sigma_mc
,
Sigma_cfl_mc
,
Phat_t_mc
=
read_ff
(
file
)
Eoft_mc
,
pp_corr_mc
,
ap_corr_mc
,
pp_corr_t_mc
,
ap_corr_t_mc
,
pp_corr_tfl_mc
,
ap_corr_tfl_mc
,
Sigma_mc
,
Sigma_cfl_mc
,
Sigma2_mc
,
Sigma2_cfl_mc
,
ChiDchi_mc
,
ChiDchi_cfl_mc
,
Phat_t_mc
=
read_ff
(
file
)
runame
=
String
(
split
(
split
(
file
,
"/"
)[
end
],
"."
)[
1
])
T
=
size
(
pp_corr_mc
)[
2
]
...
...
@@ -144,6 +167,12 @@ function uwff(file::String)
global
Sigma
=
[
uwreal
(
real
.
(
sum
(
Sigma_mc
,
dims
=
3
)[
:
,
i
,
1
,
k
]
./
Ns
),
runame
)
for
i
in
1
:
T
,
k
in
1
:
Nfl
]
global
Sigma_cfl
=
[
uwreal
(
real
.
(
sum
(
Sigma_cfl_mc
,
dims
=
3
)[
:
,
i
,
1
,
k
]
./
Ns
),
runame
)
for
i
in
1
:
T
,
k
in
1
:
Nfl
]
global
Sigma2
=
[
uwreal
(
real
.
(
sum
(
Sigma2_mc
,
dims
=
3
)[
:
,
i
,
1
,
k
]
./
Ns
),
runame
)
for
i
in
1
:
T
,
k
in
1
:
Nfl
]
global
Sigma2_cfl
=
[
uwreal
(
real
.
(
sum
(
Sigma2_cfl_mc
,
dims
=
3
)[
:
,
i
,
1
,
k
]
./
Ns
),
runame
)
for
i
in
1
:
T
,
k
in
1
:
Nfl
]
global
ChiDchi
=
[
uwreal
(
real
.
(
sum
(
ChiDchi_mc
,
dims
=
3
)[
:
,
i
,
1
,
k
]
./
Ns
),
runame
)
for
i
in
1
:
T
,
k
in
1
:
Nfl
]
global
ChiDchi_cfl
=
[
uwreal
(
real
.
(
sum
(
ChiDchi_cfl_mc
,
dims
=
3
)[
:
,
i
,
1
,
k
]
./
Ns
),
runame
)
for
i
in
1
:
T
,
k
in
1
:
Nfl
]
global
Phat_t
=
[
uwreal
(
sum
(
Phat_t_mc
,
dims
=
2
)[
:
,
1
,
i
]
./
Ns
,
runame
)
for
i
in
1
:
Nfl
]
return
nothing
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment