Changeset 33297
- Timestamp:
- Feb 16, 2012, 3:41:58 PM (14 years ago)
- Location:
- branches/eam_branches/ipp-20111122/Ohana/src
- Files:
-
- 7 edited
-
addstar/test/relphot.parallel.dvo (modified) (2 diffs)
-
relphot/include/relphot.h (modified) (2 diffs)
-
relphot/src/ImageSubset.c (modified) (5 diffs)
-
relphot/src/args.c (modified) (4 diffs)
-
relphot/src/initialize.c (modified) (4 diffs)
-
relphot/src/load_catalogs.c (modified) (2 diffs)
-
relphot/src/reload_catalogs.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20111122/Ohana/src/addstar/test/relphot.parallel.dvo
r33288 r33297 114 114 end 115 115 116 # XXX tmp 117 exec rsync -aub $catdir/ $catdir.raw/ 118 116 119 # parallel-ize the database 117 120 mkparallel $catdir … … 130 133 # run relphot on the parallel db and check that the images now match the expected values 131 134 exec relphot -parallel-serial g,r,i -v -region 9.5 10.5 19.5 20.5 -D CATDIR $catdir.p0 -D STAR_TOOFEW 1 -D SIGMA_LIM 0.07 -statmode WT_MEAN -cloud-limit 0.5 -keep-ubercal -D IMAGE_OFFSET 0.5 -update >& log.relphot.p0 135 136 exec dvodist -in $catdir.p0 132 137 133 138 for i 0 mjd_nc[] -
branches/eam_branches/ipp-20111122/Ohana/src/relphot/include/relphot.h
r33274 r33297 100 100 int PARALLEL; 101 101 int PARALLEL_MANUAL; 102 int PARALLEL_SERIAL; 102 103 103 104 int VERBOSE; … … 129 130 int PLOTDELAY; 130 131 int UpdateAverages; 132 133 char *PhotcodeList; 131 134 132 135 int RELPHOT_GRID_X; -
branches/eam_branches/ipp-20111122/Ohana/src/relphot/src/ImageSubset.c
r33254 r33297 41 41 42 42 // load data for this header 43 if (!gfits_load_header (f, &theader)) return (NULL); 43 if (!gfits_load_header (f, &theader)) { 44 fclose (f); 45 return (NULL); 46 } 44 47 45 48 // read the fits table bytes 46 if (!gfits_fread_ftable_data (f, &ftable, FALSE)) return (NULL); 47 48 // XXX close the fits file here 49 if (!gfits_fread_ftable_data (f, &ftable, FALSE)) { 50 fclose (f); 51 return (NULL); 52 } 53 fclose (f); 49 54 50 55 // a bit annoying : we read the entire block of data, then extract the columns, then set the image structure values. … … 59 64 GET_COLUMN (flags, "FLAGS", int); 60 65 GET_COLUMN (tzero, "TZERO", int); 61 GET_COLUMN (trate, "TRATE", char);66 GET_COLUMN (trate, "TRATE", short); 62 67 63 68 // XXX free the fits table data here … … 117 122 float *Mcal, *dMcal; 118 123 unsigned int *imageID, *map, *flags, *tzero; 119 unsigned char*trate;124 unsigned short *trate; 120 125 121 // create interme diate storage arrays122 ALLOCATE (Mcal, float, Nimage);123 ALLOCATE (dMcal, float, Nimage);124 ALLOCATE (imageID, unsigned int, Nimage);125 ALLOCATE (map, unsigned int, Nimage);126 ALLOCATE (flags, unsigned int, Nimage);127 ALLOCATE (tzero, unsigned int, Nimage);128 ALLOCATE (trate, unsigned char, Nimage);126 // create intermediate storage arrays 127 ALLOCATE (Mcal, float, Nimage); 128 ALLOCATE (dMcal, float, Nimage); 129 ALLOCATE (imageID, unsigned int, Nimage); 130 ALLOCATE (map, unsigned int, Nimage); 131 ALLOCATE (flags, unsigned int, Nimage); 132 ALLOCATE (tzero, unsigned int, Nimage); 133 ALLOCATE (trate, unsigned short, Nimage); 129 134 130 135 // assign the storage arrays … … 137 142 tzero[i] = image[i].tzero; 138 143 trate[i] = image[i].trate; 144 fprintf (stderr, "time: %d, trate: %d\n", image[i].tzero, image[i].trate); 139 145 } 140 146 … … 172 178 gfits_free_table (&ftable); 173 179 180 fclose (f); 181 fflush (f); 182 174 183 return TRUE; 175 184 } -
branches/eam_branches/ipp-20111122/Ohana/src/relphot/src/args.c
r33274 r33297 89 89 remove_argument (N, &argc, argv); 90 90 } 91 // this is a test mode : rather than launching the relphot_client jobs remotely, they are 92 // run in serial via 'system' 93 PARALLEL_SERIAL = FALSE; 94 if ((N = get_argument (argc, argv, "-parallel-serial"))) { 95 if (PARALLEL_MANUAL) { 96 fprintf (stderr, "ERROR: cannot mix -parallel-manual and -parallel-serial\n"); 97 exit (1); 98 } 99 PARALLEL = TRUE; // -parallel-serial implies -parallel 100 PARALLEL_SERIAL = TRUE; 101 remove_argument (N, &argc, argv); 102 } 91 103 92 104 PLOTSTUFF = FALSE; … … 112 124 } 113 125 114 strcpy (STATMODE, " CHI_INNER_WTMEAN");126 strcpy (STATMODE, "WT_MEAN"); 115 127 if ((N = get_argument (argc, argv, "-statmode"))) { 116 128 remove_argument (N, &argc, argv); … … 293 305 // by definition, the client is not parallel 294 306 PARALLEL = FALSE; 307 PARALLEL_MANUAL = FALSE; 308 PARALLEL_SERIAL = FALSE; 295 309 296 310 if ((N = get_argument (argc, argv, "-v"))) { … … 344 358 if (!MODE) relphot_client_usage(); 345 359 360 strcpy (STATMODE, "WT_MEAN"); 361 if ((N = get_argument (argc, argv, "-statmode"))) { 362 remove_argument (N, &argc, argv); 363 strcpy (STATMODE, argv[N]); 364 remove_argument (N, &argc, argv); 365 } 366 346 367 /* specify portion of the sky */ 347 368 UserPatch.Rmin = 0; -
branches/eam_branches/ipp-20111122/Ohana/src/relphot/src/initialize.c
r33274 r33297 12 12 // load the list of photcodes into the globals (photcodes, Nphotcodes) 13 13 // only a single remaining argument in this mode (the list of photcodes, eg g,r,i) 14 ParsePhotcodeList (argv[1]); 14 PhotcodeList = strcreate (argv[1]); 15 ParsePhotcodeList (PhotcodeList); 15 16 } 16 17 if (USE_GRID && (Nphotcodes > 1)) { … … 58 59 void initialize_client (int argc, char **argv) { 59 60 61 // XXX need to determine which globals can affect relphot_client in either mode and pass appropriately 62 60 63 relphot_client_help (argc, argv); 61 64 ConfigInit (&argc, argv); … … 63 66 64 67 // load the list of photcodes into the globals (photcodes, Nphotcodes) 65 ParsePhotcodeList (argv[1]); 68 PhotcodeList = strcreate (argv[1]); 69 ParsePhotcodeList (PhotcodeList); 66 70 } 67 71 … … 80 84 while ((codename = strtok_r (list, ",", &ptr)) != NULL) { 81 85 list = NULL; // pass NULL on successive strtok_r calls 82 fprintf (stderr, "PHOTCODE LIST: %s\n", myList);83 fprintf (stderr, "codename: %s\n", codename);84 86 if ((photcodes[Nphotcodes] = GetPhotcodebyName (codename)) == NULL) { 85 87 fprintf (stderr, "ERROR: photcode %s not found in photcode table\n", codename); -
branches/eam_branches/ipp-20111122/Ohana/src/relphot/src/load_catalogs.c
r33274 r33297 76 76 77 77 fprintf (stderr, "using "OFF_T_FMT" of "OFF_T_FMT" stars ("OFF_T_FMT" of "OFF_T_FMT" measurements)\n", Nstar, Nstar_total, Nmeas, Nmeas_total); 78 if (Nstar < 1) Shutdown ("%s", "ERROR: no stars match the minimum requirements; exiting \n"); 78 if (!hostID && (Nstar < 1)) Shutdown ("%s", "ERROR: no stars match the minimum requirements; exiting \n"); 79 // in regular relphot, we shutdown here; in relphot_client, we generate and return an empty table (for consistency) 79 80 80 81 … … 108 109 109 110 char command[1024]; 110 snprintf (command, 1024, "relphot_client -test -load %s -hostID %d -catdir%s -hostdir %s",111 catalogFile, table->hosts[i].hostID, CATDIR, table->hosts[i].pathname);111 snprintf (command, 1024, "relphot_client %s -load %s -hostID %d -D CATDIR %s -hostdir %s", 112 PhotcodeList, catalogFile, table->hosts[i].hostID, CATDIR, table->hosts[i].pathname); 112 113 113 114 fprintf (stderr, "command: %s\n", command); 114 115 115 if (!PARALLEL_MANUAL) { 116 if (PARALLEL_MANUAL) continue; 117 118 if (PARALLEL_SERIAL) { 119 int status = system (command); 120 if (status) { 121 fprintf (stderr, "ERROR running relphot_client\n"); 122 exit (2); 123 } 124 } else { 116 125 // launch the job on the remote machine (no handshake) 117 126 int errorInfo = 0; -
branches/eam_branches/ipp-20111122/Ohana/src/relphot/src/reload_catalogs.c
r33274 r33297 134 134 135 135 char command[1024]; 136 snprintf (command, 1024, "relphot_client -reload %s -hostname %s -catdir%s -hostdir %s",137 imageFile, table->hosts[i].hostname, CATDIR, table->hosts[i].pathname);136 snprintf (command, 1024, "relphot_client %s -update %s -hostID %d -D CATDIR %s -hostdir %s", 137 PhotcodeList, imageFile, table->hosts[i].hostID, CATDIR, table->hosts[i].pathname); 138 138 139 139 fprintf (stderr, "command: %s\n", command); 140 140 141 if (!PARALLEL_MANUAL) { 141 if (PARALLEL_MANUAL) continue; 142 143 if (PARALLEL_SERIAL) { 144 int status = system (command); 145 if (status) { 146 fprintf (stderr, "ERROR running relphot_client\n"); 147 exit (2); 148 } 149 } else { 142 150 // launch the job on the remote machine (no handshake) 143 151 int errorInfo = 0;
Note:
See TracChangeset
for help on using the changeset viewer.
