Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
juobs
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
Javier Ugarrio
juobs
Commits
6e94e6a0
Commit
6e94e6a0
authored
Jan 20, 2021
by
Javier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
read_ms includes dtr != 1
parent
efdaa98b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
20 deletions
+31
-20
src/juobs_reader.jl
src/juobs_reader.jl
+31
-20
No files found.
src/juobs_reader.jl
View file @
6e94e6a0
...
@@ -259,20 +259,20 @@ function read_md(path::String)
...
@@ -259,20 +259,20 @@ function read_md(path::String)
end
end
@doc
raw
"""
@doc
raw
"""
read_ms(path::String
)
read_ms(path::String
; id::Union{Int64, Nothing}=nothing, dtr::Int64=1)
Reads openQCD ms dat files at a given path. This method return:
Reads openQCD ms dat files at a given path. This method return
YData
:
t(t): flow time values
t(t): flow time values
Wsl(icfg, x0, t): the time-slice sums of the densities of the Wilson plaquette action
Ysl(icfg, x0, t): the time-slice sums of the densities of the Yang-Mills action
Ysl(icfg, x0, t): the time-slice sums of the densities of the Yang-Mills action
Qsl(icfg, x0, t): the time-slice sums of the densities of the topological charge
vtr: vector that contains trajectory number
id: ensmble id
Examples:
Examples:
```@example
```@example
t, W, Y, Q
= read_ms(path)
Y
= read_ms(path)
```
```
"""
"""
function
read_ms
(
path
::
String
;
id
::
Union
{
Int64
,
Nothing
}
=
nothing
)
function
read_ms
(
path
::
String
;
id
::
Union
{
Int64
,
Nothing
}
=
nothing
,
dtr
::
Int64
=
1
)
if
isnothing
(
id
)
if
isnothing
(
id
)
bname
=
basename
(
path
)
bname
=
basename
(
path
)
m
=
findfirst
(
r
"[A-Z][0-9]{3}r[0-9]{3}"
,
bname
)
m
=
findfirst
(
r
"[A-Z][0-9]{3}r[0-9]{3}"
,
bname
)
...
@@ -290,27 +290,38 @@ function read_ms(path::String; id::Union{Int64, Nothing}=nothing)
...
@@ -290,27 +290,38 @@ function read_ms(path::String; id::Union{Int64, Nothing}=nothing)
ntr
=
Int32
((
fsize
-
3
*
4
-
8
)
/
datsize
)
ntr
=
Int32
((
fsize
-
3
*
4
-
8
)
/
datsize
)
vntr
=
Vector
{
Int32
}(
undef
,
ntr
)
if
mod
(
ntr
,
dtr
)
!=
0
error
(
"ntr / dtr must be exact"
)
end
vntr
=
Vector
{
Int32
}(
undef
,
div
(
ntr
,
dtr
))
# x0, t, cfg
# x0, t, cfg
Wsl
=
Array
{
Float64
}(
undef
,
ntr
,
tvals
,
nn
+
1
)
Wsl
=
Array
{
Float64
}(
undef
,
div
(
ntr
,
dtr
)
,
tvals
,
nn
+
1
)
Ysl
=
Array
{
Float64
}(
undef
,
ntr
,
tvals
,
nn
+
1
)
Ysl
=
Array
{
Float64
}(
undef
,
div
(
ntr
,
dtr
)
,
tvals
,
nn
+
1
)
Qsl
=
Array
{
Float64
}(
undef
,
ntr
,
tvals
,
nn
+
1
)
Qsl
=
Array
{
Float64
}(
undef
,
div
(
ntr
,
dtr
)
,
tvals
,
nn
+
1
)
k
=
0
for
itr
=
1
:
ntr
for
itr
=
1
:
ntr
vntr
[
itr
]
=
read
(
data
,
Int32
)
tmp
=
read
(
data
,
Int32
)
if
mod
(
itr
,
dtr
)
==
0
k
+=
1
vntr
[
k
]
=
tmp
end
for
iobs
=
1
:
3
for
iobs
=
1
:
3
for
inn
=
0
:
nn
for
inn
=
0
:
nn
tmp
=
Vector
{
Float64
}(
undef
,
tvals
)
tmp2
=
Vector
{
Float64
}(
undef
,
tvals
)
read!
(
data
,
tmp
)
read!
(
data
,
tmp2
)
if
mod
(
itr
,
dtr
)
==
0
if
iobs
==
1
if
iobs
==
1
Wsl
[
itr
,
:
,
inn
+
1
]
=
tmp
Wsl
[
k
,
:
,
inn
+
1
]
=
tmp2
elseif
iobs
==
2
elseif
iobs
==
2
Ysl
[
itr
,
:
,
inn
+
1
]
=
tmp
Ysl
[
k
,
:
,
inn
+
1
]
=
tmp2
elseif
iobs
==
3
elseif
iobs
==
3
Qsl
[
itr
,
:
,
inn
+
1
]
=
tmp
Qsl
[
k
,
:
,
inn
+
1
]
=
tmp2
end
end
end
end
end
end
end
end
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