Changeset 33600
- Timestamp:
- Mar 23, 2012, 2:19:56 PM (14 years ago)
- Location:
- branches/eam_branches/ipp-20111122/Ohana/src
- Files:
-
- 1 added
- 23 edited
-
libdvo/include/dvo.h (modified) (1 diff)
-
libdvo/src/HostTable.c (modified) (8 diffs)
-
opihi/cmd.data/Makefile (modified) (1 diff)
-
opihi/cmd.data/cumulative.c (modified) (2 diffs)
-
opihi/cmd.data/init.c (modified) (2 diffs)
-
opihi/cmd.data/line.c (modified) (2 diffs)
-
opihi/dvo/Makefile (modified) (1 diff)
-
opihi/dvo/avextract.c (modified) (5 diffs)
-
opihi/dvo/avmatch.c (modified) (1 diff)
-
opihi/dvo/dvo_host_utils.c (modified) (3 diffs)
-
opihi/dvo/hosts.c (added)
-
opihi/dvo/init.c (modified) (2 diffs)
-
opihi/dvo/mextract.c (modified) (1 diff)
-
opihi/include/dvoshell.h (modified) (1 diff)
-
opihi/lib.shell/VectorOps.c (modified) (2 diffs)
-
photdbc/src/photdbc_catalogs.c (modified) (2 diffs)
-
relastro/src/UpdateObjectOffsets.c (modified) (1 diff)
-
relastro/src/high_speed_catalogs.c (modified) (1 diff)
-
relastro/src/load_catalogs.c (modified) (1 diff)
-
relastro/src/relastro_objects.c (modified) (1 diff)
-
relphot/src/load_catalogs.c (modified) (1 diff)
-
relphot/src/reload_catalogs.c (modified) (1 diff)
-
relphot/src/relphot_objects.c (modified) (1 diff)
-
uniphot/src/update_dvo_setphot.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20111122/Ohana/src/libdvo/include/dvo.h
r33574 r33600 628 628 HostTable *HostTableLoad (char *catdir, char *rootname); 629 629 int HostTableWaitJobs (HostTable *table, char *file, int lineno); 630 int HostTableWaitJobsGetIO (HostTable *table, char *file, int lineno );630 int HostTableWaitJobsGetIO (HostTable *table, char *file, int lineno, int VERBOSE); 631 631 int HostTableTestHost (SkyRegion *region, int hostID); 632 632 -
branches/eam_branches/ipp-20111122/Ohana/src/libdvo/src/HostTable.c
r33584 r33600 29 29 } 30 30 31 void FreeTable (HostTable *table) { 32 33 if (!table) return; 34 if (table->hosts) { 35 FreeHosts (table->hosts, table->Nhosts); 36 } 37 if (table->index) free (table->index); 38 free (table); 39 return; 40 } 41 31 42 HostTable *HostTableLoad (char *catdir, char *rootname) { 32 43 … … 41 52 if (!f) { 42 53 fprintf (stderr, "failed to open host table %s\n", filename); 54 free (filename); 43 55 return NULL; 44 56 } … … 73 85 fprintf (stderr, "error reading line %d of host table %s\n", Nline, filename); 74 86 FreeHosts (hosts, Nhosts); 87 free (filename); 75 88 return NULL; 76 89 } … … 119 132 } 120 133 134 free (filename); 121 135 return table; 122 136 } … … 196 210 197 211 // wait for all children to complete, report output to stdout 198 int HostTableWaitJobsGetIO (HostTable *table, char *file, int lineno ) {212 int HostTableWaitJobsGetIO (HostTable *table, char *file, int lineno, int VERBOSE) { 199 213 200 214 // we have launched table->Nhosts jobs; wait for all of them to complete... … … 257 271 // if (table->hosts[i].stdout.Nbuffer > 0x10000) { 258 272 if (table->hosts[i].stdout.Nbuffer > 0x1000) { 259 fprintf (stdout, "--- stdout from %s ---\n", table->hosts[i].hostname); 273 int printHead = VERBOSE || table->hosts[i].stdout.Nbuffer; 274 if (printHead) fprintf (stdout, "--- stdout from %s ---\n", table->hosts[i].hostname); 260 275 write (STDOUT_FILENO, table->hosts[i].stdout.buffer, table->hosts[i].stdout.Nbuffer); 261 276 FlushIOBuffer (&table->hosts[i].stdout); 262 fprintf (stdout, "\n");277 if (printHead) fprintf (stdout, "\n"); 263 278 } 264 279 } … … 269 284 // if (table->hosts[i].stderr.Nbuffer > 0x10000) { 270 285 if (table->hosts[i].stderr.Nbuffer > 0x1000) { 271 fprintf (stdout, "--- stderr from %s ---\n", table->hosts[i].hostname); 286 int printHead = VERBOSE || table->hosts[i].stderr.Nbuffer; 287 if (printHead) fprintf (stdout, "--- stderr from %s ---\n", table->hosts[i].hostname); 272 288 write (STDOUT_FILENO, table->hosts[i].stderr.buffer, table->hosts[i].stderr.Nbuffer); 273 289 FlushIOBuffer (&table->hosts[i].stderr); 274 fprintf (stdout, "\n");290 if (printHead) fprintf (stdout, "\n"); 275 291 } 276 292 } … … 301 317 302 318 // check on the status of this and report any output? 303 fprintf (stdout, "job finished for %s (%d)\n", host->hostname, pid);319 if (VERBOSE) fprintf (stdout, "job finished for %s (%d)\n", host->hostname, pid); 304 320 305 321 // read stdout 322 int printHead; 323 printHead = VERBOSE || host->stdout.Nbuffer; 306 324 EmptyIOBuffer (&host->stdout, 100, host->stdio[HOST_STDOUT]); 307 fprintf (stdout, "--- stdout from %s ---\n", host->hostname);325 if (printHead) fprintf (stdout, "--- stdout from %s ---\n", host->hostname); 308 326 write (STDOUT_FILENO, host->stdout.buffer, host->stdout.Nbuffer); 309 327 FlushIOBuffer (&host->stdout); 310 fprintf (stdout, "\n");328 if (printHead) fprintf (stdout, "\n"); 311 329 312 330 // read stderr 331 printHead = VERBOSE || host->stderr.Nbuffer; 313 332 EmptyIOBuffer (&host->stderr, 100, host->stdio[HOST_STDERR]); 314 fprintf (stdout, "--- stderr from %s ---\n", host->hostname);333 if (printHead) fprintf (stdout, "--- stderr from %s ---\n", host->hostname); 315 334 write (STDOUT_FILENO, host->stderr.buffer, host->stderr.Nbuffer); 316 335 FlushIOBuffer (&host->stderr); 317 fprintf (stdout, "\n");336 if (printHead) fprintf (stdout, "\n"); 318 337 319 338 if (WIFEXITED(status)) { 320 fprintf (stdout, "normal completion, exit status is %d\n", WEXITSTATUS(status));339 if (VERBOSE) fprintf (stdout, "normal completion, exit status is %d\n", WEXITSTATUS(status)); 321 340 host->status = WEXITSTATUS(status); 322 341 if (host->status) { -
branches/eam_branches/ipp-20111122/Ohana/src/opihi/cmd.data/Makefile
r31635 r33600 123 123 $(SRC)/swapbytes.$(ARCH).o \ 124 124 $(SRC)/textline.$(ARCH).o \ 125 $(SRC)/threshold.$(ARCH).o \ 125 126 $(SRC)/tv.$(ARCH).o \ 126 127 $(SRC)/tvchannel.$(ARCH).o \ -
branches/eam_branches/ipp-20111122/Ohana/src/opihi/cmd.data/cumulative.c
r20936 r33600 23 23 opihi_flt *Vi = ivec[0].elements.Flt; 24 24 *Vo = *Vi; 25 Vi++; 26 Vo++; 25 27 for (i = 1; i < ivec[0].Nelements; i++, Vi++, Vo++) { 26 28 *Vo = Vo[-1] + *Vi; … … 29 31 opihi_int *Vi = ivec[0].elements.Int; 30 32 *Vo = *Vi; 33 Vi++; 34 Vo++; 31 35 for (i = 1; i < ivec[0].Nelements; i++, Vi++, Vo++) { 32 36 *Vo = Vo[-1] + *Vi; -
branches/eam_branches/ipp-20111122/Ohana/src/opihi/cmd.data/init.c
r33476 r33600 112 112 int swapbytes PROTO((int, char **)); 113 113 int textline PROTO((int, char **)); 114 int threshold PROTO((int, char **)); 114 115 int tv PROTO((int, char **)); 115 116 int tvchannel PROTO((int, char **)); … … 262 263 {1, "swapbytes", swapbytes, "byte swap thing"}, 263 264 {1, "textline", textline, "write text line on graph"}, 265 {1, "threshold", threshold, "find (interpolate) location of transition"}, 264 266 {1, "tv", tv, "display an image on the Kii window"}, 265 267 {1, "tvchannel", tvchannel, "set the current tv channel"}, -
branches/eam_branches/ipp-20111122/Ohana/src/opihi/cmd.data/line.c
r13479 r33600 3 3 int line (int argc, char **argv) { 4 4 5 int kapa ;5 int kapa, N; 6 6 Graphdata graphmode; 7 7 float x[2], y[2]; 8 9 /* FracPositions uses coordinates of 0-1 relative to axis range */ 10 int FracPositions = FALSE; 11 if ((N = get_argument (argc, argv, "-frac"))) { 12 remove_argument (N, &argc, argv); 13 FracPositions = TRUE; 14 } 8 15 9 16 if (!style_args (&graphmode, &argc, argv, &kapa)) return FALSE; … … 18 25 y[1] = atof(argv[5]); 19 26 27 if (FracPositions) { 28 x[0] = x[0] * (graphmode.xmax - graphmode.xmin) + graphmode.xmin; 29 y[0] = y[0] * (graphmode.ymax - graphmode.ymin) + graphmode.ymin; 30 x[1] = x[1] * (graphmode.xmax - graphmode.xmin) + graphmode.xmin; 31 y[1] = y[1] * (graphmode.ymax - graphmode.ymin) + graphmode.ymin; 32 } 33 20 34 /* set point style and errorbar mode (these are NOT sticky) */ 21 35 graphmode.style = 0; -
branches/eam_branches/ipp-20111122/Ohana/src/opihi/dvo/Makefile
r33543 r33600 52 52 $(SRC)/gimages.$(ARCH).o \ 53 53 $(SRC)/gstar.$(ARCH).o \ 54 $(SRC)/hosts.$(ARCH).o \ 54 55 $(SRC)/images.$(ARCH).o \ 55 56 $(SRC)/imbox.$(ARCH).o \ -
branches/eam_branches/ipp-20111122/Ohana/src/opihi/dvo/avextract.c
r33583 r33600 41 41 remove_argument (N, &argc, argv); 42 42 PARALLEL = TRUE; 43 } 44 45 // use remote tables, but not dvo_client.. 46 int PARALLEL_LOCAL = FALSE; 47 HostTable *table = NULL; 48 if ((N = get_argument (argc, argv, "-parallel-local"))) { 49 remove_argument (N, &argc, argv); 50 PARALLEL_LOCAL = TRUE; 51 52 char *CATDIR = GetCATDIR(); 53 if (!CATDIR) { 54 gprint (GP_ERR, "CATDIR is not set\n"); 55 return FALSE; 56 } 57 SkyTable *sky = GetSkyTable(); 58 if (!sky) { 59 gprint (GP_ERR, "failed to load sky table for database\n"); 60 return FALSE; 61 } 62 table = HostTableLoad (CATDIR, sky->hosts); 63 if (!table) { 64 gprint (GP_ERR, "ERROR: failure reading Host Table %s for database %s\n", sky->hosts, CATDIR); 65 return FALSE; 66 } 43 67 } 44 68 … … 96 120 // this does all the work of re-packaging the command, calling it on the remote machines, then loading in the results 97 121 if (PARALLEL && !HOST_ID) { 98 int status = HostTableParallelOps (argc, argv, RESULT_FILE, 0 );122 int status = HostTableParallelOps (argc, argv, RESULT_FILE, 0, VERBOSE); 99 123 100 124 dbFreeFields (fields, Nfields); … … 141 165 /* lock, load, unlock catalog */ 142 166 char hostfile[1024]; 167 if (PARALLEL_LOCAL) { 168 int hostID = skylist[0].regions[i]->hostID; 169 int seq = table->index[hostID]; 170 HOSTDIR = table->hosts[seq].pathname; 171 } 143 172 snprintf (hostfile, 1024, "%s/%s.cpt", HOSTDIR, skylist[0].regions[i]->name); 144 catalog.filename = HOST_ID? hostfile : skylist[0].filename[i];173 catalog.filename = (HOST_ID || PARALLEL_LOCAL) ? hostfile : skylist[0].filename[i]; 145 174 catalog.catflags = LOAD_AVES | LOAD_SECF; 146 175 if (needMeasures) { … … 205 234 } 206 235 236 if (table) free (table); 207 237 if (vec) free (vec); 208 238 if (values) free (values); … … 215 245 216 246 escape: 247 if (table) free (table); 217 248 if (vec) free (vec); 218 249 if (values) free (values); -
branches/eam_branches/ipp-20111122/Ohana/src/opihi/dvo/avmatch.c
r33583 r33600 92 92 93 93 // I need to pass the RA & DEC vectors to the remote clients... 94 int status = HostTableParallelOps (argc, argv, RESULT_FILE, RAvec->Nelements );94 int status = HostTableParallelOps (argc, argv, RESULT_FILE, RAvec->Nelements, VERBOSE); 95 95 if (vec) free (vec); 96 96 -
branches/eam_branches/ipp-20111122/Ohana/src/opihi/dvo/dvo_host_utils.c
r33564 r33600 69 69 // concatenated, but for avmatch, the vectors are merged by index into a pre-known 70 70 // length. this is probably not a solution to a general problem.. 71 int HostTableParallelOps (int argc, char **argv, char *ResultFile, int Nelements ) {71 int HostTableParallelOps (int argc, char **argv, char *ResultFile, int Nelements, int VERBOSE) { 72 72 73 73 int i; … … 135 135 } 136 136 if (!PARALLEL_MANUAL && !PARALLEL_SERIAL) { 137 HostTableWaitJobsGetIO (table, __FILE__, __LINE__ );137 HostTableWaitJobsGetIO (table, __FILE__, __LINE__, VERBOSE); 138 138 } 139 139 … … 146 146 int Ninvec = 0; 147 147 Vector **invec = ReadVectorTableFITS (table->hosts[i].results, "RESULT", &Ninvec); 148 if (!invec) { 149 // failed to read the file, now what? 150 gprint (GP_ERR, "failed to read remote result file : %s\n", table->hosts[i].results); 151 free (table->hosts[i].results); 152 table->hosts[i].results = NULL; 153 continue; 154 } 148 155 free (table->hosts[i].results); 149 156 table->hosts[i].results = NULL; -
branches/eam_branches/ipp-20111122/Ohana/src/opihi/dvo/init.c
r31450 r33600 27 27 int gstar PROTO((int, char **)); 28 28 int gtypes PROTO((int, char **)); 29 int hosts PROTO((int, char **)); 29 30 int images PROTO((int, char **)); 30 31 int imbox PROTO((int, char **)); … … 79 80 {1, "gimages", gimages, "get images at location"}, 80 81 {1, "gstar", gstar, "get star statistics"}, 82 {1, "hosts", hosts, "remote host support functions"}, 81 83 {1, "images", images, "plot image boxes"}, 82 84 {1, "imbox", imbox, "plot expected image box"}, -
branches/eam_branches/ipp-20111122/Ohana/src/opihi/dvo/mextract.c
r33583 r33600 98 98 // this does all the work of re-packaging the command, calling it on the remote machines, then loading in the results 99 99 if (PARALLEL && !HOST_ID) { 100 int status = HostTableParallelOps (argc, argv, RESULT_FILE, 0 );100 int status = HostTableParallelOps (argc, argv, RESULT_FILE, 0, VERBOSE); 101 101 102 102 dbFreeFields (fields, Nfields); -
branches/eam_branches/ipp-20111122/Ohana/src/opihi/include/dvoshell.h
r33563 r33600 100 100 101 101 int HostTableLaunchJobs PROTO((HostTable *table, char *basecmd, char *options)); 102 int HostTableParallelOps PROTO((int argc, char **argv, char *ResultFile, int Nelements ));102 int HostTableParallelOps PROTO((int argc, char **argv, char *ResultFile, int Nelements, int VERBOSE)); 103 103 # endif -
branches/eam_branches/ipp-20111122/Ohana/src/opihi/lib.shell/VectorOps.c
r33543 r33600 122 122 /* is an old vector */ 123 123 if (mode == NEWVECTOR) goto error; 124 if (vectors[i]) { 125 if (vectors[i][0].elements.Ptr) free (vectors[i][0].elements.Ptr); 126 free (vectors[i]); 127 } 124 128 vectors[i] = vec; 125 129 return TRUE; … … 351 355 } 352 356 353 myAssert (*Nvec == Ninvec, "programming error (1) ");357 myAssert (*Nvec == Ninvec, "programming error (1) %d vs %d", *Nvec, Ninvec); 354 358 355 359 for (i = 0; i < Ninvec; i++) { 356 myAssert (!strcmp(vec[i]->name, invec[i]->name), "programming error (2) ");357 myAssert (vec[i]->type == invec[i]->type, "programming error ( 2)");360 myAssert (!strcmp(vec[i]->name, invec[i]->name), "programming error (2) %s vs %s", vec[i]->name, invec[i]->name); 361 myAssert (vec[i]->type == invec[i]->type, "programming error (3), %d vs %d", vec[i]->type, invec[i]->type); 358 362 359 363 int N = vec[i]->Nelements; -
branches/eam_branches/ipp-20111122/Ohana/src/photdbc/src/photdbc_catalogs.c
r33585 r33600 121 121 if (PHOTCODE_DROP_LIST) { snprintf (tmpline, MAX_PATH_LENGTH, "%s -photcode-drop %s", command, PHOTCODE_DROP_LIST); strcpy (command, tmpline); } 122 122 if (PHOTCODE_SKIP_LIST) { snprintf (tmpline, MAX_PATH_LENGTH, "%s -photcode-skip %s", command, PHOTCODE_SKIP_LIST); strcpy (command, tmpline); } 123 if (CATFORMAT) { snprintf (tmpline, MAX_PATH_LENGTH, "%s - catformat %s",command, CATFORMAT); strcpy (command, tmpline); }124 if (CATMODE) { snprintf (tmpline, MAX_PATH_LENGTH, "%s - catmode %s",command, CATMODE); strcpy (command, tmpline); }123 if (CATFORMAT) { snprintf (tmpline, MAX_PATH_LENGTH, "%s -set-format %s", command, CATFORMAT); strcpy (command, tmpline); } 124 if (CATMODE) { snprintf (tmpline, MAX_PATH_LENGTH, "%s -set-mode %s", command, CATMODE); strcpy (command, tmpline); } 125 125 126 126 fprintf (stderr, "command: %s\n", command); … … 151 151 } 152 152 if (!PARALLEL_MANUAL && !PARALLEL_SERIAL) { 153 HostTableWaitJobsGetIO (table, __FILE__, __LINE__ );153 HostTableWaitJobsGetIO (table, __FILE__, __LINE__, VERBOSE); 154 154 } 155 155 -
branches/eam_branches/ipp-20111122/Ohana/src/relastro/src/UpdateObjectOffsets.c
r33580 r33600 159 159 } 160 160 if (!PARALLEL_MANUAL && !PARALLEL_SERIAL) { 161 HostTableWaitJobsGetIO (table, __FILE__, __LINE__ );161 HostTableWaitJobsGetIO (table, __FILE__, __LINE__, VERBOSE); 162 162 } 163 163 -
branches/eam_branches/ipp-20111122/Ohana/src/relastro/src/high_speed_catalogs.c
r33580 r33600 196 196 } 197 197 if (!PARALLEL_MANUAL && !PARALLEL_SERIAL) { 198 HostTableWaitJobsGetIO (table, __FILE__, __LINE__ );198 HostTableWaitJobsGetIO (table, __FILE__, __LINE__, VERBOSE); 199 199 } 200 200 -
branches/eam_branches/ipp-20111122/Ohana/src/relastro/src/load_catalogs.c
r33580 r33600 201 201 } 202 202 if (!PARALLEL_MANUAL && !PARALLEL_SERIAL) { 203 HostTableWaitJobsGetIO (table, __FILE__, __LINE__ );203 HostTableWaitJobsGetIO (table, __FILE__, __LINE__, VERBOSE); 204 204 } 205 205 -
branches/eam_branches/ipp-20111122/Ohana/src/relastro/src/relastro_objects.c
r33580 r33600 187 187 } 188 188 if (!PARALLEL_MANUAL && !PARALLEL_SERIAL) { 189 HostTableWaitJobsGetIO (table, __FILE__, __LINE__ );189 HostTableWaitJobsGetIO (table, __FILE__, __LINE__, VERBOSE); 190 190 } 191 191 -
branches/eam_branches/ipp-20111122/Ohana/src/relphot/src/load_catalogs.c
r33581 r33600 190 190 } 191 191 if (!PARALLEL_MANUAL && !PARALLEL_SERIAL) { 192 HostTableWaitJobsGetIO (table, __FILE__, __LINE__ );192 HostTableWaitJobsGetIO (table, __FILE__, __LINE__, VERBOSE); 193 193 } 194 194 -
branches/eam_branches/ipp-20111122/Ohana/src/relphot/src/reload_catalogs.c
r33581 r33600 201 201 } 202 202 if (!PARALLEL_MANUAL && !PARALLEL_SERIAL) { 203 HostTableWaitJobsGetIO (table, __FILE__, __LINE__ );203 HostTableWaitJobsGetIO (table, __FILE__, __LINE__, VERBOSE); 204 204 } 205 205 return (TRUE); -
branches/eam_branches/ipp-20111122/Ohana/src/relphot/src/relphot_objects.c
r33581 r33600 181 181 } 182 182 if (!PARALLEL_MANUAL && !PARALLEL_SERIAL) { 183 HostTableWaitJobsGetIO (table, __FILE__, __LINE__ );183 HostTableWaitJobsGetIO (table, __FILE__, __LINE__, VERBOSE); 184 184 } 185 185 -
branches/eam_branches/ipp-20111122/Ohana/src/uniphot/src/update_dvo_setphot.c
r33582 r33600 147 147 } 148 148 if (!PARALLEL_MANUAL && !PARALLEL_SERIAL) { 149 int status = HostTableWaitJobsGetIO (table, __FILE__, __LINE__ );149 int status = HostTableWaitJobsGetIO (table, __FILE__, __LINE__, VERBOSE); 150 150 if (!status) return FALSE; 151 151 }
Note:
See TracChangeset
for help on using the changeset viewer.
