Index: /branches/eam_branches/ipp-20111122/Ohana/src/opihi/dvo/avextract.c
===================================================================
--- /branches/eam_branches/ipp-20111122/Ohana/src/opihi/dvo/avextract.c	(revision 33562)
+++ /branches/eam_branches/ipp-20111122/Ohana/src/opihi/dvo/avextract.c	(revision 33563)
@@ -43,12 +43,4 @@
   }
 
-  // dump results directly to fits file (esp for parallel dvo)
-  char *ResultFile = NULL;
-  if ((N = get_argument (argc, argv, "-result"))) {
-    remove_argument (N, &argc, argv);
-    ResultFile = strcreate(argv[N]);
-    remove_argument (N, &argc, argv);
-  }
-
   dvo_catalog_init (&catalog, TRUE);
 
@@ -63,13 +55,4 @@
     print_error(); 
     goto escape; 
-  }
-
-  // this does all the work of re-packaging the command, calling it on the remote machines, then loading in the results
-  if (PARALLEL && !HOST_ID) {
-    // not all parallel ops need to set the region selection...
-    if (!SetSkyRegions (selection)) goto escape;
-
-    int status = HostTableParallelOps (argc, argv, ResultFile, 0);
-    return status;
   }
 
@@ -110,4 +93,17 @@
   /* load region corresponding to selection above */
   if ((skylist = SelectRegions (selection)) == NULL) goto escape;
+
+  // this does all the work of re-packaging the command, calling it on the remote machines, then loading in the results
+  if (PARALLEL && !HOST_ID) {
+    int status = HostTableParallelOps (argc, argv, RESULT_FILE, 0);
+
+    dbFreeFields (fields, Nfields);
+    dbFreeStack (stack, Nstack);
+    free (stack);
+    FreeSkyRegionSelection (selection);
+    dvo_catalog_free (&catalog);
+
+    return status;
+  }
 
   /* create output storage vectors */
@@ -204,6 +200,6 @@
 
   // write vectors to a table (this is used by parallel dvo operations, but can be used elsewhere)
-  if (ResultFile) {
-    int status = WriteVectorTableFITS (ResultFile, "RESULT", vec, Nreturn, FALSE, NULL);
+  if (RESULT_FILE) {
+    int status = WriteVectorTableFITS (RESULT_FILE, "RESULT", vec, Nreturn, FALSE, NULL);
     if (!status) goto escape;
   }
Index: /branches/eam_branches/ipp-20111122/Ohana/src/opihi/dvo/avmatch.c
===================================================================
--- /branches/eam_branches/ipp-20111122/Ohana/src/opihi/dvo/avmatch.c	(revision 33562)
+++ /branches/eam_branches/ipp-20111122/Ohana/src/opihi/dvo/avmatch.c	(revision 33563)
@@ -48,12 +48,4 @@
     remove_argument (N, &argc, argv);
     PARALLEL = TRUE;
-  }
-
-  // dump results directly to fits file (esp for parallel dvo)
-  char *ResultFile = NULL;
-  if ((N = get_argument (argc, argv, "-result"))) {
-    remove_argument (N, &argc, argv);
-    ResultFile = strcreate(argv[N]);
-    remove_argument (N, &argc, argv);
   }
 
@@ -98,6 +90,5 @@
 
     // I need to pass the RA & DEC vectors to the remote clients...
-    int status = HostTableParallelOps (argc, argv, ResultFile, RAvec->Nelements);
-    if (ResultFile) free (ResultFile);
+    int status = HostTableParallelOps (argc, argv, RESULT_FILE, RAvec->Nelements);
     if (vec) free (vec);
     
@@ -225,5 +216,5 @@
   // write vectors to a table (this is used by parallel dvo operations, but can be used elsewhere)
   // only write the fields which were in a valid catalog
-  if (ResultFile) {
+  if (RESULT_FILE) {
     // extend the array by one to hold index array
     REALLOCATE (vec, Vector *, Nfields + 1);
@@ -271,5 +262,5 @@
       vec[i][0].Nelements = Nfound;
     }
-    int status = WriteVectorTableFITS (ResultFile, "RESULT", vec, Nfields + 1, FALSE, NULL);
+    int status = WriteVectorTableFITS (RESULT_FILE, "RESULT", vec, Nfields + 1, FALSE, NULL);
     free (vec[Nfields]->elements.Int);
     free (vec[Nfields]);
Index: /branches/eam_branches/ipp-20111122/Ohana/src/opihi/dvo/dvo.c.in
===================================================================
--- /branches/eam_branches/ipp-20111122/Ohana/src/opihi/dvo/dvo.c.in	(revision 33562)
+++ /branches/eam_branches/ipp-20111122/Ohana/src/opihi/dvo/dvo.c.in	(revision 33563)
@@ -48,4 +48,5 @@
   HOST_ID = 0;
   HOSTDIR = NULL;
+  RESULT_FILE = NULL;
 
   return;
Index: /branches/eam_branches/ipp-20111122/Ohana/src/opihi/dvo/dvo_client.c
===================================================================
--- /branches/eam_branches/ipp-20111122/Ohana/src/opihi/dvo/dvo_client.c	(revision 33562)
+++ /branches/eam_branches/ipp-20111122/Ohana/src/opihi/dvo/dvo_client.c	(revision 33563)
@@ -1,3 +1,5 @@
 # include "dvoshell.h"
+
+int input PROTO((int, char **));
 
 /* program-dependent initialization */
@@ -39,4 +41,11 @@
     remove_argument (N, argc, argv);
     HOSTDIR = strcreate (argv[N]);;
+    remove_argument (N, argc, argv);
+  }
+
+  RESULT_FILE = NULL;
+  if ((N = get_argument (*argc, argv, "-result"))) {
+    remove_argument (N, argc, argv);
+    RESULT_FILE = strcreate (argv[N]);;
     remove_argument (N, argc, argv);
   }
@@ -85,4 +94,9 @@
   }
 
+  int status = input (2, &argv[0]);
+  if (!status) exit (2);
+  exit (0);
+
+# if (0)
   // identiy the comm
   Command *cmd = MatchCommand (argv[1], TRUE, TRUE);
@@ -96,4 +110,5 @@
   if (!status) exit (2);
   exit (0);
+# endif
 }
 
Index: /branches/eam_branches/ipp-20111122/Ohana/src/opihi/dvo/dvo_host_utils.c
===================================================================
--- /branches/eam_branches/ipp-20111122/Ohana/src/opihi/dvo/dvo_host_utils.c	(revision 33562)
+++ /branches/eam_branches/ipp-20111122/Ohana/src/opihi/dvo/dvo_host_utils.c	(revision 33563)
@@ -6,5 +6,5 @@
 # define MAX_PATH_LENGTH 1024
 
-int HostTableLaunchJobs (HostTable *table, char *basecmd) {
+int HostTableLaunchJobs (HostTable *table, char *basecmd, char *options) {
 
   int i;
@@ -19,6 +19,12 @@
     snprintf (resultFile, MAX_PATH_LENGTH, "%s/dvo.results.fits", table->hosts[i].pathname);
 
+    char *commandFile = abspath("dvo_client.command.txt", MAX_PATH_LENGTH);
+    FILE *f = fopen (commandFile, "w");
+    fprintf (f, "%s\n", basecmd);
+    fclose (f);
+
     char command[1024];
-    snprintf (command, 1024, "dvo_client %s -result %s -hostID %d -hostdir %s", basecmd, resultFile, table->hosts[i].hostID, table->hosts[i].pathname);
+    snprintf (command, 1024, "dvo_client %s -result %s %s -hostID %d -hostdir %s", commandFile, resultFile, options, table->hosts[i].hostID, table->hosts[i].pathname);
+    free (commandFile);
 
     if (DEBUG || PARALLEL_MANUAL) fprintf (stderr, "command: %s\n", command);
@@ -103,13 +109,14 @@
 
   char tmp;
-  char *command = NULL;
-  int length = snprintf (&tmp, 0, "%s -D CATDIR %s -time %s %s -skyregion %f %f %f %f", basecmd, CATDIR, TimeRef, TimeFormat, Rmin, Rmax, Dmin, Dmax);
+  char *options = NULL;
+  int length = snprintf (&tmp, 0, "-D CATDIR %s -time %s %s -skyregion %f %f %f %f", CATDIR, TimeRef, TimeFormat, Rmin, Rmax, Dmin, Dmax);
 
-  ALLOCATE (command, char, length);
-  snprintf (command, length, "%s -D CATDIR %s -time %s %s -skyregion %f %f %f %f", basecmd, CATDIR, TimeRef, TimeFormat, Rmin, Rmax, Dmin, Dmax);
+  ALLOCATE (options, char, length);
+  snprintf (options, length, "-D CATDIR %s -time %s %s -skyregion %f %f %f %f", CATDIR, TimeRef, TimeFormat, Rmin, Rmax, Dmin, Dmax);
 
   // launch this command remotely
-  HostTableLaunchJobs (table, command);
-  free (command);
+  HostTableLaunchJobs (table, basecmd, options);
+  free (options);
+  free (basecmd);
 
   if (PARALLEL_MANUAL) {
@@ -158,4 +165,5 @@
   free (vec);
 
+  free (table);
   return TRUE;
 }
Index: /branches/eam_branches/ipp-20111122/Ohana/src/opihi/dvo/gcat.c
===================================================================
--- /branches/eam_branches/ipp-20111122/Ohana/src/opihi/dvo/gcat.c	(revision 33562)
+++ /branches/eam_branches/ipp-20111122/Ohana/src/opihi/dvo/gcat.c	(revision 33563)
@@ -3,5 +3,5 @@
 int gcat (int argc, char **argv) {
   
-  int i;
+  int i, N;
   struct stat filestat;
   double Ra, Dec, Radius;
@@ -9,4 +9,20 @@
   SkyList *skylist;
   void *Signal;
+
+  int ShowHost = FALSE;
+  if ((N = get_argument (argc, argv, "-host"))) {
+    remove_argument (N, &argc, argv);
+    ShowHost = TRUE;
+  }
+  int ShowBackup = FALSE;
+  if ((N = get_argument (argc, argv, "-backup"))) {
+    remove_argument (N, &argc, argv);
+    ShowBackup = TRUE;
+  }
+  int ShowFlags = FALSE;
+  if ((N = get_argument (argc, argv, "-flags"))) {
+    remove_argument (N, &argc, argv);
+    ShowFlags = TRUE;
+  }
 
   if ((argc != 3) && (argc != 4)) {
@@ -31,9 +47,26 @@
 
   for (i = 0; (i < skylist[0].Nregions) && !interrupt; i++) {
+    gprint (GP_ERR, "%3d %s", i, skylist[0].regions[i][0].name);
     if (stat (skylist[0].filename[i], &filestat) != -1) {
-      gprint (GP_ERR, "%3d %s *\n", i, skylist[0].regions[i][0].name);
+      gprint (GP_ERR, " *");
     } else {
-      gprint (GP_ERR, "%3d %s\n", i, skylist[0].regions[i][0].name);
+      gprint (GP_ERR, "  ");
     } 
+    if (ShowHost) {
+      gprint (GP_ERR, "  %3d", skylist[0].regions[i][0].hostID);
+    } else {
+      gprint (GP_ERR, "     ");
+    }
+    if (ShowBackup) {
+      gprint (GP_ERR, "  %3d", skylist[0].regions[i][0].backupID);
+    } else {
+      gprint (GP_ERR, "     ");
+    }
+    if (ShowFlags) {
+      gprint (GP_ERR, "  0x%04x", skylist[0].regions[i][0].hostFlags);
+    } else {
+      gprint (GP_ERR, "        ");
+    }
+    gprint (GP_ERR, "\n");
     set_str_variable ("CATNAME", skylist[0].filename[i]);
   }
Index: /branches/eam_branches/ipp-20111122/Ohana/src/opihi/dvo/mextract.c
===================================================================
--- /branches/eam_branches/ipp-20111122/Ohana/src/opihi/dvo/mextract.c	(revision 33562)
+++ /branches/eam_branches/ipp-20111122/Ohana/src/opihi/dvo/mextract.c	(revision 33563)
@@ -38,12 +38,4 @@
     remove_argument (N, &argc, argv);
     PARALLEL = TRUE;
-  }
-
-  // dump results directly to fits file (esp for parallel dvo)
-  char *ResultFile = NULL;
-  if ((N = get_argument (argc, argv, "-result"))) {
-    remove_argument (N, &argc, argv);
-    ResultFile = strcreate(argv[N]);
-    remove_argument (N, &argc, argv);
   }
 
@@ -63,13 +55,4 @@
   }
 
-  // this does all the work of re-packaging the command, calling it on the remote machines, then loading in the results
-  if (PARALLEL && !HOST_ID) {
-    // not all parallel ops need to set the region selection...
-    if (!SetSkyRegions (selection)) goto escape;
-
-    int status = HostTableParallelOps (argc, argv, ResultFile, 0);
-    return status;
-  }
-
   // init locally static variables (time refs)
   dbExtractMeasuresInit();
@@ -112,4 +95,17 @@
   /* load region corresponding to selection above */
   if ((skylist = SelectRegions (selection)) == NULL) goto escape;
+
+  // this does all the work of re-packaging the command, calling it on the remote machines, then loading in the results
+  if (PARALLEL && !HOST_ID) {
+    int status = HostTableParallelOps (argc, argv, RESULT_FILE, 0);
+
+    dbFreeFields (fields, Nfields);
+    dbFreeStack (stack, Nstack);
+    free (stack);
+    FreeSkyRegionSelection (selection);
+    dvo_catalog_free (&catalog);
+
+    return status;
+  }
 
   // load image data if needed (for fields listed below)
@@ -227,6 +223,6 @@
 
   // write vectors to a table (this is used by parallel dvo operations, but can be used elsewhere)
-  if (ResultFile) {
-    int status = WriteVectorTableFITS (ResultFile, "RESULT", vec, Nreturn, FALSE, NULL);
+  if (RESULT_FILE) {
+    int status = WriteVectorTableFITS (RESULT_FILE, "RESULT", vec, Nreturn, FALSE, NULL);
     if (!status) goto escape;
   }
@@ -243,5 +239,4 @@
 
 escape:
-  if (ResultFile) free (ResultFile);
   if (vec) free (vec);
   free (values);
Index: /branches/eam_branches/ipp-20111122/Ohana/src/opihi/include/dvoshell.h
===================================================================
--- /branches/eam_branches/ipp-20111122/Ohana/src/opihi/include/dvoshell.h	(revision 33562)
+++ /branches/eam_branches/ipp-20111122/Ohana/src/opihi/include/dvoshell.h	(revision 33563)
@@ -30,4 +30,5 @@
 int   HOST_ID;
 char *HOSTDIR;
+char *RESULT_FILE;
 
 /*** dvo prototypes ***/
@@ -98,5 +99,5 @@
 dbValue      dbExtractImages        PROTO((Image *image, off_t Nimage, off_t N, dbField *field));
 
-int          HostTableLaunchJobs    PROTO((HostTable *table, char *basecmd));
+int          HostTableLaunchJobs    PROTO((HostTable *table, char *basecmd, char *options));
 int          HostTableParallelOps   PROTO((int argc, char **argv, char *ResultFile, int Nelements));
 # endif
