Index: branches/eam_branches/ipp-20140206/Ohana/src/libdvo/include/dvo.h
===================================================================
--- branches/eam_branches/ipp-20140206/Ohana/src/libdvo/include/dvo.h	(revision 36575)
+++ branches/eam_branches/ipp-20140206/Ohana/src/libdvo/include/dvo.h	(revision 36576)
@@ -286,13 +286,13 @@
 
 // A RegionHost processes data for some region in parallel with other regions
-typedef struct {
-  double Rmin;
-  double Rmax;
-  double Dmin;
-  double Dmax;
-
-  double RminCat;
-  double RmaxCat;
-  double DminCat;
+typedef struct RegionHostInfo {
+  double Rmin;	      // (Rmin,Rmax),(Dmin,Dmax) arehard RA,DEC boundaries of the 
+  double Rmax;	      // region for which each host is responsible.  A given host
+  double Dmin;	      // calibrates the images for which the fiducial point (center) 
+  double Dmax;	      // lands in the region, and all objects in the region
+
+  double RminCat;      // (RminCat,RmaxCat),(DminCat,DmaxCat) are the region for which 
+  double RmaxCat;      // the catalogs need to be loaded : this is the outer bounds
+  double DminCat;      // of the region containing all images completely
   double DmaxCat;
 
@@ -310,4 +310,7 @@
   Image *image;
   off_t *imseq;
+
+  int *neighbors;
+  int Nneighbors;
 } RegionHostInfo;
 
Index: branches/eam_branches/ipp-20140206/Ohana/src/libdvo/src/RegionHostTable.c
===================================================================
--- branches/eam_branches/ipp-20140206/Ohana/src/libdvo/src/RegionHostTable.c	(revision 36575)
+++ branches/eam_branches/ipp-20140206/Ohana/src/libdvo/src/RegionHostTable.c	(revision 36576)
@@ -27,4 +27,7 @@
     hosts[i].Nimage = 0;
     hosts[i].NIMAGE = 0;
+
+    hosts[i].neighbors = NULL;
+    hosts[i].Nneighbors = 0;
   }
   return;
@@ -167,7 +170,62 @@
   }
 
+  for (i = 0; i < table->Nhosts; i++) {
+    RegionHostFindNeighbors (table, i);
+  }
+
   free (filename);
   fclose (f);
   return table;
+}
+
+int RegionHostFindNeighbors (RegionHostTable *table, int Nhost) {
+
+  // given a specific host (by table sequence), find all of its neighbors
+  // (eg, (host->Rmin == althost->Rmax && (host->Dmin <= althost->Dmax) && (host->Dmax >= althost->Dmin)
+
+  RegionHostInfo *myhost = &table->hosts[Nhost];
+  myAssert (!myhost->neighbors, "myhost neighbors already allocated");
+  myAssert (!myhost->Nneighbors, "myhost Nneighbors not zero?");
+  ALLOCATE (myhost->neighbors, int, 1); // always allocate 1 extra
+
+  for (i = 0; i < table->Nhosts; i++) {
+
+    if (i == Nhost) continue;
+    RegionHostInfo *althost = &table->hosts[i];
+    
+    int onBorder;
+
+    onBorder = 
+      (myhost->Rmin == altHost->Rmax) && 
+      (myhost->Dmin <= altHost->Dmax) &&
+      (myhost->Dmax >= altHost->Dmin);
+    if (onBorder) goto add_neighbor;
+
+    onBorder = 
+      (myhost->Rmax == altHost->Rmin) && 
+      (myhost->Dmin <= altHost->Dmax) &&
+      (myhost->Dmax >= altHost->Dmin);
+    if (onBorder) goto add_neighbor;
+
+    onBorder = 
+      (myhost->Dmin == altHost->Dmax) && 
+      (myhost->Rmin <= altHost->Rmax) &&
+      (myhost->Rmax >= altHost->Rmin);
+    if (onBorder) goto add_neighbor;
+
+    onBorder = 
+      (myhost->Dmax == altHost->Dmin) && 
+      (myhost->Rmin <= altHost->Rmax) &&
+      (myhost->Rmax >= altHost->Rmin);
+    if (onBorder) goto add_neighbor;
+    
+    continue;
+
+  add_neighbor:
+      myhost->neighbors[myhost->Nneighbors] = i;
+      myhost->Nneighbors ++;
+      REALLOCATE (myhost->neighbors, int, myhost->Nneighbors + 1);
+  }
+  return TRUE;
 }
 
