IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 8, 2015, 11:46:15 AM (11 years ago)
Author:
eugene
Message:

add compression timing and fix opt build issues

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ohana.20150429/src/libfits/table/F_compress_T.c

    r38418 r38429  
    2424int gfits_collect_table_gzp2 (FTable *table, TableField *field, char *raw, int row_start, int Nrows);
    2525
     26static float timeSum1 = 0.0;
     27static float timeSum2 = 0.0;
     28static float timeSum2a = 0.0;
     29static float timeSum2b = 0.0;
     30static float timeSum2c = 0.0;
     31static float timeSum2d = 0.0;
     32static float timeSum2e = 0.0;
     33static float timeSum3 = 0.0;
     34
     35void gfits_compress_timing () {
     36  fprintf (stderr, "cmp times: %f %f %f\n", timeSum1, timeSum2, timeSum3);
     37  fprintf (stderr, "cmp times: %f %f %f %f %f\n", timeSum2a, timeSum2b, timeSum2c, timeSum2d, timeSum2e);
     38
     39  timeSum1 = 0.0;
     40  timeSum2 = 0.0;
     41  timeSum2a = 0.0;
     42  timeSum2b = 0.0;
     43  timeSum2c = 0.0;
     44  timeSum2d = 0.0;
     45  timeSum2e = 0.0;
     46  timeSum3 = 0.0;
     47}
     48
    2649int gfits_compress_table (FTable *srctable, FTable *tgttable, int ztilelen, char *zcmptype) {
    2750
     
    3558  Header *srcheader = srctable->header;
    3659  Header *tgtheader = tgttable->header;
     60
     61  // XXX EAM:
     62  struct timeval startTimer, stopTimer;
     63  float dtime;
     64  gettimeofday (&startTimer, (void *) NULL);
    3765
    3866  int Ntile, ztilelast;
     
    6492  if (!gfits_scan (srcheader, "TFIELDS", "%d", 1, &Nfields)) ESCAPE;
    6593
     94  // XXX TIMER 1
     95  gettimeofday (&stopTimer, (void *) NULL);
     96  dtime = DTIME (stopTimer, startTimer);
     97  timeSum1 += dtime;
     98  gettimeofday (&startTimer, (void *) NULL);
     99
    66100  TableField *fields = NULL;
    67101  ALLOCATE_ZERO (fields, TableField, Nfields);
     
    181215  gfits_dump_raw_table (srctable, "cmp");
    182216
     217  // XXX TIMER 2
     218  gettimeofday (&stopTimer, (void *) NULL);
     219  dtime = DTIME (stopTimer, startTimer);
     220  timeSum2 += dtime;
     221  gettimeofday (&startTimer, (void *) NULL);
     222
    183223  // compress the data : copy into a tile, compress the tile, then add to the output table
    184224  // each tile -> 1 row of the output table
     
    186226
    187227    for (j = 0; j < Nfields; j++) {
     228
     229      gettimeofday (&startTimer, (void *) NULL);
    188230
    189231      int Nrows = (i == Ntile - 1) ? ztilelast : ztilelen;
     
    199241      }
    200242     
     243      // XXX TIMER 2a
     244      gettimeofday (&stopTimer, (void *) NULL);
     245      dtime = DTIME (stopTimer, startTimer);
     246      timeSum2a += dtime;
     247      gettimeofday (&startTimer, (void *) NULL);
     248 
    201249      if (VERBOSE_DUMP) {
    202250        int k;
     
    217265      }
    218266
     267      // XXX TIMER 2b
     268      gettimeofday (&stopTimer, (void *) NULL);
     269      dtime = DTIME (stopTimer, startTimer);
     270      timeSum2b += dtime;
     271      gettimeofday (&startTimer, (void *) NULL);
     272 
    219273      if (VERBOSE_DUMP) {
    220274        int k;
     
    231285      if (!gfits_compress_data (zdata, &Nzdata, fields[j].zctype, NULL, NULL, 0, raw, Nraw, fields[j].pixsize, 0, 0)) ESCAPE;
    232286     
     287      // XXX TIMER 2c
     288      gettimeofday (&stopTimer, (void *) NULL);
     289      dtime = DTIME (stopTimer, startTimer);
     290      timeSum2c += dtime;
     291      gettimeofday (&startTimer, (void *) NULL);
     292 
    233293      if (VERBOSE_DUMP) {
    234294        int k;
     
    250310      }
    251311
     312      // XXX TIMER 2d
     313      gettimeofday (&stopTimer, (void *) NULL);
     314      dtime = DTIME (stopTimer, startTimer);
     315      timeSum2d += dtime;
     316      gettimeofday (&startTimer, (void *) NULL);
     317 
    252318      if (VERBOSE_DUMP) {
    253319        int k;
     
    262328
    263329      if (!gfits_varlength_column_add_data (tgttable, zdata, Nzdata, i, &fields[j].zdef)) ESCAPE;
     330      // XXX TIMER 2e
     331      gettimeofday (&stopTimer, (void *) NULL);
     332      dtime = DTIME (stopTimer, startTimer);
     333      timeSum2e += dtime;
     334      gettimeofday (&startTimer, (void *) NULL);
     335 
    264336    }
    265337  }
     
    268340    if (!gfits_varlength_column_finish (tgttable, &fields[i].zdef)) ESCAPE;
    269341  }
     342
     343  // XXX TIMER 3
     344  gettimeofday (&stopTimer, (void *) NULL);
     345  dtime = DTIME (stopTimer, startTimer);
     346  timeSum3 += dtime;
     347  gettimeofday (&startTimer, (void *) NULL);
    270348
    271349  gfits_dump_cmp_table (tgttable, "cmp");
Note: See TracChangeset for help on using the changeset viewer.