Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
distaix
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
5
Issues
5
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
1
Merge Requests
1
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
ACS
P
Public
P
Power System Simulation and Optimization
DistAIXFramework
distaix
Commits
c55b7d45
Commit
c55b7d45
authored
Jul 29, 2019
by
Sonja Happ
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
change time measurements for MPI bcast, remove loop breaks
parent
7e96b61d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
21 deletions
+12
-21
src/model/model.cpp
src/model/model.cpp
+12
-21
No files found.
src/model/model.cpp
View file @
c55b7d45
...
@@ -1599,7 +1599,11 @@ void Model::do_backward_sweep() {
...
@@ -1599,7 +1599,11 @@ void Model::do_backward_sweep() {
IO
->
log_info
(
"Skipping ..."
);
IO
->
log_info
(
"Skipping ..."
);
}
}
counter
++
;
//check if finished
//check if finished
IO
->
stop_time_measurement
(
IO
->
tm_backward_sweep
);
IO
->
start_time_measurement
(
IO
->
tm_bcast_backward_sweep
);
if
(
context
.
contains
(
repast
::
AgentId
(
SLACK_ID
,
rank
,
TYPE_SLACK_INT
,
rank
)))
{
if
(
context
.
contains
(
repast
::
AgentId
(
SLACK_ID
,
rank
,
TYPE_SLACK_INT
,
rank
)))
{
Agent
*
slack
=
context
.
getAgent
(
repast
::
AgentId
(
SLACK_ID
,
rank
,
TYPE_SLACK_INT
,
rank
));
Agent
*
slack
=
context
.
getAgent
(
repast
::
AgentId
(
SLACK_ID
,
rank
,
TYPE_SLACK_INT
,
rank
));
...
@@ -1609,17 +1613,11 @@ void Model::do_backward_sweep() {
...
@@ -1609,17 +1613,11 @@ void Model::do_backward_sweep() {
}
}
}
}
if
(
world_size
>
1
){
if
(
world_size
>
1
){
IO
->
stop_time_measurement
(
IO
->
tm_backward_sweep
);
IO
->
start_time_measurement
(
IO
->
tm_bcast_backward_sweep
);
//TODO use MPI_Ibcast instead
//TODO use MPI_Ibcast instead
MPI_Bcast
(
&
backward_sweep_finished
,
1
,
MPI_C_BOOL
,
agent_rank_relation
[
SLACK_ID
-
1
],
MPI_COMM_WORLD
);
MPI_Bcast
(
&
backward_sweep_finished
,
1
,
MPI_C_BOOL
,
agent_rank_relation
[
SLACK_ID
-
1
],
MPI_COMM_WORLD
);
IO
->
stop_time_measurement
(
IO
->
tm_bcast_backward_sweep
);
IO
->
start_time_measurement
(
IO
->
tm_backward_sweep
);
}
}
IO
->
log_info
(
"Backward sweep finished: "
+
std
::
to_string
(
backward_sweep_finished
));
IO
->
log_info
(
"Backward sweep finished: "
+
std
::
to_string
(
backward_sweep_finished
));
IO
->
stop_time_measurement
(
IO
->
tm_bcast_backward_sweep
);
counter
++
;
IO
->
stop_time_measurement
(
IO
->
tm_backward_sweep
);
//synchronize changes
//synchronize changes
synchronize_el_connections
();
synchronize_el_connections
();
...
@@ -1656,10 +1654,6 @@ void Model::do_forward_sweep() {
...
@@ -1656,10 +1654,6 @@ void Model::do_forward_sweep() {
}
else
{
}
else
{
started_convergence_check
=
false
;
started_convergence_check
=
false
;
}
}
if
(
state
[
i
-
1
]
==
DONE_NOTHING
){
break
;
// stop iteration if one agent could not complete forward sweep because previous agents have not completed yet
}
}
else
{
}
else
{
IO
->
log_info
(
"Skipping AgentID "
+
std
::
to_string
(
agents_scheduling
[
i
-
1
]
->
getId
().
id
()));
IO
->
log_info
(
"Skipping AgentID "
+
std
::
to_string
(
agents_scheduling
[
i
-
1
]
->
getId
().
id
()));
}
}
...
@@ -1675,9 +1669,6 @@ void Model::do_forward_sweep() {
...
@@ -1675,9 +1669,6 @@ void Model::do_forward_sweep() {
if
(
state
[
index
]
==
DONE_CONVERGENCE_CHECK
){
if
(
state
[
index
]
==
DONE_CONVERGENCE_CHECK
){
checked_convergence
++
;
checked_convergence
++
;
}
}
if
(
state
[
index
]
==
DONE_NOTHING
){
break
;
// stop iteration if one agent could to nothing because it is likely that the following agents cannot to anything either
}
}
else
{
}
else
{
IO
->
log_info
(
"Skipping AgentID "
+
std
::
to_string
(
i
->
getId
().
id
()));
IO
->
log_info
(
"Skipping AgentID "
+
std
::
to_string
(
i
->
getId
().
id
()));
}
}
...
@@ -1688,7 +1679,11 @@ void Model::do_forward_sweep() {
...
@@ -1688,7 +1679,11 @@ void Model::do_forward_sweep() {
IO
->
log_info
(
"Skipping ..."
);
IO
->
log_info
(
"Skipping ..."
);
}
}
//check if finished
counter
++
;
//check if finished
IO
->
stop_time_measurement
(
IO
->
tm_forward_sweep
);
IO
->
start_time_measurement
(
IO
->
tm_bcast_forward_sweep
);
if
(
context
.
contains
(
repast
::
AgentId
(
SLACK_ID
,
rank
,
TYPE_SLACK_INT
,
rank
))){
if
(
context
.
contains
(
repast
::
AgentId
(
SLACK_ID
,
rank
,
TYPE_SLACK_INT
,
rank
))){
Agent
*
slack
=
context
.
getAgent
(
repast
::
AgentId
(
SLACK_ID
,
rank
,
TYPE_SLACK_INT
,
rank
));
Agent
*
slack
=
context
.
getAgent
(
repast
::
AgentId
(
SLACK_ID
,
rank
,
TYPE_SLACK_INT
,
rank
));
...
@@ -1698,16 +1693,12 @@ void Model::do_forward_sweep() {
...
@@ -1698,16 +1693,12 @@ void Model::do_forward_sweep() {
}
}
}
}
IO
->
stop_time_measurement
(
IO
->
tm_forward_sweep
);
IO
->
start_time_measurement
(
IO
->
tm_bcast_forward_sweep
);
//TODO use MPI_Ibcast instead
//TODO use MPI_Ibcast instead
MPI_Bcast
(
&
forward_sweep_finished
,
1
,
MPI_C_BOOL
,
agent_rank_relation
[
SLACK_ID
-
1
],
MPI_COMM_WORLD
);
// root was 0
MPI_Bcast
(
&
forward_sweep_finished
,
1
,
MPI_C_BOOL
,
agent_rank_relation
[
SLACK_ID
-
1
],
MPI_COMM_WORLD
);
// root was 0
IO
->
stop_time_measurement
(
IO
->
tm_bcast_forward_sweep
);
IO
->
stop_time_measurement
(
IO
->
tm_bcast_forward_sweep
);
IO
->
start_time_measurement
(
IO
->
tm_forward_sweep
);
counter
++
;
// in forward sweep info about next and previous electrical nodes are required
// in forward sweep info about next and previous electrical nodes are required
// that is why both sets need to be updated here
// that is why both sets need to be updated here
IO
->
stop_time_measurement
(
IO
->
tm_forward_sweep
);
synchronize_el_connections
();
synchronize_el_connections
();
IO
->
start_time_measurement
(
IO
->
tm_forward_sweep
);
IO
->
start_time_measurement
(
IO
->
tm_forward_sweep
);
...
...
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