Changeset 35333
- Timestamp:
- Mar 29, 2013, 2:47:47 PM (13 years ago)
- Location:
- branches/eam_branches/ipp-20130307/Ohana/src/dvomerge
- Files:
-
- 2 added
- 5 edited
-
Makefile (modified) (4 diffs)
-
include/dvomerge.h (modified) (1 diff)
-
src/args.c (modified) (2 diffs)
-
src/dvosecfilt.c (modified) (2 diffs)
-
src/dvosecfilt_catalogs.c (added)
-
src/dvosecfilt_client.c (added)
-
src/help.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20130307/Ohana/src/dvomerge/Makefile
r34405 r35333 23 23 dvoverify_client : $(BIN)/dvoverify_client.$(ARCH) 24 24 25 all: dvomerge dvomerge_client dvoconvert dvosecfilt dvo verify dvoverify_client25 all: dvomerge dvomerge_client dvoconvert dvosecfilt dvosecfilt_client dvoverify dvoverify_client 26 26 27 27 # $(SRC)/dvomergeContinue.$(ARCH).o … … 93 93 DVOSECFILT = \ 94 94 $(SRC)/dvosecfilt.$(ARCH).o \ 95 $(SRC)/dvosecfilt_catalogs.$(ARCH).o \ 95 96 $(SRC)/SetSignals.$(ARCH).o \ 96 97 $(SRC)/ConfigInit.$(ARCH).o \ … … 101 102 $(DVOSECFILT) : $(INC)/dvomerge.h 102 103 $(BIN)/dvosecfilt.$(ARCH) : $(DVOSECFILT) 104 105 DVOSECFILT_CLIENT = \ 106 $(SRC)/dvosecfilt_client.$(ARCH).o \ 107 $(SRC)/dvosecfilt_catalogs.$(ARCH).o \ 108 $(SRC)/SetSignals.$(ARCH).o \ 109 $(SRC)/ConfigInit.$(ARCH).o \ 110 $(SRC)/Shutdown.$(ARCH).o \ 111 $(SRC)/help.$(ARCH).o \ 112 $(SRC)/args.$(ARCH).o 113 114 $(DVOSECFILT_CLIENT) : $(INC)/dvomerge.h 115 $(BIN)/dvosecfilt_client.$(ARCH) : $(DVOSECFILT_CLIENT) 103 116 104 117 DVOREPAIR = \ … … 136 149 $(BIN)/dvoverify_client.$(ARCH) : $(DVOVERIFY_CLIENT) 137 150 138 INSTALL = dvomerge dvomerge_client dvoconvert dvosecfilt dvo repair dvoverify dvoverify_client151 INSTALL = dvomerge dvomerge_client dvoconvert dvosecfilt dvosecfilt_client dvorepair dvoverify dvoverify_client 139 152 140 153 # dependancy rules for binary code ######################### -
branches/eam_branches/ipp-20130307/Ohana/src/dvomerge/include/dvomerge.h
r34405 r35333 104 104 int dvosecfilt_args PROTO((int *argc, char **argv)); 105 105 106 void dvosecfilt_client_usage PROTO((void)); 107 void dvosecfilt_client_help PROTO((int argc, char **argv)); 108 int dvosecfilt_client_args PROTO((int *argc, char **argv)); 109 110 int dvosecfilt_catalogs PROTO((SkyTable *insky, int Nsecfilt)); 111 int dvosecfilt_parallel PROTO((SkyTable *insky, int Nsecfilt)); 112 106 113 int SkyTablePopulatedRange PROTO((off_t *ns, off_t *ne, SkyTable *sky, off_t Nstart)); 107 114 int SkyListPopulatedRange PROTO((off_t *ns, off_t *ne, SkyList *sky, off_t Nstart)); -
branches/eam_branches/ipp-20130307/Ohana/src/dvomerge/src/args.c
r34260 r35333 170 170 int N; 171 171 172 /* extra error messages */ 173 VERBOSE = FALSE; 174 if ((N = get_argument (*argc, argv, "-v"))) { 175 VERBOSE = TRUE; 172 HOST_ID = 0; 173 174 /* extra error messages */ 175 VERBOSE = FALSE; 176 if ((N = get_argument (*argc, argv, "-v"))) { 177 VERBOSE = TRUE; 178 remove_argument (N, argc, argv); 179 } 180 181 PARALLEL = FALSE; 182 if ((N = get_argument (*argc, argv, "-parallel"))) { 183 PARALLEL = TRUE; 184 remove_argument (N, argc, argv); 185 } 186 // this is a test mode : rather than launching the remote jobs and waiting for completion, 187 // relphot will simply list the remote command and wait for the user to signal completion 188 PARALLEL_MANUAL = FALSE; 189 if ((N = get_argument (*argc, argv, "-parallel-manual"))) { 190 PARALLEL = TRUE; // -parallel-manual implies -parallel 191 PARALLEL_MANUAL = TRUE; 192 remove_argument (N, argc, argv); 193 } 194 // this is a test mode : rather than launching the relphot_client jobs remotely, they are 195 // run in serial via 'system' 196 PARALLEL_SERIAL = FALSE; 197 if ((N = get_argument (*argc, argv, "-parallel-serial"))) { 198 if (PARALLEL_MANUAL) { 199 fprintf (stderr, "ERROR: cannot mix -parallel-manual and -parallel-serial\n"); 200 exit (1); 201 } 202 PARALLEL = TRUE; // -parallel-serial implies -parallel 203 PARALLEL_SERIAL = TRUE; 176 204 remove_argument (N, argc, argv); 177 205 } … … 180 208 return TRUE; 181 209 } 210 211 /*** check for command line options ***/ 212 int dvosecfilt_client_args (int *argc, char **argv) { 213 214 int N; 215 216 // by definition, the client is not parallel 217 PARALLEL = FALSE; 218 PARALLEL_MANUAL = FALSE; 219 PARALLEL_SERIAL = FALSE; 220 221 HOST_ID = 0; 222 if ((N = get_argument (*argc, argv, "-hostID"))) { 223 remove_argument (N, argc, argv); 224 HOST_ID = atoi (argv[N]); 225 remove_argument (N, argc, argv); 226 } 227 if (!HOST_ID) dvosecfilt_client_usage(); 228 229 HOSTDIR = NULL; 230 if ((N = get_argument (*argc, argv, "-hostdir"))) { 231 remove_argument (N, argc, argv); 232 HOSTDIR = strcreate (argv[N]); 233 remove_argument (N, argc, argv); 234 } 235 if (!HOSTDIR) dvosecfilt_client_usage(); 236 237 /* extra error messages */ 238 VERBOSE = FALSE; 239 if ((N = get_argument (*argc, argv, "-v"))) { 240 VERBOSE = TRUE; 241 remove_argument (N, argc, argv); 242 } 243 244 if (*argc != 3) dvosecfilt_client_usage(); 245 return TRUE; 246 } -
branches/eam_branches/ipp-20130307/Ohana/src/dvomerge/src/dvosecfilt.c
r29001 r35333 3 3 // modify the number of average photcodes : change only secfilt tables in place 4 4 int main (int argc, char **argv) { 5 6 char filename[256], *input;7 off_t i, j, k, Nsecfilt, NsecInput, Nstart;8 SkyTable *insky;9 Catalog catalog;10 SecFilt *insec, *outsec;11 5 12 6 SetSignals (); … … 15 9 dvosecfilt_args (&argc, argv); 16 10 17 input = argv[1];18 Nsecfilt = atoi(argv[2]);11 strcpy (CATDIR, argv[1]); 12 int Nsecfilt = atoi(argv[2]); 19 13 20 14 // load the sky table for the existing database 21 insky = SkyTableLoadOptimal (input, NULL, NULL, FALSE, SKY_DEPTH_HST, VERBOSE);22 SkyTableSetFilenames (insky, input, "cpt");15 SkyTable *insky = SkyTableLoadOptimal (CATDIR, NULL, NULL, FALSE, SKY_DEPTH_HST, VERBOSE); 16 SkyTableSetFilenames (insky, CATDIR, "cpt"); 23 17 24 // loop over all input catalogs 25 for (i = 0; i < insky[0].Nregions; i++) { 26 if (!insky[0].regions[i].table) continue; 27 if (VERBOSE) fprintf (stderr, "table: %s\n", insky[0].regions[i].name); 28 29 // set the parameters which guide catalog open/load/create 30 catalog.filename = insky[0].filename[i]; 31 catalog.Nsecfilt = 0; 32 33 // always load all of the data (if any exists) 34 catalog.catflags = LOAD_SECF; 35 catalog.catformat = dvo_catalog_catformat (CATFORMAT); // set the default catformat from config data 36 catalog.catmode = dvo_catalog_catmode (CATMODE); // set the default catmode from config data 37 38 if (!dvo_catalog_open (&catalog, &insky[0].regions[i], VERBOSE, "w")) { 39 fprintf (stderr, "ERROR: failure to open catalog file %s\n", filename); 40 exit (2); 41 } 42 43 if (catalog.Naves_disk == 0) { 44 dvo_catalog_unlock (&catalog); 45 dvo_catalog_free (&catalog); 46 continue; 47 } 48 49 if (Nsecfilt == catalog.Nsecfilt) { 50 dvo_catalog_unlock (&catalog); 51 dvo_catalog_free (&catalog); 52 continue; 53 } 54 55 NsecInput = catalog.Nsecfilt; 56 Nstart = MIN(Nsecfilt, NsecInput); 57 58 insec = catalog.secfilt; 59 ALLOCATE (outsec, SecFilt, catalog.Naves_disk * Nsecfilt); 60 61 for (k = 0; k < catalog.Naves_disk; k++) { 62 for (j = 0; (j < catalog.Nsecfilt) && (j < Nsecfilt); j++) { 63 outsec[k*Nsecfilt + j].M = insec[k*NsecInput + j].M; 64 outsec[k*Nsecfilt + j].dM = insec[k*NsecInput + j].dM; 65 outsec[k*Nsecfilt + j].Xm = insec[k*NsecInput + j].Xm; 66 outsec[k*Nsecfilt + j].flags = insec[k*NsecInput + j].flags; 67 outsec[k*Nsecfilt + j].Ncode = insec[k*NsecInput + j].Ncode; 68 outsec[k*Nsecfilt + j].Nused = insec[k*NsecInput + j].Nused; 69 outsec[k*Nsecfilt + j].M_20 = insec[k*NsecInput + j].M_20; 70 outsec[k*Nsecfilt + j].M_80 = insec[k*NsecInput + j].M_80; 71 } 72 for (j = Nstart; j < Nsecfilt; j++) { 73 outsec[k*Nsecfilt + j].M = NAN; 74 outsec[k*Nsecfilt + j].dM = NAN; 75 outsec[k*Nsecfilt + j].Xm = NAN_S_SHORT; 76 } 77 } 78 free (catalog.secfilt); 79 catalog.secfilt = outsec; 80 catalog.Nsecfilt = Nsecfilt; 81 catalog.Nsecf_mem = Nsecfilt * catalog.Naves_disk; 82 catalog.Nsecf_disk = Nsecfilt * catalog.Naves_disk; 83 84 dvo_catalog_save (&catalog, VERBOSE); 85 dvo_catalog_unlock (&catalog); 86 dvo_catalog_free (&catalog); 87 } 18 dvosecfilt_catalogs (insky, Nsecfilt); 88 19 89 20 exit (0); -
branches/eam_branches/ipp-20130307/Ohana/src/dvomerge/src/help.c
r33963 r35333 25 25 void dvosecfilt_usage(void) { 26 26 27 fprintf (stderr, "USAGE: dvosecfilt (catdir) (Nsecfilt)\n"); 27 fprintf (stderr, "USAGE: dvosecfilt (catdir) (Nsecfilt)\n\n"); 28 fprintf (stderr, " optional flags:\n"); 29 fprintf (stderr, " -v : verbose mode\n"); 30 31 exit (2); 32 } 33 34 void dvosecfilt_client_usage(void) { 35 36 fprintf (stderr, "USAGE: dvosecfilt_client (catdir) (Nsecfilt)\n\n"); 37 fprintf (stderr, " optional flags:\n"); 38 fprintf (stderr, " -v : verbose mode\n"); 28 39 29 40 exit (2); … … 123 134 } 124 135 136 void dvosecfilt_client_help (int argc, char **argv) { 137 138 /* check for help request */ 139 if (get_argument (argc, argv, "-help")) goto show_help; 140 if (get_argument (argc, argv, "-h")) goto show_help; 141 return; 142 143 show_help: 144 145 fprintf (stderr, "USAGE\n"); 146 fprintf (stderr, " dvosecfilt_client (catdir) (Nsecfilt)\n\n"); 147 148 fprintf (stderr, " change number of secfilt entries in photcode table (updates secfilt tables (cps), NSECFILT in cpt files)\n"); 149 fprintf (stderr, " NOTE: the user must change the photcode table to reflect the change (use photcode-table -export / -import)\n"); 150 151 fprintf (stderr, " optional flags:\n"); 152 fprintf (stderr, " -v : verbose mode\n"); 153 fprintf (stderr, " -help : this list\n"); 154 fprintf (stderr, " -h : this list\n\n"); 155 exit (2); 156 } 157 125 158 void dvorepair_help (int argc, char **argv) { 126 159
Note:
See TracChangeset
for help on using the changeset viewer.
