Changeset 36520
- Timestamp:
- Feb 18, 2014, 10:22:56 AM (12 years ago)
- Location:
- branches/eam_branches/ipp-20140206/Ohana/src
- Files:
-
- 10 edited
-
libdvo/include/dvo.h (modified) (2 diffs)
-
libdvo/src/RegionHostTable.c (modified) (4 diffs)
-
libdvo/src/dvo_photcode_ops.c (modified) (1 diff)
-
relphot/include/relphot.h (modified) (1 diff)
-
relphot/src/MeanMagIO.c (modified) (3 diffs)
-
relphot/src/assign_images.c (modified) (1 diff)
-
relphot/src/indexCatalog.c (modified) (1 diff)
-
relphot/src/relphot_parallel_regions.c (modified) (2 diffs)
-
relphot/src/share_image_mags.c (modified) (7 diffs)
-
relphot/src/share_mean_mags.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20140206/Ohana/src/libdvo/include/dvo.h
r36519 r36520 291 291 double Dmin; 292 292 double Dmax; 293 294 char *hostname; 295 293 296 int hostID; // remove machine ID in SkyTable 294 297 int stdio[3]; // fd's for communication with the remote host 295 298 int pid; // remote process ID 296 char *hostname; 297 298 int line_numbers; 299 int status; 299 300 300 301 off_t Nimage; 301 302 off_t NIMAGE; 302 303 Image *image; 304 int line_numbers; 303 305 } RegionHostInfo; 304 306 305 307 typedef struct { 308 double Rmin; 309 double Rmax; 310 double Dmin; 311 double Dmax; 312 306 313 int Nhosts; 307 314 RegionHostInfo *hosts; … … 849 856 void FreeRegionHostTable (RegionHostTable *table); 850 857 RegionHostTable *RegionHostTableLoad (char *catdir, char *rootname); 858 int RegionHostTableWaitJobs (RegionHostTable *regionHosts, char *file, int lineno); 851 859 852 860 # endif // DVO_H -
branches/eam_branches/ipp-20140206/Ohana/src/libdvo/src/RegionHostTable.c
r36519 r36520 72 72 int maxID = 0; 73 73 74 RegionHostTable *table = NULL; 75 ALLOCATE (table, RegionHostTable, 1); 76 table->Rmin = 360; 77 table->Rmax = 0; 78 table->Dmin = +90; 79 table->Dmax = -90; 80 74 81 for (Nline = 0; TRUE; Nline ++) { 75 82 int ID; … … 85 92 if (line[i] == '#') continue; 86 93 if (line[i] == 0) continue; 87 88 UserPatch.Rmin = 360;89 UserPatch.Rmax = 0;90 UserPatch.Dmin = +90;91 UserPatch.Dmax = -90;92 94 93 95 double Rmin, Rmax, Dmin, Dmax; … … 121 123 hosts[Nhosts].Dmax = Dmax; 122 124 123 UserPatch.Rmin = MIN(Rmin, UserPatch.Rmin);124 UserPatch.Rmax = MIN(Rmax, UserPatch.Rmax);125 UserPatch.Dmin = MIN(Dmin, UserPatch.Dmin);126 UserPatch.Dmax = MIN(Dmax, UserPatch.Dmax);125 table->Rmin = MIN(Rmin, table->Rmin); 126 table->Rmax = MIN(Rmax, table->Rmax); 127 table->Dmin = MIN(Dmin, table->Dmin); 128 table->Dmax = MIN(Dmax, table->Dmax); 127 129 128 130 // InitIOBuffer (&hosts[Nhosts].stdout, 1000); … … 137 139 } 138 140 139 RegionHostTable *table = NULL;140 ALLOCATE (table, RegionHostTable, 1);141 141 table->Nhosts = Nhosts; 142 142 table->hosts = hosts; -
branches/eam_branches/ipp-20140206/Ohana/src/libdvo/src/dvo_photcode_ops.c
r34844 r36520 169 169 } 170 170 171 // returns Nsec if code is PRI/SEC, else -1 171 172 int GetPhotcodeNsec (int code) { 172 173 -
branches/eam_branches/ipp-20140206/Ohana/src/relphot/include/relphot.h
r36519 r36520 118 118 unsigned int objID; 119 119 unsigned int catID; 120 int photcode; 120 121 } MeanMag; 121 122 -
branches/eam_branches/ipp-20140206/Ohana/src/relphot/src/MeanMagIO.c
r36518 r36520 67 67 ALLOCATE (meanmags, MeanMag, Nrow); 68 68 for (i = 0; i < Nrow; i++) { 69 meanma n[i].M = M [i];70 meanma n[i].dM = dM [i];71 meanma n[i].Xm = Xm [i];72 meanma n[i].Nsec = Nsec [i];73 meanma n[i].objID = objID[i];74 meanma n[i].catID = catID[i];69 meanmags[i].M = M [i]; 70 meanmags[i].dM = dM [i]; 71 meanmags[i].Xm = Xm [i]; 72 meanmags[i].Nsec = Nsec [i]; 73 meanmags[i].objID = objID[i]; 74 meanmags[i].catID = catID[i]; 75 75 } 76 76 fprintf (stderr, "loaded data for %lld images\n", (long long) Nrow); … … 83 83 free (catID); 84 84 85 *nmeanmag = Nrow;86 return meanma n;85 *nmeanmags = Nrow; 86 return meanmags; 87 87 } 88 88 … … 133 133 // assign the storage arrays 134 134 for (i = 0; i < Nmeanmags; i++) { 135 M [i] = meanmag [i].M ;136 dM [i] = meanmag [i].dM ;137 Xm [i] = meanmag [i].Xm ;138 Nsec [i] = meanmag [i].Nsec ;139 objID[i] = meanmag [i].objID;140 catID[i] = meanmag [i].catID;135 M [i] = meanmags[i].M ; 136 dM [i] = meanmags[i].dM ; 137 Xm [i] = meanmags[i].Xm ; 138 Nsec [i] = meanmags[i].Nsec ; 139 objID[i] = meanmags[i].objID; 140 catID[i] = meanmags[i].catID; 141 141 } 142 142 -
branches/eam_branches/ipp-20140206/Ohana/src/relphot/src/assign_images.c
r36519 r36520 36 36 int select_images_hostregion (RegionHostTable *regionHosts, Image *image, off_t Nimage) { 37 37 38 int i, j, ecode, found; 38 int ecode, found; 39 off_t i, j; 39 40 40 41 // INITTIME; -
branches/eam_branches/ipp-20140206/Ohana/src/relphot/src/indexCatalog.c
r36518 r36520 8 8 // find the max value of catID 9 9 int catIDmax = 0; 10 11 int i; 12 off_t j; 13 10 14 for (i = 0; i < Ncatalog; i++) { 11 15 catIDmax = MAX (catalog[i].catID, catIDmax); -
branches/eam_branches/ipp-20140206/Ohana/src/relphot/src/relphot_parallel_regions.c
r36519 r36520 10 10 INITTIME; 11 11 12 // load the RegionTable (UserRegion should not be used at this level) 13 RegionHostTable *regionHosts = RegionHostTableLoad (CATDIR, REGION_FILE); 14 12 15 // load the flat correction table (if defined) 13 16 char flatcorrfile[256]; … … 17 20 SkyTable *sky = SkyTableLoadOptimal (CATDIR, SKY_TABLE, GSCFILE, TRUE, SKY_DEPTH, VERBOSE); 18 21 SkyTableSetFilenames (sky, CATDIR, "cpt"); 19 SkyList *skylist = SkyListByBounds (sky, -1, UserPatch.Rmin, UserPatch.Rmax, UserPatch.Dmin, UserPatch.Dmax); 20 21 // load the RegionTable (UserRegion should not be used at this level) 22 RegionHostTable *regionHosts = RegionHostTableLoad (CATDIR, REGION_FILE); 22 SkyList *skylist = SkyListByBounds (sky, -1, regionHosts->Rmin, regionHosts->Rmax, regionHosts->Dmin, regionHosts->Dmax); 23 23 24 24 /* register database handle with shutdown procedure */ -
branches/eam_branches/ipp-20140206/Ohana/src/relphot/src/share_image_mags.c
r36519 r36520 48 48 49 49 for (i = 0; i < regionHosts->Nhosts; i++) { 50 if (regionHosts->hosts .hostsID == REGION_HOST_ID) continue;50 if (regionHosts->hosts[i].hostID == REGION_HOST_ID) continue; 51 51 // XXX add neighbor check? : if (not_neighbor(host[i])) continue; 52 52 … … 57 57 58 58 off_t Nsubset; 59 ImageMag *image_mags_subset = ImageMagLoad (regionHosts->hosts[i] , &Nsubset);59 ImageMag *image_mags_subset = ImageMagLoad (regionHosts->hosts[i].hostname, &Nsubset); 60 60 61 61 image_mags = merge_image_mags (image_mags, &Nimage_mags, image_mags_subset, Nsubset); … … 63 63 64 64 for (i = 0; i < Nimage_mags; i++) { 65 off_t seq = getImageByID (image_mags[i]. ID);65 off_t seq = getImageByID (image_mags[i].imageID); 66 66 if (seq < 0) { 67 67 // XXX is this a problem? (no, other hosts don't know which images I own) 68 68 continue; 69 69 } 70 images[seq].Mcal = image_mags[i].Mcal;71 images[seq].dMcal = image_mags[i].dMcal;72 images[seq].dMagSys = image_mags[i].dMagSys;73 images[seq].Xm = image_mags[i].Xm;70 images[seq].Mcal = image_mags[i].Mcal; 71 images[seq].dMcal = image_mags[i].dMcal; 72 images[seq].dMagSys = image_mags[i].dMagSys; 73 images[seq].Xm = image_mags[i].Xm; 74 74 images[seq].nFitPhotom = image_mags[i].nFitPhotom; 75 images[seq].flags = image_mags[i].flags;75 images[seq].flags = image_mags[i].flags; 76 76 images[seq].ubercalDist = image_mags[i].ubercalDist; 77 77 } 78 return TRUE; 78 79 } 79 80 … … 90 91 while (TRUE) { 91 92 92 f = fopen (filename );93 f = fopen (filename, "r"); 93 94 if (!f) { 94 95 usleep (2000000); … … 106 107 // message is of the form: NLOOP: %03d 107 108 int loop; 108 sscanf (message, "% s %d", &loop);109 sscanf (message, "%*s %d", &loop); 109 110 if (loop != nloop) { 110 111 usleep (2000000); … … 113 114 return TRUE; 114 115 } 116 return FALSE; 115 117 } 116 118 … … 147 149 int set_image_mags (ImageMag *image_mags, Image *image) { 148 150 149 fprintf (stderr, "ERROR: need to fix this function\n"); 150 exit (2); 151 152 image_mags->Mcal = image->Mcal; 151 image_mags->Mcal = image->Mcal; 152 image_mags->dMcal = image->dMcal; 153 image_mags->dMagSys = image->dMagSys; 154 image_mags->Xm = image->Xm; 155 image_mags->nFitPhotom = image->nFitPhotom; 156 image_mags->flags = image->flags; 157 image_mags->ubercalDist = image->ubercalDist; 153 158 154 159 return TRUE; -
branches/eam_branches/ipp-20140206/Ohana/src/relphot/src/share_mean_mags.c
r36519 r36520 94 94 } 95 95 96 int Nsec = photcode_to_secfilt (meanmags[i].photcode); 97 catalog[catSeq].secfilt[objSeq*Nsecfilt + Nsec].mag = meanmags[i].mag; 96 int ecode = GetPhotcodeEquivCodebyCode (meanmags[i].photcode); 97 if (ecode < 0) continue; 98 int Nsec = GetPhotcodeNsec (ecode); 99 if (Nsec < 0) continue; 100 101 catalog[catSeq].secfilt[objSeq*Nsecfilt + Nsec].M = meanmags[i].M; 98 102 } 99 103 return TRUE; … … 130 134 // message is of the form: NLOOP: %03d 131 135 int loop; 132 sscanf (message, "% s %d", &loop);136 sscanf (message, "%*s %d", &loop); 133 137 if (loop != nloop) { 134 138 usleep (2000000);
Note:
See TracChangeset
for help on using the changeset viewer.
