IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 36998


Ignore:
Timestamp:
Jul 11, 2014, 8:47:39 AM (12 years ago)
Author:
eugene
Message:

allow parallel image hosts to continue as soon at remote clients have finished reading database

Location:
branches/eam_branches/ipp-20140610/Ohana/src/relphot
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20140610/Ohana/src/relphot/Makefile

    r36990 r36998  
    8888$(SRC)/liststats.$(ARCH).o       \
    8989$(SRC)/initialize.$(ARCH).o      \
     90$(SRC)/syncfile.$(ARCH).o        \
    9091$(SRC)/load_catalogs.$(ARCH).o   \
    9192$(SRC)/reload_catalogs.$(ARCH).o \
  • branches/eam_branches/ipp-20140610/Ohana/src/relphot/include/relphot.h

    r36995 r36998  
    351351void          liststats_setmode   PROTO((StatType *stats, char *strmode));
    352352int           liststats           PROTO((double *value, double *dvalue, double *wvalue, int N, StatType *stats));
    353 Catalog      *load_catalogs       PROTO((SkyList *skylist, int *Ncatalog, int hostID, char *hostpath));
    354 Catalog      *load_catalogs_parallel PROTO((SkyList *sky, int *Ncatalog));
     353Catalog      *load_catalogs       PROTO((SkyList *skylist, int *Ncatalog, int hostID, char *hostpath, char *syncfile));
     354Catalog      *load_catalogs_parallel PROTO((SkyList *sky, int *Ncatalog, char *syncfile));
    355355
    356356SkyList      *load_images         PROTO((FITS_DB *db, char *regionName, SkyRegion *region));
  • branches/eam_branches/ipp-20140610/Ohana/src/relphot/src/load_catalogs.c

    r36630 r36998  
    1212// if this function is called with a specified hostID, then only the fraction of the
    1313// database hosted by that hostID is loaded
    14 Catalog *load_catalogs (SkyList *skylist, int *Ncatalog, int hostID, char *hostpath) {
     14Catalog *load_catalogs (SkyList *skylist, int *Ncatalog, int hostID, char *hostpath, char *syncfile) {
    1515
    1616  off_t i, Nmeas, Nstar, Nmeas_total, Nstar_total;
     
    1919  // XXX need to decide how to determine PARALLEL mode...
    2020  if (PARALLEL && !hostID) {
    21     catalog = load_catalogs_parallel (skylist, Ncatalog);
     21    catalog = load_catalogs_parallel (skylist, Ncatalog, syncfile);
    2222    return catalog;
    2323  }
     
    9292  // in regular relphot, we shutdown here; in relphot_client, we generate and return an empty table (for consistency)
    9393
     94  // if we are running with parallel_images but not a parallel database, we need to
     95  // release the lock so the next image host can proceed
     96  if (!hostID && syncfile) {
     97    update_sync_file (syncfile, 1);
     98  }
     99
    94100  // XXX consider only returning the populated catalogs
    95101  *Ncatalog = skylist[0].Nregions;
     
    105111// CATDIR is supplied globally
    106112# define DEBUG 1
    107 Catalog *load_catalogs_parallel (SkyList *sky, int *Ncatalog) {
     113Catalog *load_catalogs_parallel (SkyList *sky, int *Ncatalog, char *syncfile) {
    108114
    109115  char uniquer[12];
     
    206212  }
    207213
     214  // update syncfile here (save lots of I/O time):
     215
     216  // at this point, the remote relastro_client jobs are done loading their data.  in a
     217  // parallel_images mode, the next image host can be launched while this image host now
     218  // reads that
     219
     220  // NOTE: if I let all hosts load blindly, I saturate the data clients with too many
     221  // relphot_client requests.  I need to have the master mediate this.  the master
     222  // will not launch the next remote job until this one says it is done
     223  if (syncfile) {
     224    update_sync_file (syncfile, 1);
     225  }
     226
    208227  // each host generates a BrightCatalog structure, with the measure, average, etc value
    209228  // loaded into a single set of arrays (of MeasureTiny, AverageTiny, Secfilt).  I need to
  • branches/eam_branches/ipp-20140610/Ohana/src/relphot/src/relphot_client.c

    r36630 r36998  
    3939    case MODE_LOAD: {
    4040      int Ncatalog;
    41       Catalog *catalog = load_catalogs (skylist, &Ncatalog, HOST_ID, HOSTDIR);
     41      Catalog *catalog = load_catalogs (skylist, &Ncatalog, HOST_ID, HOSTDIR, NULL);
    4242      if (!catalog) {
    4343          fprintf (stderr, "ERROR loading catalogs from %s\n", CATDIR);
  • branches/eam_branches/ipp-20140610/Ohana/src/relphot/src/relphot_images.c

    r36630 r36998  
    5252  if (NLOOP > 0) {
    5353    /* load catalog data from region files (hostID is 0 since we are not a client */
    54     catalog = load_catalogs (skylist, &Ncatalog, 0, NULL);
     54    catalog = load_catalogs (skylist, &Ncatalog, 0, NULL, NULL);
    5555    MARKTIME("-- load catalog data: %f sec\n", dtime);
    5656 
  • branches/eam_branches/ipp-20140610/Ohana/src/relphot/src/relphot_parallel_images.c

    r36990 r36998  
    5555
    5656  /* load catalog data from region files (hostID is 0 since we are not a client */
    57   catalog = load_catalogs (skylist, &Ncatalog, 0, NULL);
     57  char *syncfile = make_filename (CATDIR, regionHosts->hosts[myHost].hostname, REGION_HOST_ID, "loadcat.sync");
     58  catalog = load_catalogs (skylist, &Ncatalog, 0, NULL, syncfile);
    5859  MARKTIME("-- load catalog data: %f sec\n", dtime);
     60  free (syncfile);
     61
    5962  client_logger_message ("loaded catalog data\n");
    6063
    61   // NOTE: if I let all hosts load blindly, I saturate the data clients with too many
    62   // relphot_client requests.  I need to have the master mediate this.  the master
    63   // will not launch the next remote job until this one says it is done
    64   char *syncfile = make_filename (CATDIR, regionHosts->hosts[myHost].hostname, REGION_HOST_ID, "loadcat.sync");
    65   update_sync_file (syncfile, 1);
    66  
    6764  // generate tables go from catID,objID -> catSeq,objSeq
    6865  indexCatalogs (catalog, Ncatalog);
Note: See TracChangeset for help on using the changeset viewer.