IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 33297


Ignore:
Timestamp:
Feb 16, 2012, 3:41:58 PM (14 years ago)
Author:
eugene
Message:

relphot parallel works, at least in a serial mode

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

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20111122/Ohana/src/addstar/test/relphot.parallel.dvo

    r33288 r33297  
    114114  end
    115115
     116  # XXX tmp
     117  exec rsync -aub $catdir/ $catdir.raw/
     118
    116119  # parallel-ize the database
    117120  mkparallel $catdir
     
    130133  # run relphot on the parallel db and check that the images now match the expected values
    131134  exec relphot -parallel-serial g,r,i -v -region 9.5 10.5 19.5 20.5 -D CATDIR $catdir.p0 -D STAR_TOOFEW 1 -D SIGMA_LIM 0.07 -statmode WT_MEAN -cloud-limit 0.5 -keep-ubercal -D IMAGE_OFFSET 0.5 -update >& log.relphot.p0
     135
     136  exec dvodist -in $catdir.p0
    132137
    133138  for i 0 mjd_nc[]
  • branches/eam_branches/ipp-20111122/Ohana/src/relphot/include/relphot.h

    r33274 r33297  
    100100int    PARALLEL;
    101101int    PARALLEL_MANUAL;
     102int    PARALLEL_SERIAL;
    102103
    103104int    VERBOSE;
     
    129130int    PLOTDELAY;
    130131int    UpdateAverages;
     132
     133char  *PhotcodeList;
    131134
    132135int    RELPHOT_GRID_X;
  • branches/eam_branches/ipp-20111122/Ohana/src/relphot/src/ImageSubset.c

    r33254 r33297  
    4141
    4242  // load data for this header
    43   if (!gfits_load_header (f, &theader)) return (NULL);
     43  if (!gfits_load_header (f, &theader)) {
     44    fclose (f);
     45    return (NULL);
     46  }
    4447
    4548  // read the fits table bytes
    46   if (!gfits_fread_ftable_data (f, &ftable, FALSE)) return (NULL);
    47  
    48   // XXX close the fits file here
     49  if (!gfits_fread_ftable_data (f, &ftable, FALSE)) {
     50    fclose (f);
     51    return (NULL);
     52  }
     53  fclose (f);
    4954
    5055  // a bit annoying : we read the entire block of data, then extract the columns, then set the image structure values.
     
    5964  GET_COLUMN (flags,   "FLAGS",      int);
    6065  GET_COLUMN (tzero,   "TZERO",      int);
    61   GET_COLUMN (trate,   "TRATE",      char);
     66  GET_COLUMN (trate,   "TRATE",      short);
    6267
    6368  // XXX free the fits table data here
     
    117122  float *Mcal, *dMcal;
    118123  unsigned int *imageID, *map, *flags, *tzero;
    119   unsigned char *trate;
     124  unsigned short *trate;
    120125
    121   // create interme  diate storage arrays
    122   ALLOCATE (Mcal,    float,        Nimage);
    123   ALLOCATE (dMcal,   float,        Nimage);
    124   ALLOCATE (imageID, unsigned int, Nimage);
    125   ALLOCATE (map,     unsigned int, Nimage);
    126   ALLOCATE (flags,   unsigned int, Nimage);
    127   ALLOCATE (tzero,   unsigned int, Nimage);
    128   ALLOCATE (trate,   unsigned char, Nimage);
     126  // create intermediate storage arrays
     127  ALLOCATE (Mcal,    float,          Nimage);
     128  ALLOCATE (dMcal,   float,          Nimage);
     129  ALLOCATE (imageID, unsigned int,   Nimage);
     130  ALLOCATE (map,     unsigned int,   Nimage);
     131  ALLOCATE (flags,   unsigned int,   Nimage);
     132  ALLOCATE (tzero,   unsigned int,   Nimage);
     133  ALLOCATE (trate,   unsigned short, Nimage);
    129134
    130135  // assign the storage arrays
     
    137142    tzero[i]   = image[i].tzero;
    138143    trate[i]   = image[i].trate;
     144    fprintf (stderr, "time: %d, trate: %d\n", image[i].tzero, image[i].trate);
    139145  }
    140146
     
    172178  gfits_free_table (&ftable);
    173179
     180  fclose (f);
     181  fflush (f);
     182
    174183  return TRUE;
    175184}
  • branches/eam_branches/ipp-20111122/Ohana/src/relphot/src/args.c

    r33274 r33297  
    8989    remove_argument (N, &argc, argv);
    9090  }
     91  // this is a test mode : rather than launching the relphot_client jobs remotely, they are
     92  // run in serial via 'system'
     93  PARALLEL_SERIAL = FALSE;
     94  if ((N = get_argument (argc, argv, "-parallel-serial"))) {
     95    if (PARALLEL_MANUAL) {
     96      fprintf (stderr, "ERROR: cannot mix -parallel-manual and -parallel-serial\n");
     97      exit (1);
     98    }
     99    PARALLEL = TRUE; // -parallel-serial implies -parallel
     100    PARALLEL_SERIAL = TRUE;
     101    remove_argument (N, &argc, argv);
     102  }
    91103
    92104  PLOTSTUFF = FALSE;
     
    112124  }     
    113125
    114   strcpy (STATMODE, "CHI_INNER_WTMEAN");
     126  strcpy (STATMODE, "WT_MEAN");
    115127  if ((N = get_argument (argc, argv, "-statmode"))) {
    116128    remove_argument (N, &argc, argv);
     
    293305  // by definition, the client is not parallel
    294306  PARALLEL = FALSE;
     307  PARALLEL_MANUAL = FALSE;
     308  PARALLEL_SERIAL = FALSE;
    295309
    296310  if ((N = get_argument (argc, argv, "-v"))) {
     
    344358  if (!MODE) relphot_client_usage();
    345359
     360  strcpy (STATMODE, "WT_MEAN");
     361  if ((N = get_argument (argc, argv, "-statmode"))) {
     362    remove_argument (N, &argc, argv);
     363    strcpy (STATMODE, argv[N]);
     364    remove_argument (N, &argc, argv);
     365  }
     366
    346367  /* specify portion of the sky */
    347368  UserPatch.Rmin = 0;
  • branches/eam_branches/ipp-20111122/Ohana/src/relphot/src/initialize.c

    r33274 r33297  
    1212    // load the list of photcodes into the globals (photcodes, Nphotcodes)
    1313    // only a single remaining argument in this mode (the list of photcodes, eg g,r,i)
    14     ParsePhotcodeList (argv[1]);
     14    PhotcodeList = strcreate (argv[1]);
     15    ParsePhotcodeList (PhotcodeList);
    1516  }
    1617  if (USE_GRID && (Nphotcodes > 1)) {
     
    5859void initialize_client (int argc, char **argv) {
    5960
     61  // XXX need to determine which globals can affect relphot_client in either mode and pass appropriately
     62
    6063  relphot_client_help (argc, argv);
    6164  ConfigInit (&argc, argv);
     
    6366
    6467  // load the list of photcodes into the globals (photcodes, Nphotcodes)
    65   ParsePhotcodeList (argv[1]);
     68  PhotcodeList = strcreate (argv[1]);
     69  ParsePhotcodeList (PhotcodeList);
    6670}
    6771
     
    8084  while ((codename = strtok_r (list, ",", &ptr)) != NULL) {
    8185    list = NULL; // pass NULL on successive strtok_r calls
    82     fprintf (stderr, "PHOTCODE LIST: %s\n", myList);
    83     fprintf (stderr, "codename: %s\n", codename);
    8486    if ((photcodes[Nphotcodes] = GetPhotcodebyName (codename)) == NULL) {
    8587      fprintf (stderr, "ERROR: photcode %s not found in photcode table\n", codename);
  • branches/eam_branches/ipp-20111122/Ohana/src/relphot/src/load_catalogs.c

    r33274 r33297  
    7676
    7777  fprintf (stderr, "using "OFF_T_FMT" of "OFF_T_FMT" stars ("OFF_T_FMT" of "OFF_T_FMT" measurements)\n", Nstar, Nstar_total, Nmeas, Nmeas_total);
    78   if (Nstar < 1) Shutdown ("%s", "ERROR: no stars match the minimum requirements; exiting \n");
     78  if (!hostID && (Nstar < 1)) Shutdown ("%s", "ERROR: no stars match the minimum requirements; exiting \n");
     79  // in regular relphot, we shutdown here; in relphot_client, we generate and return an empty table (for consistency)
    7980   
    8081
     
    108109
    109110    char command[1024];
    110     snprintf (command, 1024, "relphot_client -test -load %s -hostID %d -catdir %s -hostdir %s",
    111               catalogFile, table->hosts[i].hostID, CATDIR, table->hosts[i].pathname);
     111    snprintf (command, 1024, "relphot_client %s -load %s -hostID %d -D CATDIR %s -hostdir %s",
     112              PhotcodeList, catalogFile, table->hosts[i].hostID, CATDIR, table->hosts[i].pathname);
    112113
    113114    fprintf (stderr, "command: %s\n", command);
    114115
    115     if (!PARALLEL_MANUAL) {
     116    if (PARALLEL_MANUAL) continue;
     117
     118    if (PARALLEL_SERIAL) {
     119      int status = system (command);
     120      if (status) {
     121        fprintf (stderr, "ERROR running relphot_client\n");
     122        exit (2);
     123      }
     124    } else {
    116125      // launch the job on the remote machine (no handshake)
    117126      int errorInfo = 0;
  • branches/eam_branches/ipp-20111122/Ohana/src/relphot/src/reload_catalogs.c

    r33274 r33297  
    134134
    135135    char command[1024];
    136     snprintf (command, 1024, "relphot_client -reload %s -hostname %s -catdir %s -hostdir %s",
    137               imageFile, table->hosts[i].hostname, CATDIR, table->hosts[i].pathname);
     136    snprintf (command, 1024, "relphot_client %s -update %s -hostID %d -D CATDIR %s -hostdir %s",
     137              PhotcodeList, imageFile, table->hosts[i].hostID, CATDIR, table->hosts[i].pathname);
    138138
    139139    fprintf (stderr, "command: %s\n", command);
    140140
    141     if (!PARALLEL_MANUAL) {
     141    if (PARALLEL_MANUAL) continue;
     142
     143    if (PARALLEL_SERIAL) {
     144      int status = system (command);
     145      if (status) {
     146        fprintf (stderr, "ERROR running relphot_client\n");
     147        exit (2);
     148      }
     149    } else {
    142150      // launch the job on the remote machine (no handshake)
    143151      int errorInfo = 0;
Note: See TracChangeset for help on using the changeset viewer.