nbPoints_ = speedTrace->event_list.size() + 1;
timePoints_ = new double[nbPoints_];
integral_ = new double[nbPoints_];
nbPoints_ = speedTrace->event_list.size() + 1;
timePoints_ = new double[nbPoints_];
integral_ = new double[nbPoints_];
while ((xbt_heap_size(tiActionHeap_) > 0) && (xbt_heap_maxkey(tiActionHeap_) <= now)) {
CpuTiAction *action = static_cast<CpuTiAction*>(xbt_heap_pop(tiActionHeap_));
XBT_DEBUG("Action %p: finish", action);
while ((xbt_heap_size(tiActionHeap_) > 0) && (xbt_heap_maxkey(tiActionHeap_) <= now)) {
CpuTiAction *action = static_cast<CpuTiAction*>(xbt_heap_pop(tiActionHeap_));
XBT_DEBUG("Action %p: finish", action);
CpuTiAction *action = &*it;
if (action->getState() == Action::State::running
|| action->getState() == Action::State::ready
|| action->getState() == Action::State::not_in_the_system) {
action->setFinishTime(date);
action->setState(Action::State::failed);
CpuTiAction *action = &*it;
if (action->getState() == Action::State::running
|| action->getState() == Action::State::ready
|| action->getState() == Action::State::not_in_the_system) {
action->setFinishTime(date);
action->setState(Action::State::failed);
action = &*it;
/* action not running, skip it */
if (action->getStateSet() != surf_cpu_model_pm->getRunningActionSet())
action = &*it;
/* action not running, skip it */
if (action->getStateSet() != surf_cpu_model_pm->getRunningActionSet())
action->setFinishTime(speedIntegratedTrace_->solve(now, total_area));
/* verify which event will happen before (max_duration or finish time) */
if (action->getMaxDuration() > NO_MAX_DURATION &&
action->setFinishTime(speedIntegratedTrace_->solve(now, total_area));
/* verify which event will happen before (max_duration or finish time) */
if (action->getMaxDuration() > NO_MAX_DURATION &&
} else {
/* put the max duration time on heap */
if (action->getMaxDuration() > NO_MAX_DURATION)
min_finish = action->getStartTime() + action->getMaxDuration();
}
/* add in action heap */
} else {
/* put the max duration time on heap */
if (action->getMaxDuration() > NO_MAX_DURATION)
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) {
if (heap_act != action)
DIE_IMPOSSIBLE;
}
if (min_finish > NO_MAX_DURATION)
xbt_heap_push(static_cast<CpuTiModel*>(model())->tiActionHeap_, action, min_finish);
if (heap_act != action)
DIE_IMPOSSIBLE;
}
if (min_finish > NO_MAX_DURATION)
xbt_heap_push(static_cast<CpuTiModel*>(model())->tiActionHeap_, action, min_finish);
- XBT_DEBUG("Update finish time: Cpu(%s) Action: %p, Start Time: %f Finish Time: %f Max duration %f", cname(), action,
- action->getStartTime(), action->finishTime_, action->getMaxDuration());
+ XBT_DEBUG("Update finish time: Cpu(%s) Action: %p, Start Time: %f Finish Time: %f Max duration %f", getCname(),
+ action, action->getStartTime(), action->getFinishTime(), action->getMaxDuration());
/* compute the integration area */
double area_total = speedIntegratedTrace_->integrate(lastUpdate_, now) * speed_.peak;
XBT_DEBUG("Flops total: %f, Last update %f", area_total, lastUpdate_);
/* compute the integration area */
double area_total = speedIntegratedTrace_->integrate(lastUpdate_, now) * speed_.peak;
XBT_DEBUG("Flops total: %f, Last update %f", area_total, lastUpdate_);
CpuTiAction *action = &*it;
/* action not running, skip it */
if (action->getStateSet() != model()->getRunningActionSet())
CpuTiAction *action = &*it;
/* action not running, skip it */
if (action->getStateSet() != model()->getRunningActionSet())
- XBT_IN("(%s,%g)", cname(), size);
+ XBT_IN("(%s,%g)", getCname(), size);
CpuTiAction* action = new CpuTiAction(static_cast<CpuTiModel*>(model()), size, isOff(), this);
actionSet_->push_back(*action);
CpuTiAction* action = new CpuTiAction(static_cast<CpuTiModel*>(model()), size, isOff(), this);
actionSet_->push_back(*action);
- XBT_IN("(%s,%g)", cname(), duration);
+ XBT_IN("(%s,%g)", getCname(), duration);
CpuTiAction* action = new CpuTiAction(static_cast<CpuTiModel*>(model()), 1.0, isOff(), this);
CpuTiAction* action = new CpuTiAction(static_cast<CpuTiModel*>(model()), 1.0, isOff(), this);
action->suspended_ = 2;
if (duration == NO_MAX_DURATION) {
/* Move to the *end* of the corresponding action set. This convention
action->suspended_ = 2;
if (duration == NO_MAX_DURATION) {
/* Move to the *end* of the corresponding action set. This convention
XBT_IN("(%p,%g)", this, duration);
XBT_IN("(%p,%g)", this, duration);
- 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()));
void CpuTiAction::setSharingWeight(double priority)
{
XBT_IN("(%p,%g)", this, priority);
void CpuTiAction::setSharingWeight(double priority)
{
XBT_IN("(%p,%g)", this, priority);