IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 33537


Ignore:
Timestamp:
Mar 15, 2012, 2:59:06 PM (14 years ago)
Author:
eugene
Message:

enable parallel output for high-speed

Location:
branches/eam_branches/ipp-20111122/Ohana/src/relastro
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20111122/Ohana/src/relastro/include/relastro.h

    r33532 r33537  
    142142int    PARALLEL_MANUAL;
    143143int    PARALLEL_SERIAL;
     144
     145int    PARALLEL_OUTPUT;
    144146
    145147int    VERBOSE;
  • branches/eam_branches/ipp-20111122/Ohana/src/relastro/src/UpdateObjectOffsets.c

    r33532 r33537  
    1515
    1616  // XXX need to decide how to determine PARALLEL mode...
    17   if (PARALLEL & !hostID) {
     17  if (PARALLEL && !hostID) {
    1818    UpdateObjectOffsets_parallel (skylist);
    1919    return TRUE;
  • branches/eam_branches/ipp-20111122/Ohana/src/relastro/src/UpdateObjects.c

    r33448 r33537  
    9898      // when we update the output measure values, we need to do it here
    9999
    100       Tmin = Tmax = (measure[0].t - T2000) / (86400*365.25);
    101100      mode = FIT_MODE;
    102101
    103102      // find the basic properties of the detections for this object (Tmin, Tmax, Tmean)
    104       Tmean = 0;
    105103      for (k = 0; k < catalog[i].average[j].Nmeasure; k++) {
    106104
     
    129127        T[N] = (measure[k].t - T2000) / (86400*365.25) ; // time relative to J2000 in years
    130128
    131         Tmin = MIN(Tmin, T[N]);
    132         Tmax = MAX(Tmax, T[N]);
    133         Tmean += T[N];
    134 
    135129        // dX, dY : error in arcsec --
    136130        dX[N] = GetAstromErrorTiny (&measure[k], ERROR_MODE_RA);
    137131        dY[N] = GetAstromErrorTiny (&measure[k], ERROR_MODE_DEC);
     132
     133        // XXX this is a bit hackish -- allow a given photcode or measurement to be
     134        // ignored by ignoring excessively bad errors
     135        if (dX[N] > 10.0) continue;
     136        if (dY[N] > 10.0) continue;
    138137
    139138        // add systematic error in quadrature, if desired
     
    166165      catalog[i].average[j].flags &= ~ID_STAR_FEW;
    167166
     167      // find Tmin & Tmax from the list of accepted measurements
     168      Tmean = 0;
     169      Tmin = Tmax = T[0];
     170      for (k = 0; k < N; k++) {
     171        Tmin = MIN(Tmin, T[N]);
     172        Tmax = MAX(Tmax, T[N]);
     173        Tmean += T[N];
     174      }
    168175      // XXX add the parallax factor range as a criterion as well
    169176      Trange = Tmax - Tmin;
    170177      if (Trange < PM_DT_MIN) mode = FIT_AVERAGE;
    171178      if ((mode == FIT_PM_ONLY) && (N < PM_TOOFEW)) mode = FIT_AVERAGE;
     179
     180      if (FIT_TARGET == TARGET_HIGH_SPEED) {
     181          Tmean = 0.5*(Tmax - Tmin);
     182      } else {
     183          Tmean /= (float) N;
     184      }
    172185
    173186      // too few measurements for average position (require 2 values)
     
    186199      coords.crval2 = D[0];
    187200
    188       if (FIT_TARGET == TARGET_HIGH_SPEED) {
    189           Tmean = 0.5*(Tmax - Tmin);
    190       } else {
    191           Tmean /= (float) N;
    192       }
    193      
    194201      // XVERB |= (catalog[i].averge[j].objID == 0xc90) && (catalog[i].average[j].catID == 0x2a1e);
    195202      XVERB |= (catalog[i].average[j].objID == OBJ_ID_SRC) && (catalog[i].average[j].catID == CAT_ID_SRC);
  • branches/eam_branches/ipp-20111122/Ohana/src/relastro/src/args.c

    r33448 r33537  
    9595    HIGH_SPEED_DIR = abspath(argv[N], MAX_PATH_LENGTH);
    9696    remove_argument (N, &argc, argv);
     97  }
     98
     99  PARALLEL_OUTPUT = FALSE;
     100  if ((N = get_argument (argc, argv, "-parallel-output"))) {
     101    remove_argument (N, &argc, argv);
     102    PARALLEL_OUTPUT = TRUE;
     103    if (FIT_TARGET != TARGET_HIGH_SPEED) {
     104      fprintf (stderr, "-parallel-output only valid for -high-speed mode\n");
     105      exit (1);
     106    }
    97107  }
    98108
  • branches/eam_branches/ipp-20111122/Ohana/src/relastro/src/high_speed_catalogs.c

    r33520 r33537  
    1414
    1515  // XXX need to decide how to determine PARALLEL mode...
    16   if (PARALLEL & !hostID) {
     16  if (PARALLEL && !hostID) {
    1717    high_speed_catalogs_parallel (skylist);
    1818    goto finish;
     
    8787  }   
    8888
     89  // If we want to parallelize the output, the remote client needs to load the HostTable
     90  // for the output catdir.  Require the output HostTable to match the input (ie, same
     91  // hostIDs must exist).  Preferred, but not required, that they match in the host
     92  // location.
     93  HostTable *tableOut = NULL;
     94  if (PARALLEL_OUTPUT) {
     95    // load the list of hosts
     96    tableOut = HostTableLoad (HIGH_SPEED_DIR, skylist->hosts);
     97    if (!tableOut) {
     98      fprintf (stderr, "ERROR: failure reading Host Table %s for output database %s\n", skylist->hosts, HIGH_SPEED_DIR);
     99      exit (1);
     100    }   
     101    if (table->Nhosts != tableOut->Nhosts) {
     102      fprintf (stderr, "ERROR: output HostTable must have matching hosts (%d in, %d out)\n", table->Nhosts, tableOut->Nhosts);
     103      exit (1);
     104    }
     105  }
     106
    89107  int i;
    90108  for (i = 0; i < table->Nhosts; i++) {
     
    95113    table->hosts[i].pathname = tmppath;
    96114
    97     // options / arguments that can affect relastro_client -high-speed
     115    // use this directory to save the output catalogs (distributed if parallel)
     116    char *outputDir = strcreate(HIGH_SPEED_DIR);
     117    if (PARALLEL_OUTPUT) {
     118      // find the matching host entry in the output HostTable (match by ID, not index)
     119      int hostID = table->hosts[i].hostID;
     120      int index = table->index[hostID];
     121      if (index == -1) {
     122        fprintf (stderr, "ERROR: output HostTable must have matching hosts (host ID %d not found)\n", hostID);
     123        exit (1);
     124      }
     125
     126      free (outputDir);
     127      outputDir = abspath (tableOut->hosts[index].pathname, MAX_PATH_LENGTH);
     128    }
    98129
    99130    char command[1024];
    100131    snprintf (command, 1024, "relastro_client -high-speed %s %s %f %s -hostID %d -D CATDIR %s -hostdir %s -region %f %f %f %f",
    101               PHOTCODE_A_LIST, PHOTCODE_B_LIST, RADIUS, HIGH_SPEED_DIR, table->hosts[i].hostID, CATDIR, table->hosts[i].pathname, UserPatch.Rmin, UserPatch.Rmax, UserPatch.Dmin, UserPatch.Dmax);
    102 
     132              PHOTCODE_A_LIST, PHOTCODE_B_LIST, RADIUS, outputDir, table->hosts[i].hostID, CATDIR, table->hosts[i].pathname, UserPatch.Rmin, UserPatch.Rmax, UserPatch.Dmin, UserPatch.Dmax);
     133
     134    free (outputDir);
     135
     136    // options / arguments that can affect relastro_client -high-speed
    103137    char tmpline[1024];
    104138    if (FIT_MODE == FIT_PM_ONLY)         { snprintf (tmpline, 1024, "%s -pm",    command);              strcpy (command, tmpline); }
  • branches/eam_branches/ipp-20111122/Ohana/src/relastro/src/high_speed_objects.c

    r33479 r33537  
    1818  int Nsecfilt;
    1919  char filename[1024];
     20
    2021  snprintf (filename, 1024, "%s/%s.cpt", HIGH_SPEED_DIR, region[0].name);
    2122  fprintf (stderr, "%s\n",filename);
  • branches/eam_branches/ipp-20111122/Ohana/src/relastro/src/load_catalogs.c

    r33520 r33537  
    99
    1010  // XXX need to decide how to determine PARALLEL mode...
    11   if (PARALLEL & !hostID) {
     11  if (PARALLEL && !hostID) {
    1212    catalog = load_catalogs_parallel (skylist, Ncatalog);
    1313    return catalog;
  • branches/eam_branches/ipp-20111122/Ohana/src/relastro/src/relastro_objects.c

    r33520 r33537  
    2626
    2727  // XXX need to decide how to determine PARALLEL mode...
    28   if (PARALLEL & !hostID) {
     28  if (PARALLEL && !hostID) {
    2929    relastro_objects_parallel (skylist);
    3030    return TRUE;
Note: See TracChangeset for help on using the changeset viewer.