IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 23, 2012, 2:19:56 PM (14 years ago)
Author:
eugene
Message:

improve verbosity; clear some memory leaks in parallel ops

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20111122/Ohana/src/opihi/dvo/avextract.c

    r33583 r33600  
    4141    remove_argument (N, &argc, argv);
    4242    PARALLEL = TRUE;
     43  }
     44
     45  // use remote tables, but not dvo_client..
     46  int PARALLEL_LOCAL = FALSE;
     47  HostTable *table = NULL;
     48  if ((N = get_argument (argc, argv, "-parallel-local"))) {
     49    remove_argument (N, &argc, argv);
     50    PARALLEL_LOCAL = TRUE;
     51
     52    char *CATDIR = GetCATDIR();
     53    if (!CATDIR) {
     54      gprint (GP_ERR, "CATDIR is not set\n");
     55      return FALSE;
     56    }
     57    SkyTable *sky = GetSkyTable();
     58    if (!sky) {
     59      gprint (GP_ERR, "failed to load sky table for database\n");
     60      return FALSE;
     61    }
     62    table = HostTableLoad (CATDIR, sky->hosts);
     63    if (!table) {
     64      gprint (GP_ERR, "ERROR: failure reading Host Table %s for database %s\n", sky->hosts, CATDIR);
     65      return FALSE;
     66    }   
    4367  }
    4468
     
    96120  // this does all the work of re-packaging the command, calling it on the remote machines, then loading in the results
    97121  if (PARALLEL && !HOST_ID) {
    98     int status = HostTableParallelOps (argc, argv, RESULT_FILE, 0);
     122    int status = HostTableParallelOps (argc, argv, RESULT_FILE, 0, VERBOSE);
    99123
    100124    dbFreeFields (fields, Nfields);
     
    141165    /* lock, load, unlock catalog */
    142166    char hostfile[1024];
     167    if (PARALLEL_LOCAL) {
     168      int hostID = skylist[0].regions[i]->hostID;
     169      int seq = table->index[hostID];
     170      HOSTDIR = table->hosts[seq].pathname;
     171    }
    143172    snprintf (hostfile, 1024, "%s/%s.cpt", HOSTDIR, skylist[0].regions[i]->name);
    144     catalog.filename = HOST_ID ? hostfile : skylist[0].filename[i];
     173    catalog.filename = (HOST_ID || PARALLEL_LOCAL) ? hostfile : skylist[0].filename[i];
    145174    catalog.catflags = LOAD_AVES | LOAD_SECF;
    146175    if (needMeasures) {
     
    205234  }
    206235
     236  if (table) free (table);
    207237  if (vec) free (vec);
    208238  if (values) free (values);
     
    215245
    216246 escape:
     247  if (table) free (table);
    217248  if (vec) free (vec);
    218249  if (values) free (values);
Note: See TracChangeset for help on using the changeset viewer.