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
e9f7fa0d
Commit
e9f7fa0d
authored
Jul 25, 2019
by
Lukas Weber
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
parameter name parallel tempering
parent
ec60b5ae
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
11 deletions
+13
-11
src/mc.cpp
src/mc.cpp
+4
-4
src/mc.h
src/mc.h
+4
-4
src/runner_pt.cpp
src/runner_pt.cpp
+5
-3
No files found.
src/mc.cpp
View file @
e9f7fa0d
...
@@ -69,7 +69,7 @@ void mc::_do_update() {
...
@@ -69,7 +69,7 @@ void mc::_do_update() {
}
}
}
}
void
mc
::
_pt_update_param
(
double
new_param
,
const
std
::
string
&
new_dir
)
{
void
mc
::
_pt_update_param
(
const
std
::
string
&
param_name
,
double
new_param
,
const
std
::
string
&
new_dir
)
{
// take over the bins of the new target dir
// take over the bins of the new target dir
{
{
iodump
dump_file
=
iodump
::
open_readonly
(
new_dir
+
".dump.h5"
);
iodump
dump_file
=
iodump
::
open_readonly
(
new_dir
+
".dump.h5"
);
...
@@ -86,7 +86,7 @@ void mc::_pt_update_param(double new_param, const std::string &new_dir) {
...
@@ -86,7 +86,7 @@ void mc::_pt_update_param(double new_param, const std::string &new_dir) {
*
unclean
));
*
unclean
));
}
}
pt_update_param
(
new_param
);
pt_update_param
(
param_name
,
new_param
);
}
}
void
mc
::
pt_measure_statistics
()
{
void
mc
::
pt_measure_statistics
()
{
...
@@ -97,8 +97,8 @@ void mc::pt_measure_statistics() {
...
@@ -97,8 +97,8 @@ void mc::pt_measure_statistics() {
}
}
}
}
double
mc
::
_pt_weight_ratio
(
double
new_param
)
{
double
mc
::
_pt_weight_ratio
(
const
std
::
string
&
param_name
,
double
new_param
)
{
double
wr
=
pt_weight_ratio
(
new_param
);
double
wr
=
pt_weight_ratio
(
param_name
,
new_param
);
return
wr
;
return
wr
;
}
}
...
...
src/mc.h
View file @
e9f7fa0d
...
@@ -32,10 +32,10 @@ protected:
...
@@ -32,10 +32,10 @@ protected:
virtual
void
write_output
(
const
std
::
string
&
filename
);
virtual
void
write_output
(
const
std
::
string
&
filename
);
virtual
void
do_update
()
=
0
;
virtual
void
do_update
()
=
0
;
virtual
void
do_measurement
()
=
0
;
virtual
void
do_measurement
()
=
0
;
virtual
void
pt_update_param
(
double
/*new_param*/
)
{
virtual
void
pt_update_param
(
const
std
::
string
&
/*param_name*/
,
double
/*new_param*/
)
{
throw
std
::
runtime_error
{
"running parallel tempering, but pt_update_param not implemented"
};
throw
std
::
runtime_error
{
"running parallel tempering, but pt_update_param not implemented"
};
}
}
virtual
double
pt_weight_ratio
(
double
/*new_param*/
)
{
virtual
double
pt_weight_ratio
(
const
std
::
string
&
/*param_name*/
,
double
/*new_param*/
)
{
throw
std
::
runtime_error
{
"running parallel tempering, but pt_weight_ratio not implemented"
};
throw
std
::
runtime_error
{
"running parallel tempering, but pt_weight_ratio not implemented"
};
return
1
;
return
1
;
}
}
...
@@ -61,8 +61,8 @@ public:
...
@@ -61,8 +61,8 @@ public:
void
_do_update
();
void
_do_update
();
void
_do_measurement
();
void
_do_measurement
();
void
_pt_update_param
(
double
new_param
,
const
std
::
string
&
new_dir
);
void
_pt_update_param
(
const
std
::
string
&
param_name
,
double
new_param
,
const
std
::
string
&
new_dir
);
double
_pt_weight_ratio
(
double
new_param
);
double
_pt_weight_ratio
(
const
std
::
string
&
param_name
,
double
new_param
);
void
pt_measure_statistics
();
void
pt_measure_statistics
();
...
...
src/runner_pt.cpp
View file @
e9f7fa0d
...
@@ -406,7 +406,7 @@ int runner_pt_master::assign_new_chain(int rank_section) {
...
@@ -406,7 +406,7 @@ int runner_pt_master::assign_new_chain(int rank_section) {
for
(
int
target
=
0
;
target
<
chain_len_
;
target
++
)
{
for
(
int
target
=
0
;
target
<
chain_len_
;
target
++
)
{
int
msg
[
3
]
=
{
-
1
,
0
,
0
};
int
msg
[
3
]
=
{
-
1
,
0
,
0
};
if
(
chain_run_id
>
=
0
)
{
if
(
chain_run_id
>
0
)
{
auto
&
chain_run
=
pt_chain_runs_
[
chain_run_id
];
auto
&
chain_run
=
pt_chain_runs_
[
chain_run_id
];
auto
&
chain
=
pt_chains_
[
chain_run
.
id
];
auto
&
chain
=
pt_chains_
[
chain_run
.
id
];
msg
[
0
]
=
chain
.
task_ids
[
target
];
msg
[
0
]
=
chain
.
task_ids
[
target
];
...
@@ -634,10 +634,12 @@ void runner_pt_slave::pt_global_update() {
...
@@ -634,10 +634,12 @@ void runner_pt_slave::pt_global_update() {
MPI_Recv
(
&
response
,
1
,
MPI_INT
,
MASTER
,
0
,
MPI_COMM_WORLD
,
MPI_STATUS_IGNORE
);
MPI_Recv
(
&
response
,
1
,
MPI_INT
,
MASTER
,
0
,
MPI_COMM_WORLD
,
MPI_STATUS_IGNORE
);
// job_.log(fmt::format(" * rank {}: ready for global update", rank_));
// job_.log(fmt::format(" * rank {}: ready for global update", rank_));
const
std
::
string
&
param_name
=
job_
.
jobfile
[
"jobconfig"
].
get
<
std
::
string
>
(
"parallel_tempering_parameter"
);
if
(
response
==
GA_CALC_WEIGHT
)
{
if
(
response
==
GA_CALC_WEIGHT
)
{
double
partner_param
;
double
partner_param
;
MPI_Recv
(
&
partner_param
,
1
,
MPI_DOUBLE
,
MASTER
,
0
,
MPI_COMM_WORLD
,
MPI_STATUS_IGNORE
);
MPI_Recv
(
&
partner_param
,
1
,
MPI_DOUBLE
,
MASTER
,
0
,
MPI_COMM_WORLD
,
MPI_STATUS_IGNORE
);
double
weight_ratio
=
sys_
->
_pt_weight_ratio
(
partner_param
);
double
weight_ratio
=
sys_
->
_pt_weight_ratio
(
par
am_name
,
par
tner_param
);
MPI_Send
(
&
weight_ratio
,
1
,
MPI_DOUBLE
,
MASTER
,
0
,
MPI_COMM_WORLD
);
MPI_Send
(
&
weight_ratio
,
1
,
MPI_DOUBLE
,
MASTER
,
0
,
MPI_COMM_WORLD
);
// job_.log(fmt::format(" * rank {}: weight sent", rank_));
// job_.log(fmt::format(" * rank {}: weight sent", rank_));
}
else
{
}
else
{
...
@@ -663,7 +665,7 @@ void runner_pt_slave::pt_global_update() {
...
@@ -663,7 +665,7 @@ void runner_pt_slave::pt_global_update() {
task_id_
=
new_task_id
;
task_id_
=
new_task_id
;
sweeps_per_global_update_
=
job_
.
jobfile
[
"tasks"
][
job_
.
task_names
[
task_id_
]].
get
<
int
>
(
sweeps_per_global_update_
=
job_
.
jobfile
[
"tasks"
][
job_
.
task_names
[
task_id_
]].
get
<
int
>
(
"pt_sweeps_per_global_update"
);
"pt_sweeps_per_global_update"
);
sys_
->
_pt_update_param
(
new_param
,
job_
.
rundir
(
task_id_
,
run_id_
));
sys_
->
_pt_update_param
(
param_name
,
new_param
,
job_
.
rundir
(
task_id_
,
run_id_
));
}
}
current_param_
=
new_param
;
current_param_
=
new_param
;
}
}
...
...
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