Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
batsim
batsim
Commits
e8358185
Commit
e8358185
authored
Aug 15, 2017
by
Steffen Lackner
Browse files
[code] Fix: only utilise tracer if energy is enabled
parent
c36f02f6
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/pstate.cpp
View file @
e8358185
...
...
@@ -171,8 +171,11 @@ bool CurrentSwitches::mark_switch_as_done(int machine_id,
}
all_machines
=
s
->
all_machines
;
context
->
pstate_tracer
.
add_pstate_change
(
MSG_get_clock
(),
s
->
all_machines
,
s
->
target_pstate
);
context
->
energy_tracer
.
add_pstate_change
(
MSG_get_clock
(),
s
->
all_machines
,
s
->
target_pstate
);
if
(
context
->
energy_used
)
{
context
->
pstate_tracer
.
add_pstate_change
(
MSG_get_clock
(),
s
->
all_machines
,
s
->
target_pstate
);
context
->
energy_tracer
.
add_pstate_change
(
MSG_get_clock
(),
s
->
all_machines
,
s
->
target_pstate
);
}
delete
s
;
return
true
;
...
...
src/server.cpp
View file @
e8358185
...
...
@@ -274,8 +274,11 @@ void server_on_pstate_modification(ServerData * data,
PStateModificationMessage
*
message
=
(
PStateModificationMessage
*
)
task_data
->
data
;
data
->
context
->
current_switches
.
add_switch
(
message
->
machine_ids
,
message
->
new_pstate
);
data
->
context
->
energy_tracer
.
add_pstate_change
(
MSG_get_clock
(),
message
->
machine_ids
,
if
(
data
->
context
->
energy_used
)
{
data
->
context
->
energy_tracer
.
add_pstate_change
(
MSG_get_clock
(),
message
->
machine_ids
,
message
->
new_pstate
);
}
// Let's quickly check whether this is a switchON or a switchOFF
// Unknown transition states will be set to -42.
...
...
@@ -290,9 +293,11 @@ void server_on_pstate_modification(ServerData * data,
transition_state
=
-
2
;
// means we are switching to a SLEEP_PSTATE
}
// The pstate is set to an invalid one to know the machines are in transition.
data
->
context
->
pstate_tracer
.
add_pstate_change
(
MSG_get_clock
(),
message
->
machine_ids
,
if
(
data
->
context
->
energy_used
)
{
// The pstate is set to an invalid one to know the machines are in transition.
data
->
context
->
pstate_tracer
.
add_pstate_change
(
MSG_get_clock
(),
message
->
machine_ids
,
transition_state
);
}
// Let's mark that some switches have been requested
data
->
context
->
nb_grouped_switches
++
;
...
...
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