Changeset 33328
- Timestamp:
- Feb 21, 2012, 8:53:51 PM (14 years ago)
- Location:
- branches/eam_branches/ipp-20111122/Ohana/src/relphot
- Files:
-
- 8 edited
-
Makefile (modified) (1 diff)
-
include/relphot.h (modified) (2 diffs)
-
src/StarOps.c (modified) (1 diff)
-
src/args.c (modified) (1 diff)
-
src/help.c (modified) (2 diffs)
-
src/relphot.c (modified) (1 diff)
-
src/relphot_client.c (modified) (1 diff)
-
src/relphot_objects.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20111122/Ohana/src/relphot/Makefile
r33254 r33328 71 71 $(SRC)/load_catalogs.$(ARCH).o \ 72 72 $(SRC)/reload_catalogs.$(ARCH).o \ 73 $(SRC)/relphot_objects.$(ARCH).o \ 73 74 $(SRC)/relphot_client.$(ARCH).o \ 74 75 $(SRC)/setExclusions.$(ARCH).o \ -
branches/eam_branches/ipp-20111122/Ohana/src/relphot/include/relphot.h
r33303 r33328 12 12 MODE_LOAD = 1, 13 13 MODE_UPDATE = 2, 14 MODE_UPDATE_OBJECTS = 3, 14 15 } ModeType; 15 16 … … 286 287 void wimages PROTO((void)); 287 288 void write_coords PROTO((Header *header, Coords *coords)); 288 int relphot_objects ( void);289 int relphot_objects (int hostID, char *hostpath); 289 290 290 291 void relphot_usage (void); -
branches/eam_branches/ipp-20111122/Ohana/src/relphot/src/StarOps.c
r33169 r33328 239 239 // NOTE: this function operates on the real Measure & Average structures, not the 240 240 // MeasureTiny & AverageTiny structures 241 // NOTE: this function is called on the remote machine -- make sure any (global) options 242 // are passed to the relphot_client program 241 243 int setMave (Catalog *catalog, int Ncatalog) { 242 244 -
branches/eam_branches/ipp-20111122/Ohana/src/relphot/src/args.c
r33303 r33328 352 352 remove_argument (N, &argc, argv); 353 353 } 354 if ((N = get_argument (argc, argv, "-update-objects"))) { 355 if (MODE) { 356 fprintf (stderr, "ERROR: cannot mix modes (-load, -update, -update-objects)\n"); 357 relphot_client_usage(); 358 } 359 MODE = MODE_UPDATE_OBJECTS; 360 remove_argument (N, &argc, argv); 361 } 354 362 if (!MODE) relphot_client_usage(); 355 363 -
branches/eam_branches/ipp-20111122/Ohana/src/relphot/src/help.c
r33274 r33328 47 47 fprintf (stderr, "ERROR: USAGE: relphot (photcodes) -load (filename) -hostID (hostID) -hostdir (hostdir) [options]\n"); 48 48 fprintf (stderr, " or: relphot -update (filename) -hostID (hostID) -hostdir (hostdir) [options]\n"); 49 fprintf (stderr, " or: relphot -update-objects -hostID (hostID) -hostdir (hostdir) [options]\n"); 49 50 fprintf (stderr, " use -h for more usage information\n"); 50 51 exit (2); … … 65 66 fprintf (stderr, " relphot_client -update (images) : apply calculated zero points to the client's tables\n\n"); 66 67 fprintf (stderr, " (images) : location of the table with the image zero points\n"); 68 fprintf (stderr, " relphot_client -update-objects : determine average magnitudes for objects\n\n"); 67 69 fprintf (stderr, " db info : -hostID (hostID) -hostdir (hostdir) -catdir (catdir)\n"); 68 70 fprintf (stderr, "other options:\n"); 69 fprintf (stderr, " -v : verbose output\n"); 71 fprintf (stderr, " -v : verbose output\n"); 72 fprintf (stderr, " -vv : extra verbose output\n"); 70 73 fprintf (stderr, " \n"); 71 74 exit (2); -
branches/eam_branches/ipp-20111122/Ohana/src/relphot/src/relphot.c
r33274 r33328 22 22 /* the object analysis is a separate process iterating over catalogs */ 23 23 if (UpdateAverages) { 24 relphot_objects ( );24 relphot_objects (0, NULL); 25 25 exit (0); 26 26 } -
branches/eam_branches/ipp-20111122/Ohana/src/relphot/src/relphot_client.c
r33301 r33328 71 71 } 72 72 73 case MODE_UPDATE_OBJECTS: { 74 relphot_objects (HOST_ID, HOSTDIR); 75 break; 76 } 77 73 78 default: 74 79 fprintf (stderr, "impossible!"); -
branches/eam_branches/ipp-20111122/Ohana/src/relphot/src/relphot_objects.c
r33117 r33328 6 6 // has been correctly propagated to the measurement, the average will respect that value. 7 7 8 int relphot_objects () { 8 int relphot_objects_parallel (SkyList *sky); 9 10 int relphot_objects (int hostID, char *hostpath) { 9 11 10 12 off_t i, j, k; … … 22 24 skylist = SkyListByPatch (sky, -1, &UserPatch); 23 25 26 // XXX need to decide how to determine PARALLEL mode... 27 if (PARALLEL & !hostID) { 28 relphot_objects_parallel (skylist); 29 return TRUE; 30 } 31 24 32 // load data from each region file, only use bright stars 25 33 for (i = 0; i < skylist[0].Nregions; i++) { 26 34 35 if (hostID && (skylist[0].regions[i]->hostID != hostID)) continue; 36 27 37 // set up the basic catalog info 28 catalog.filename = skylist[0].filename[i]; 38 // set up the basic catalog info 39 char hostfile[1024]; 40 snprintf (hostfile, 1024, "%s/%s.cpt", hostpath, skylist[0].regions[i]->name); 41 catalog.filename = hostID ? hostfile : skylist[0].filename[i]; 29 42 catalog.catformat = dvo_catalog_catformat (CATFORMAT); // set the default catformat from config data 30 43 catalog.catmode = dvo_catalog_catmode (CATMODE); // set the default catmode from config data … … 43 56 } 44 57 58 // XXX need to respect UBERCAL measurements (and not reset them?) 45 59 // reset 46 60 if (RESET) { … … 81 95 return (TRUE); 82 96 } 97 98 // CATDIR is supplied globally 99 # define DEBUG 1 100 int relphot_objects_parallel (SkyList *sky) { 101 102 // launch the setphot_client jobs to the parallel hosts 103 104 // load the list of hosts 105 HostTable *table = HostTableLoad (CATDIR, sky->hosts); 106 if (!table) { 107 fprintf (stderr, "ERROR: failure reading Host Table %s for database %s\n", sky->hosts, CATDIR); 108 exit (1); 109 } 110 111 int i; 112 for (i = 0; i < table->Nhosts; i++) { 113 114 // ensure that the paths are absolute path names 115 char *tmppath = abspath (table->hosts[i].pathname, MAX_PATH_LENGTH); 116 free (table->hosts[i].pathname); 117 table->hosts[i].pathname = tmppath; 118 119 char catalogFile[512]; 120 snprintf (catalogFile, 512, "%s/relphot.catalog.subset.dat", table->hosts[i].pathname); 121 122 // options / arguments that can affect relphot_client -update-objects: 123 // VERBOSE, VERBOSE2 124 // KEEP_UBERCAL 125 // RESET (-reset) 126 // TimeSelect -time 127 // DophotSelect 128 // (note that psfQual is applied rigidly at 0.85, as is the galaxy test) 129 // MAG_LIM 130 // SIGMA_LIM 131 // ImagSelect, ImagMin, ImagMax 132 // MaxDensityUse, MaxDensityValue 133 134 char command[1024]; 135 snprintf (command, 1024, "relphot_client -update-objects -hostID %d -D CATDIR %s -hostdir %s -region %f %f %f %f", 136 table->hosts[i].hostID, CATDIR, table->hosts[i].pathname, UserPatch.Rmin, UserPatch.Rmax, UserPatch.Dmin, UserPatch.Dmax); 137 138 char tmpline[1024]; 139 if (VERBOSE) { snprintf (tmpline, 1024, "%s -v", command); strcpy (command, tmpline); } 140 if (VERBOSE2) { snprintf (tmpline, 1024, "%s -vv", command); strcpy (command, tmpline); } 141 if (RESET) { snprintf (tmpline, 1024, "%s -reset", command); strcpy (command, tmpline); } 142 if (KEEP_UBERCAL) { snprintf (tmpline, 1024, "%s -keep-ubercal", command); strcpy (command, tmpline); } 143 144 fprintf (stderr, "command: %s\n", command); 145 146 if (PARALLEL_MANUAL) continue; 147 148 if (PARALLEL_SERIAL) { 149 int status = system (command); 150 if (status) { 151 fprintf (stderr, "ERROR running relphot_client\n"); 152 exit (2); 153 } 154 } else { 155 // launch the job on the remote machine (no handshake) 156 int errorInfo = 0; 157 int pid = rconnect ("ssh", table->hosts[i].hostname, command, table->hosts[i].stdio, &errorInfo, FALSE); 158 if (!pid) { 159 if (DEBUG) fprintf (stderr, "failure to start %s (error %d)\n", table->hosts[i].hostname, errorInfo); 160 exit (1); 161 } 162 table->hosts[i].pid = pid; // save for future reference 163 } 164 } 165 166 if (PARALLEL_MANUAL) { 167 fprintf (stderr, "run the relphot_client commands above. when these are done, hit return\n"); 168 getchar(); 169 } 170 if (!PARALLEL_MANUAL && !PARALLEL_SERIAL) { 171 HostTableWaitJobs (table, __FILE__, __LINE__); 172 } 173 174 return TRUE; 175 }
Note:
See TracChangeset
for help on using the changeset viewer.
