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
34d94db4
Commit
34d94db4
authored
Aug 22, 2019
by
Lukas Weber
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
some cleaning up (remove histograms)
parent
eb682698
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
50 deletions
+4
-50
src/iodump.h
src/iodump.h
+1
-1
src/runner_pt.cpp
src/runner_pt.cpp
+2
-43
src/runner_pt.h
src/runner_pt.h
+1
-6
No files found.
src/iodump.h
View file @
34d94db4
...
@@ -15,7 +15,7 @@ private:
...
@@ -15,7 +15,7 @@ private:
public:
public:
iodump_exception
(
const
std
::
string
&
msg
);
iodump_exception
(
const
std
::
string
&
msg
);
const
char
*
what
()
const
noexcept
;
const
char
*
what
()
const
noexcept
override
;
};
};
// This thing is a wrapper around an HDF5 file which can do both reading and
// This thing is a wrapper around an HDF5 file which can do both reading and
...
...
src/runner_pt.cpp
View file @
34d94db4
...
@@ -5,7 +5,6 @@
...
@@ -5,7 +5,6 @@
namespace
loadl
{
namespace
loadl
{
enum
{
enum
{
S_IDLE
,
S_BUSY
,
S_BUSY
,
S_READY_FOR_GLOBAL
,
S_READY_FOR_GLOBAL
,
S_TIMEUP
,
S_TIMEUP
,
...
@@ -34,23 +33,16 @@ pt_chain_run::pt_chain_run(const pt_chain &chain, int run_id) : id{chain.id}, ru
...
@@ -34,23 +33,16 @@ pt_chain_run::pt_chain_run(const pt_chain &chain, int run_id) : id{chain.id}, ru
weight_ratios
.
resize
(
chain
.
params
.
size
(),
-
1
);
weight_ratios
.
resize
(
chain
.
params
.
size
(),
-
1
);
switch_partners
.
resize
(
chain
.
params
.
size
());
switch_partners
.
resize
(
chain
.
params
.
size
());
last_visited
.
resize
(
chain
.
params
.
size
());
for
(
size_t
i
=
0
;
i
<
rank_to_pos
.
size
();
i
++
)
{
for
(
size_t
i
=
0
;
i
<
rank_to_pos
.
size
();
i
++
)
{
rank_to_pos
[
i
]
=
i
;
rank_to_pos
[
i
]
=
i
;
}
}
}
}
void
pt_chain_run
::
clear_histograms
()
{
std
::
fill
(
last_visited
.
begin
(),
last_visited
.
end
(),
0
);
}
pt_chain_run
pt_chain_run
::
checkpoint_read
(
const
iodump
::
group
&
g
)
{
pt_chain_run
pt_chain_run
::
checkpoint_read
(
const
iodump
::
group
&
g
)
{
pt_chain_run
run
;
pt_chain_run
run
;
g
.
read
(
"id"
,
run
.
id
);
g
.
read
(
"id"
,
run
.
id
);
g
.
read
(
"run_id"
,
run
.
run_id
);
g
.
read
(
"run_id"
,
run
.
run_id
);
g
.
read
(
"rank_to_pos"
,
run
.
rank_to_pos
);
g
.
read
(
"rank_to_pos"
,
run
.
rank_to_pos
);
g
.
read
(
"last_visited"
,
run
.
last_visited
);
uint8_t
swap_odd
;
uint8_t
swap_odd
;
g
.
read
(
"swap_odd"
,
swap_odd
);
g
.
read
(
"swap_odd"
,
swap_odd
);
run
.
swap_odd
=
swap_odd
;
run
.
swap_odd
=
swap_odd
;
...
@@ -65,7 +57,6 @@ void pt_chain_run::checkpoint_write(const iodump::group &g) {
...
@@ -65,7 +57,6 @@ void pt_chain_run::checkpoint_write(const iodump::group &g) {
g
.
write
(
"id"
,
id
);
g
.
write
(
"id"
,
id
);
g
.
write
(
"run_id"
,
run_id
);
g
.
write
(
"run_id"
,
run_id
);
g
.
write
(
"rank_to_pos"
,
rank_to_pos
);
g
.
write
(
"rank_to_pos"
,
rank_to_pos
);
g
.
write
(
"last_visited"
,
last_visited
);
g
.
write
(
"swap_odd"
,
static_cast
<
uint8_t
>
(
swap_odd
));
g
.
write
(
"swap_odd"
,
static_cast
<
uint8_t
>
(
swap_odd
));
}
}
...
@@ -73,9 +64,6 @@ void pt_chain::checkpoint_read(const iodump::group &g) {
...
@@ -73,9 +64,6 @@ void pt_chain::checkpoint_read(const iodump::group &g) {
g
.
read
(
"params"
,
params
);
g
.
read
(
"params"
,
params
);
g
.
read
(
"rejection_rates"
,
rejection_rates
);
g
.
read
(
"rejection_rates"
,
rejection_rates
);
g
.
read
(
"rejection_rate_entries"
,
rejection_rate_entries
);
g
.
read
(
"rejection_rate_entries"
,
rejection_rate_entries
);
g
.
read
(
"nup_histogram"
,
nup_histogram
);
g
.
read
(
"ndown_histogram"
,
ndown_histogram
);
g
.
read
(
"entries_before_optimization"
,
entries_before_optimization
);
g
.
read
(
"entries_before_optimization"
,
entries_before_optimization
);
}
}
...
@@ -83,8 +71,6 @@ void pt_chain::checkpoint_write(const iodump::group &g) {
...
@@ -83,8 +71,6 @@ void pt_chain::checkpoint_write(const iodump::group &g) {
g
.
write
(
"params"
,
params
);
g
.
write
(
"params"
,
params
);
g
.
write
(
"rejection_rates"
,
rejection_rates
);
g
.
write
(
"rejection_rates"
,
rejection_rates
);
g
.
write
(
"rejection_rate_entries"
,
rejection_rate_entries
);
g
.
write
(
"rejection_rate_entries"
,
rejection_rate_entries
);
g
.
write
(
"nup_histogram"
,
nup_histogram
);
g
.
write
(
"ndown_histogram"
,
ndown_histogram
);
g
.
write
(
"entries_before_optimization"
,
entries_before_optimization
);
g
.
write
(
"entries_before_optimization"
,
entries_before_optimization
);
}
}
...
@@ -92,8 +78,6 @@ void pt_chain::clear_histograms() {
...
@@ -92,8 +78,6 @@ void pt_chain::clear_histograms() {
rejection_rate_entries
[
0
]
=
0
;
rejection_rate_entries
[
0
]
=
0
;
rejection_rate_entries
[
1
]
=
0
;
rejection_rate_entries
[
1
]
=
0
;
std
::
fill
(
rejection_rates
.
begin
(),
rejection_rates
.
end
(),
0
);
std
::
fill
(
rejection_rates
.
begin
(),
rejection_rates
.
end
(),
0
);
std
::
fill
(
nup_histogram
.
begin
(),
nup_histogram
.
end
(),
0
);
std
::
fill
(
ndown_histogram
.
begin
(),
ndown_histogram
.
end
(),
0
);
}
}
...
@@ -237,9 +221,6 @@ void runner_pt_master::construct_pt_chains() {
...
@@ -237,9 +221,6 @@ void runner_pt_master::construct_pt_chains() {
chain_len_
=
c
.
task_ids
.
size
();
chain_len_
=
c
.
task_ids
.
size
();
c
.
nup_histogram
.
resize
(
chain_len_
);
c
.
ndown_histogram
.
resize
(
chain_len_
);
c
.
rejection_rates
.
resize
(
chain_len_
-
1
);
c
.
rejection_rates
.
resize
(
chain_len_
-
1
);
if
(
po_config_
.
enabled
)
{
if
(
po_config_
.
enabled
)
{
...
@@ -306,11 +287,6 @@ void runner_pt_master::write_param_optimization_stats() {
...
@@ -306,11 +287,6 @@ void runner_pt_master::write_param_optimization_stats() {
for
(
auto
&
chain
:
pt_chains_
)
{
for
(
auto
&
chain
:
pt_chains_
)
{
auto
cg
=
g
.
open_group
(
fmt
::
format
(
"chain{:04d}"
,
chain
.
id
));
auto
cg
=
g
.
open_group
(
fmt
::
format
(
"chain{:04d}"
,
chain
.
id
));
std
::
vector
<
double
>
f
(
chain_len_
);
for
(
size_t
i
=
0
;
i
<
f
.
size
();
i
++
)
{
f
[
i
]
=
chain
.
nup_histogram
[
i
]
*
1.
/
(
chain
.
ndown_histogram
[
i
]
+
chain
.
nup_histogram
[
i
]);
}
cg
.
insert_back
(
"f"
,
f
);
cg
.
insert_back
(
"params"
,
chain
.
params
);
cg
.
insert_back
(
"params"
,
chain
.
params
);
std
::
vector
<
double
>
rejection_est
(
chain
.
rejection_rates
);
std
::
vector
<
double
>
rejection_est
(
chain
.
rejection_rates
);
...
@@ -438,18 +414,7 @@ int runner_pt_master::assign_new_chain(int rank_section) {
...
@@ -438,18 +414,7 @@ int runner_pt_master::assign_new_chain(int rank_section) {
return
chain_run_id
;
return
chain_run_id
;
}
}
void
runner_pt_master
::
pt_param_optimization
(
pt_chain
&
chain
,
pt_chain_run
&
chain_run
)
{
void
runner_pt_master
::
pt_param_optimization
(
pt_chain
&
chain
)
{
for
(
size_t
rank
=
0
;
rank
<
chain_run
.
rank_to_pos
.
size
();
rank
++
)
{
if
(
chain_run
.
rank_to_pos
[
rank
]
==
0
)
{
chain_run
.
last_visited
[
rank
]
=
1
;
}
if
(
chain_run
.
rank_to_pos
[
rank
]
==
static_cast
<
int
>
(
chain_run
.
rank_to_pos
.
size
())
-
1
)
{
chain_run
.
last_visited
[
rank
]
=
-
1
;
}
chain
.
ndown_histogram
[
chain_run
.
rank_to_pos
[
rank
]]
+=
chain_run
.
last_visited
[
rank
]
==
-
1
;
chain
.
nup_histogram
[
chain_run
.
rank_to_pos
[
rank
]]
+=
chain_run
.
last_visited
[
rank
]
==
1
;
}
if
(
std
::
min
(
chain
.
rejection_rate_entries
[
0
],
chain
.
rejection_rate_entries
[
1
])
>=
chain
.
entries_before_optimization
)
{
if
(
std
::
min
(
chain
.
rejection_rate_entries
[
0
],
chain
.
rejection_rate_entries
[
1
])
>=
chain
.
entries_before_optimization
)
{
chain
.
entries_before_optimization
*=
po_config_
.
nsamples_growth
;
chain
.
entries_before_optimization
*=
po_config_
.
nsamples_growth
;
...
@@ -461,12 +426,6 @@ void runner_pt_master::pt_param_optimization(pt_chain &chain, pt_chain_run &chai
...
@@ -461,12 +426,6 @@ void runner_pt_master::pt_param_optimization(pt_chain &chain, pt_chain_run &chai
checkpoint_write
();
checkpoint_write
();
write_param_optimization_stats
();
write_param_optimization_stats
();
chain
.
clear_histograms
();
chain
.
clear_histograms
();
for
(
auto
&
cr
:
pt_chain_runs_
)
{
if
(
cr
.
id
==
chain
.
id
)
{
cr
.
clear_histograms
();
}
}
}
}
}
}
...
@@ -513,7 +472,7 @@ void runner_pt_master::react() {
...
@@ -513,7 +472,7 @@ void runner_pt_master::react() {
int
rank_section
=
rank
/
chain_len_
;
int
rank_section
=
rank
/
chain_len_
;
if
(
po_config_
.
enabled
)
{
if
(
po_config_
.
enabled
)
{
pt_param_optimization
(
chain
,
chain_run
);
pt_param_optimization
(
chain
);
}
}
std
::
fill
(
chain_run
.
weight_ratios
.
begin
(),
chain_run
.
weight_ratios
.
end
(),
-
1
);
std
::
fill
(
chain_run
.
weight_ratios
.
begin
(),
chain_run
.
weight_ratios
.
end
(),
-
1
);
...
...
src/runner_pt.h
View file @
34d94db4
...
@@ -16,8 +16,6 @@ struct pt_chain {
...
@@ -16,8 +16,6 @@ struct pt_chain {
int
scheduled_runs
{};
int
scheduled_runs
{};
// parameter optimization
// parameter optimization
std
::
vector
<
int
>
nup_histogram
;
std
::
vector
<
int
>
ndown_histogram
;
int
entries_before_optimization
{
0
};
int
entries_before_optimization
{
0
};
std
::
vector
<
double
>
rejection_rates
;
std
::
vector
<
double
>
rejection_rates
;
...
@@ -41,15 +39,12 @@ public:
...
@@ -41,15 +39,12 @@ public:
bool
swap_odd
{};
bool
swap_odd
{};
std
::
vector
<
int
>
rank_to_pos
;
std
::
vector
<
int
>
rank_to_pos
;
std
::
vector
<
int
>
last_visited
;
std
::
vector
<
int
>
switch_partners
;
std
::
vector
<
int
>
switch_partners
;
std
::
vector
<
double
>
weight_ratios
;
std
::
vector
<
double
>
weight_ratios
;
pt_chain_run
(
const
pt_chain
&
chain
,
int
run_id
);
pt_chain_run
(
const
pt_chain
&
chain
,
int
run_id
);
static
pt_chain_run
checkpoint_read
(
const
iodump
::
group
&
g
);
static
pt_chain_run
checkpoint_read
(
const
iodump
::
group
&
g
);
void
checkpoint_write
(
const
iodump
::
group
&
g
);
void
checkpoint_write
(
const
iodump
::
group
&
g
);
void
clear_histograms
();
};
};
int
runner_pt_start
(
jobinfo
job
,
const
mc_factory
&
mccreator
,
int
argc
,
char
**
argv
);
int
runner_pt_start
(
jobinfo
job
,
const
mc_factory
&
mccreator
,
int
argc
,
char
**
argv
);
...
@@ -86,7 +81,7 @@ private:
...
@@ -86,7 +81,7 @@ private:
int
schedule_chain_run
();
int
schedule_chain_run
();
void
pt_global_update
(
pt_chain
&
chain
,
pt_chain_run
&
chain_run
);
void
pt_global_update
(
pt_chain
&
chain
,
pt_chain_run
&
chain_run
);
void
pt_param_optimization
(
pt_chain
&
chain
,
pt_chain_run
&
chain_run
);
void
pt_param_optimization
(
pt_chain
&
chain
);
void
react
();
void
react
();
void
send_action
(
int
action
,
int
destination
);
void
send_action
(
int
action
,
int
destination
);
...
...
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