Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Lukas Weber
load_leveller
Commits
a4216e44
Commit
a4216e44
authored
Apr 09, 2019
by
Lukas Weber
Browse files
job status fix
parent
390ffb98
Changes
3
Hide whitespace changes
Inline
Side-by-side
python/loadleveller/jobstatus.py
View file @
a4216e44
...
...
@@ -16,13 +16,12 @@ class JobProgress:
def
__init__
(
self
,
jobfile
):
self
.
jobfile
=
jobfile
with
open
(
jobfile
,
'r'
)
as
f
:
jobfile
=
yaml
.
load
(
f
)
jobfile
=
yaml
.
safe_
load
(
f
)
self
.
tasks
=
jobfile
[
'tasks'
].
keys
()
self
.
restart
=
False
self
.
progress
=
[]
for
task
in
self
.
tasks
:
tp
=
TaskProgress
()
...
...
@@ -42,18 +41,18 @@ class JobProgress:
tp
.
therm_sweeps
+=
f
[
'/thermalization_sweeps'
][
0
]
if
sweeps
<
target_sweeps
+
target_therm
:
if
tp
.
sweeps
<
tp
.
target_sweeps
+
tp
.
target_therm
:
self
.
restart
=
True
self
.
progress
.
append
(
tp
)
def
needs_restart
():
def
needs_restart
(
self
):
return
self
.
restart
def
needs_merge
():
def
needs_merge
(
self
):
result_mtime
=
0
try
:
result_mtime
=
os
.
path
.
getmtime
(
args
.
jobfile
+
'.results.yml'
)
result_mtime
=
os
.
path
.
getmtime
(
self
.
jobfile
+
'.results.yml'
)
except
FileNotFoundError
:
return
True
...
...
@@ -98,7 +97,7 @@ def ystatus():
return
False
for
task
,
tp
in
zip
(
job_prog
.
tasks
,
job_prog
.
progress
):
print
(
'{t}: {tp.
run_co
un
t
} runs, {tp.sweeps}/{tp.target_sweeps} sweeps, {tp.therm_sweeps}/{tp.target_therm} thermalization'
.
format
(
t
=
task
,
tp
=
tp
))
print
(
'{t}: {tp.
num_r
un
s
} runs, {tp.sweeps}/{tp.target_sweeps} sweeps, {tp.therm_sweeps}/{tp.target_therm} thermalization'
.
format
(
t
=
task
,
tp
=
tp
))
except
FileNotFoundError
as
e
:
print
(
"Error: jobfile '{}' not found."
.
format
(
args
.
jobfile
))
python/ydelete
View file @
a4216e44
...
...
@@ -11,7 +11,7 @@ args = parser.parse_args()
with
open
(
args
.
jobfile
,
'r'
)
as
f
:
jobfile
=
yaml
.
load
(
f
)
jobfile
=
yaml
.
safe_
load
(
f
)
try
:
shutil
.
rmtree
(
'{}.data'
.
format
(
args
.
jobfile
))
# adjust this if you adjust the task dir format in load-leveller
...
...
src/runner.cpp
View file @
a4216e44
...
...
@@ -50,7 +50,7 @@ static double parse_duration(std::string str) {
}
else
{
throw
std
::
runtime_error
{
"seconds"
};
}
}
catch
(
std
::
exception
e
)
{
}
catch
(
std
::
exception
&
e
)
{
throw
std
::
runtime_error
{
fmt
::
format
(
"'{}' does not fit time format [[hours:]minutes:]seconds: {}"
,
str
,
e
.
what
())};
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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