~ubuntu-branches/ubuntu/oneiric/simgrid/oneiric

« back to all changes in this revision

Viewing changes to src/surf/cpu_im.c

  • Committer: Bazaar Package Importer
  • Author(s): Martin Quinson
  • Date: 2011-05-24 17:28:10 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20110524172810-s95cvuff63wvfxdy
Tags: 3.6~rc2-1
* New upstream version: Release candidate to 3.6 
  (There were two of them to take a last minute change into account)
* First upload to unstable
* Bump standards-version to 3.9.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
234
234
                                          (action).variable) * (now -
235
235
                                                                cpu->last_update));
236
236
#ifdef HAVE_TRACING
237
 
      TRACE_surf_host_set_utilization(cpu->generic_resource.name,
238
 
                                      action->
239
 
                                      generic_lmm_action.generic_action.
240
 
                                      data, (surf_action_t) action,
241
 
                                      lmm_variable_getvalue
242
 
                                      (GENERIC_LMM_ACTION
243
 
                                       (action).variable),
244
 
                                      cpu->last_update,
245
 
                                      now - cpu->last_update);
 
237
      if (TRACE_is_enabled()) {
 
238
        TRACE_surf_host_set_utilization(cpu->generic_resource.name,
 
239
                                        action->
 
240
                                        generic_lmm_action.generic_action.
 
241
                                        data, (surf_action_t) action,
 
242
                                        lmm_variable_getvalue
 
243
                                        (GENERIC_LMM_ACTION
 
244
                                         (action).variable),
 
245
                                        cpu->last_update,
 
246
                                        now - cpu->last_update);
 
247
      }
246
248
#endif
247
249
      XBT_DEBUG("Update action(%p) remains %lf", action,
248
250
             GENERIC_ACTION(action).remains);
325
327
    GENERIC_ACTION(action).finish = surf_get_clock();
326
328
    /* set the remains to 0 due to precision problems when updating the remaining amount */
327
329
#ifdef HAVE_TRACING
328
 
    {
 
330
    if (TRACE_is_enabled()) {
329
331
      cpu_Cas01_im_t cpu = ((cpu_Cas01_im_t)(action->cpu));
330
332
      TRACE_surf_host_set_utilization(cpu->generic_resource.name,
331
333
          action->generic_lmm_action.generic_action.data,
340
342
    cpu_im_update_remains(action->cpu, surf_get_clock());
341
343
  }
342
344
#ifdef HAVE_TRACING
343
 
  {
 
345
  if (TRACE_is_enabled()) {
344
346
    //defining the last timestamp that we can safely dump to trace file
345
347
    //without losing the event ascending order (considering all CPU's)
346
 
        void **data;
 
348
    void **data;
347
349
    cpu_Cas01_im_t cpu;
348
350
    xbt_lib_cursor_t cursor;
349
351
    char *key;
350
352
    double smaller = -1;
351
353
    xbt_lib_foreach(host_lib, cursor, key, data){
352
 
        if(data[SURF_CPU_LEVEL]){
353
 
          cpu = data[SURF_CPU_LEVEL];
354
 
                  if (smaller < 0){
355
 
                        smaller = cpu->last_update;
356
 
                        continue;
357
 
                  }
358
 
                  if (cpu->last_update < smaller){
359
 
                        smaller = cpu->last_update;
360
 
                  }
361
 
        }
362
 
   }
 
354
      if(data[SURF_CPU_LEVEL]){
 
355
        cpu = data[SURF_CPU_LEVEL];
 
356
        if (smaller < 0){
 
357
          smaller = cpu->last_update;
 
358
          continue;
 
359
        }
 
360
        if (cpu->last_update < smaller){
 
361
          smaller = cpu->last_update;
 
362
        }
 
363
      }
 
364
    }
363
365
    if (smaller > 0) {
364
366
      TRACE_last_timestamp_to_dump = smaller;
365
367
    }