IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 36569


Ignore:
Timestamp:
Feb 27, 2014, 3:58:27 PM (12 years ago)
Author:
eugene
Message:

relastro parallel regions builds (but not tested)

Location:
branches/eam_branches/ipp-20140206/Ohana/src/relastro
Files:
1 added
11 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20140206/Ohana/src/relastro/Makefile

    r36566 r36569  
    7777$(SRC)/share_images_pos.$(ARCH).o \
    7878$(SRC)/ImagePosIO.$(ARCH).o \
     79$(SRC)/ImageTable.$(ARCH).o \
    7980$(SRC)/markObjects.$(ARCH).o \
    8081$(SRC)/indexCatalogs.$(ARCH).o \
  • branches/eam_branches/ipp-20140206/Ohana/src/relastro/include/relastro.h

    r36566 r36569  
    66# include <pthread.h>
    77
     8# define MARKTIME(MSG,...) {                    \
     9    gettimeofday (&stopTimer, (void *) NULL);   \
     10    float dtime = DTIME (stopTimer, startTimer);        \
     11    fprintf (stderr, MSG, __VA_ARGS__); }
     12
     13# define INITTIME \
     14  struct timeval startTimer, stopTimer; \
     15  gettimeofday (&startTimer, (void *) NULL);
     16
    817// choose off_t or int depending on full-scale relphot analysis resources
    918// # define IDX_T off_t
     
    2029typedef enum {FIT_NONE, FIT_AVERAGE, FIT_PM_ONLY, FIT_PAR_ONLY, FIT_PM_AND_PAR} FitMode;
    2130
    22 typedef enum {TARGET_NONE, TARGET_SIMPLE, TARGET_CHIPS, TARGET_MOSAICS, TARGET_HIGH_SPEED, TARGET_MERGE_SOURCE, TARGET_UPDATE_OBJECTS, TARGET_UPDATE_OFFSETS, TARGET_LOAD_OBJECTS, TARGET_HPM} FitTarget;
     31typedef enum {TARGET_NONE, TARGET_SIMPLE, TARGET_CHIPS, TARGET_MOSAICS, TARGET_HIGH_SPEED, TARGET_MERGE_SOURCE, TARGET_UPDATE_OBJECTS, TARGET_UPDATE_OFFSETS, TARGET_LOAD_OBJECTS, TARGET_HPM, TARGET_PARALLEL_REGIONS, TARGET_PARALLEL_IMAGES} FitTarget;
    2332
    2433typedef enum {
     
    129138} StatType;
    130139
    131 # define MARKTIME(MSG,...) { \
    132   float dtime; \
    133   gettimeofday (&stop, (void *) NULL); \
    134   dtime = DTIME (stop, start); \
    135   fprintf (stderr, MSG, __VA_ARGS__); }
    136 
    137140/* global variables set in parameter file */
    138141# define DVO_MAX_PATH 1024
     
    145148char   SKY_TABLE[DVO_MAX_PATH];
    146149int    SKY_DEPTH;  /** XXX EAM : depth of catalog tables, fix usage */
     150
     151// globals for parallel region operations
     152char  *REGION_FILE;
     153char  *IMAGE_TABLE;
     154int    REGION_HOST_ID;
     155int    PARALLEL_REGIONS_MANUAL;
    147156
    148157int          HOST_ID;
     
    486495int share_mean_pos (Catalog *catalog, int Ncatalog, RegionHostTable *regionHosts, int nloop);
    487496int slurp_mean_pos (Catalog *catalog, int Ncatalog, RegionHostTable *regionHosts, int nloop);
    488 int set_mean_pos (MeanPos *meanpos, AverageTiny *average, SecFilt *secfilt, int Nsec);
     497int set_mean_pos (MeanPos *meanpos, AverageTiny *average);
    489498MeanPos *merge_mean_pos (MeanPos *target, int *ntarget, MeanPos *source, int Nsource);
    490499
     
    505514int set_image_pos (ImagePos *image_pos, Image *image);
    506515
     516Image *ImageTableLoad(char *filename, off_t *nimage);
     517int ImageTableSave (char *filename, Image *images, off_t Nimages);
  • branches/eam_branches/ipp-20140206/Ohana/src/relastro/src/StarMaps.c

    r35105 r36569  
    5959  off_t i, N, Nimages;
    6060  int xbin, ybin;
    61   struct timeval start, stop;
    6261
    63   gettimeofday (&start, (void *) NULL);
     62  INITTIME;
    6463
    6564  // Images *images = getimages(&Nimages, NULL); return value ignored
  • branches/eam_branches/ipp-20140206/Ohana/src/relastro/src/args.c

    r35763 r36569  
    4949    remove_argument (N, &argc, argv);
    5050    FIT_TARGET = TARGET_UPDATE_OFFSETS;
     51  }
     52
     53  // elements needed for parallel regions / parallel images
     54  REGION_FILE = NULL;
     55  if ((N = get_argument (argc, argv, "-region-hosts"))) {
     56    remove_argument (N, &argc, argv);
     57    REGION_FILE = strcreate (argv[N]);
     58    remove_argument (N, &argc, argv);
     59  }
     60
     61  REGION_HOST_ID = 0;
     62  if ((N = get_argument (argc, argv, "-region-hostID"))) {
     63    remove_argument (N, &argc, argv);
     64    REGION_HOST_ID = atoi (argv[N]);
     65    remove_argument (N, &argc, argv);
     66  }
     67
     68  IMAGE_TABLE = NULL;
     69  if ((N = get_argument (argc, argv, "-parallel-images"))) {
     70    remove_argument (N, &argc, argv);
     71    FIT_TARGET = TARGET_PARALLEL_IMAGES;
     72    if (N >= argc) usage();
     73    IMAGE_TABLE = strcreate (argv[N]);
     74    remove_argument (N, &argc, argv);
     75    if (!REGION_FILE) usage();
     76  }
     77
     78  PARALLEL_REGIONS_MANUAL = FALSE;
     79  if ((N = get_argument (argc, argv, "-parallel-regions"))) {
     80    remove_argument (N, &argc, argv);
     81    FIT_TARGET = TARGET_PARALLEL_REGIONS;
     82    if (!REGION_FILE) usage();
     83    if ((N = get_argument (argc, argv, "-parallel-regions-manual"))) {
     84      remove_argument (N, &argc, argv);
     85      PARALLEL_REGIONS_MANUAL = TRUE;
     86    }
    5187  }
    5288
     
    436472
    437473  BCATALOG = NULL;
     474
     475  REGION_FILE = NULL;
     476  REGION_HOST_ID = 0;
     477  IMAGE_TABLE = NULL;
     478  PARALLEL_REGIONS_MANUAL = FALSE;
    438479
    439480  HOST_ID = 0;
  • branches/eam_branches/ipp-20140206/Ohana/src/relastro/src/assign_images.c

    r36564 r36569  
    3838  // supply the mosaics to the image table for the regionHosts : we already have the image
    3939  // <-> mosaic relationship, we just need to select these mosaics (once per regionHost)
    40   select_mosaics_hostregion (regionHosts, image, Nimage);
     40  // XXX DEFINE ME: select_mosaics_hostregion (regionHosts, image, Nimage);
     41  abort ();
    4142
    4243  return TRUE;
     
    4849int select_images_hostregion (RegionHostTable *regionHosts, Image *image, off_t Nimage) {
    4950
    50   int ecode, found;
    5151  off_t i, j;
    5252
     
    6161  for (j = 0; j < Nimage; j++) {
    6262   
    63     /* exclude images by photcode */
    64     ecode = GetPhotcodeEquivCodebyCode (image[j].photcode);
    65     found = FALSE;
    66     int Ns;
    67     for (Ns = 0; !found && (Ns < Nphotcodes); Ns++) {
    68       if (ecode == photcodes[Ns][0].code) found = TRUE;
    69     }
    70     if (!found) continue;
     63    /* select images by photcode, or equiv photcode, if specified */
     64    if (NphotcodesKeep > 0) {
     65      int found = FALSE;
     66      // XXX this bit of code excludes DIS mosaics and should be fixed
     67      for (i = 0; (i < NphotcodesKeep) && !found; i++) {
     68        if (photcodesKeep[i][0].code == image[j].photcode) found = TRUE;
     69        if (photcodesKeep[i][0].code == GetPhotcodeEquivCodebyCode(image[j].photcode)) found = TRUE;
     70      }
     71      if (!found) continue;
     72    }
     73    if (NphotcodesSkip > 0) {
     74      int found = FALSE;
     75      for (i = 0; (i < NphotcodesSkip) && !found; i++) {
     76        if (photcodesSkip[i][0].code == image[j].photcode) found = TRUE;
     77        if (photcodesSkip[i][0].code == GetPhotcodeEquivCodebyCode(image[j].photcode)) found = TRUE;
     78      }
     79      if (found) continue;
     80    }
    7181
    7282    /* exclude images by time */
  • branches/eam_branches/ipp-20140206/Ohana/src/relastro/src/launch_region_hosts.c

    r36564 r36569  
    5555
    5656    char command[1024];
    57     snprintf (command, 1024, "relastro %s -parallel-images %s -region-hosts %s -region-hostID %d -D CATDIR %s -region %f %f %f %f -statmode %s -D CAMERA %s -D STAR_TOOFEW %d -minerror %f",
    58               PhotcodeList, filename, REGION_FILE, host->hostID, CATDIR, host->RminCat, host->RmaxCat, host->DminCat, host->DmaxCat, STATMODE, CAMERA, STAR_TOOFEW, MIN_ERROR);
     57    snprintf (command, 1024, "relastro -parallel-images %s -region-hosts %s -region-hostID %d -D CATDIR %s -region %f %f %f %f -statmode %s -minerror %f",
     58              filename, REGION_FILE, host->hostID, CATDIR, host->RminCat, host->RmaxCat, host->DminCat, host->DmaxCat, STATMODE, MIN_ERROR);
    5959
    60     if (VERBOSE)         strextend (command, "-v");
    61     if (VERBOSE2)        strextend (command, "-vv");
    62     if (RESET)           strextend (command, "-reset");
    63     if (RESET_ZEROPTS)   strextend (command, "-reset-zpts");
    64     if (UPDATE)          strextend (command, "-update");
    65     if (!KEEP_UBERCAL)   strextend (command, "-reset-ubercal");
    66     if (PARALLEL)        strextend (command, "-parallel");
    67     if (PARALLEL_MANUAL) strextend (command, "-parallel-manual");
    68     if (PARALLEL_SERIAL) strextend (command, "-parallel-serial");
     60    if (VERBOSE)            strextend (command, "-v");
     61    if (VERBOSE2)           strextend (command, "-vv");
     62    if (RESET)              strextend (command, "-reset");
     63    if (UPDATE)             strextend (command, "-update");
     64    if (PARALLEL)           strextend (command, "-parallel");
     65    if (PARALLEL_MANUAL)    strextend (command, "-parallel-manual");
     66    if (PARALLEL_SERIAL)    strextend (command, "-parallel-serial");
     67    if (PHOTCODE_KEEP_LIST) strextend (command, "+photcode %s", PHOTCODE_KEEP_LIST);
     68    if (PHOTCODE_SKIP_LIST) strextend (command, "-photcode %s", PHOTCODE_SKIP_LIST);
    6969
    7070    fprintf (stderr, "command: %s\n", command);
  • branches/eam_branches/ipp-20140206/Ohana/src/relastro/src/load_images.c

    r35763 r36569  
    11# include "relastro.h"
    2 
    3 # define MARKTIME(MSG,...) { \
    4   float dtime; \
    5   gettimeofday (&stop, (void *) NULL); \
    6   dtime = DTIME (stop, start); \
    7   fprintf (stderr, MSG, __VA_ARGS__); }
    82
    93int load_images (FITS_DB *db, SkyList *skylist, int UseFullOverlap) {
     
    126  off_t      Nimage, Nsubset;
    137  off_t     *LineNumber;
    14   struct timeval start, stop;
    158
    16   gettimeofday (&start, (void *) NULL);
     9  INITTIME;
    1710
    1811  // convert database table to internal structure
  • branches/eam_branches/ipp-20140206/Ohana/src/relastro/src/relastro_images.c

    r35763 r36569  
    66  Catalog *catalog;
    77  FITS_DB db;
    8   struct timeval start, stop;
    98
    10   gettimeofday (&start, (void *) NULL);
     9  INITTIME;
    1110
    1211  /* register database handle with shutdown procedure */
  • branches/eam_branches/ipp-20140206/Ohana/src/relastro/src/resort_catalog.c

    r34088 r36569  
    3030  if (catalog[0].sorted == TRUE) return;
    3131
    32   // struct timeval start, stop;
    33   // gettimeofday (&start, NULL);
     32  // INITTIME;
    3433
    3534  /* internal counters */
  • branches/eam_branches/ipp-20140206/Ohana/src/relastro/src/select_images.c

    r36482 r36569  
    1515void dsortindex (double *X, off_t *Y, int N);
    1616off_t getRegionStartByRA (double R, double *Rref, off_t Nregions);
    17 
    18 # define MARKTIME(MSG,...) { \
    19   float dtime; \
    20   gettimeofday (&stop, (void *) NULL); \
    21   dtime = DTIME (stop, start); \
    22   fprintf (stderr, MSG, __VA_ARGS__); }
    2317
    2418Image *select_images (SkyList *skylist, Image *timage, off_t Ntimage, off_t **LineNumber, off_t *Nimage, int UseFullOverlap) {
     
    3125  Coords tcoords;
    3226  SkyRegionCoords *skycoords;
    33   struct timeval start, stop;
    3427 
    3528  double RmaxSkyRegion, RminSkyRegion, RmidSkyRegion, DminSkyRegion, DmaxSkyRegion;
     
    5043  }
    5144
    52   gettimeofday (&start, (void *) NULL);
     45  INITTIME;
    5346
    5447  // the comparison is made in the catalog local projection. below we set crval1,2
  • branches/eam_branches/ipp-20140206/Ohana/src/relastro/src/share_mean_pos.c

    r36564 r36569  
    1313  MeanPos *meanpos = NULL;
    1414  ALLOCATE (meanpos, MeanPos, NMEANPOS);
    15 
    16   int Ns;
    17   int Nsecfilt = GetPhotcodeNsecfilt();
    1815
    1916  int myHost = regionHosts->index[REGION_HOST_ID];
     
    3835      if (catalog[i].averageT[j].nOwn == catalog[i].averageT[j].Nmeasure) continue;
    3936
    40       for (Ns = 0; Ns < Nphotcodes; Ns++) {
    41         int thisCode = photcodes[Ns][0].code;
    42         int Nsec = GetPhotcodeNsec(thisCode);
    43         set_mean_pos (&meanpos[Nmeanpos], &catalog[i].averageT[j], &catalog[i].secfilt[Nsecfilt*j + Nsec], Nsec);
    44         Nmeanpos ++;
    45         CHECK_REALLOCATE (meanpos, MeanPos, NMEANPOS, Nmeanpos, D_NMEANPOS);
    46       }
     37      set_mean_pos (&meanpos[Nmeanpos], &catalog[i].averageT[j]);
     38      Nmeanpos ++;
     39      CHECK_REALLOCATE (meanpos, MeanPos, NMEANPOS, Nmeanpos, D_NMEANPOS);
    4740    }
    4841  }
     
    7164
    7265  fprintf (stderr, "grabbing mean object pos from other hosts...\n");
    73 
    74   int Nsecfilt = GetPhotcodeNsecfilt();
    7566
    7667  for (i = 0; i < regionHosts->Nhosts; i++) {
     
    112103}
    113104
    114 int set_mean_pos (MeanPos *meanpos, AverageTiny *average, SecFilt *secfilt, int Nsec) {
     105int set_mean_pos (MeanPos *meanpos, AverageTiny *average) {
    115106
    116107  meanpos->R     = average->R;
Note: See TracChangeset for help on using the changeset viewer.