Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
L
load_leveller
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Test Cases
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
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
Lukas Weber
load_leveller
Commits
6f9d664e
Commit
6f9d664e
authored
May 28, 2019
by
Lukas Weber
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
only read jobfile once
parent
e3c3cc8a
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
25 additions
and
20 deletions
+25
-20
python/loadl
python/loadl
+13
-8
python/loadleveller/jobstatus.py
python/loadleveller/jobstatus.py
+1
-1
src/loadleveller.h
src/loadleveller.h
+3
-3
src/mc.cpp
src/mc.cpp
+2
-2
src/mc.h
src/mc.h
+2
-2
src/parser.cpp
src/parser.cpp
+1
-1
src/parser.h
src/parser.h
+1
-1
src/runner.cpp
src/runner.cpp
+1
-1
src/runner_single.cpp
src/runner_single.cpp
+1
-1
No files found.
python/loadl
View file @
6f9d664e
...
...
@@ -50,15 +50,15 @@ def run():
label
=
'Warning'
if
args_run
.
force
else
'Error'
if
binary_modtime
>
data_modtime
:
print
(
'{}: binary
\'
{}
\'
is newer than the checkpoint files.'
.
format
(
label
,
job
.
mc_binary
))
if
not
args
.
force
:
print
(
'{}: binary
\'
{}
\'
is newer than the checkpoint files.'
.
format
(
label
,
job
.
jobconfig
[
'mc_binary'
]
))
if
not
args
_run
.
force
:
print
(
'Use
\'
--restart
\'
to start from a blank run or use
\'
--force
\'
to proceed if you are sure
\n
the changes you made are compatible.'
)
sys
.
exit
(
1
)
except
StopIteration
:
pass
if
args_run
.
single
:
cmd
=
[
job
.
mc_binary
,
'single'
,
jobname
]
cmd
=
[
job
.
jobconfig
[
'mc_binary'
],
'single'
,
job
.
jobname
]
print
(
'$ '
+
' '
.
join
(
cmd
))
subprocess
.
run
(
cmd
)
else
:
...
...
@@ -66,10 +66,15 @@ def run():
def
delete
():
import
shutil
print
(
'$ rm -r {}.data'
.
format
(
job
.
jobname
))
shutil
.
rmtree
(
'{}.data'
.
format
(
job
.
jobname
))
print
(
'$ rm -r {}.results.yml'
.
format
(
job
.
jobname
))
shutil
.
rmtree
(
'{}.results.yml'
.
format
(
job
.
jobname
))
datadir
=
'{}.data'
.
format
(
job
.
jobname
)
results_file
=
'{}.results.yml'
.
format
(
job
.
jobname
)
if
os
.
path
.
exists
(
datadir
):
print
(
'$ rm -r {}'
.
format
(
datadir
))
shutil
.
rmtree
(
datadir
)
if
os
.
path
.
exists
(
results_file
):
print
(
'$ rm {}'
.
format
(
results_file
))
os
.
unlink
(
results_file
)
def
merge
():
cmd
=
[
job
.
jobconfig
[
'mc_binary'
],
'merge'
,
job
.
jobname
]
...
...
@@ -78,7 +83,7 @@ def merge():
def
status
():
from
loadleveller
import
jobstatus
rc
=
jobstatus
.
print_status
(
job
,
sys
.
arg
s
[
3
:])
rc
=
jobstatus
.
print_status
(
job
,
sys
.
arg
v
[
3
:])
sys
.
exit
(
rc
)
...
...
python/loadleveller/jobstatus.py
View file @
6f9d664e
...
...
@@ -70,7 +70,7 @@ def print_status(jobfile, args):
parser
.
add_argument
(
'--need-restart'
,
action
=
'store_true'
,
help
=
'Return 1 if the job is not completed yet and 0 otherwise.'
)
parser
.
add_argument
(
'--need-merge'
,
action
=
'store_true'
,
help
=
'Return 1 if the merged results are older than the raw data and 0 otherwise.'
)
args
=
parser
.
parse_args
()
args
=
parser
.
parse_args
(
args
)
try
:
job_prog
=
JobProgress
(
jobfile
)
...
...
src/loadleveller.h
View file @
6f9d664e
...
...
@@ -10,7 +10,7 @@ namespace loadl {
inline
int
merge_only
(
jobinfo
job
,
const
mc_factory
&
mccreator
,
int
,
char
**
)
{
for
(
size_t
task_id
=
0
;
task_id
<
job
.
task_names
.
size
();
task_id
++
)
{
std
::
vector
<
evalable
>
evalables
;
std
::
unique_ptr
<
mc
>
sys
{
mccreator
(
job
.
job
name
,
job
.
task_names
[
task_id
])};
std
::
unique_ptr
<
mc
>
sys
{
mccreator
(
job
.
job
file
[
job
.
task_names
[
task_id
]
])};
sys
->
register_evalables
(
evalables
);
job
.
merge_task
(
task_id
,
evalables
);
...
...
@@ -43,8 +43,8 @@ inline int run_mc(int (*starter)(jobinfo job, const mc_factory &, int argc, char
// run this function from main() in your code.
template
<
class
mc_implementation
>
int
run
(
int
argc
,
char
**
argv
)
{
auto
mccreator
=
[
&
](
const
std
::
string
&
jobfile
,
const
std
::
string
&
taskname
)
->
mc
*
{
return
new
mc_implementation
(
jobfile
,
taskname
)
;
auto
mccreator
=
[
&
](
const
&
parser
p
)
->
mc
*
{
return
new
mc_implementation
{
p
}
;
};
if
(
argc
>
1
&&
std
::
string
(
argv
[
1
])
==
"merge"
)
{
...
...
src/mc.cpp
View file @
6f9d664e
...
...
@@ -2,8 +2,8 @@
namespace
loadl
{
mc
::
mc
(
const
std
::
string
&
jobfile
,
const
std
::
string
&
taskname
)
:
param
{
p
arser
{
jobfile
}[
"tasks"
][
taskname
]
}
{
mc
::
mc
(
const
parser
&
p
)
:
param
{
p
}
{
therm_
=
param
.
get
<
int
>
(
"thermalization"
);
}
...
...
src/mc.h
View file @
6f9d664e
...
...
@@ -48,9 +48,9 @@ public:
bool
is_thermalized
();
measurements
measure
;
mc
(
const
std
::
string
&
jobfile
,
const
std
::
string
&
taskname
);
mc
(
const
parser
&
p
);
virtual
~
mc
()
=
default
;
};
typedef
std
::
function
<
mc
*
(
const
std
::
string
&
,
const
std
::
string
&
)
>
mc_factory
;
typedef
std
::
function
<
mc
*
(
const
parser
&
)
>
mc_factory
;
}
src/parser.cpp
View file @
6f9d664e
...
...
@@ -54,7 +54,7 @@ parser::iterator parser::end() {
return
iterator
{
filename_
,
content_
.
end
()};
}
bool
parser
::
defined
(
const
std
::
string
&
key
)
{
bool
parser
::
defined
(
const
std
::
string
&
key
)
const
{
if
(
!
content_
.
IsMap
())
{
return
false
;
}
...
...
src/parser.h
View file @
6f9d664e
...
...
@@ -47,7 +47,7 @@ public:
}
// is key defined?
bool
defined
(
const
std
::
string
&
key
);
bool
defined
(
const
std
::
string
&
key
)
const
;
parser
operator
[](
const
std
::
string
&
key
);
iterator
begin
();
...
...
src/runner.cpp
View file @
6f9d664e
...
...
@@ -297,7 +297,7 @@ void runner_slave::start() {
int
action
=
what_is_next
(
S_IDLE
);
while
(
action
!=
A_EXIT
)
{
if
(
action
==
A_NEW_JOB
)
{
sys_
=
std
::
unique_ptr
<
mc
>
{
mccreator_
(
job_
.
job
name
,
job_
.
task_names
[
task_id_
])};
sys_
=
std
::
unique_ptr
<
mc
>
{
mccreator_
(
job_
.
job
file
[
job_
.
task_names
[
task_id_
]
])};
if
(
!
sys_
->
_read
(
job_
.
rundir
(
task_id_
,
run_id_
)))
{
sys_
->
_init
();
// checkpointing();
...
...
src/runner_single.cpp
View file @
6f9d664e
...
...
@@ -25,7 +25,7 @@ int runner_single::start() {
read
();
task_id_
=
get_new_task_id
(
task_id_
);
while
(
task_id_
!=
-
1
&&
!
time_is_up
())
{
sys_
=
std
::
unique_ptr
<
mc
>
{
mccreator_
(
job_
.
job
name
,
job_
.
task_names
.
at
(
task_id_
)
)};
sys_
=
std
::
unique_ptr
<
mc
>
{
mccreator_
(
job_
.
job
file
[
job_
.
task_names
.
at
(
task_id_
)]
)};
if
(
!
sys_
->
_read
(
job_
.
rundir
(
task_id_
,
1
)))
{
sys_
->
_init
();
}
...
...
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