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
f85ec54f
Commit
f85ec54f
authored
Jul 30, 2019
by
Lukas Weber
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add_observable -> register_observable
parent
4f73681a
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
20 additions
and
20 deletions
+20
-20
src/mc.cpp
src/mc.cpp
+5
-5
src/measurements.cpp
src/measurements.cpp
+2
-2
src/measurements.h
src/measurements.h
+1
-1
src/runner_pt.cpp
src/runner_pt.cpp
+5
-6
src/runner_pt.h
src/runner_pt.h
+7
-6
No files found.
src/mc.cpp
View file @
f85ec54f
...
...
@@ -18,14 +18,14 @@ int mc::sweep() const {
void
mc
::
_init
()
{
// simple profiling support: measure the time spent for sweeps/measurements etc
measure
.
add
_observable
(
"_ll_checkpoint_read_time"
,
1
);
measure
.
add
_observable
(
"_ll_checkpoint_write_time"
,
1
);
measure
.
add
_observable
(
"_ll_measurement_time"
,
1000
);
measure
.
add
_observable
(
"_ll_sweep_time"
,
1000
);
measure
.
register
_observable
(
"_ll_checkpoint_read_time"
,
1
);
measure
.
register
_observable
(
"_ll_checkpoint_write_time"
,
1
);
measure
.
register
_observable
(
"_ll_measurement_time"
,
1000
);
measure
.
register
_observable
(
"_ll_sweep_time"
,
1000
);
if
(
pt_mode_
)
{
if
(
param
.
get
<
bool
>
(
"pt_statistics"
,
false
))
{
measure
.
add
_observable
(
"_ll_pt_rank"
,
1
);
measure
.
register
_observable
(
"_ll_pt_rank"
,
1
);
}
}
...
...
src/measurements.cpp
View file @
f85ec54f
...
...
@@ -13,7 +13,7 @@ bool measurements::observable_name_is_legal(const std::string &obs_name) {
return
true
;
}
void
measurements
::
add
_observable
(
const
std
::
string
&
name
,
size_t
bin_size
,
size_t
vector_length
)
{
void
measurements
::
register
_observable
(
const
std
::
string
&
name
,
size_t
bin_size
,
size_t
vector_length
)
{
if
(
!
observable_name_is_legal
(
name
))
{
throw
std
::
runtime_error
(
fmt
::
format
(
"Illegal observable name '{}': names must not contain / or ."
,
name
));
...
...
@@ -30,7 +30,7 @@ void measurements::checkpoint_write(const iodump::group &dump_file) {
void
measurements
::
checkpoint_read
(
const
iodump
::
group
&
dump_file
)
{
for
(
const
auto
&
obs_name
:
dump_file
)
{
add
_observable
(
obs_name
);
register
_observable
(
obs_name
);
observables_
.
at
(
obs_name
).
checkpoint_read
(
obs_name
,
dump_file
.
open_group
(
obs_name
));
}
}
...
...
src/measurements.h
View file @
f85ec54f
...
...
@@ -14,7 +14,7 @@ class measurements {
public:
static
bool
observable_name_is_legal
(
const
std
::
string
&
name
);
void
add
_observable
(
const
std
::
string
&
name
,
size_t
bin_size
=
1
,
size_t
vector_length
=
1
);
void
register
_observable
(
const
std
::
string
&
name
,
size_t
bin_size
=
1
,
size_t
vector_length
=
1
);
// use this to add a measurement sample to an observable.
template
<
class
T
>
...
...
src/runner_pt.cpp
View file @
f85ec54f
...
...
@@ -302,7 +302,6 @@ void runner_pt_master::checkpoint_read() {
pt_chains_
.
at
(
id
).
checkpoint_read
(
pt_chains
.
open_group
(
name
));
}
g
.
read
(
"current_chain_id"
,
current_chain_id_
);
}
}
...
...
@@ -340,8 +339,6 @@ void runner_pt_master::checkpoint_write() {
c
.
checkpoint_write
(
pt_chains
.
open_group
(
fmt
::
format
(
"{:04d}"
,
c
.
id
)));
}
g
.
write
(
"current_chain_id"
,
current_chain_id_
);
if
(
use_param_optimization_
)
{
write_params_yaml
();
}
...
...
@@ -389,8 +386,8 @@ int runner_pt_master::schedule_chain_run() {
int
nchains
=
pt_chains_
.
size
();
for
(
int
i
=
1
;
i
<=
nchains
;
i
++
)
{
if
(
!
pt_chains_
[(
old_id
+
i
)
%
nchains
].
is_done
())
{
int
new_chain_id
=
(
old_id
+
i
)
%
nchains
;
auto
&
chain
=
pt_chains_
[
new_chain_id
];
current_chain_id_
=
(
old_id
+
i
)
%
nchains
;
auto
&
chain
=
pt_chains_
[
current_chain_id_
];
chain
.
scheduled_runs
++
;
int
idx
=
0
;
...
...
@@ -774,7 +771,9 @@ int runner_pt_slave::what_is_next(int status) {
void
runner_pt_slave
::
checkpoint_write
()
{
time_last_checkpoint_
=
MPI_Wtime
();
sys_
->
_write
(
job_
.
rundir
(
task_id_
,
run_id_
));
job_
.
log
(
fmt
::
format
(
"* rank {}: checkpoint {}"
,
rank_
,
job_
.
rundir
(
task_id_
,
run_id_
)));
if
(
chain_rank_
==
0
)
{
job_
.
log
(
fmt
::
format
(
"* rank {}: chain checkpoint {}"
,
rank_
,
job_
.
rundir
(
task_id_
,
run_id_
)));
}
}
void
runner_pt_master
::
send_action
(
int
action
,
int
destination
)
{
...
...
src/runner_pt.h
View file @
f85ec54f
...
...
@@ -37,16 +37,15 @@ public:
int
id
{};
int
run_id
{};
bool
swap_odd
{};
pt_chain_run
(
const
pt_chain
&
chain
,
int
run_id
);
static
pt_chain_run
checkpoint_read
(
const
iodump
::
group
&
g
);
void
checkpoint_write
(
const
iodump
::
group
&
g
);
std
::
vector
<
int
>
rank_to_pos
;
std
::
vector
<
int
>
last_visited
;
std
::
vector
<
int
>
switch_partners
;
std
::
vector
<
double
>
weight_ratios
;
std
::
vector
<
int
>
last_visited
;
pt_chain_run
(
const
pt_chain
&
chain
,
int
run_id
);
static
pt_chain_run
checkpoint_read
(
const
iodump
::
group
&
g
);
void
checkpoint_write
(
const
iodump
::
group
&
g
);
};
int
runner_pt_start
(
jobinfo
job
,
const
mc_factory
&
mccreator
,
int
argc
,
char
**
argv
);
...
...
@@ -67,6 +66,8 @@ private:
std
::
map
<
int
,
int
>
rank_to_chain_run_
;
int
current_chain_id_
{
-
1
};
measurements
pt_meas_
;
void
construct_pt_chains
();
void
checkpoint_write
();
void
checkpoint_read
();
...
...
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