Index: /branches/eam_branches/ipp-20130307/Ohana/src/opihi/dvo/mmatch.c
===================================================================
--- /branches/eam_branches/ipp-20130307/Ohana/src/opihi/dvo/mmatch.c	(revision 35400)
+++ /branches/eam_branches/ipp-20130307/Ohana/src/opihi/dvo/mmatch.c	(revision 35401)
@@ -106,76 +106,4 @@
   RAvec  = NULL;
   DECvec = NULL;
-  if (PARALLEL && !HOST_ID) {
-
-    // We need to copy the args to a temp array and modify them so that we send the
-    // correct set to the remote client.  The args list looks like this:
-    // if (!CoordsFile) : mmatch (RA) (DEC) (RADIUS) field, ...
-    // if ( CoordsFile) : mmatch (RADIUS) field, ... [because we stripped off the -coords filename elements]
-
-    // allocate the temp array and copy all but (RA) (DEC)
-    int targc = 0;
-    char **targv = NULL;
-    ALLOCATE (targv, char *, argc + 2);
-    for (i = 0; i < argc; i++) {
-      if (!CoordsFile && (i == 1)) continue;
-      if (!CoordsFile && (i == 2)) continue;
-      targv[targc] = strcreate (argv[i]);
-      targc ++;
-    }
-
-    // if not specified, create the coords.fits input file
-    if (!CoordsFile) {
-      // get vectors corresponding to coordinates of interest
-      if ((RAvec  = SelectVector (argv[1], ANYVECTOR, TRUE)) == NULL) goto help;
-      if ((DECvec = SelectVector (argv[2], ANYVECTOR, TRUE)) == NULL) goto help;
-      
-      ALLOCATE (vec, Vector *, 2);
-      vec[0] = RAvec;
-      vec[1] = DECvec;
-
-      CoordsFile = abspath("coords.fits", 1024);
-      int status = WriteVectorTableFITS (CoordsFile, "COORDS", vec, 2, FALSE, NULL);
-      if (!status) goto escape;
-    }
-
-    // add the coords file to the args list
-    targv[targc+0] = strcreate ("-coords");
-    targv[targc+1] = CoordsFile; // this gets freed with targv
-    targc += 2;
-    
-    // if needed, add the index vector to the args list
-    if (IDXvec) {
-      REALLOCATE (targv, char *, targc + 2);
-      targv[targc+0] = strcreate ("-index");
-      targv[targc+1] = strcreate (IDXvec[0].name);
-      targc += 2;
-    }      
-
-    if (loadImages) {
-      Image *image;
-      off_t Nimage;
-      if ((image = LoadImagesDVO (&Nimage)) == NULL) goto escape;
-
-      char *filename = abspath("image.metadata.fits", DVO_MAX_PATH);
-      ImageMetadataSave (filename, image, Nimage);
-
-      REALLOCATE (targv, char *, targc + 2);
-      targv[targc+0] = strcreate ("-image-metadata");
-      targv[targc+1] = strcreate (filename);
-      targc += 2;
-    }
-
-    // call the remote client
-    int status = HostTableParallelOps (skylist, targc, targv, RESULT_FILE, TRUE, 0, VERBOSE);
-    if (vec) free (vec);
-    
-    // free up targv
-    for (i = 0; i < targc; i++) {
-      free (targv[i]);
-    }
-    free (targv);
-
-    return status;
-  }
 
   // get vectors corresponding to coordinates of interest
@@ -193,4 +121,77 @@
     remove_argument (1, &argc, argv);
   }
+
+  /* load regions which contain all supplied RA,DEC coordinates */
+  if ((skylist = SelectRegionsByCoordVectors (RAvec, DECvec)) == NULL) goto escape;
+
+  if (PARALLEL && !HOST_ID) {
+
+    // We need to copy the args to a temp array and modify them so that we send the
+    // correct set to the remote client.  The args list looks like this:
+    // if (!CoordsFile) : mmatch (RADIUS) field, ... [we removed RA & DEC above]
+    // if ( CoordsFile) : mmatch (RADIUS) field, ... [because we stripped off the -coords filename elements]
+
+    // allocate the temp array and copy all but (RA) (DEC)
+    int targc = 0;
+    char **targv = NULL;
+    ALLOCATE (targv, char *, argc + 2);
+    for (i = 0; i < argc; i++) {
+      targv[targc] = strcreate (argv[i]);
+      targc ++;
+    }
+
+    // if not specified, create the coords.fits input file
+    // NOTE: RAvec, DECvec were set above
+    if (!CoordsFile) {
+      ALLOCATE (vec, Vector *, 2);
+      vec[0] = RAvec;
+      vec[1] = DECvec;
+
+      // XXX this is now set for both cases...
+      CoordsFile = abspath("coords.fits", 1024);
+      int status = WriteVectorTableFITS (CoordsFile, "COORDS", vec, 2, FALSE, NULL);
+      if (!status) goto escape;
+    }
+
+    // add the coords file to the args list
+    targv[targc+0] = strcreate ("-coords");
+    targv[targc+1] = CoordsFile; // this gets freed with targv
+    targc += 2;
+    
+    // if needed, add the index vector to the args list
+    if (IDXvec) {
+      REALLOCATE (targv, char *, targc + 2);
+      targv[targc+0] = strcreate ("-index");
+      targv[targc+1] = strcreate (IDXvec[0].name);
+      targc += 2;
+    }      
+
+    if (loadImages) {
+      Image *image;
+      off_t Nimage;
+      if ((image = LoadImagesDVO (&Nimage)) == NULL) goto escape;
+
+      char *filename = abspath("image.metadata.fits", DVO_MAX_PATH);
+      ImageMetadataSave (filename, image, Nimage);
+
+      REALLOCATE (targv, char *, targc + 2);
+      targv[targc+0] = strcreate ("-image-metadata");
+      targv[targc+1] = strcreate (filename);
+      targc += 2;
+    }
+
+    // call the remote client
+    int status = HostTableParallelOps (skylist, targc, targv, RESULT_FILE, TRUE, 0, VERBOSE);
+    if (vec) free (vec);
+    
+    // free up targv
+    for (i = 0; i < targc; i++) {
+      free (targv[i]);
+    }
+    free (targv);
+
+    return status;
+  } // END of remote call section
+
   RADIUS = atof (argv[1]);
   remove_argument (1, &argc, argv);
@@ -209,6 +210,4 @@
   }
 
-  /* load regions which contain all supplied RA,DEC coordinates */
-  if ((skylist = SelectRegionsByCoordVectors (RAvec, DECvec)) == NULL) goto escape;
 
   /* create output storage vectors */
Index: /branches/eam_branches/ipp-20130307/Ohana/src/opihi/dvo/remote.c
===================================================================
--- /branches/eam_branches/ipp-20130307/Ohana/src/opihi/dvo/remote.c	(revision 35400)
+++ /branches/eam_branches/ipp-20130307/Ohana/src/opihi/dvo/remote.c	(revision 35401)
@@ -61,6 +61,18 @@
   }
 
+  // load the list of hosts
+  SkyTable *sky = GetSkyTable();
+  if (!sky) {
+    gprint (GP_ERR, "failed to load sky table for database\n");
+    return FALSE;
+  }
+  SkyList *skylist = NULL;
+  ALLOCATE (skylist, SkyList, 1);
+  skylist[0].Nregions = sky[0].Nregions;
+  strcpy (skylist[0].hosts, sky[0].hosts);
+
   // strip of the 'remote' and send the remaining arguments to the remote machine
-  int status = HostTableParallelOps (NULL, argc - 1, &argv[1], NULL, ReadVectors, 0, VERBOSE);
+  int status = HostTableParallelOps (skylist, argc - 1, &argv[1], NULL, ReadVectors, 0, VERBOSE);
+  free (skylist);
   return status;
 }
Index: /branches/eam_branches/ipp-20130307/Ohana/src/opihi/dvo/skyregion.c
===================================================================
--- /branches/eam_branches/ipp-20130307/Ohana/src/opihi/dvo/skyregion.c	(revision 35400)
+++ /branches/eam_branches/ipp-20130307/Ohana/src/opihi/dvo/skyregion.c	(revision 35401)
@@ -98,4 +98,5 @@
   new[0].Nregions = 0;
   new[0].ownElements = FALSE; // this list is only holding a view to the elements
+  strcpy (new[0].hosts, sky[0].hosts);
 
   // output list
@@ -107,4 +108,5 @@
   list[0].Nregions = 0;
   list[0].ownElements = FALSE; // this list is only holding a view to the elements
+  strcpy (list[0].hosts, sky[0].hosts);
 
   for (i = 0; i < Npts; i++) {
