A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'master' of git+ssh://scm.gforge.inria.fr//gitroot/simgrid/simgrid
[simgrid.git]
/
src
/
surf
/
cpu_ti.cpp
diff --git
a/src/surf/cpu_ti.cpp
b/src/surf/cpu_ti.cpp
index
0149656
..
d899ed0
100644
(file)
--- a/
src/surf/cpu_ti.cpp
+++ b/
src/surf/cpu_ti.cpp
@@
-468,9
+468,9
@@
void CpuTi::apply_event(tmgr_trace_event_t event, double value)
|| action->getState() == Action::State::not_in_the_system) {
action->setFinishTime(date);
action->setState(Action::State::failed);
|| action->getState() == Action::State::not_in_the_system) {
action->setFinishTime(date);
action->setState(Action::State::failed);
- if (action->
indexHeap_
>= 0) {
+ if (action->
getIndexHeap()
>= 0) {
CpuTiAction* heap_act = static_cast<CpuTiAction*>(
CpuTiAction* heap_act = static_cast<CpuTiAction*>(
- xbt_heap_remove(static_cast<CpuTiModel*>(model())->tiActionHeap_, action->
indexHeap_
));
+ xbt_heap_remove(static_cast<CpuTiModel*>(model())->tiActionHeap_, action->
getIndexHeap()
));
if (heap_act != action)
DIE_IMPOSSIBLE;
}
if (heap_act != action)
DIE_IMPOSSIBLE;
}
@@
-538,10
+538,10
@@
void CpuTi::updateActionsFinishTime(double now)
min_finish = action->getStartTime() + action->getMaxDuration();
}
/* add in action heap */
min_finish = action->getStartTime() + action->getMaxDuration();
}
/* add in action heap */
- XBT_DEBUG("action(%p) index %d", action, action->
indexHeap_
);
- if (action->
indexHeap_
>= 0) {
+ XBT_DEBUG("action(%p) index %d", action, action->
getIndexHeap()
);
+ if (action->
getIndexHeap()
>= 0) {
CpuTiAction* heap_act = static_cast<CpuTiAction*>(
CpuTiAction* heap_act = static_cast<CpuTiAction*>(
- xbt_heap_remove(static_cast<CpuTiModel*>(model())->tiActionHeap_, action->
indexHeap_
));
+ xbt_heap_remove(static_cast<CpuTiModel*>(model())->tiActionHeap_, action->
getIndexHeap()
));
if (heap_act != action)
DIE_IMPOSSIBLE;
}
if (heap_act != action)
DIE_IMPOSSIBLE;
}
@@
-664,15
+664,10
@@
CpuTiAction::CpuTiAction(CpuTiModel *model_, double cost, bool failed, CpuTi *cp
: CpuAction(model_, cost, failed)
, cpu_(cpu)
{
: CpuAction(model_, cost, failed)
, cpu_(cpu)
{
-
indexHeap_ = -1
;
+
updateIndexHeap(-1)
;
cpu_->modified(true);
}
cpu_->modified(true);
}
-void CpuTiAction::updateIndexHeap(int i)
-{
- indexHeap_ = i;
-}
-
void CpuTiAction::setState(Action::State state)
{
CpuAction::setState(state);
void CpuTiAction::setState(Action::State state)
{
CpuAction::setState(state);
@@
-689,7
+684,7
@@
int CpuTiAction::unref()
if (action_ti_hook.is_linked())
cpu_->actionSet_->erase(cpu_->actionSet_->iterator_to(*this));
/* remove from heap */
if (action_ti_hook.is_linked())
cpu_->actionSet_->erase(cpu_->actionSet_->iterator_to(*this));
/* remove from heap */
- xbt_heap_remove(static_cast<CpuTiModel*>(getModel())->tiActionHeap_,
this->indexHeap_
);
+ xbt_heap_remove(static_cast<CpuTiModel*>(getModel())->tiActionHeap_,
getIndexHeap()
);
cpu_->modified(true);
delete this;
return 1;
cpu_->modified(true);
delete this;
return 1;
@@
-700,7
+695,7
@@
int CpuTiAction::unref()
void CpuTiAction::cancel()
{
this->setState(Action::State::failed);
void CpuTiAction::cancel()
{
this->setState(Action::State::failed);
- xbt_heap_remove(getModel()->getActionHeap(),
this->indexHeap_
);
+ xbt_heap_remove(getModel()->getActionHeap(),
getIndexHeap()
);
cpu_->modified(true);
}
cpu_->modified(true);
}
@@
-709,7
+704,7
@@
void CpuTiAction::suspend()
XBT_IN("(%p)", this);
if (suspended_ != 2) {
suspended_ = 1;
XBT_IN("(%p)", this);
if (suspended_ != 2) {
suspended_ = 1;
- xbt_heap_remove(getModel()->getActionHeap(),
indexHeap_
);
+ xbt_heap_remove(getModel()->getActionHeap(),
getIndexHeap()
);
cpu_->modified(true);
}
XBT_OUT();
cpu_->modified(true);
}
XBT_OUT();
@@
-740,8
+735,8
@@
void CpuTiAction::setMaxDuration(double duration)
min_finish = getFinishTime();
/* add in action heap */
min_finish = getFinishTime();
/* add in action heap */
- if (
indexHeap_
>= 0) {
- CpuTiAction
*heap_act = static_cast<CpuTiAction*>(xbt_heap_remove(getModel()->getActionHeap(), indexHeap_
));
+ if (
getIndexHeap()
>= 0) {
+ CpuTiAction
* heap_act = static_cast<CpuTiAction*>(xbt_heap_remove(getModel()->getActionHeap(), getIndexHeap()
));
if (heap_act != this)
DIE_IMPOSSIBLE;
}
if (heap_act != this)
DIE_IMPOSSIBLE;
}
@@
-753,7
+748,7
@@
void CpuTiAction::setMaxDuration(double duration)
void CpuTiAction::setSharingWeight(double priority)
{
XBT_IN("(%p,%g)", this, priority);
void CpuTiAction::setSharingWeight(double priority)
{
XBT_IN("(%p,%g)", this, priority);
- s
haringWeight_ = priority
;
+ s
etSharingWeightNoUpdate(priority)
;
cpu_->modified(true);
XBT_OUT();
}
cpu_->modified(true);
XBT_OUT();
}