Index: /branches/eam_branches/ohana.20170822/src/libdvo/include/dvodb.h
===================================================================
--- /branches/eam_branches/ohana.20170822/src/libdvo/include/dvodb.h	(revision 40167)
+++ /branches/eam_branches/ohana.20170822/src/libdvo/include/dvodb.h	(revision 40168)
@@ -3,4 +3,11 @@
 
 # define MEASURE_HAS_XCCD 1
+
+// Some values used by code moved to libdvo from opihi.
+enum {OPIHI_NOTYPE, OPIHI_FLT, OPIHI_INT};
+# define opihi_flt double
+// # define opihi_int int64_t
+# define opihi_int long long int
+# define OPIHI_INT_FMT "%lld"
 
 typedef enum {
@@ -471,15 +478,15 @@
   char    type;
   int     field;
-  // opihi_flt FltValue;
-  // opihi_int IntValue;
-  double FltValue;
-  int IntValue;
+  opihi_flt FltValue;
+  opihi_int IntValue;
+  // double FltValue;
+  // int IntValue;
 } dbStack;
 
 typedef struct {
-  // opihi_flt Flt;
-  // opihi_int Int;
-  double Flt;
-  int Int;
+  opihi_flt Flt;
+  opihi_int Int;
+  // double Flt;
+  // int Int;
 } dbValue;
 
@@ -562,9 +569,4 @@
 int dbExtractImagesReset (void);
 
-// Some values used by code moved to libdvo from opihi.
-enum {OPIHI_NOTYPE, OPIHI_FLT, OPIHI_INT};
-#define opihi_flt double
-#define opihi_int int
-
 #include "get_graphdata.h"
 
Index: /branches/eam_branches/ohana.20170822/src/libdvo/src/dbCheckStack.c
===================================================================
--- /branches/eam_branches/ohana.20170822/src/libdvo/src/dbCheckStack.c	(revision 40167)
+++ /branches/eam_branches/ohana.20170822/src/libdvo/src/dbCheckStack.c	(revision 40168)
@@ -43,5 +43,5 @@
        * an int unless proven otherwise **/
       stack[i].FltValue = strtod (stack[i].name, &c1);
-      stack[i].IntValue = strtol (stack[i].name, &c2, 0);
+      stack[i].IntValue = strtoll (stack[i].name, &c2, 0);
       if (c2 == stack[i].name + strlen (stack[i].name)) {
 	stack[i].type  |= DB_STACK_INT;
Index: /branches/eam_branches/ohana.20170822/src/libohana/include/ohana_sort.h
===================================================================
--- /branches/eam_branches/ohana.20170822/src/libohana/include/ohana_sort.h	(revision 40167)
+++ /branches/eam_branches/ohana.20170822/src/libohana/include/ohana_sort.h	(revision 40168)
@@ -68,4 +68,5 @@
 void fsort (float *value, int N);
 void isort (int *value, int N);
+void llsort (long long int *value, int N);
 
 void dsortpair (double *X, double *Y, int N);
Index: /branches/eam_branches/ohana.20170822/src/libohana/src/sorts.c
===================================================================
--- /branches/eam_branches/ohana.20170822/src/libohana/src/sorts.c	(revision 40167)
+++ /branches/eam_branches/ohana.20170822/src/libohana/src/sorts.c	(revision 40168)
@@ -30,4 +30,16 @@
 
 # define SWAPFUNC(A,B){ int tmp = value[A]; value[A] = value[B]; value[B] = tmp; }
+# define COMPARE(A,B)(value[A] < value[B])
+
+  OHANA_SORT (N, COMPARE, SWAPFUNC);
+
+# undef SWAPFUNC
+# undef COMPARE
+
+}
+
+void llsort (long long int *value, int N) {
+
+# define SWAPFUNC(A,B){ long long int tmp = value[A]; value[A] = value[B]; value[B] = tmp; }
 # define COMPARE(A,B)(value[A] < value[B])
 
Index: /branches/eam_branches/ohana.20170822/src/opihi/cmd.astro/fitplx.c
===================================================================
--- /branches/eam_branches/ohana.20170822/src/opihi/cmd.astro/fitplx.c	(revision 40167)
+++ /branches/eam_branches/ohana.20170822/src/opihi/cmd.astro/fitplx.c	(revision 40168)
@@ -77,5 +77,5 @@
   double *dD = dDvec->elements.Flt;
 
-  int *mask = NULL;
+  opihi_int *mask = NULL;
   if (mvec) {
     mask = mvec->elements.Int;
@@ -380,5 +380,5 @@
 }
 
-int PlxSetMeanEpoch (double *R, double *D, double *T, double *Rmean, double *Dmean, double *Tmean, int *mask, int Ntotal) {
+int PlxSetMeanEpoch (double *R, double *D, double *T, double *Rmean, double *Dmean, double *Tmean, opihi_int *mask, int Ntotal) {
 
   int i;
@@ -413,5 +413,5 @@
 
 // generate the fit values (projected X,Y; parallax factors; 
-int PlxSetEpochPosition (PlxFitData *fitdata, double *R, double *D, double *dR, double *dD, double *T, int *mask, int Ntotal, Coords *coords, double Tmean) {
+int PlxSetEpochPosition (PlxFitData *fitdata, double *R, double *D, double *dR, double *dD, double *T, opihi_int *mask, int Ntotal, Coords *coords, double Tmean) {
 
   int i;
@@ -464,5 +464,5 @@
 # define MAX_REJECT 0.1
 
-int PlxOutlierClip (PlxFitData *fitdata, int *mask, int Noutlier, float dPsigMax, Vector *dPvec, int VERBOSE) {
+int PlxOutlierClip (PlxFitData *fitdata, opihi_int *mask, int Noutlier, float dPsigMax, Vector *dPvec, int VERBOSE) {
 
   int i, n;
Index: /branches/eam_branches/ohana.20170822/src/opihi/cmd.astro/fitplx_irls.c
===================================================================
--- /branches/eam_branches/ohana.20170822/src/opihi/cmd.astro/fitplx_irls.c	(revision 40167)
+++ /branches/eam_branches/ohana.20170822/src/opihi/cmd.astro/fitplx_irls.c	(revision 40168)
@@ -81,5 +81,5 @@
   double *dD = dDvec->elements.Flt;
 
-  int *mask = NULL;
+  opihi_int *mask = NULL;
   if (mvec) {
     mask = mvec->elements.Int;
@@ -109,6 +109,6 @@
   for (i = 0; (VERBOSE == 2) && (i < fitdata.Npts); i++) {
     int n = fitdata.index[i];
-    int maskValue = mask ? mask[n] : 1;
-    fprintf (stderr, "%f %f : %f %d : %f %f %f\n", R[n], D[n], T[n], maskValue, fitdata.t[i], fitdata.X[i], fitdata.Y[i]);
+    opihi_int maskValue = mask ? mask[n] : 1;
+    fprintf (stderr, "%f %f : %f "OPIHI_INT_FMT" : %f %f %f\n", R[n], D[n], T[n], maskValue, fitdata.t[i], fitdata.X[i], fitdata.Y[i]);
   }
 
@@ -150,5 +150,5 @@
       
       if (VERBOSE == 2) {
-	  fprintf (stderr, "%f %f : %f %d : %f %f %f : %f %f %f %f\n", R[n], D[n], T[n], mask[n], fitdata.t[i], fitdata.X[i], fitdata.Y[i], fitdata.Wx[i], fitdata.Wy[i], Sum_Wx, Sum_Wy);
+	  fprintf (stderr, "%f %f : %f "OPIHI_INT_FMT" : %f %f %f : %f %f %f %f\n", R[n], D[n], T[n], mask[n], fitdata.t[i], fitdata.X[i], fitdata.Y[i], fitdata.Wx[i], fitdata.Wy[i], Sum_Wx, Sum_Wy);
       }
     }
Index: /branches/eam_branches/ohana.20170822/src/opihi/cmd.astro/fitpm.c
===================================================================
--- /branches/eam_branches/ohana.20170822/src/opihi/cmd.astro/fitpm.c	(revision 40167)
+++ /branches/eam_branches/ohana.20170822/src/opihi/cmd.astro/fitpm.c	(revision 40168)
@@ -50,5 +50,5 @@
   double *dD = dDvec->elements.Flt;
 
-  int *mask = NULL;
+  opihi_int *mask = NULL;
   if (mvec) {
     mask = mvec->elements.Int;
Index: /branches/eam_branches/ohana.20170822/src/opihi/cmd.astro/fitpm_irls.c
===================================================================
--- /branches/eam_branches/ohana.20170822/src/opihi/cmd.astro/fitpm_irls.c	(revision 40167)
+++ /branches/eam_branches/ohana.20170822/src/opihi/cmd.astro/fitpm_irls.c	(revision 40168)
@@ -58,5 +58,5 @@
   double *dD = dDvec->elements.Flt;
 
-  int *mask = NULL;
+  opihi_int *mask = NULL;
   if (mvec) {
     mask = mvec->elements.Int;
Index: /branches/eam_branches/ohana.20170822/src/opihi/cmd.data/print_vectors.c
===================================================================
--- /branches/eam_branches/ohana.20170822/src/opihi/cmd.data/print_vectors.c	(revision 40167)
+++ /branches/eam_branches/ohana.20170822/src/opihi/cmd.data/print_vectors.c	(revision 40168)
@@ -35,5 +35,5 @@
 	  gprint (GP_LOG, "%f ", vec[i][0].elements.Flt[j]);
 	} else {
-	  gprint (GP_LOG, "%d ", vec[i][0].elements.Int[j]);
+	  gprint (GP_LOG, OPIHI_INT_FMT, vec[i][0].elements.Int[j]);
 	}
       }
Index: /branches/eam_branches/ohana.20170822/src/opihi/cmd.data/reindex.c
===================================================================
--- /branches/eam_branches/ohana.20170822/src/opihi/cmd.data/reindex.c	(revision 40167)
+++ /branches/eam_branches/ohana.20170822/src/opihi/cmd.data/reindex.c	(revision 40168)
@@ -47,5 +47,5 @@
 	continue;
       }
-      if (*vx > Nmax) ESCAPE("unexpected value in index: %d (%d)\n", *vx, i);
+      if (*vx > Nmax) ESCAPE("unexpected value in index: "OPIHI_INT_FMT" (%d)\n", *vx, i);
       ovec[0].elements.Flt[Npts] = vi[*vx];
       Npts++;
@@ -67,5 +67,5 @@
 	continue;
       }
-      if (*vx > Nmax) ESCAPE("unexpected value in index: %d (%d)\n", *vx, i);
+      if (*vx > Nmax) ESCAPE("unexpected value in index: "OPIHI_INT_FMT" (%d)\n", *vx, i);
       ovec[0].elements.Int[Npts] = vi[*vx];
       Npts++;
Index: /branches/eam_branches/ohana.20170822/src/opihi/cmd.data/uniq.c
===================================================================
--- /branches/eam_branches/ohana.20170822/src/opihi/cmd.data/uniq.c	(revision 40167)
+++ /branches/eam_branches/ohana.20170822/src/opihi/cmd.data/uniq.c	(revision 40168)
@@ -80,5 +80,5 @@
     memcpy (indata, ivec->elements.Int, ivec[0].Nelements*sizeof(opihi_int));
 
-    isort (indata, ivec->Nelements);
+    llsort (indata, ivec->Nelements);
 
     Nnew = 0;
Index: /branches/eam_branches/ohana.20170822/src/opihi/cmd.data/write_vectors.c
===================================================================
--- /branches/eam_branches/ohana.20170822/src/opihi/cmd.data/write_vectors.c	(revision 40167)
+++ /branches/eam_branches/ohana.20170822/src/opihi/cmd.data/write_vectors.c	(revision 40168)
@@ -165,7 +165,7 @@
 	} else {
 	  if (CSV) {
-	    fprintf (f, "%d,", vec[j][0].elements.Int[i]);
+	    fprintf (f, OPIHI_INT_FMT",", vec[j][0].elements.Int[i]);
 	  } else {
-	    fprintf (f, "%d ", vec[j][0].elements.Int[i]);
+	    fprintf (f, OPIHI_INT_FMT" ", vec[j][0].elements.Int[i]);
 	  }
 	}
Index: /branches/eam_branches/ohana.20170822/src/opihi/dvo/remote.c
===================================================================
--- /branches/eam_branches/ohana.20170822/src/opihi/dvo/remote.c	(revision 40167)
+++ /branches/eam_branches/ohana.20170822/src/opihi/dvo/remote.c	(revision 40168)
@@ -27,5 +27,8 @@
     gprint (GP_ERR, "  -skip-result : do not try to read from the result file\n");
     gprint (GP_ERR, "OR:    remote -reload (uniquer)\n");
+    gprint (GP_ERR, "       (reloads the remote host results into vectors as if a parallel command were run)\n");
     gprint (GP_ERR, "OR:    remote -get-results (uniquer)\n");
+    gprint (GP_ERR, "       (generates the list of remote result filenames and status variables)\n");
+    gprint (GP_ERR, "       (RESULT_FILE:i is the filenme, RESULT_STATUS:i is the dvo_client exit status)\n");
     return FALSE;
   }
Index: /branches/eam_branches/ohana.20170822/src/opihi/include/astro.h
===================================================================
--- /branches/eam_branches/ohana.20170822/src/opihi/include/astro.h	(revision 40167)
+++ /branches/eam_branches/ohana.20170822/src/opihi/include/astro.h	(revision 40168)
@@ -47,7 +47,7 @@
 double VectorFractionInterpolate (double *values, float fraction, int Npts);
 
-int PlxSetMeanEpoch (double *R, double *D, double *T, double *Rmean, double *Dmean, double *Tmean, int *mask, int Ntotal);
-int PlxSetEpochPosition (PlxFitData *fitdata, double *R, double *D, double *dR, double *dD, double *T, int *mask, int Ntotal, Coords *coords, double Tmean);
-int PlxOutlierClip (PlxFitData *fitdata, int *mask, int Noutlier, float dPsigMax, Vector *dPvec, int VERBOSE);
+int PlxSetMeanEpoch (double *R, double *D, double *T, double *Rmean, double *Dmean, double *Tmean, opihi_int *mask, int Ntotal);
+int PlxSetEpochPosition (PlxFitData *fitdata, double *R, double *D, double *dR, double *dD, double *T, opihi_int *mask, int Ntotal, Coords *coords, double Tmean);
+int PlxOutlierClip (PlxFitData *fitdata, opihi_int *mask, int Noutlier, float dPsigMax, Vector *dPvec, int VERBOSE);
 
 int PlxFitDataAlloc (PlxFitData *data, int N);
Index: /branches/eam_branches/ohana.20170822/src/opihi/lib.shell/dvomath.c
===================================================================
--- /branches/eam_branches/ohana.20170822/src/opihi/lib.shell/dvomath.c	(revision 40167)
+++ /branches/eam_branches/ohana.20170822/src/opihi/lib.shell/dvomath.c	(revision 40168)
@@ -82,5 +82,5 @@
       } else {
 	if (stack[0].type == ST_SCALAR_INT) {
-	  sprintf (outname, "%d", stack[0].IntValue);
+	  sprintf (outname, OPIHI_INT_FMT, stack[0].IntValue);
 	} else {
 	  sprintf (outname, "%.12g", stack[0].FltValue);
Index: /branches/eam_branches/ohana.20170822/src/opihi/lib.shell/evaluate_stack.c
===================================================================
--- /branches/eam_branches/ohana.20170822/src/opihi/lib.shell/evaluate_stack.c	(revision 40167)
+++ /branches/eam_branches/ohana.20170822/src/opihi/lib.shell/evaluate_stack.c	(revision 40168)
@@ -89,5 +89,5 @@
       }
       if (tmp_stack.type == ST_SCALAR_INT) {
-	gprint (GP_ERR, "---> %d ", tmp_stack.IntValue);
+	gprint (GP_ERR, "---> "OPIHI_INT_FMT" ", tmp_stack.IntValue);
       }
       if (tmp_stack.type == ST_SCALAR_FLT) {
