Changeset 33944 for branches/eam_branches/ipp-20120405/Ohana
- Timestamp:
- May 29, 2012, 4:18:58 PM (14 years ago)
- Location:
- branches/eam_branches/ipp-20120405/Ohana/src/opihi
- Files:
-
- 8 edited
-
cmd.data/threshold.c (modified) (2 diffs)
-
dvo/avextract.c (modified) (4 diffs)
-
dvo/avmatch.c (modified) (2 diffs)
-
dvo/dvo_host_utils.c (modified) (4 diffs)
-
dvo/mextract.c (modified) (1 diff)
-
dvo/remote.c (modified) (2 diffs)
-
lib.shell/VectorIO.c (modified) (1 diff)
-
lib.shell/startup.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20120405/Ohana/src/opihi/cmd.data/threshold.c
r33662 r33944 69 69 x0 = isFltX ? vecx[0].elements.Flt[Nhi] : vecy[0].elements.Int[Nhi]; 70 70 x1 = isFltX ? vecx[0].elements.Flt[Nhi+1] : vecy[0].elements.Int[Nhi+1]; 71 Xvalue = (value - y0) * (x1 - x0) / (y1 - y0) + x0; 71 if (y0 == y1) { 72 Xvalue = 0.5*(x0 + x1); 73 } else { 74 Xvalue = (value - y0) * (x1 - x0) / (y1 - y0) + x0; 75 } 72 76 } else { 73 77 // interpolate to value: … … 76 80 x0 = isFltX ? vecx[0].elements.Flt[Nhi-1] : vecy[0].elements.Int[Nhi-1]; 77 81 x1 = isFltX ? vecx[0].elements.Flt[Nhi] : vecy[0].elements.Int[Nhi]; 78 Xvalue = (value - y0) * (x1 - x0) / (y1 - y0) + x0; 82 if (y0 == y1) { 83 Xvalue = 0.5*(x0 + x1); 84 } else { 85 Xvalue = (value - y0) * (x1 - x0) / (y1 - y0) + x0; 86 } 79 87 } 80 88 -
branches/eam_branches/ipp-20120405/Ohana/src/opihi/dvo/avextract.c
r33827 r33944 74 74 } 75 75 76 // this is used to NOT save the results in the results file 77 // use this option when mextract is used in a script which does its 78 // own job of packaging the results 79 int SKIP_RESULTS = FALSE; 80 if ((N = get_argument (argc, argv, "-skip-results"))) { 81 remove_argument (N, &argc, argv); 82 SKIP_RESULTS = TRUE; 83 } 84 76 85 dvo_catalog_init (&catalog, TRUE); 77 86 … … 87 96 goto escape; 88 97 } 98 99 // init locally static variables (time refs) 100 dbExtractAveragesInit (); 89 101 90 102 // command-line is of the form: avextract field,field, field [where (field op value)...] … … 198 210 m = catalog.average[j].measureOffset; 199 211 200 // reset counters for saved fields, extract fields201 dbExtractAveragesInit (); 212 dbExtractAveragesInitAve (); // reset counters for saved fields (costs very little) 213 202 214 for (n = 0; n < Nfields; n++) { 203 215 values[n] = dbExtractAverages (&catalog.average[j], &catalog.secfilt[j*Nsecfilt], &catalog.measure[m], &fields[n]); … … 234 246 235 247 // write vectors to a table (this is used by parallel dvo operations, but can be used elsewhere) 236 if (RESULT_FILE ) {248 if (RESULT_FILE && !SKIP_RESULTS) { 237 249 int status = WriteVectorTableFITS (RESULT_FILE, "RESULT", vec, Nreturn, FALSE, NULL); 238 if (!status) goto escape; 250 if (!status) { 251 goto escape; 252 } 239 253 } 240 254 -
branches/eam_branches/ipp-20120405/Ohana/src/opihi/dvo/avmatch.c
r33827 r33944 66 66 if (!InitPhotcodes ()) goto escape; 67 67 Nsecfilt = GetPhotcodeNsecfilt (); 68 69 // init locally static variables (time refs) 70 dbExtractAveragesInit (); 68 71 69 72 // this does all the work of re-packaging the command, calling it on the remote machines, then loading in the results … … 206 209 207 210 // reset counters for saved fields, extract fields 208 dbExtractAveragesInit ();211 dbExtractAveragesInitAve (); 209 212 for (n = 0; n < Nfields; n++) { 210 213 values[n] = dbExtractAverages (&catalog.average[Ncat], &catalog.secfilt[Ncat*Nsecfilt], &catalog.measure[m], &fields[n]); -
branches/eam_branches/ipp-20120405/Ohana/src/opihi/dvo/dvo_host_utils.c
r33912 r33944 6 6 # define DVO_MAX_PATH 1024 7 7 8 # define DIE(WHO,MSG) { perror(WHO); myAbort(MSG); } 9 8 10 int HostTableLaunchJobs (HostTable *table, char *basecmd, char *options, int VERBOSE) { 9 11 … … 33 35 FILE *f = fopen (commandFile, "w"); 34 36 fprintf (f, "%s\n", basecmd); 35 fclose (f); 37 if (fflush (f)) DIE("flush", "failed to flush"); 38 39 int fd = fileno (f); 40 if (fsync (fd)) DIE("fsync", "failed to fsync"); 41 42 if (fclose (f)) DIE("close", "failed to close"); 43 44 // force NFS to write the file to disk 45 int state; 46 f = fsetlockfile (commandFile, 0.5, LCK_XCLD, &state); 47 fclearlockfile (commandFile, f, LCK_XCLD, &state); 36 48 37 49 char command[1024]; … … 216 228 Vector **vec = NULL; 217 229 for (i = 0; i < table->Nhosts; i++) { 218 if (table->hosts[i].status) continue;219 220 230 // ensure that the paths are absolute path names 221 231 char *tmppath = abspath (table->hosts[i].pathname, DVO_MAX_PATH); … … 240 250 table->hosts[i].results = NULL; 241 251 252 // fprintf (stderr, "%s : %d\n", table->hosts[i].pathname, invec[0]->Nelements); 253 242 254 vec = MergeVectors (vec, &Nvec, invec, Ninvec); 243 255 if (vec != invec) { -
branches/eam_branches/ipp-20120405/Ohana/src/opihi/dvo/mextract.c
r33662 r33944 189 189 } 190 190 191 dbExtractMeasuresInitAve (); // reset counters for saved fields (costs very little 191 dbExtractMeasuresInitAve (); // reset counters for saved fields (costs very little) 192 192 193 193 for (k = 0; (k < catalog.average[j].Nmeasure); k++, m++) { -
branches/eam_branches/ipp-20120405/Ohana/src/opihi/dvo/remote.c
r33911 r33944 31 31 32 32 if ((N = get_argument (argc, argv, "-reload"))) { 33 if (argc != N) { 33 remove_argument (N, &argc, argv); 34 if (argc != 2) { 34 35 gprint (GP_ERR, "USAGE: remote -reload (uniquer)\n"); 35 36 gprint (GP_ERR, " (uniquer) is the element in the middle of the results file\n"); … … 37 38 return FALSE; 38 39 } 39 remove_argument (N, &argc, argv);40 40 int status = HostTableReloadResults (argv[1], VERBOSE); 41 41 return status; -
branches/eam_branches/ipp-20120405/Ohana/src/opihi/lib.shell/VectorIO.c
r33662 r33944 20 20 } 21 21 if (f == (FILE *) NULL) { 22 gprint (GP_ERR, "can't open file for write \n");22 gprint (GP_ERR, "can't open file for write : %s\n", filename); 23 23 return (FALSE); 24 24 } -
branches/eam_branches/ipp-20120405/Ohana/src/opihi/lib.shell/startup.c
r27998 r33944 138 138 if (is_script) { 139 139 /* first argument in input script, rest are argv */ 140 set_str_variable ("SCRIPT_NAME", argv[1]); 140 141 list[Nlist] = strcreate (argv[1]); 141 142 Nlist ++;
Note:
See TracChangeset
for help on using the changeset viewer.
