Changeset 38494
- Timestamp:
- Jun 19, 2015, 9:01:56 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20150616/Ohana/src/libdvo/src/dvo_catalog_split.c
r38441 r38494 1 1 # include <dvo.h> 2 # define OHANA_MEMCHECK 02 # define OHANA_MEMCHECK 1 3 3 4 4 // return options: … … 92 92 Matrix matrix; 93 93 94 if (OHANA_MEMCHECK) ohana_memcheck_func(TRUE);94 // if (OHANA_MEMCHECK) ohana_memcheck (TRUE); 95 95 96 96 /* rewind file pointers and truncate (file is still open) */ … … 128 128 int isCompressed = output_is_compressed (start, Nrows, Ntotal, catalog->catcompress); 129 129 130 if (OHANA_MEMCHECK) ohana_memcheck_func(TRUE);130 // if (OHANA_MEMCHECK) ohana_memcheck (TRUE); 131 131 132 132 if (isCompressed) { … … 149 149 } 150 150 151 if (OHANA_MEMCHECK) ohana_memcheck_func(TRUE);151 // if (OHANA_MEMCHECK) ohana_memcheck (TRUE); 152 152 153 153 // write the table data … … 169 169 fullsize += outtable->datasize + outtable->header->datasize; 170 170 171 if (OHANA_MEMCHECK) ohana_memcheck_func (TRUE); 171 // XXX test of repeated failure 172 { 173 Matrix myMatrix; 174 175 // write the PHU matrix; this is probably a NOP, do I have to keep it in? 176 gfits_create_matrix (&catalog->header, &myMatrix); 177 178 int niter; 179 for (niter = 0; niter < 5; niter ++) { 180 char name[1024]; 181 snprintf (name, 1024, "%s.v.%d", catalog->filename, niter); 182 FILE *f = fopen (name, "w"); 183 184 myAssert (gfits_fwrite_header (f, &catalog->header), "failed to write header"); 185 myAssert (gfits_fwrite_matrix (f, &myMatrix), "failed to write matrix"); 186 myAssert (gfits_fwrite_Theader (f, outtable->header), "can't write table header"); 187 myAssert (gfits_fwrite_table (f, outtable), "can't write table data"); 188 myAssert (!fflush (f), "failed to flush"); 189 myAssert (!fclose (f), "failed to close"); 190 int fd = fileno(f); 191 myAssert (fsync(fd), "failed to sync"); 192 fprintf (stderr, "wrote to %s\n", name); 193 } 194 gfits_free_matrix (&myMatrix); 195 } 196 197 // if (OHANA_MEMCHECK) ohana_memcheck (TRUE); 172 198 173 199 // since we init'ed the structures above, these operations are safe whether or not we compressed the table
Note:
See TracChangeset
for help on using the changeset viewer.
