while ((xbt_heap_size(model->model_private->action_heap) > 0)
&& (double_equals(xbt_heap_maxkey(model->model_private->action_heap), now))) {
action = xbt_heap_pop(model->model_private->action_heap);
- XBT_DEBUG("Action %p: finish", action);
- action->generic_action.finish = surf_get_clock();
+ XBT_DEBUG("Something happened to action %p", action);
#ifdef HAVE_TRACING
if (TRACE_is_enabled()) {
if(model == surf_cpu_model){
#endif
if(model == surf_cpu_model){
+ action->generic_action.finish = surf_get_clock();
+ XBT_DEBUG("Action %p finished", action);
+
/* set the remains to 0 due to precision problems when updating the remaining amount */
action->generic_action.remains = 0;
surf_action_state_set((surf_action_t) action, SURF_ACTION_DONE);
else{
// if I am wearing a latency hat
if (action->hat == LATENCY) {
+ XBT_DEBUG("Latency paid for action %p. Activating", action);
lmm_update_variable_weight(model->model_private->maxmin_system, action->variable,
((surf_action_network_CM02_t)(action))->weight);
surf_action_lmm_heap_remove(model->model_private->action_heap,action);
action->hat == NORMAL) {
// no need to communicate anymore
// assume that flows that reached max_duration have remaining of 0
- action->generic_action.remains = 0;
+ action->generic_action.finish = surf_get_clock();
+ XBT_DEBUG("Action %p finished", action);
+ action->generic_action.remains = 0;
((surf_action_t)action)->finish = surf_get_clock();
model->action_state_set((surf_action_t) action,
SURF_ACTION_DONE);
#include "heap_private.h"
#include <stdio.h>
+XBT_LOG_NEW_DEFAULT_SUBCATEGORY(xbt_heap, xbt, "Heap");
static void xbt_heap_max_heapify(xbt_heap_t H);
static void xbt_heap_increase_key(xbt_heap_t H, int i);
item->key = key;
item->content = content;
xbt_heap_increase_key(H, count - 1);
+ XBT_DEBUG("Heap has now %d elements and max elem is %g",xbt_heap_size(H),xbt_heap_maxkey(H));
return;
}
int size = H->size;
void *max;
+ XBT_DEBUG("Heap has %d elements before extraction and max elem was %g",xbt_heap_size(H),xbt_heap_maxkey(H));
+
if (H->count == 0)
return NULL;
*/
void *xbt_heap_remove(xbt_heap_t H, int i)
{
+ XBT_DEBUG("Heap has %d elements: extracting element %d",xbt_heap_size(H),i);
+
if ((i < 0) || (i > H->count - 1))
return NULL;
/* put element i at head */