Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
LGPU FPP
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
LGPU FPP
Commits
97621903
Commit
97621903
authored
Oct 31, 2023
by
Fernando Pérez Panadero
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
IO changes
parent
4feb9499
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
109 additions
and
5 deletions
+109
-5
src/Dirac/Dirac.jl
src/Dirac/Dirac.jl
+1
-1
src/Dirac/DiracIO.jl
src/Dirac/DiracIO.jl
+52
-1
src/LatticeGPU.jl
src/LatticeGPU.jl
+2
-2
src/YM/YMio.jl
src/YM/YMio.jl
+54
-1
No files found.
src/Dirac/Dirac.jl
View file @
97621903
...
...
@@ -478,6 +478,6 @@ export Dw!, DwdagDw!, g5Dw!, pfrandomize!, Csw!
include
(
"DiracIO.jl"
)
export
read_prop
,
save_prop
export
read_prop
,
save_prop
,
read_dpar
end
src/Dirac/DiracIO.jl
View file @
97621903
"""
read_prop(
psi, lp::SpaceParm{4,M,B,D},
)
read_prop(
fname::String
)
Reads propagator from file `fname` using the native (BDIO) format.
"""
...
...
@@ -129,4 +129,55 @@ function save_prop(fname::String, psi, lp::SpaceParm{4,M,B,D}, dpar::DiracParam;
BDIO_close!
(
fb
)
return
nothing
end
"""
read_dpar(fname::String)
Reads Dirac parameters from file `fname` using the native (BDIO) format. Returns DiracParam and SpaceParm.
"""
function
read_dpar
(
fname
::
String
)
UID_HDR
=
14
fb
=
BDIO_open
(
fname
,
"r"
)
while
BDIO_get_uinfo
(
fb
)
!=
UID_HDR
BDIO_seek!
(
fb
)
end
ihdr
=
Vector
{
Int32
}(
undef
,
2
)
BDIO_read
(
fb
,
ihdr
)
if
(
ihdr
[
1
]
!=
convert
(
Int32
,
1753996112
))
&&
(
ihdr
[
2
]
!=
convert
(
Int32
,
5
))
error
(
"Wrong file format [header]"
)
end
run
=
BDIO
.
BDIO_read_str
(
fb
)
while
BDIO_get_uinfo
(
fb
)
!=
1
BDIO_seek!
(
fb
)
end
ifoo
=
Vector
{
Int32
}(
undef
,
2
)
BDIO_read
(
fb
,
ifoo
)
ndim
=
convert
(
Int64
,
ifoo
[
1
])
npls
=
convert
(
Int64
,
round
(
ndim
*
(
ndim
-
1
)
/
2
))
ibc
=
convert
(
Int64
,
ifoo
[
2
])
ifoo
=
Vector
{
Int32
}(
undef
,
ndim
+
convert
(
Int32
,
npls
))
BDIO_read
(
fb
,
ifoo
)
iL
=
ntuple
(
i
->
convert
(
Int64
,
ifoo
[
i
]),
ndim
)
ntw
=
ntuple
(
i
->
convert
(
Int64
,
ifoo
[
i
+
ndim
]),
npls
)
foopars
=
Vector
{
Float64
}(
undef
,
4
)
BDIO_read
(
fb
,
foopars
)
footh
=
Vector
{
Float64
}(
undef
,
4
)
lp
=
SpaceParm
{
ndim
}(
iL
,
(
4
,
4
,
4
,
4
),
ibc
,
ntw
)
dpar
=
DiracParam
{
Float64
}(
SU3fund
,
foopars
[
1
],
foopars
[
2
],
ntuple
(
i
->
footh
[
i
],
4
),
foopars
[
3
])
BDIO_close!
(
fb
)
return
dpar
,
lp
end
\ No newline at end of file
src/LatticeGPU.jl
View file @
97621903
...
...
@@ -45,7 +45,7 @@ export Eoft_clover, Eoft_plaq, Qtop
export
FlowIntr
,
wfl_euler
,
zfl_euler
,
wfl_rk2
,
zfl_rk2
,
wfl_rk3
,
zfl_rk3
export
flw
,
flw_adapt
export
sfcoupling
,
bndfield
,
setbndfield
export
import_lex64
,
import_cern64
,
import_bsfqcd
,
save_cnfg
,
read_cnfg
export
import_lex64
,
import_cern64
,
import_bsfqcd
,
save_cnfg
,
read_cnfg
,
read_gp
include
(
"Spinors/Spinors.jl"
)
...
...
@@ -58,7 +58,7 @@ include("Dirac/Dirac.jl")
using
.
Dirac
export
DiracWorkspace
,
DiracParam
export
Dw!
,
DwdagDw!
,
pfrandomize!
,
g5Dw!
,
Csw!
export
read_prop
,
save_prop
export
read_prop
,
save_prop
,
read_dpar
include
(
"Solvers/Solvers.jl"
)
using
.
Solvers
...
...
src/YM/YMio.jl
View file @
97621903
...
...
@@ -10,7 +10,7 @@
###
"""
read_cnfg(
U, lp::SpaceParm{4,M,B,D},
)
read_cnfg(
fname::String
)
Reads configuration from file `fname` using the native (BDIO) format.
"""
...
...
@@ -117,6 +117,13 @@ function save_cnfg(fname::String, U, lp::SpaceParm{4,M,B,D}, gp::GaugeParm; run:
BDIO_write!
(
fb
,
[
convert
(
Int32
,
lp
.
iL
[
i
])
for
i
in
1
:
4
])
BDIO_write!
(
fb
,
[
convert
(
Int32
,
lp
.
ntw
[
i
])
for
i
in
1
:
M
])
BDIO_write!
(
fb
,
[
gp
.
beta
,
gp
.
c0
,
gp
.
cG
[
1
],
gp
.
cG
[
2
]])
for
i
in
1
:
4
for
a
in
fieldnames
(
SU3
)
BDIO_write!
(
fb
,[
getfield
(
gp
.
Ubnd
[
i
],
a
)])
end
end
end
BDIO_write_hash!
(
fb
)
...
...
@@ -297,3 +304,49 @@ function import_cern64(fname, ibc, lp::SpaceParm; log=true)
return
CuArray
(
Ucpu
)
end
"""
read_gp(fname::String)
Reads Gauge parameters from file `fname` using the native (BDIO) format. Returns GaugeParm and SpaceParm.
"""
function
read_gp
(
fname
::
String
)
UID_HDR
=
14
fb
=
BDIO_open
(
fname
,
"r"
)
while
BDIO_get_uinfo
(
fb
)
!=
UID_HDR
BDIO_seek!
(
fb
)
end
ihdr
=
Vector
{
Int32
}(
undef
,
2
)
BDIO_read
(
fb
,
ihdr
)
if
(
ihdr
[
1
]
!=
convert
(
Int32
,
1653996111
))
&&
(
ihdr
[
2
]
!=
convert
(
Int32
,
2
))
error
(
"Wrong file format [header]"
)
end
run
=
BDIO
.
BDIO_read_str
(
fb
)
while
BDIO_get_uinfo
(
fb
)
!=
1
BDIO_seek!
(
fb
)
end
ifoo
=
Vector
{
Int32
}(
undef
,
4
)
BDIO_read
(
fb
,
ifoo
)
ndim
=
convert
(
Int64
,
ifoo
[
1
])
npls
=
convert
(
Int64
,
round
(
ndim
*
(
ndim
-
1
)
/
2
))
ibc
=
convert
(
Int64
,
ifoo
[
2
])
nf
=
ifoo
[
4
]
ifoo
=
Vector
{
Int32
}(
undef
,
ndim
+
convert
(
Int32
,
npls
))
BDIO_read
(
fb
,
ifoo
)
iL
=
ntuple
(
i
->
convert
(
Int64
,
ifoo
[
i
]),
ndim
)
ntw
=
ntuple
(
i
->
convert
(
Int64
,
ifoo
[
i
+
ndim
]),
npls
)
dfoo
=
Vector
{
Float64
}(
undef
,
4
)
BDIO_read
(
fb
,
dfoo
)
lp
=
SpaceParm
{
ndim
}(
iL
,
(
4
,
4
,
4
,
4
),
ibc
,
ntw
)
gp
=
GaugeParm
{
Float64
}(
SU3
{
Float64
},
dfoo
[
1
],
dfoo
[
2
])
return
gp
,
lp
end
\ No newline at end of file
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