IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 36520


Ignore:
Timestamp:
Feb 18, 2014, 10:22:56 AM (12 years ago)
Author:
eugene
Message:

relphot parallel builds (not yet run or tested

Location:
branches/eam_branches/ipp-20140206/Ohana/src
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20140206/Ohana/src/libdvo/include/dvo.h

    r36519 r36520  
    291291  double Dmin;
    292292  double Dmax;
     293
     294  char *hostname;
     295
    293296  int hostID;                 // remove machine ID in SkyTable
    294297  int stdio[3];               // fd's for communication with the remote host
    295298  int pid;                    // remote process ID
    296   char *hostname;
    297 
    298   int line_numbers;
     299  int status;
    299300
    300301  off_t Nimage;
    301302  off_t NIMAGE;
    302303  Image *image;
     304  int line_numbers;
    303305} RegionHostInfo;
    304306
    305307typedef struct {
     308  double Rmin;
     309  double Rmax;
     310  double Dmin;
     311  double Dmax;
     312
    306313  int Nhosts;
    307314  RegionHostInfo *hosts;
     
    849856void FreeRegionHostTable (RegionHostTable *table);
    850857RegionHostTable *RegionHostTableLoad (char *catdir, char *rootname);
     858int RegionHostTableWaitJobs (RegionHostTable *regionHosts, char *file, int lineno);
    851859
    852860# endif // DVO_H
  • branches/eam_branches/ipp-20140206/Ohana/src/libdvo/src/RegionHostTable.c

    r36519 r36520  
    7272  int maxID = 0;
    7373
     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
    7481  for (Nline = 0; TRUE; Nline ++) {
    7582    int ID;
     
    8592    if (line[i] == '#') continue;
    8693    if (line[i] == 0) continue;
    87 
    88     UserPatch.Rmin = 360;
    89     UserPatch.Rmax =   0;
    90     UserPatch.Dmin = +90;
    91     UserPatch.Dmax = -90;
    9294
    9395    double Rmin, Rmax, Dmin, Dmax;
     
    121123    hosts[Nhosts].Dmax = Dmax;
    122124   
    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);
    127129
    128130    // InitIOBuffer (&hosts[Nhosts].stdout, 1000);
     
    137139  }   
    138140
    139   RegionHostTable *table = NULL;
    140   ALLOCATE (table, RegionHostTable, 1);
    141141  table->Nhosts = Nhosts;
    142142  table->hosts = hosts;
  • branches/eam_branches/ipp-20140206/Ohana/src/libdvo/src/dvo_photcode_ops.c

    r34844 r36520  
    169169}
    170170
     171// returns Nsec if code is PRI/SEC, else -1
    171172int GetPhotcodeNsec (int code) {
    172173 
  • branches/eam_branches/ipp-20140206/Ohana/src/relphot/include/relphot.h

    r36519 r36520  
    118118  unsigned int objID;
    119119  unsigned int catID;
     120  int photcode;
    120121} MeanMag;
    121122
  • branches/eam_branches/ipp-20140206/Ohana/src/relphot/src/MeanMagIO.c

    r36518 r36520  
    6767  ALLOCATE (meanmags, MeanMag, Nrow);
    6868  for (i = 0; i < Nrow; i++) {
    69     meanman[i].M              = M    [i];
    70     meanman[i].dM             = dM   [i];
    71     meanman[i].Xm             = Xm   [i];
    72     meanman[i].Nsec           = Nsec [i];
    73     meanman[i].objID          = objID[i];
    74     meanman[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];
    7575  }
    7676  fprintf (stderr, "loaded data for %lld images\n", (long long) Nrow);
     
    8383  free (catID);
    8484
    85   *nmeanmag = Nrow;
    86   return meanman;
     85  *nmeanmags = Nrow;
     86  return meanmags;
    8787}
    8888
     
    133133  // assign the storage arrays
    134134  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;
    141141  }
    142142
  • branches/eam_branches/ipp-20140206/Ohana/src/relphot/src/assign_images.c

    r36519 r36520  
    3636int select_images_hostregion (RegionHostTable *regionHosts, Image *image, off_t Nimage) {
    3737
    38   int i, j, ecode, found;
     38  int ecode, found;
     39  off_t i, j;
    3940
    4041  // INITTIME;
  • branches/eam_branches/ipp-20140206/Ohana/src/relphot/src/indexCatalog.c

    r36518 r36520  
    88  // find the max value of catID
    99  int catIDmax = 0;
     10
     11  int i;
     12  off_t j;
     13
    1014  for (i = 0; i < Ncatalog; i++) {
    1115    catIDmax = MAX (catalog[i].catID, catIDmax);
  • branches/eam_branches/ipp-20140206/Ohana/src/relphot/src/relphot_parallel_regions.c

    r36519 r36520  
    1010  INITTIME;
    1111
     12  // load the RegionTable (UserRegion should not be used at this level)
     13  RegionHostTable *regionHosts = RegionHostTableLoad (CATDIR, REGION_FILE);
     14
    1215  // load the flat correction table (if defined)
    1316  char flatcorrfile[256];
     
    1720  SkyTable *sky = SkyTableLoadOptimal (CATDIR, SKY_TABLE, GSCFILE, TRUE, SKY_DEPTH, VERBOSE);
    1821  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);
    2323
    2424  /* register database handle with shutdown procedure */
  • branches/eam_branches/ipp-20140206/Ohana/src/relphot/src/share_image_mags.c

    r36519 r36520  
    4848
    4949  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;
    5151    // XXX add neighbor check? : if (not_neighbor(host[i])) continue;
    5252
     
    5757
    5858    off_t Nsubset;
    59     ImageMag *image_mags_subset = ImageMagLoad (regionHosts->hosts[i], &Nsubset);
     59    ImageMag *image_mags_subset = ImageMagLoad (regionHosts->hosts[i].hostname, &Nsubset);
    6060
    6161    image_mags = merge_image_mags (image_mags, &Nimage_mags, image_mags_subset, Nsubset);
     
    6363
    6464  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);
    6666    if (seq < 0) {
    6767      // XXX is this a problem? (no, other hosts don't know which images I own)
    6868      continue;
    6969    }
    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;
    7474    images[seq].nFitPhotom  = image_mags[i].nFitPhotom;
    75     images[seq].flags      = image_mags[i].flags;
     75    images[seq].flags       = image_mags[i].flags;
    7676    images[seq].ubercalDist = image_mags[i].ubercalDist;
    7777  }
     78  return TRUE;
    7879}
    7980
     
    9091  while (TRUE) {
    9192
    92     f = fopen (filename);
     93    f = fopen (filename, "r");
    9394    if (!f) {
    9495      usleep (2000000);
     
    106107    // message is of the form: NLOOP: %03d
    107108    int loop;
    108     sscanf (message, "%s %d", &loop);
     109    sscanf (message, "%*s %d", &loop);
    109110    if (loop != nloop) {
    110111      usleep (2000000);
     
    113114    return TRUE;
    114115  }
     116  return FALSE;
    115117}
    116118
     
    147149int set_image_mags (ImageMag *image_mags, Image *image) {
    148150
    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;
    153158
    154159  return TRUE;
  • branches/eam_branches/ipp-20140206/Ohana/src/relphot/src/share_mean_mags.c

    r36519 r36520  
    9494    }
    9595
    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;
    98102  }
    99103  return TRUE;
     
    130134    // message is of the form: NLOOP: %03d
    131135    int loop;
    132     sscanf (message, "%s %d", &loop);
     136    sscanf (message, "%*s %d", &loop);
    133137    if (loop != nloop) {
    134138      usleep (2000000);
Note: See TracChangeset for help on using the changeset viewer.