Changeset 37796
- Timestamp:
- Jan 11, 2015, 1:12:08 PM (12 years ago)
- Location:
- branches/eam_branches/ipp-20140904/Ohana/src/dvosplit
- Files:
-
- 4 edited
-
include/dvosplit.h (modified) (1 diff)
-
src/args.c (modified) (1 diff)
-
src/split_averages.c (modified) (4 diffs)
-
src/split_measures.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20140904/Ohana/src/dvosplit/include/dvosplit.h
r33656 r37796 22 22 } AveLinks; 23 23 24 int FULL_TABLE; 24 25 int VERBOSE; 25 26 char *OUTDIR; -
branches/eam_branches/ipp-20140904/Ohana/src/dvosplit/src/args.c
r33656 r37796 57 57 } 58 58 59 // override input catalog format (PS1_V1, PS1_REF, etc) 60 FULL_TABLE = FALSE; 61 if ((N = get_argument (argc, argv, "-full-table"))) { 62 remove_argument (N, &argc, argv); 63 FULL_TABLE = TRUE; 64 } 65 59 66 /* extra error messages */ 60 67 VERBOSE = FALSE; -
branches/eam_branches/ipp-20140904/Ohana/src/dvosplit/src/split_averages.c
r37043 r37796 27 27 incatalog[0].catflags = LOAD_AVES | LOAD_SECF; 28 28 29 if ( incatalog[0].catmode == DVO_MODE_SPLIT) {29 if ((incatalog[0].catmode == DVO_MODE_SPLIT) && !FULL_TABLE) { 30 30 Nblocks = incatalog[0].Naves_disk / NROWS; 31 31 if (incatalog[0].Naves_disk % NROWS) Nblocks ++; … … 36 36 for (block = 0; block < Nblocks; block++) { 37 37 38 if ( incatalog[0].catmode == DVO_MODE_SPLIT) {38 if ((incatalog[0].catmode == DVO_MODE_SPLIT) && !FULL_TABLE) { 39 39 // read up to NROWS at a time 40 40 dvo_catalog_load_segment (incatalog, VERBOSE, block*NROWS, NROWS); 41 41 fprintf (stderr, "splitting %s (averages) .. %d of %d\n", incatalog[0].filename, block, Nblocks); 42 assert (block*NROWS == incatalog[0].Naves_off); 42 43 } else { 43 44 dvo_catalog_load (incatalog, VERBOSE); 44 45 fprintf (stderr, "splitting %s (averages)\n", incatalog[0].filename); 45 46 } 46 47 assert (block*NROWS == incatalog[0].Naves_off);48 47 49 48 // distribute data to the output catalogs … … 54 53 inD = incatalog[0].average[ave].D; 55 54 55 if (incatalog[0].average[ave].Nmeasure == 0) { 56 fprintf (stderr, "WARNING: object with no measurements, skipping %d (%f, %f)\n", averef, inR, inD); 57 continue; 58 } 56 59 // which of the outcatalogs contains this coordinate? 57 60 … … 98 101 99 102 // write out the new values 100 for (cat = 0; cat < outlist[0].Nregions; cat++) { 101 outcatalogs[cat].catflags = LOAD_AVES | LOAD_SECF; 103 if (!FULL_TABLE) { 104 for (cat = 0; cat < outlist[0].Nregions; cat++) { 105 outcatalogs[cat].catflags = LOAD_AVES | LOAD_SECF; 102 106 103 dvo_catalog_save (&outcatalogs[cat], VERBOSE);104 // fprintf (stderr, "secfilt: %d %d %d %d\n", outcatalogs[cat].Nsecf_mem, outcatalogs[cat].Nsecf_disk, outcatalogs[cat].Nsecf_off, outcatalogs[cat].Naverage, outcatalogs[cat].Nsecfilt);107 dvo_catalog_save (&outcatalogs[cat], VERBOSE); 108 // fprintf (stderr, "secfilt: %d %d %d %d\n", outcatalogs[cat].Nsecf_mem, outcatalogs[cat].Nsecf_disk, outcatalogs[cat].Nsecf_off, outcatalogs[cat].Naverage, outcatalogs[cat].Nsecfilt); 105 109 106 // advance the pointers and free the current data107 // XXX these should be done within save segment:108 outcatalogs[cat].Naves_disk += outcatalogs[cat].Naverage;109 outcatalogs[cat].Naves_off += outcatalogs[cat].Naverage;110 outcatalogs[cat].Nsecf_disk += outcatalogs[cat].Nsecfilt * outcatalogs[cat].Naverage;111 outcatalogs[cat].Nsecf_off += outcatalogs[cat].Nsecfilt * outcatalogs[cat].Naverage;112 outcatalogs[cat].Nsecfilt = Nsecfilt;110 // advance the pointers and free the current data 111 // XXX these should be done within save segment: 112 outcatalogs[cat].Naves_disk += outcatalogs[cat].Naverage; 113 outcatalogs[cat].Naves_off += outcatalogs[cat].Naverage; 114 outcatalogs[cat].Nsecf_disk += outcatalogs[cat].Nsecfilt * outcatalogs[cat].Naverage; 115 outcatalogs[cat].Nsecf_off += outcatalogs[cat].Nsecfilt * outcatalogs[cat].Naverage; 116 outcatalogs[cat].Nsecfilt = Nsecfilt; 113 117 114 outcatalogs[cat].Naverage = 0; 115 outcatalogs[cat].Nsecf_mem = 0; 118 outcatalogs[cat].Naverage = 0; 119 outcatalogs[cat].Nsecf_mem = 0; 120 } 116 121 } 117 122 } 118 123 119 for (cat = 0; cat < outlist[0].Nregions; cat++) { 120 dvo_catalog_free_data (&outcatalogs[cat]); 124 if (!FULL_TABLE) { 125 for (cat = 0; cat < outlist[0].Nregions; cat++) { 126 dvo_catalog_free_data (&outcatalogs[cat]); 127 } 121 128 } 122 129 -
branches/eam_branches/ipp-20140904/Ohana/src/dvosplit/src/split_measures.c
r37043 r37796 27 27 // } 28 28 29 if ( incatalog[0].catmode == DVO_MODE_SPLIT) {29 if ((incatalog[0].catmode == DVO_MODE_SPLIT) && !FULL_TABLE) { 30 30 Nblocks = incatalog[0].Nmeas_disk / NROWS; 31 31 if (incatalog[0].Nmeas_disk % NROWS) Nblocks ++; … … 37 37 38 38 // read up to NROWS at a time 39 if ( incatalog[0].catmode == DVO_MODE_SPLIT) {39 if ((incatalog[0].catmode == DVO_MODE_SPLIT) && !FULL_TABLE) { 40 40 dvo_catalog_load_segment (incatalog, VERBOSE, block*NROWS, NROWS); 41 41 fprintf (stderr, "splitting %s (measures) .. %d of %d\n", incatalog[0].filename, block, Nblocks); 42 assert (block*NROWS == incatalog[0].Nmeas_off); 42 43 } else { 43 44 dvo_catalog_load (incatalog, VERBOSE); 44 45 fprintf (stderr, "splitting %s (measures)\n", incatalog[0].filename); 45 46 } 46 47 assert (block*NROWS == incatalog[0].Nmeas_off);48 47 49 48 for (meas = 0; meas < incatalog[0].Nmeasure; meas++) { … … 52 51 Ncat = outcat[averef]; 53 52 53 int averef_out = outref[averef]; 54 if (averef_out >= outcatalogs[Ncat].Naverage) { 55 fprintf (stderr, "mismatch 1\n"); 56 abort(); 57 } 58 54 59 Nout = outcatalogs[Ncat].Nmeasure; 55 60 outcatalogs[Ncat].measure[Nout] = incatalog[0].measure[meas]; 56 61 outcatalogs[Ncat].measure[Nout].averef = outref[averef]; 62 57 63 outcatalogs[Ncat].Nmeasure++; 58 64 … … 64 70 dvo_catalog_free_data (incatalog); 65 71 72 if (!FULL_TABLE) { 73 for (cat = 0; cat < outlist[0].Nregions; cat++) { 74 outcatalogs[cat].catflags = LOAD_MEAS; 75 dvo_catalog_save (&outcatalogs[cat], VERBOSE); 76 77 outcatalogs[cat].Nmeas_disk += outcatalogs[cat].Nmeasure; 78 outcatalogs[cat].Nmeas_off += outcatalogs[cat].Nmeasure; 79 outcatalogs[cat].Nmeasure = 0; 80 } 81 } 82 } 83 84 if (FULL_TABLE) { 66 85 for (cat = 0; cat < outlist[0].Nregions; cat++) { 67 outcatalogs[cat].catflags = LOAD_ MEAS;86 outcatalogs[cat].catflags = LOAD_AVES | LOAD_SECF | LOAD_MEAS; 68 87 dvo_catalog_save (&outcatalogs[cat], VERBOSE); 69 70 outcatalogs[cat].Nmeas_disk += outcatalogs[cat].Nmeasure;71 outcatalogs[cat].Nmeas_off += outcatalogs[cat].Nmeasure;72 outcatalogs[cat].Nmeasure = 0;73 74 88 } 75 89 }
Note:
See TracChangeset
for help on using the changeset viewer.
