Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
ACS
Public
Power System Simulation and Optimization
DPsim
DPsim
Commits
08666bb7
Commit
08666bb7
authored
Nov 13, 2020
by
Felix Wege
Browse files
use only syncStart interfaces for sync with remote
parent
93bb3631
Changes
1
Hide whitespace changes
Inline
Side-by-side
Source/Simulation.cpp
View file @
08666bb7
...
...
@@ -208,20 +208,20 @@ void Simulation::createMNASolver() {
void
Simulation
::
sync
()
{
#ifdef WITH_SHMEM
// We send initial state over all interfaces
for
(
auto
ifm
:
mInterfaces
)
{
ifm
.
interface
->
writeValues
();
}
mLog
->
info
(
"Waiting for start synchronization on {} i
nterfaces
"
,
mInterfaces
.
size
()
);
// Blocking wait for interfaces
int
numOfSyncInterfaces
=
std
::
count_if
(
mI
nterfaces
.
begin
()
,
mInterfaces
.
end
(),
[](
InterfaceMapping
ifm
)
{
return
ifm
.
syncStart
;}
);
mLog
->
info
(
"Start synchronization with remotes on {} interfaces"
,
numOfSyncInterfaces
);
for
(
auto
ifm
:
mInterfaces
)
{
ifm
.
interface
->
readValues
(
ifm
.
syncStart
);
}
if
(
ifm
.
syncStart
)
{
// Send initial state over interface
ifm
.
interface
->
writeValues
();
for
(
auto
ifm
:
mInterfaces
)
{
ifm
.
interface
->
writeValues
();
// Blocking wait for interface
ifm
.
interface
->
readValues
(
ifm
.
syncStart
);
ifm
.
interface
->
writeValues
();
}
}
mLog
->
info
(
"Synchronized simulation start with remotes"
);
...
...
Write
Preview
Supports
Markdown
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