Index: /branches/eam_branches/ipp-20111122/Ohana/src/opihi/Makefile
===================================================================
--- /branches/eam_branches/ipp-20111122/Ohana/src/opihi/Makefile	(revision 33304)
+++ /branches/eam_branches/ipp-20111122/Ohana/src/opihi/Makefile	(revision 33305)
@@ -9,4 +9,5 @@
 dimm:     	 lib.data lib.shell cmd.basic cmd.data cmd.astro
 dvo:      	 lib.data lib.shell cmd.basic cmd.data cmd.astro
+dvo_client:    	 lib.data lib.shell cmd.basic cmd.data cmd.astro
 pantasks: 	 lib.data lib.shell cmd.basic cmd.data cmd.astro
 pantasks_server: lib.data lib.shell cmd.basic cmd.data cmd.astro
@@ -24,6 +25,7 @@
 all:
 	for i in $(PROGRAM) $(SPECIAL); do $(MAKE) $$i || exit; done
-	$(MAKE) pantasks_client
-	$(MAKE) pantasks_server
+	# $(MAKE) dvo_client
+	# $(MAKE) pantasks_client
+	# $(MAKE) pantasks_server
 
 libs:
@@ -63,4 +65,10 @@
 	if [ -d pantasks ]; then (cd pantasks && $(MAKE) $@); fi
 
+dvo_client:
+	if [ -d dvo ]; then (cd dvo && $(MAKE) $@); fi
+
+dvo_client.install: dvo_client
+	if [ -d dvo ]; then (cd dvo && $(MAKE) $@); fi
+
 $(PROGRAM) $(LIBS) $(EXTRAS):
 	if [ -d "$@" ]; then (cd $@ && $(MAKE)); fi
Index: /branches/eam_branches/ipp-20111122/Ohana/src/opihi/doc/dvo.parallel.txt
===================================================================
--- /branches/eam_branches/ipp-20111122/Ohana/src/opihi/doc/dvo.parallel.txt	(revision 33305)
+++ /branches/eam_branches/ipp-20111122/Ohana/src/opihi/doc/dvo.parallel.txt	(revision 33305)
@@ -0,0 +1,12 @@
+
+2012.02.17
+
+ To parallelize dvo queries, like mextract, I need a version of dvo
+ that takes acts as the remote client.  It should take a single dvo
+ command on the command line and operate on it on the remote host.
+ eg:
+
+dvo_client mextract (reset of line)
+
+it would dump out a result table somewhere (what is loaded?)
+
Index: /branches/eam_branches/ipp-20111122/Ohana/src/opihi/dvo/Makefile
===================================================================
--- /branches/eam_branches/ipp-20111122/Ohana/src/opihi/dvo/Makefile	(revision 33304)
+++ /branches/eam_branches/ipp-20111122/Ohana/src/opihi/dvo/Makefile	(revision 33305)
@@ -25,6 +25,5 @@
 $(SRC)/region_list.$(ARCH).o		\
 $(SRC)/find_matches.$(ARCH).o		\
-$(SRC)/photometry.$(ARCH).o             \
-$(SRC)/dvo.$(ARCH).o
+$(SRC)/photometry.$(ARCH).o             
 
 cmds = \
@@ -88,5 +87,12 @@
 dvo: $(BIN)/dvo.$(ARCH)
 $(SRC)/dvo.$(ARCH).o : $(libs)
-$(BIN)/dvo.$(ARCH)   : $(funcs) $(cmds)
+$(BIN)/dvo.$(ARCH)   : $(funcs) $(cmds) $(SRC)/dvo.$(ARCH).o
+
+dvo_client: $(BIN)/dvo_client.$(ARCH)
+$(SRC)/dvo_client.$(ARCH).o : $(libs)
+$(BIN)/dvo_client.$(ARCH)   : $(funcs) $(cmds) $(SRC)/dvo_client.$(ARCH).o
+
+dvo.install: $(DESTBIN)/dvo
+dvo_client.install: $(DESTBIN)/dvo_client
 
 install: $(DESTBIN)/dvo help modules
@@ -98,5 +104,5 @@
 modules: dvo.modules
 
-.PHONY: dvo
+.PHONY: dvo dvo_client
 
 # deprecated functions: verify & delete
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 33305)
+++ /branches/eam_branches/ipp-20111122/Ohana/src/opihi/dvo/dvo_client.c	(revision 33305)
@@ -0,0 +1,71 @@
+# include "dvoshell.h"
+
+/* program-dependent initialization */
+void program_init (int *argc, char **argv) {
+  
+  /* load the commands used by this implementation */
+  InitBasic ();
+  InitData ();
+  InitAstro ();
+  InitDVO ();
+
+  {
+    char *helpdir;
+    char *modules;
+    static char *datadir = "@DATADIR@";
+    ALLOCATE (helpdir, char, strlen(datadir) + strlen("/help") + 2);
+    sprintf (helpdir, "%s/help", datadir);
+    set_str_variable ("HELPDIR", helpdir);
+    free (helpdir);
+    ALLOCATE (modules, char, strlen(datadir) + strlen("/modules") + 2);
+    sprintf (modules, "%s/modules", datadir);
+    set_str_variable ("MODULES:0", modules);
+    set_int_variable ("MODULES:n", 1);
+    free (modules);
+  }
+
+  return;
+}
+
+// dvo_client should be called like a dvo command;
+int main (int argc, char **argv) {
+  
+  // parse out whatever might be needed up front
+  general_init (&argc, argv);
+  program_init (&argc, argv);
+
+  if (argc < 2) {
+    fprintf (stderr, "USAGE: dvo_client (command) (options)\n");
+    exit (3);
+  }
+
+  // identiy the comm
+  Command *cmd = MatchCommand (argv[1], TRUE, TRUE);
+  if (cmd == NULL) {
+    fprintf (stderr, "unknown command %s\n", argv[1]);
+    exit (1);
+  }
+
+  // argv[0] is dvo_client; we want to pass in argv[1].. as argv[0]
+  int status = (*cmd[0].func) (argc - 1, argv + 1);
+  if (!status) exit (2);
+  exit (0);
+}
+
+/* standard welcome message */
+void welcome () {
+  gprint (GP_ERR, "starting dvo_client...\n");
+}
+
+/* add program-dependent exit functions here */
+void cleanup () {
+  QuitKapa ();
+  ConfigFree ();
+
+  FreeBasic ();
+  FreeData ();
+  FreeAstro ();
+  FreeDVO ();
+  return;
+}
+
Index: /branches/eam_branches/ipp-20111122/Ohana/src/opihi/dvo/mextract.c
===================================================================
--- /branches/eam_branches/ipp-20111122/Ohana/src/opihi/dvo/mextract.c	(revision 33304)
+++ /branches/eam_branches/ipp-20111122/Ohana/src/opihi/dvo/mextract.c	(revision 33305)
@@ -32,4 +32,14 @@
     remove_argument (N, &argc, argv);
     VERBOSE = TRUE;
+  }
+
+  // XXX not yet thought through (where are these set?)
+  if (PARALLEL && !HOST_ID) {
+    HostTableLaunchJobs (CATDIR, argc, argv);
+    HostTableWaitJobs (table, __FILE__, __LINE__);
+
+    // load fields from file
+    ReadVectorTables
+    return TRUE;
   }
 
@@ -121,4 +131,8 @@
 
   for (i = 0; (i < skylist[0].Nregions) && !interrupt; i++) {
+
+    // XXX parallel case, wrong client
+    if (HOST_ID && (HOST_ID != skylist[0].regions[i]->hostID)) continue;
+
     /* lock, load, unlock catalog */
     catalog.filename = skylist[0].filename[i];
@@ -189,4 +203,10 @@
   for (n = 0; n < Nreturn; n++) {
     ResetVector (vec[n], fields[n].type, MAX(0,Npts));
+  }
+
+  if (HOST_ID) {
+    // write table
+    WriteVectorTable (vec);
+    return TRUE;
   }
 
