- Timestamp:
- Jun 8, 2015, 11:46:15 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ohana.20150429/src/libfits/test/tcomptiming.c
r38426 r38429 8 8 char *cmptype[] = {"NONE", "NONE_1", "NONE_2", "GZIP_1", "GZIP_2", "RICE_1", "RICE_ONE", "AUTO", NULL}; 9 9 10 static int Nval = 1000000 ;10 static int Nval = 10000000; 11 11 12 12 int main (int argc, char **argv) { … … 24 24 for (lNtile = 1.0; lNtile < lNtileMax; lNtile += 1.0) { 25 25 int Ntile = pow (10.0, lNtile); 26 fprintf (stderr, "--- Ntile = %d ---\n", Ntile); 26 27 test_compress_timing ("NONE_2", Ntile); 27 fprintf (stderr, "--- Ntile = %d ---\n", Ntile);28 gfits_compress_timing(); 28 29 gfits_uncompress_timing(); 29 30 } … … 54 55 ok (gfits_create_table (&header, &ftable), "created the basic table"); 55 56 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 56 70 char *VAL_B; ALLOCATE (VAL_B, char, Nval); 57 71 short *VAL_I; ALLOCATE (VAL_I, short, Nval); … … 64 78 srand48(A); 65 79 80 // XXX TIMER 1 81 gettimeofday (&stopTimer, (void *) NULL); 82 dtime = DTIME (stopTimer, startTimer); 83 timeSum1 += dtime; 84 gettimeofday (&startTimer, (void *) NULL); 85 66 86 int i; 67 87 for (i = 0; i < Nval; i++) { … … 74 94 } 75 95 96 // XXX TIMER 1 97 gettimeofday (&stopTimer, (void *) NULL); 98 dtime = DTIME (stopTimer, startTimer); 99 timeSum2 += dtime; 100 gettimeofday (&startTimer, (void *) NULL); 101 76 102 // add the columns to the output array 77 103 ok (gfits_set_bintable_column (&header, &ftable, "VAL_B", VAL_B, Nval), "set byte table column"); … … 82 108 ok (gfits_set_bintable_column (&header, &ftable, "VAL_D", VAL_D, Nval), "set double table column"); 83 109 110 // XXX TIMER 1 111 gettimeofday (&stopTimer, (void *) NULL); 112 dtime = DTIME (stopTimer, startTimer); 113 timeSum3 += dtime; 114 gettimeofday (&startTimer, (void *) NULL); 115 84 116 Header *outheader = &header; 85 117 FTable *outtable = &ftable; … … 107 139 off_t Nrow; 108 140 141 // XXX TIMER 1 142 gettimeofday (&stopTimer, (void *) NULL); 143 dtime = DTIME (stopTimer, startTimer); 144 timeSum4 += dtime; 145 gettimeofday (&startTimer, (void *) NULL); 146 109 147 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"); 110 148 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"); … … 113 151 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"); 114 152 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); 115 159 116 160 // count mismatched values … … 131 175 } 132 176 177 // XXX TIMER 1 178 gettimeofday (&stopTimer, (void *) NULL); 179 dtime = DTIME (stopTimer, startTimer); 180 timeSum6 += dtime; 181 gettimeofday (&startTimer, (void *) NULL); 182 133 183 ok (!NVAL_B_bad, "byte values match (input vs output)"); 134 184 ok (!NVAL_I_bad, "short values match (input vs output)"); … … 144 194 gfits_free_table (outtable); 145 195 } 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 146 204 return TRUE; 147 205 }
Note:
See TracChangeset
for help on using the changeset viewer.
