Changeset 35336
- Timestamp:
- Mar 30, 2013, 2:25:04 PM (13 years ago)
- Location:
- branches/eam_branches/ipp-20130307/Ohana/src/dvomerge
- Files:
-
- 1 added
- 5 edited
-
include/dvomerge.h (modified) (2 diffs)
-
src/args.c (modified) (2 diffs)
-
src/dvosecfilt.c (modified) (1 diff)
-
src/dvosecfilt_catalogs.c (modified) (6 diffs)
-
src/dvosecfilt_client.c (modified) (1 diff)
-
test/dvosecfilt.parallel.sh (added)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20130307/Ohana/src/dvomerge/include/dvomerge.h
r35333 r35336 36 36 int REPLACE_BY_PHOTCODE; 37 37 38 char *SINGLE_CPT; 38 39 SkyRegion UserPatch; // used by MODE CAT 39 40 … … 108 109 int dvosecfilt_client_args PROTO((int *argc, char **argv)); 109 110 110 int dvosecfilt_catalogs PROTO(( SkyTable *insky,int Nsecfilt));111 int dvosecfilt_catalogs PROTO((int Nsecfilt)); 111 112 int dvosecfilt_parallel PROTO((SkyTable *insky, int Nsecfilt)); 112 113 -
branches/eam_branches/ipp-20130307/Ohana/src/dvomerge/src/args.c
r35333 r35336 179 179 } 180 180 181 SINGLE_CPT = NULL; 182 if ((N = get_argument (*argc, argv, "-cpt"))) { 183 remove_argument (N, argc, argv); 184 SINGLE_CPT = strcreate (argv[N]); 185 remove_argument (N, argc, argv); 186 } 187 188 /* specify portion of the sky : allow default of all sky? */ 189 UserPatch.Rmin = 0; 190 UserPatch.Rmax = 360; 191 UserPatch.Dmin = -90; 192 UserPatch.Dmax = +90; 193 if ((N = get_argument (*argc, argv, "-region"))) { 194 remove_argument (N, argc, argv); 195 UserPatch.Rmin = atof (argv[N]); 196 remove_argument (N, argc, argv); 197 UserPatch.Rmax = atof (argv[N]); 198 remove_argument (N, argc, argv); 199 UserPatch.Dmin = atof (argv[N]); 200 remove_argument (N, argc, argv); 201 UserPatch.Dmax = atof (argv[N]); 202 remove_argument (N, argc, argv); 203 } 204 181 205 PARALLEL = FALSE; 182 206 if ((N = get_argument (*argc, argv, "-parallel"))) { … … 219 243 PARALLEL_SERIAL = FALSE; 220 244 245 SINGLE_CPT = NULL; 246 if ((N = get_argument (*argc, argv, "-cpt"))) { 247 remove_argument (N, argc, argv); 248 SINGLE_CPT = strcreate (argv[N]); 249 remove_argument (N, argc, argv); 250 } 251 252 /* specify portion of the sky : allow default of all sky? */ 253 UserPatch.Rmin = 0; 254 UserPatch.Rmax = 360; 255 UserPatch.Dmin = -90; 256 UserPatch.Dmax = +90; 257 if ((N = get_argument (*argc, argv, "-region"))) { 258 remove_argument (N, argc, argv); 259 UserPatch.Rmin = atof (argv[N]); 260 remove_argument (N, argc, argv); 261 UserPatch.Rmax = atof (argv[N]); 262 remove_argument (N, argc, argv); 263 UserPatch.Dmin = atof (argv[N]); 264 remove_argument (N, argc, argv); 265 UserPatch.Dmax = atof (argv[N]); 266 remove_argument (N, argc, argv); 267 } 268 221 269 HOST_ID = 0; 222 270 if ((N = get_argument (*argc, argv, "-hostID"))) { -
branches/eam_branches/ipp-20130307/Ohana/src/dvomerge/src/dvosecfilt.c
r35333 r35336 12 12 int Nsecfilt = atoi(argv[2]); 13 13 14 // load the sky table for the existing database 15 SkyTable *insky = SkyTableLoadOptimal (CATDIR, NULL, NULL, FALSE, SKY_DEPTH_HST, VERBOSE); 16 SkyTableSetFilenames (insky, CATDIR, "cpt"); 17 18 dvosecfilt_catalogs (insky, Nsecfilt); 14 dvosecfilt_catalogs (Nsecfilt); 19 15 20 16 exit (0); -
branches/eam_branches/ipp-20130307/Ohana/src/dvomerge/src/dvosecfilt_catalogs.c
r35333 r35336 1 1 # include "dvomerge.h" 2 2 3 int dvosecfilt_catalogs ( SkyTable *insky,int Nsecfilt) {3 int dvosecfilt_catalogs (int Nsecfilt) { 4 4 5 5 off_t i, j, k, NsecInput, Nstart; … … 7 7 SecFilt *insec, *outsec; 8 8 char filename[DVO_MAX_PATH]; 9 SkyList *skylist; 10 11 SkyTable *sky = SkyTableLoadOptimal (CATDIR, NULL, NULL, FALSE, SKY_DEPTH_HST, VERBOSE); 12 SkyTableSetFilenames (sky, CATDIR, "cpt"); 9 13 10 14 if (PARALLEL && !HOST_ID) { 11 int status = dvosecfilt_parallel ( insky, Nsecfilt);15 int status = dvosecfilt_parallel (sky, Nsecfilt); 12 16 return status; 13 17 } 14 18 19 // determine the populated SkyRegions overlapping the requested area (default depth) 20 if (SINGLE_CPT) { 21 skylist = SkyRegionByCPT (sky, SINGLE_CPT); 22 } else { 23 skylist = SkyListByPatch (sky, -1, &UserPatch); 24 } 25 myAssert (skylist, "ooops!"); 26 15 27 // loop over all input catalogs 16 for (i = 0; i < insky[0].Nregions; i++) {17 if (! insky[0].regions[i].table) continue;18 if (VERBOSE) fprintf (stderr, "table: %s\n", insky[0].regions[i].name);28 for (i = 0; i < skylist->Nregions; i++) { 29 if (!skylist->regions[i]->table) continue; 30 if (VERBOSE) fprintf (stderr, "table: %s\n", skylist->regions[i]->name); 19 31 20 32 // does this host ID match the desired location for the table? 21 if (!HostTableTestHost( &insky[0].regions[i], HOST_ID)) continue;33 if (!HostTableTestHost(skylist->regions[i], HOST_ID)) continue; 22 34 23 35 char hostfile[1024]; 24 snprintf (hostfile, 1024, "%s/%s.cpt", HOSTDIR, insky[0].regions[i].name);25 catalog.filename = HOST_ID ? hostfile : insky[0].filename[i];36 snprintf (hostfile, 1024, "%s/%s.cpt", HOSTDIR, skylist->regions[i]->name); 37 catalog.filename = HOST_ID ? hostfile : skylist->filename[i]; 26 38 27 39 // always load all of the data (if any exists) … … 31 43 catalog.catmode = dvo_catalog_catmode (CATMODE); // set the default catmode from config data 32 44 33 if (!dvo_catalog_open (&catalog, &insky[0].regions[i], VERBOSE, "w")) {45 if (!dvo_catalog_open (&catalog, skylist->regions[i], VERBOSE, "w")) { 34 46 fprintf (stderr, "ERROR: failure to open catalog file %s\n", filename); 35 47 exit (2); … … 77 89 78 90 // launch the dvosecfilt_client jobs to the parallel hosts 79 int dvosecfilt_parallel (SkyTable * insky, int Nsecfilt) {91 int dvosecfilt_parallel (SkyTable *sky, int Nsecfilt) { 80 92 81 93 // ensure that the paths are absolute path names … … 83 95 84 96 // load the list of hosts 85 HostTable *table = HostTableLoad (CATDIR, insky->hosts);97 HostTable *table = HostTableLoad (CATDIR, sky->hosts); 86 98 if (!table) { 87 fprintf (stderr, "ERROR: failure reading Host Table %s for database %s\n", insky->hosts, CATDIR);99 fprintf (stderr, "ERROR: failure reading Host Table %s for database %s\n", sky->hosts, CATDIR); 88 100 exit (1); 89 101 } … … 99 111 // options / arguments that can affect relastro_client -update-objects: 100 112 char command[DVO_MAX_PATH]; 101 snprintf (command, DVO_MAX_PATH, "dvosecfilt_client %s %d -hostID %d -hostdir %s", 102 abscatdir, Nsecfilt, table->hosts[i].hostID, table->hosts[i].pathname 113 snprintf (command, DVO_MAX_PATH, "dvosecfilt_client %s %d -hostID %d -hostdir %s -region %f %f %f %f", 114 abscatdir, Nsecfilt, table->hosts[i].hostID, table->hosts[i].pathname, 115 UserPatch.Rmin, UserPatch.Rmax, UserPatch.Dmin, UserPatch.Dmax 103 116 ); 104 117 105 118 char tmpline[DVO_MAX_PATH]; 106 if (VERBOSE) { snprintf (tmpline, DVO_MAX_PATH, "%s -v", command); strcpy (command, tmpline); } 119 if (VERBOSE) { snprintf (tmpline, DVO_MAX_PATH, "%s -v", command); strcpy (command, tmpline); } 120 if (SINGLE_CPT) { snprintf (tmpline, DVO_MAX_PATH, "%s -cpt %s", command, SINGLE_CPT); strcpy (command, tmpline); } 107 121 108 122 fprintf (stderr, "command: %s\n", command); -
branches/eam_branches/ipp-20130307/Ohana/src/dvomerge/src/dvosecfilt_client.c
r35333 r35336 12 12 int Nsecfilt = atoi(argv[2]); 13 13 14 // load the sky table for the existing database 15 SkyTable *insky = SkyTableLoadOptimal (CATDIR, NULL, NULL, FALSE, SKY_DEPTH_HST, VERBOSE); 16 SkyTableSetFilenames (insky, CATDIR, "cpt"); 17 18 dvosecfilt_catalogs (insky, Nsecfilt); 14 dvosecfilt_catalogs (Nsecfilt); 19 15 20 16 exit (0);
Note:
See TracChangeset
for help on using the changeset viewer.
