Changeset 35699
- Timestamp:
- Jun 21, 2013, 3:21:44 PM (13 years ago)
- Location:
- branches/eam_branches/ipp-20130509/Ohana/src/dvomerge
- Files:
-
- 4 edited
-
include/dvomerge.h (modified) (1 diff)
-
src/args.c (modified) (3 diffs)
-
src/dvomergeUpdate_catalogs.c (modified) (6 diffs)
-
test/dvomerge.parallel.sh (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20130509/Ohana/src/dvomerge/include/dvomerge.h
r35619 r35699 23 23 int HOST_ID; 24 24 char *HOSTDIR; 25 26 int PARALLEL_INPUT; 25 27 26 28 int VERBOSE; -
branches/eam_branches/ipp-20130509/Ohana/src/dvomerge/src/args.c
r35619 r35699 76 76 } 77 77 78 // is the input database a parallel db? 79 PARALLEL_INPUT = FALSE; 80 if ((N = get_argument (*argc, argv, "-parallel-input"))) { 81 PARALLEL_INPUT = TRUE; 82 remove_argument (N, argc, argv); 83 } 84 85 // is the output database a parallel db? 78 86 PARALLEL = FALSE; 79 87 if ((N = get_argument (*argc, argv, "-parallel"))) { … … 117 125 IMAGES_ONLY = FALSE; 118 126 127 // is the input database a parallel db? 128 PARALLEL_INPUT = FALSE; 129 if ((N = get_argument (*argc, argv, "-parallel-input"))) { 130 PARALLEL_INPUT = TRUE; 131 remove_argument (N, argc, argv); 132 } 133 119 134 HOST_ID = 0; 120 135 if ((N = get_argument (*argc, argv, "-hostID"))) { … … 246 261 } 247 262 263 // is the output database a parallel db? 248 264 PARALLEL = FALSE; 249 265 if ((N = get_argument (*argc, argv, "-parallel"))) { -
branches/eam_branches/ipp-20130509/Ohana/src/dvomerge/src/dvomergeUpdate_catalogs.c
r35619 r35699 19 19 int status = dvomergeUpdate_parallel (input, output, outsky, IDmap); 20 20 return status; 21 } 22 23 // load the list of hosts 24 HostTable *table_input = NULL; 25 if (PARALLEL_INPUT) { 26 table_input = HostTableLoad (input, inlist->hosts); 27 if (!table_input) { 28 fprintf (stderr, "ERROR: failure reading Host Table %s for database %s\n", inlist->hosts, input); 29 exit (1); 30 } 31 32 // ensure we have absolute paths for hostdirs 33 for (i = 0; i < table_input->Nhosts; i++) { 34 char *tmppath = abspath (table_input->hosts[i].pathname, DVO_MAX_PATH); 35 free (table_input->hosts[i].pathname); 36 table_input->hosts[i].pathname = tmppath; 37 } 21 38 } 22 39 … … 25 42 if (!inlist[0].regions[i][0].table) continue; 26 43 if (VERBOSE) fprintf (stderr, "input: %s\n", inlist[0].regions[i][0].name); 44 45 // in a parallel context, we need to re-map the input filename 46 char *filename_input = strcreate (inlist[0].filename[i]); 47 if (PARALLEL_INPUT) { 48 49 int hostID_input = inlist[0].regions[i]->hostID; 50 int table_index = table_input->index[hostID_input]; 51 char *hostdir_input = table_input->hosts[table_index].pathname; 52 53 // set the parameters which guide catalog open/load/create 54 char hostfile_input[DVO_MAX_PATH]; 55 snprintf (hostfile_input, DVO_MAX_PATH, "%s/%s.cpt", hostdir_input, inlist[0].regions[i]->name); 56 free (filename_input); 57 filename_input = strcreate (hostfile_input); 58 } 27 59 28 60 // SkyListByBounds will return neighbor catalogs if the boundaries exactly match (due to rounding). Since the regions are not infinitely small, … … 49 81 50 82 // get stats for history check, skip input catalog if file not found (NULL inStats) 51 dmhObjectStats *inStats = dmhObjectStatsRead ( inlist[0].filename[i]);83 dmhObjectStats *inStats = dmhObjectStatsRead (filename_input); 52 84 if (!inStats) { 53 if (VERBOSE) fprintf (stderr, "skipping %s, empty \n", inlist[0].filename[i]);85 if (VERBOSE) fprintf (stderr, "skipping %s, empty \n", filename_input); 54 86 OutputStatusFree (outstat, outlist->Nregions); 55 87 SkyListFree (outlist); … … 76 108 } 77 109 if (!missed) { 78 if (VERBOSE || VERIFY) fprintf (stderr, "skipping %s, already merged\n", inlist[0].filename[i]);110 if (VERBOSE || VERIFY) fprintf (stderr, "skipping %s, already merged\n", filename_input); 79 111 OutputStatusFree (outstat, outlist->Nregions); 80 112 dmhObjectStatsFree (inStats); … … 83 115 } 84 116 if (VERIFY) { 85 fprintf (stderr, "%s NOT merged\n", inlist[0].filename[i]);117 fprintf (stderr, "%s NOT merged\n", filename_input); 86 118 continue; 87 119 } 88 120 89 121 // read the input catalog 90 LoadCatalog (&incatalog, &inlist[0].regions[i][0], inlist[0].filename[i], "r", NsecfiltInput); 122 LoadCatalog (&incatalog, &inlist[0].regions[i][0], filename_input, "r", NsecfiltInput); 123 free (filename_input); 91 124 92 125 // skip empty input catalogs … … 198 231 199 232 char tmpline[DVO_MAX_PATH]; 200 if (VERBOSE) { snprintf (tmpline, DVO_MAX_PATH, "%s -v", command); strcpy (command, tmpline); }201 if (VERIFY) { snprintf (tmpline, DVO_MAX_PATH, "%s -verify", command); strcpy (command, tmpline); }233 if (VERBOSE) { snprintf (tmpline, DVO_MAX_PATH, "%s -v", command); strcpy (command, tmpline); } 234 if (VERIFY) { snprintf (tmpline, DVO_MAX_PATH, "%s -verify", command); strcpy (command, tmpline); } 202 235 if (VERIFY_CATALOG_ONLY) { snprintf (tmpline, DVO_MAX_PATH, "%s -verify-catalogs", command); strcpy (command, tmpline); } 203 if (REPLACE_BY_PHOTCODE) { snprintf (tmpline, DVO_MAX_PATH, "%s -replace", command); strcpy (command, tmpline); } 236 if (REPLACE_BY_PHOTCODE) { snprintf (tmpline, DVO_MAX_PATH, "%s -replace", command); strcpy (command, tmpline); } 237 if (PARALLEL_INPUT) { snprintf (tmpline, DVO_MAX_PATH, "%s -parallel-input", command); strcpy (command, tmpline); } 204 238 205 239 fprintf (stderr, "command: %s\n", command); -
branches/eam_branches/ipp-20130509/Ohana/src/dvomerge/test/dvomerge.parallel.sh
r33963 r35699 1 1 #!/bin/csh -f 2 2 3 rm -rf catdir.merge 4 rsync - auv catdir.2mass/ catdir.merge/3 rm -rf catdir.merge catdir.merge.p? 4 rsync --exclude=.svn -auv catdir.2mass/ catdir.merge/ 5 5 cp HostTable.dat catdir.merge/ 6 6 dvodist -out catdir.merge 7 rm -rf catdir.merge/n???? 8 7 9 dvomerge -parallel catdir.grizy into catdir.merge 10 dvomerge -parallel catdir.grizy into catdir.merge -verify
Note:
See TracChangeset
for help on using the changeset viewer.
