- Timestamp:
- Feb 20, 2012, 3:18:25 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20111122/Ohana/src/opihi/dvo/avextract.c
r31450 r33314 1 1 # include "dvoshell.h" 2 3 int HostTableLaunchJobs (HostTable *table, char *basecmd); 4 Vector **MergeVectors (Vector **vec, int *Nvec, Vector **invec, int Ninvec); 5 int HostTableParallelOps (int argc, char **argv, char *ResultFile); 2 6 3 7 int avextract (int argc, char **argv) { … … 37 41 } 38 42 43 int PARALLEL = FALSE; 44 if ((N = get_argument (argc, argv, "-parallel"))) { 45 remove_argument (N, &argc, argv); 46 PARALLEL = TRUE; 47 } 48 49 // dump results directly to fits file (esp for parallel dvo) 50 char *ResultFile = NULL; 51 if ((N = get_argument (argc, argv, "-result"))) { 52 remove_argument (N, &argc, argv); 53 ResultFile = strcreate(argv[N]); 54 remove_argument (N, &argc, argv); 55 } 56 39 57 dvo_catalog_init (&catalog, TRUE); 40 58 … … 43 61 Nsecfilt = GetPhotcodeNsecfilt (); 44 62 45 // parse skyregion options 63 // parse skyregion options. NOTE: this is stripped off in parallel operation and always 64 // defined for the client via the -skyregion option. The dvo_client parses this 65 // argument in the main program, before it is passed to the command (like mextract) 46 66 if ((selection = SetRegionSelection (&argc, argv)) == NULL) { 47 67 print_error(); 48 68 goto escape; 69 } 70 71 // this does all the work of re-packaging the command, calling it on the remote machines, then loading in the results 72 if (PARALLEL && !HOST_ID) { 73 // not all parallel ops need to set the region selection... 74 if (!SetSkyRegions (selection)) goto escape; 75 76 int status = HostTableParallelOps (argc, argv, ResultFile); 77 return status; 49 78 } 50 79 … … 114 143 interrupt = FALSE; 115 144 for (i = 0; (i < skylist[0].Nregions) && !interrupt; i++) { 145 // parallel case, wrong client 146 if (HOST_ID && (HOST_ID != skylist[0].regions[i]->hostID)) continue; 147 116 148 /* lock, load, unlock catalog */ 117 catalog.filename = skylist[0].filename[i]; 149 char hostfile[1024]; 150 snprintf (hostfile, 1024, "%s/%s.cpt", HOSTDIR, skylist[0].regions[i]->name); 151 catalog.filename = HOST_ID ? hostfile : skylist[0].filename[i]; 118 152 catalog.catflags = LOAD_AVES | LOAD_SECF; 119 153 if (needMeasures) { … … 169 203 interrupt = FALSE; 170 204 for (n = 0; n < Nreturn; n++) { 171 vec[n][0].Nelements = Npts; 172 if (vec[n][0].type == OPIHI_FLT) { 173 REALLOCATE (vec[n][0].elements.Flt, opihi_flt, MAX(1,Npts)); 174 } else { 175 REALLOCATE (vec[n][0].elements.Int, opihi_int, MAX(1,Npts)); 176 } 205 ResetVector (vec[n], fields[n].type, Npts); 206 } 207 208 // write vectors to a table (this is used by parallel dvo operations, but can be used elsewhere) 209 if (ResultFile) { 210 int status = WriteVectorTableFITS (ResultFile, "RESULT", vec, Nreturn, FALSE, NULL); 211 if (!status) goto escape; 177 212 } 178 213
Note:
See TracChangeset
for help on using the changeset viewer.
