Index: /branches/eam_branches/ipp-20140206/Ohana/src/libdvo/include/dvo.h
===================================================================
--- /branches/eam_branches/ipp-20140206/Ohana/src/libdvo/include/dvo.h	(revision 36576)
+++ /branches/eam_branches/ipp-20140206/Ohana/src/libdvo/include/dvo.h	(revision 36577)
@@ -311,6 +311,7 @@
   off_t *imseq;
 
-  int *neighbors;
-  int Nneighbors;
+  int *neighbors;	      // list of neighbor index values
+  int Nneighbors;	      // number of neighbors
+  char isNeighbor;	      // TRUE if I am a neighbor to the current region host
 } RegionHostInfo;
 
@@ -906,4 +907,5 @@
 int RegionHostTableWaitJobs (RegionHostTable *regionHosts, char *file, int lineno);
 int RegionHostTableWaitJobsGetIO (RegionHostTable *regionHosts, char *file, int lineno, int VERBOSE);
+int RegionHostFindNeighbors (RegionHostTable *table, int Nhost);
 
 # endif // DVO_H
Index: /branches/eam_branches/ipp-20140206/Ohana/src/libdvo/src/RegionHostTable.c
===================================================================
--- /branches/eam_branches/ipp-20140206/Ohana/src/libdvo/src/RegionHostTable.c	(revision 36576)
+++ /branches/eam_branches/ipp-20140206/Ohana/src/libdvo/src/RegionHostTable.c	(revision 36577)
@@ -30,4 +30,5 @@
     hosts[i].neighbors = NULL;
     hosts[i].Nneighbors = 0;
+    hosts[i].isNeighbor = FALSE;
   }
   return;
@@ -170,8 +171,4 @@
   }
 
-  for (i = 0; i < table->Nhosts; i++) {
-    RegionHostFindNeighbors (table, i);
-  }
-
   free (filename);
   fclose (f);
@@ -180,4 +177,6 @@
 
 int RegionHostFindNeighbors (RegionHostTable *table, int Nhost) {
+
+  int i;
 
   // given a specific host (by table sequence), find all of its neighbors
@@ -192,5 +191,5 @@
 
     if (i == Nhost) continue;
-    RegionHostInfo *althost = &table->hosts[i];
+    RegionHostInfo *altHost = &table->hosts[i];
     
     int onBorder;
@@ -226,4 +225,5 @@
       myhost->Nneighbors ++;
       REALLOCATE (myhost->neighbors, int, myhost->Nneighbors + 1);
+      altHost->isNeighbor = TRUE;
   }
   return TRUE;
Index: /branches/eam_branches/ipp-20140206/Ohana/src/relastro/src/relastro_parallel_images.c
===================================================================
--- /branches/eam_branches/ipp-20140206/Ohana/src/relastro/src/relastro_parallel_images.c	(revision 36576)
+++ /branches/eam_branches/ipp-20140206/Ohana/src/relastro/src/relastro_parallel_images.c	(revision 36577)
@@ -19,4 +19,6 @@
   // load the RegionTable (UserRegion should not be used at this level)
   RegionHostTable *regionHosts = RegionHostTableLoad (CATDIR, REGION_FILE);
+  int myHost = regionHosts->index[REGION_HOST_ID];
+  RegionHostFindNeighbors (regionHosts, myHost);
 
   // load the subset images belonging to this host
@@ -112,5 +114,4 @@
 
   // this is a checkpoint to make sure all hosts have finished the loop above
-  int myHost = regionHosts->index[REGION_HOST_ID];
   char *loopsyncfile = make_filename (CATDIR, regionHosts->hosts[myHost].hostname, REGION_HOST_ID, "loop.sync");
   update_sync_file (loopsyncfile, 0);
Index: /branches/eam_branches/ipp-20140206/Ohana/src/relastro/src/share_images_pos.c
===================================================================
--- /branches/eam_branches/ipp-20140206/Ohana/src/relastro/src/share_images_pos.c	(revision 36576)
+++ /branches/eam_branches/ipp-20140206/Ohana/src/relastro/src/share_images_pos.c	(revision 36577)
@@ -53,5 +53,5 @@
   for (i = 0; i < regionHosts->Nhosts; i++) {
     if (regionHosts->hosts[i].hostID == REGION_HOST_ID) continue;
-    // XXX add neighbor check? : if (not_neighbor(host[i])) continue;
+    if ((REGION_HOST_ID > -1) && !regionHosts->hosts[i].isNeighbor) continue;
 
     char *syncfile = make_filename (CATDIR, regionHosts->hosts[i].hostname, regionHosts->hosts[i].hostID, "imagepos.sync");
Index: /branches/eam_branches/ipp-20140206/Ohana/src/relastro/src/share_mean_pos.c
===================================================================
--- /branches/eam_branches/ipp-20140206/Ohana/src/relastro/src/share_mean_pos.c	(revision 36576)
+++ /branches/eam_branches/ipp-20140206/Ohana/src/relastro/src/share_mean_pos.c	(revision 36577)
@@ -66,6 +66,6 @@
 
   for (i = 0; i < regionHosts->Nhosts; i++) {
-    // if (not_neighbor(host[i])) continue;
     if (regionHosts->hosts[i].hostID == REGION_HOST_ID) continue;
+    if ((REGION_HOST_ID > -1) && !regionHosts->hosts[i].isNeighbor) continue;
 
     char *syncfile = make_filename (CATDIR, regionHosts->hosts[i].hostname, regionHosts->hosts[i].hostID, "meanpos.sync");
Index: /branches/eam_branches/ipp-20140206/Ohana/src/relphot/src/relphot_parallel_images.c
===================================================================
--- /branches/eam_branches/ipp-20140206/Ohana/src/relphot/src/relphot_parallel_images.c	(revision 36576)
+++ /branches/eam_branches/ipp-20140206/Ohana/src/relphot/src/relphot_parallel_images.c	(revision 36577)
@@ -21,4 +21,6 @@
   // load the RegionTable (UserRegion should not be used at this level)
   RegionHostTable *regionHosts = RegionHostTableLoad (CATDIR, REGION_FILE);
+  int myHost = regionHosts->index[REGION_HOST_ID];
+  RegionHostFindNeighbors (regionHosts, myHost);
 
   // load the subset images belonging to this host
@@ -117,5 +119,4 @@
 
   // this is a checkpoint to make sure all hosts have finished the loop above
-  int myHost = regionHosts->index[REGION_HOST_ID];
   char *loopsyncfile = make_filename (CATDIR, regionHosts->hosts[myHost].hostname, REGION_HOST_ID, "loop.sync");
   update_sync_file (loopsyncfile, 0);
Index: /branches/eam_branches/ipp-20140206/Ohana/src/relphot/src/share_image_mags.c
===================================================================
--- /branches/eam_branches/ipp-20140206/Ohana/src/relphot/src/share_image_mags.c	(revision 36576)
+++ /branches/eam_branches/ipp-20140206/Ohana/src/relphot/src/share_image_mags.c	(revision 36577)
@@ -53,5 +53,5 @@
   for (i = 0; i < regionHosts->Nhosts; i++) {
     if (regionHosts->hosts[i].hostID == REGION_HOST_ID) continue;
-    // XXX add neighbor check? : if (not_neighbor(host[i])) continue;
+    if ((REGION_HOST_ID > -1) && !regionHosts->hosts[i].isNeighbor) continue;
 
     char *syncfile = make_filename (CATDIR, regionHosts->hosts[i].hostname, regionHosts->hosts[i].hostID, "imagemags.sync");
Index: /branches/eam_branches/ipp-20140206/Ohana/src/relphot/src/share_mean_mags.c
===================================================================
--- /branches/eam_branches/ipp-20140206/Ohana/src/relphot/src/share_mean_mags.c	(revision 36576)
+++ /branches/eam_branches/ipp-20140206/Ohana/src/relphot/src/share_mean_mags.c	(revision 36577)
@@ -77,4 +77,5 @@
     // if (not_neighbor(host[i])) continue;
     if (regionHosts->hosts[i].hostID == REGION_HOST_ID) continue;
+    if ((REGION_HOST_ID > -1) && !regionHosts->hosts[i].isNeighbor) continue;
 
     char *syncfile = make_filename (CATDIR, regionHosts->hosts[i].hostname, regionHosts->hosts[i].hostID, "meanmags.sync");
