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
286d9a77
Commit
286d9a77
authored
8 months ago
by
Fernando Pérez Panadero
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changes in IO. Reader.
parent
6df52e76
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
151 additions
and
54 deletions
+151
-54
main.jl
main.jl
+1
-0
src/io.jl
src/io.jl
+10
-9
src/mc.jl
src/mc.jl
+39
-0
src/meas.jl
src/meas.jl
+16
-45
src/utils.jl
src/utils.jl
+85
-0
No files found.
main.jl
View file @
286d9a77
...
@@ -14,6 +14,7 @@ reset_timer!()
...
@@ -14,6 +14,7 @@ reset_timer!()
include
(
"./src/io.jl"
)
include
(
"./src/io.jl"
)
include
(
"./src/meas.jl"
)
include
(
"./src/meas.jl"
)
include
(
"./src/mc.jl"
)
@timeit
"Input reading and space allocation"
begin
@timeit
"Input reading and space allocation"
begin
read_input
()
read_input
()
...
...
This diff is collapsed.
Click to expand it.
src/io.jl
View file @
286d9a77
...
@@ -114,10 +114,11 @@ function save_data()
...
@@ -114,10 +114,11 @@ function save_data()
BDIO_start_record!
(
fb
,
BDIO_BIN_GENERIC
,
1
)
BDIO_start_record!
(
fb
,
BDIO_BIN_GENERIC
,
1
)
BDIO_write!
(
fb
,
[
convert
(
Int32
,
4
)])
BDIO_write!
(
fb
,
[
convert
(
Int32
,
4
)])
BDIO_write!
(
fb
,
[
convert
(
Int32
,
lp
.
iL
[
i
])
for
i
in
1
:
4
])
BDIO_write!
(
fb
,
[
convert
(
Int32
,
lp
.
iL
[
i
])
for
i
in
1
:
4
])
BDIO_write!
(
fb
,
[
dpar
.
m0
,
dpar
.
csw
,
dpar
.
ct
,
params
[
"Fermion"
][
"Cfl"
]])
BDIO_write!
(
fb
,
[
dpar
.
m0
,
dpar
.
csw
,
params
[
"Fermion"
][
"Cfl"
]])
BDIO_write!
(
fb
,
[
dpar
.
th
[
i
]
for
i
in
1
:
4
])
BDIO_write!
(
fb
,
[
dpar
.
th
[
i
]
for
i
in
1
:
4
])
BDIO_write!
(
fb
,
[
convert
(
Int32
,
length
(
flow_times
))])
BDIO_write!
(
fb
,
flow_times
)
BDIO_write!
(
fb
,
flow_times
)
BDIO_write!
(
fb
,
[
N_noise
,
])
BDIO_write!
(
fb
,
[
convert
(
Int32
,
N_noise
)
])
BDIO_write_hash!
(
fb
)
BDIO_write_hash!
(
fb
)
end
end
...
@@ -125,14 +126,14 @@ function save_data()
...
@@ -125,14 +126,14 @@ function save_data()
BDIO_start_record!
(
fb
,
BDIO_BIN_GENERIC
,
8
)
BDIO_start_record!
(
fb
,
BDIO_BIN_GENERIC
,
8
)
for
fl
in
1
:
length
(
flow_times
)
for
noi
in
1
:
N_noise
for
noi
in
1
:
N_noise
BDIO_write!
(
fb
,
pp_corr_t0
[
:
,
noi
])
BDIO_write!
(
fb
,
pp_corr_t0
)
BDIO_write!
(
fb
,
ap_corr_t0
[
:
,
noi
])
BDIO_write!
(
fb
,
ap_corr_t0
)
BDIO_write!
(
fb
,
pp_corr_t
)
for
fl
in
1
:
length
(
flow_times
)
BDIO_write!
(
fb
,
ap_corr_t
)
BDIO_write!
(
fb
,
pp_corr_t
[
:
,
noi
,
fl
])
BDIO_write!
(
fb
,
Quark_cond
)
BDIO_write!
(
fb
,
ap_corr_t
[
:
,
noi
,
fl
])
BDIO_write!
(
fb
,
Quark_cond
[
noi
,
fl
])
end
end
end
end
...
...
This diff is collapsed.
Click to expand it.
src/mc.jl
0 → 100644
View file @
286d9a77
using
LatticeGPU
using
TOML
using
TimerOutputs
using
ArgParse
using
CUDA
function
thermalize
()
println
(
log_file
,
"
\n
Starting simulation
\n
"
)
println
(
log_file
,
"Thermalizing..."
)
flush
(
log_file
)
for
_
in
1
:
params
[
"HMC"
][
"nth"
]
HMC!
(
U
,
intsch
,
lp
,
gp
,
ymws
)
end
return
nothing
end
function
Gauge_update
()
println
(
log_file
,
"Performing "
*
string
(
params
[
"HMC"
][
"dmeas"
])
*
" HMC steps..."
)
flush
(
log_file
)
for
_
in
1
:
params
[
"HMC"
][
"dmeas"
]
_
,
acc
=
HMC!
(
U
,
intsch
,
lp
,
gp
,
ymws
)
acc
?
nothing
:
println
(
log_file
,
"Rejected HCM step"
)
end
global
MCid
=
MCid
+
1
println
(
log_file
,
"Updated to Gauge configuration n"
*
string
(
MCid
))
Csw!
(
dws
,
U
,
gp
,
lp
)
U_CPU
.=
Array
(
U
)
flush
(
log_file
)
return
nothing
end
This diff is collapsed.
Click to expand it.
src/meas.jl
View file @
286d9a77
...
@@ -26,45 +26,6 @@ function load_fields()
...
@@ -26,45 +26,6 @@ function load_fields()
end
end
function
thermalize
()
println
(
log_file
,
"
\n
Starting simulation
\n
"
)
println
(
log_file
,
"Thermalizing..."
)
flush
(
log_file
)
for
_
in
1
:
params
[
"HMC"
][
"nth"
]
HMC!
(
U
,
intsch
,
lp
,
gp
,
ymws
)
end
return
nothing
end
function
Gauge_update
()
println
(
log_file
,
"Performing "
*
string
(
params
[
"HMC"
][
"dmeas"
])
*
" HMC steps..."
)
flush
(
log_file
)
for
_
in
1
:
params
[
"HMC"
][
"dmeas"
]
_
,
acc
=
HMC!
(
U
,
intsch
,
lp
,
gp
,
ymws
)
acc
?
nothing
:
println
(
log_file
,
"Rejected HCM step"
)
end
global
MCid
=
MCid
+
1
println
(
log_file
,
"Updated to Gauge configuration n"
*
string
(
MCid
))
Csw!
(
dws
,
U
,
gp
,
lp
)
U_CPU
.=
Array
(
U
)
flush
(
log_file
)
return
nothing
end
"""
"""
function two_pt()
function two_pt()
...
@@ -72,7 +33,7 @@ Stores the two point function in the variables 'pp_corr_t0', 'ap_corr_t0', 'pp_c
...
@@ -72,7 +33,7 @@ Stores the two point function in the variables 'pp_corr_t0', 'ap_corr_t0', 'pp_c
"""
"""
function
two_pt
()
function
two_pt
()
println
(
log_file
,
"
\n
Measuring 2pt..."
)
println
(
log_file
,
"Measuring 2pt..."
)
flush
(
log_file
)
flush
(
log_file
)
for
noi
in
1
:
N_noise
for
noi
in
1
:
N_noise
...
@@ -92,8 +53,6 @@ function two_pt()
...
@@ -92,8 +53,6 @@ function two_pt()
end
end
end
end
end
end
end
end
delta_t
=
0.0
delta_t
=
0.0
neps
=
int
.
eps_ini
neps
=
int
.
eps_ini
for
fl
in
1
:
length
(
flow_times
)
for
fl
in
1
:
length
(
flow_times
)
...
@@ -117,7 +76,12 @@ function two_pt()
...
@@ -117,7 +76,12 @@ function two_pt()
copyto!
(
U
,
U_CPU
)
copyto!
(
U
,
U_CPU
)
end
end
println
(
log_file
,
"Finished measuring 2pt
\n
"
)
pp_corr_t0
.=
pp_corr_t0
./
prod
(
lp
.
iL
[
1
:
3
])
ap_corr_t0
.=
ap_corr_t0
./
prod
(
lp
.
iL
[
1
:
3
])
pp_corr_t
.=
pp_corr_t
./
prod
(
lp
.
iL
[
1
:
3
])
ap_corr_t
.=
pp_corr_t
./
prod
(
lp
.
iL
[
1
:
3
])
println
(
log_file
,
"Finished measuring 2pt"
)
flush
(
log_file
)
flush
(
log_file
)
return
nothing
return
nothing
...
@@ -125,6 +89,11 @@ end
...
@@ -125,6 +89,11 @@ end
"""
function one_pt()
Stores the one point function in the variable 'Quark_cond'.
"""
function
one_pt
()
function
one_pt
()
copyto!
(
U
,
U_CPU
)
copyto!
(
U
,
U_CPU
)
...
@@ -133,7 +102,7 @@ function one_pt()
...
@@ -133,7 +102,7 @@ function one_pt()
println
(
log_file
,
"Measuring 1pt at t = "
*
string
(
flow_times
[
fl
])
*
"..."
)
println
(
log_file
,
"Measuring 1pt at t = "
*
string
(
flow_times
[
fl
])
*
"..."
)
flush
(
log_file
)
flush
(
log_file
)
for
noi
in
1
:
N_noise
for
noi
in
1
:
N_noise
pfrandomize!
(
psi
,
lp
)
pfrandomize!
(
psi
,
lp
)
...
@@ -153,7 +122,9 @@ function one_pt()
...
@@ -153,7 +122,9 @@ function one_pt()
end
end
end
end
println
(
log_file
,
"Finished measuring 1pt
\n
"
)
Quark_cond
.=
Quark_cond
./
prod
(
lp
.
iL
)
println
(
log_file
,
"Finished measuring 1pt"
)
return
nothing
return
nothing
end
end
...
...
This diff is collapsed.
Click to expand it.
src/utils.jl
0 → 100644
View file @
286d9a77
using
LatticeGPU
using
ADerrors
using
BDIO
function
read_ff
(
name
::
String
)
file
=
BDIO_open
(
name
,
"r"
,
"FerFlow correlators"
)
while
BDIO_get_uinfo
(
file
)
!=
1
BDIO_seek!
(
file
)
end
dims
=
Vector
{
Int32
}(
undef
,
1
)
iL
=
Vector
{
Int32
}(
undef
,
4
)
dpars
=
Vector
{
Float64
}(
undef
,
3
)
# m0,csw,Cfl
th
=
Vector
{
ComplexF64
}(
undef
,
4
)
nflow
=
Vector
{
Int32
}(
undef
,
1
)
N_noise
=
Vector
{
Int32
}(
undef
,
1
)
BDIO_read
(
file
,
dims
)
BDIO_read
(
file
,
iL
)
BDIO_read
(
file
,
dpars
)
BDIO_read
(
file
,
th
)
BDIO_read
(
file
,
nflow
)
flow_times
=
Vector
{
Float64
}(
undef
,
nflow
)
BDIO_read
(
file
,
flow_times
)
BDIO_read
(
file
,
N_noise
)
N_noise
=
N_noise
[
1
]
nflow
=
nflow
[
1
]
TvecR
=
Vector
{
Float64
}(
undef
,
iL
[
4
]);
TvecC
=
Vector
{
ComplexF64
}(
undef
,
iL
[
4
]);
CN
=
Vector
{
ComplexF64
}(
undef
,
1
);
pp_corr
=
Array
{
Float64
}(
undef
,
1
,
iL
[
4
],
N_noise
);
ap_corr
=
Array
{
ComplexF64
}(
undef
,
1
,
iL
[
4
],
N_noise
);
pp_corr_t
=
Array
{
Float64
}(
undef
,
1
,
iL
[
4
],
N_noise
,
nflow
);
ap_corr_t
=
Array
{
ComplexF64
}(
undef
,
1
,
iL
[
4
],
N_noise
,
nflow
);
Sigma
=
Array
{
ComplexF64
}(
undef
,
1
,
N_noise
,
nflow
);
pp_corr_mc
=
Array
{
Float64
}(
undef
,
0
,
iL
[
4
],
N_noise
);
ap_corr_mc
=
Array
{
ComplexF64
}(
undef
,
0
,
iL
[
4
],
N_noise
);
pp_corr_t_mc
=
Array
{
Float64
}(
undef
,
0
,
iL
[
4
],
N_noise
,
nflow
);
ap_corr_t_mc
=
Array
{
ComplexF64
}(
undef
,
0
,
iL
[
4
],
N_noise
,
nflow
);
Sigma_mc
=
Array
{
ComplexF64
}(
undef
,
0
,
N_noise
,
nflow
);
while
BDIO_get_uinfo
(
file
)
!=
8
BDIO_seek!
(
file
)
end
while
BDIO_get_uinfo
(
file
)
==
8
for
noi
in
1
:
N_noise
BDIO_read
(
file
,
TvecR
)
pp_corr
[
1
,
:
,
noi
]
.=
TvecR
BDIO_read
(
file
,
TvecC
)
ap_corr
[
1
,
:
,
noi
]
.=
TvecC
for
fl
in
1
:
nflow
BDIO_read
(
file
,
TvecR
)
pp_corr_t
[
1
,
:
,
noi
,
fl
]
.=
TvecR
BDIO_read
(
file
,
TvecC
)
ap_corr_t
[
1
,
:
,
noi
,
fl
]
.=
TvecC
BDIO_read
(
file
,
CN
)
Sigma
[
1
,
noi
,
fl
]
=
CN
[
1
]
end
end
pp_corr_mc
=
[
pp_corr_mc
;
pp_corr
]
ap_corr_mc
=
[
ap_corr_mc
;
ap_corr
]
pp_corr_t_mc
=
[
pp_corr_t_mc
;
pp_corr_t
]
ap_corr_t_mc
=
[
ap_corr_t_mc
;
ap_corr_t
]
Sigma_mc
=
[
Sigma_mc
;
Sigma
]
BDIO_seek!
(
file
,
2
)
end
BDIO_close!
(
file
)
return
pp_corr_mc
,
ap_corr_mc
,
pp_corr_t_mc
,
ap_corr_t_mc
,
Sigma_mc
end
This diff is collapsed.
Click to expand it.
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