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
ce78676e
Commit
ce78676e
authored
Jul 15, 2019
by
Steffen Vogel
🎅🏼
Browse files
simulation: use new loggers
Former-commit-id:
d99cf227
parent
ea9cc192
Changes
1
Hide whitespace changes
Inline
Side-by-side
Source/Simulation.cpp
View file @
ce78676e
...
...
@@ -264,14 +264,14 @@ void Simulation::sync() {
ifm
.
interface
->
writeValues
();
}
std
::
cout
<<
Logger
::
prefix
()
<<
"Waiting for start synchronization on
"
<<
mI
nterfaces
.
size
()
<<
" interfaces"
<<
std
::
endl
;
mSLog
->
info
(
"Waiting for start synchronization on
{} i
nterfaces
"
,
mInterfaces
.
size
())
;
// Blocking wait for interfaces
for
(
auto
ifm
:
mInterfaces
)
{
ifm
.
interface
->
readValues
(
ifm
.
syncStart
);
}
std
::
cout
<<
Logger
::
prefix
()
<<
"Synchronized simulation start with remotes"
<<
std
::
endl
;
mSLog
->
info
(
"Synchronized simulation start with remotes"
)
;
#endif
}
...
...
@@ -301,15 +301,14 @@ void Simulation::prepSchedule() {
}
void
Simulation
::
schedule
()
{
std
::
cout
<<
Logger
::
prefix
()
<<
"Scheduling tasks."
<<
std
::
endl
;
mSLog
->
info
(
"Scheduling tasks."
)
;
prepSchedule
();
mScheduler
->
createSchedule
(
mTasks
,
mTaskInEdges
,
mTaskOutEdges
);
}
#ifdef WITH_GRAPHVIZ
void
Simulation
::
renderDependencyGraph
(
std
::
ostream
&
os
)
{
if
(
mTasks
.
size
()
==
0
)
prepSchedule
();
initialize
();
Graph
::
Graph
g
(
"dependencies"
,
Graph
::
Type
::
directed
);
for
(
auto
task
:
mTasks
)
{
...
...
@@ -326,10 +325,10 @@ void Simulation::renderDependencyGraph(std::ostream &os) {
#endif
void
Simulation
::
run
()
{
initialize
();
initialize
();
#ifdef WITH_SHMEM
std
::
cout
<<
Logger
::
prefix
()
<<
"Opening interfaces."
<<
std
::
endl
;
mSLog
->
info
(
"Opening interfaces."
)
;
for
(
auto
ifm
:
mInterfaces
)
ifm
.
interface
->
open
();
...
...
@@ -337,7 +336,7 @@ void Simulation::run() {
sync
();
#endif
std
::
cout
<<
Logger
::
prefix
()
<<
"Start simulation."
<<
std
::
endl
;
mSLog
->
info
(
"Start simulation."
)
;
while
(
mTime
<
mFinalTime
)
{
step
();
...
...
@@ -353,7 +352,7 @@ void Simulation::run() {
for
(
auto
lg
:
mLoggers
)
lg
->
close
();
std
::
cout
<<
Logger
::
prefix
()
<<
"Simulation finished."
<<
std
::
endl
;
mSLog
->
info
(
"Simulation finished."
)
;
//mScheduler->getMeasurements();
}
...
...
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