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/test/tcomptiming.c

    r38426 r38429  
    88char *cmptype[] = {"NONE", "NONE_1", "NONE_2", "GZIP_1", "GZIP_2", "RICE_1", "RICE_ONE", "AUTO", NULL};
    99
    10 static int Nval = 1000000;
     10static int Nval = 10000000;
    1111
    1212int main (int argc, char **argv) {
     
    2424  for (lNtile = 1.0; lNtile < lNtileMax; lNtile += 1.0) {
    2525    int Ntile = pow (10.0, lNtile);
     26    fprintf (stderr, "--- Ntile = %d ---\n", Ntile);
    2627    test_compress_timing ("NONE_2", Ntile);
    27     fprintf (stderr, "--- Ntile = %d ---\n", Ntile);
     28    gfits_compress_timing();
    2829    gfits_uncompress_timing();
    2930  }
     
    5455  ok (gfits_create_table (&header, &ftable), "created the basic table");
    5556
     57  // XXX EAM:
     58  struct timeval startTimer, stopTimer;
     59  float dtime;
     60  gettimeofday (&startTimer, (void *) NULL);
     61
     62  float timeSum1 = 0.0;
     63  float timeSum2 = 0.0;
     64  float timeSum3 = 0.0;
     65  float timeSum4 = 0.0;
     66  float timeSum5 = 0.0;
     67  float timeSum6 = 0.0;
     68  float timeSum7 = 0.0;
     69
    5670  char    *VAL_B;  ALLOCATE (VAL_B, char,    Nval);
    5771  short   *VAL_I;  ALLOCATE (VAL_I, short,   Nval);
     
    6478  srand48(A);
    6579
     80  // XXX TIMER 1
     81  gettimeofday (&stopTimer, (void *) NULL);
     82  dtime = DTIME (stopTimer, startTimer);
     83  timeSum1 += dtime;
     84  gettimeofday (&startTimer, (void *) NULL);
     85
    6686  int i;
    6787  for (i = 0; i < Nval; i++) {
     
    7494  }     
    7595
     96  // XXX TIMER 1
     97  gettimeofday (&stopTimer, (void *) NULL);
     98  dtime = DTIME (stopTimer, startTimer);
     99  timeSum2 += dtime;
     100  gettimeofday (&startTimer, (void *) NULL);
     101
    76102  // add the columns to the output array
    77103  ok (gfits_set_bintable_column (&header, &ftable, "VAL_B", VAL_B, Nval), "set byte   table column");
     
    82108  ok (gfits_set_bintable_column (&header, &ftable, "VAL_D", VAL_D, Nval), "set double table column");
    83109
     110  // XXX TIMER 1
     111  gettimeofday (&stopTimer, (void *) NULL);
     112  dtime = DTIME (stopTimer, startTimer);
     113  timeSum3 += dtime;
     114  gettimeofday (&startTimer, (void *) NULL);
     115
    84116  Header *outheader = &header;
    85117  FTable *outtable = &ftable;
     
    107139  off_t Nrow;
    108140
     141  // XXX TIMER 1
     142  gettimeofday (&stopTimer, (void *) NULL);
     143  dtime = DTIME (stopTimer, startTimer);
     144  timeSum4 += dtime;
     145  gettimeofday (&startTimer, (void *) NULL);
     146
    109147  char    *VAL_B_t = gfits_get_bintable_column_data (outheader, outtable, "VAL_B", type, &Nrow, &Ncol); ok (!strcmp (type, "byte"),    "read byte    table column"); ok (Nrow == Nval, "right number of rows"); ok (Ncol == 1, "right number of cols");
    110148  short   *VAL_I_t = gfits_get_bintable_column_data (outheader, outtable, "VAL_I", type, &Nrow, &Ncol); ok (!strcmp (type, "short"),   "read short   table column"); ok (Nrow == Nval, "right number of rows"); ok (Ncol == 1, "right number of cols");
     
    113151  float   *VAL_E_t = gfits_get_bintable_column_data (outheader, outtable, "VAL_E", type, &Nrow, &Ncol); ok (!strcmp (type, "float"),   "read float   table column"); ok (Nrow == Nval, "right number of rows"); ok (Ncol == 1, "right number of cols");
    114152  double  *VAL_D_t = gfits_get_bintable_column_data (outheader, outtable, "VAL_D", type, &Nrow, &Ncol); ok (!strcmp (type, "double"),  "read double  table column"); ok (Nrow == Nval, "right number of rows"); ok (Ncol == 1, "right number of cols");
     153
     154  // XXX TIMER 1
     155  gettimeofday (&stopTimer, (void *) NULL);
     156  dtime = DTIME (stopTimer, startTimer);
     157  timeSum5 += dtime;
     158  gettimeofday (&startTimer, (void *) NULL);
    115159
    116160  // count mismatched values
     
    131175  }
    132176
     177  // XXX TIMER 1
     178  gettimeofday (&stopTimer, (void *) NULL);
     179  dtime = DTIME (stopTimer, startTimer);
     180  timeSum6 += dtime;
     181  gettimeofday (&startTimer, (void *) NULL);
     182
    133183  ok (!NVAL_B_bad, "byte    values match (input vs output)");
    134184  ok (!NVAL_I_bad, "short   values match (input vs output)");
     
    144194    gfits_free_table (outtable);
    145195  }
     196  // XXX TIMER 1
     197  gettimeofday (&stopTimer, (void *) NULL);
     198  dtime = DTIME (stopTimer, startTimer);
     199  timeSum7 += dtime;
     200  gettimeofday (&startTimer, (void *) NULL);
     201
     202  fprintf (stderr, "out times: %f %f %f %f %f %f %f\n", timeSum1, timeSum2, timeSum3, timeSum4, timeSum5, timeSum6, timeSum7);
     203
    146204  return TRUE;
    147205}
Note: See TracChangeset for help on using the changeset viewer.