X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/c3890db8638c24b07758f57081aed4932379b5de..e7d7d4a985338bffc0574da0889c604489a84c13:/src/surf/surf_interface.cpp diff --git a/src/surf/surf_interface.cpp b/src/surf/surf_interface.cpp index cc093ad3ce..6de2b62a46 100644 --- a/src/surf/surf_interface.cpp +++ b/src/surf/surf_interface.cpp @@ -583,8 +583,7 @@ double Model::shareResourcesLazy(double now) action->getMaxDuration()); if (min != -1) { - action->heapRemove(p_actionHeap); - action->heapInsert(p_actionHeap, min, max_dur_flag ? MAX_DURATION : NORMAL); + action->heapUpdate(p_actionHeap, min, max_dur_flag ? MAX_DURATION : NORMAL); XBT_DEBUG("Insert at heap action(%p) min %f now %f", action, min, now); } else DIE_IMPOSSIBLE; @@ -672,10 +671,12 @@ void Model::updateActionsState(double now, double delta) void Model::updateActionsStateLazy(double /*now*/, double /*delta*/) { + THROW_UNIMPLEMENTED; } void Model::updateActionsStateFull(double /*now*/, double /*delta*/) { + THROW_UNIMPLEMENTED; } /************ @@ -1006,6 +1007,16 @@ void Action::heapRemove(xbt_heap_t heap) } } +void Action::heapUpdate(xbt_heap_t heap, double key, enum heap_action_type hat) +{ + m_hat = hat; + if (m_indexHeap >= 0) { + xbt_heap_update(heap, m_indexHeap, key); + }else{ + xbt_heap_push(heap, this, key); + } +} + /* added to manage the communication action's heap */ void surf_action_lmm_update_index_heap(void *action, int i) { ((ActionPtr)action)->updateIndexHeap(i);