Changeset 18393 for trunk/ppStack
- Timestamp:
- Jun 30, 2008, 6:27:12 PM (18 years ago)
- File:
-
- 1 edited
-
trunk/ppStack/src/ppStackLoop.c (modified) (12 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ppStack/src/ppStackLoop.c
r18385 r18393 30 30 "SOURCE.PLOT.MOMENTS", "SOURCE.PLOT.PSFMODEL", "SOURCE.PLOT.APRESID", 31 31 "PSPHOT.INPUT.CMF", NULL }; 32 33 static void memDump(const char *name) 34 { 35 return; 36 37 static int num = 0; // Counter, to make files unique and give an idea of sequence 38 39 psString filename = NULL; // Name of file 40 psStringAppend(&filename, "memdump_%s_%03d.txt", name, num); 41 FILE *memFile = fopen(filename, "w"); 42 psFree(filename); 43 44 psMemBlock **leaks = NULL; 45 int numLeaks = psMemCheckLeaks(0, &leaks, NULL, true); 46 fprintf(memFile, "# MemBlock Size Source\n"); 47 unsigned long total = 0; // Total memory used 48 for (int i = 0; i < numLeaks; i++) { 49 psMemBlock *mb = leaks[i]; 50 fprintf(memFile, "%12lu\t%12zd\t%s:%d\n", mb->id, mb->userMemorySize, 51 mb->file, mb->lineno); 52 total += mb->userMemorySize; 53 } 54 fclose(memFile); 55 psFree(leaks); 56 57 fprintf(stderr, "Memdump %s %d: Memory use: %ld, sbrk: %p\n", name, num, total, sbrk(0)); 58 num++; 59 } 60 32 61 33 62 … … 210 239 psMetadata *ppsub = psMetadataLookupMetadata(NULL, config->recipes, "PPSUB"); // PPSUB recipe 211 240 int overlap = 2 * psMetadataLookupS32(NULL, ppsub, "KERNEL.SIZE"); // Overlap by kernel size between consecutive scans 241 242 memDump("start"); 212 243 213 244 // Preparation iteration: Load the sources, and get a target PSF model … … 328 359 } 329 360 361 memDump("psf"); 362 330 363 const char *outName = psMetadataLookupStr(NULL, config->arguments, "OUTPUT"); // Output root 331 364 assert(outName); … … 389 422 filesIterateUp(config); 390 423 numGood++; 424 425 memDump("match"); 391 426 } 392 427 psFree(globalSources); … … 405 440 #endif 406 441 442 memDump("preinitial"); 407 443 408 444 // Stack the convolved files … … 524 560 } 525 561 } 562 563 memDump("initial"); 526 564 527 565 // Reset for the second read … … 574 612 } 575 613 rejected->data[i] = reject; 614 615 memDump("reject"); 616 576 617 } 577 618 psFree(subKernels); … … 586 627 return false; 587 628 } 629 630 memDump("prefinal"); 588 631 589 632 // Read convolutions by chunks … … 689 732 psFree(weightFits); 690 733 734 memDump("final"); 735 691 736 if (psMetadataLookupBool(&mdok, config->arguments, "PHOTOMETRY")) { 692 737 … … 708 753 } 709 754 755 memDump("phot"); 756 710 757 // Statistics on output 711 758 if (stats) { … … 713 760 ppStatsFPA(stats, outCell->parent->parent, view, maskBlank, config); 714 761 } 762 763 memDump("stats"); 715 764 716 765 // Put version information into the header … … 746 795 } 747 796 797 memDump("finish"); 798 748 799 return true; 749 800 }
Note:
See TracChangeset
for help on using the changeset viewer.
