Changeset 27160
- Timestamp:
- Mar 3, 2010, 1:54:33 PM (16 years ago)
- Location:
- trunk/ppStack/src
- Files:
-
- 4 edited
-
ppStack.c (modified) (3 diffs)
-
ppStackFinish.c (modified) (1 diff)
-
ppStackLoop.c (modified) (3 diffs)
-
ppStackLoop.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ppStack/src/ppStack.c
r27135 r27160 24 24 25 25 pmConfig *config = pmConfigRead(&argc, argv, PPSTACK_RECIPE); // Configuration 26 ppStackOptions *options = NULL; // Options for stacking 26 27 if (!config) { 27 28 goto die; … … 54 55 } 55 56 56 if (!ppStackLoop(config)) { 57 options = ppStackOptionsAlloc(); 58 if (!ppStackLoop(config, options)) { 57 59 goto die; 58 60 } … … 76 78 } 77 79 } 80 81 // Write out summary statistics 82 if (options && options->stats) { 83 84 psMetadataAddS32(options->stats, PS_LIST_TAIL, "QUALITY", PS_META_REPLACE, 85 "Bad data quality flag", options->quality); 86 psMetadataAddF32(options->stats, PS_LIST_TAIL, "TIME_STACK", 0, 87 "Total time", psTimerClear("PPSTACK_TOTAL")); 88 89 const char *statsMDC = psMetadataConfigFormat(options->stats); 90 if (!statsMDC || strlen(statsMDC) == 0) { 91 psError(PS_ERR_IO, false, "Unable to get statistics MDC file."); 92 return false; 93 } 94 if (fprintf(options->statsFile, "%s", statsMDC) != strlen(statsMDC)) { 95 psError(PS_ERR_IO, false, "Unable to write statistics MDC file."); 96 return false; 97 } 98 psFree(statsMDC); 99 if (fclose(options->statsFile) == EOF) { 100 psError(PS_ERR_IO, false, "Unable to close statistics MDC file."); 101 return false; 102 } 103 options->statsFile = NULL; 104 pmConfigRunFilenameAddWrite(config, "STATS", 105 psMetadataLookupStr(NULL, config->arguments, "STATS")); 106 } 107 psFree(options); 78 108 79 109 // Dump configuration -
trunk/ppStack/src/ppStackFinish.c
r27158 r27160 68 68 psFree(options->outRO); options->outRO = NULL; 69 69 70 // Write out summary statistics71 if (options->stats) {72 73 psMetadataAddS32(options->stats, PS_LIST_TAIL, "QUALITY", PS_META_REPLACE,74 "Bad data quality flag", options->quality);75 psMetadataAddF32(options->stats, PS_LIST_TAIL, "TIME_STACK", 0,76 "Total time", psTimerClear("PPSTACK_TOTAL"));77 78 const char *statsMDC = psMetadataConfigFormat(options->stats);79 if (!statsMDC || strlen(statsMDC) == 0) {80 psError(PS_ERR_IO, false, "Unable to get statistics MDC file.");81 return false;82 }83 if (fprintf(options->statsFile, "%s", statsMDC) != strlen(statsMDC)) {84 psError(PS_ERR_IO, false, "Unable to write statistics MDC file.");85 return false;86 }87 psFree(statsMDC);88 if (fclose(options->statsFile) == EOF) {89 psError(PS_ERR_IO, false, "Unable to close statistics MDC file.");90 return false;91 }92 options->statsFile = NULL;93 pmConfigRunFilenameAddWrite(config, "STATS", psMetadataLookupStr(NULL, config->arguments, "STATS"));94 }95 96 70 return true; 97 71 } -
trunk/ppStack/src/ppStackLoop.c
r27158 r27160 50 50 51 51 52 bool ppStackLoop(pmConfig *config )52 bool ppStackLoop(pmConfig *config, ppStackOptions *options) 53 53 { 54 54 assert(config); … … 56 56 psTimerStart("PPSTACK_TOTAL"); 57 57 psTimerStart("PPSTACK_STEPS"); 58 59 ppStackOptions *options = ppStackOptionsAlloc(); // Options for stacking60 58 61 59 // Setup … … 222 220 return false; 223 221 } 224 psLogMsg("ppStack", PS_LOG_INFO, "Stage 9: Final output: %f sec", psTimerClear("PPSTACK_STEPS"));225 222 ppStackMemDump("finish"); 226 223 -
trunk/ppStack/src/ppStackLoop.h
r26076 r27160 11 11 // Loop over the inputs, doing the combination 12 12 bool ppStackLoop( 13 pmConfig *config // Configuration 13 pmConfig *config, // Configuration 14 ppStackOptions *options // Options for stacking 14 15 ); 15 16
Note:
See TracChangeset
for help on using the changeset viewer.
