Index: branches/eam_branches/ipp-20140904/Ohana/src/relastro/Makefile
===================================================================
--- branches/eam_branches/ipp-20140904/Ohana/src/relastro/Makefile	(revision 37705)
+++ branches/eam_branches/ipp-20140904/Ohana/src/relastro/Makefile	(revision 37706)
@@ -89,4 +89,5 @@
 $(SRC)/indexCatalogs.$(ARCH).o \
 $(SRC)/syncfile.$(ARCH).o \
+$(SRC)/client_logger.$(ARCH).o \
 $(SRC)/relastroVisual.$(ARCH).o
 
Index: branches/eam_branches/ipp-20140904/Ohana/src/relastro/include/relastro.h
===================================================================
--- branches/eam_branches/ipp-20140904/Ohana/src/relastro/include/relastro.h	(revision 37705)
+++ branches/eam_branches/ipp-20140904/Ohana/src/relastro/include/relastro.h	(revision 37706)
@@ -653,2 +653,5 @@
 void lockUpdateChips ();
 void unlockUpdateChips ();
+
+int client_logger_init (char *dirname);
+int client_logger_message (char *format,...);
Index: branches/eam_branches/ipp-20140904/Ohana/src/relastro/src/BrightCatalog.c
===================================================================
--- branches/eam_branches/ipp-20140904/Ohana/src/relastro/src/BrightCatalog.c	(revision 37705)
+++ branches/eam_branches/ipp-20140904/Ohana/src/relastro/src/BrightCatalog.c	(revision 37706)
@@ -43,11 +43,8 @@
   if (!gfits_fread_header (f, &header)) {
     if (VERBOSE) fprintf (stderr, "can't read image subset header\n");
-    fclose (f);
     goto escape;
   }
   if (!gfits_fread_matrix (f, &matrix, &header)) {
     if (VERBOSE) fprintf (stderr, "can't read image subset matrix\n");
-    gfits_free_header (&header);
-    fclose (f);
     goto escape;
   }
@@ -316,5 +313,5 @@
   if (catalog) free (catalog);
 
-  fclose (f);
+  if (f) fclose (f);
   return NULL;
 }
Index: branches/eam_branches/ipp-20140904/Ohana/src/relastro/src/client_logger.c
===================================================================
--- branches/eam_branches/ipp-20140904/Ohana/src/relastro/src/client_logger.c	(revision 37706)
+++ branches/eam_branches/ipp-20140904/Ohana/src/relastro/src/client_logger.c	(revision 37706)
@@ -0,0 +1,37 @@
+# include "relastro.h"
+
+// I'm getting unlogged errors and failures.  I need a log ouput that the clients can
+// write independent of the master
+
+static FILE *logfile = NULL;
+int client_logger_init (char *dirname) {
+
+  char filename[DVO_MAX_PATH];
+
+  snprintf (filename, DVO_MAX_PATH, "%s/log.rlas.XXXXXX", dirname);
+    
+  int fd = mkstemp (filename);
+  if (fd == -1) {
+    fprintf (stderr, "failed to open client logger %s, exiting\n", filename);
+    exit (50);
+  }
+
+  logfile = fdopen (fd, "w");
+  if (!logfile)  {
+    fprintf (stderr, "failed to fdopen client logger, exiting\n");
+    exit (51);
+  }
+  return TRUE;
+}
+
+int client_logger_message (char *format,...) {
+
+  va_list argp;
+
+  va_start (argp, format);
+  vfprintf (logfile, format, argp);
+  va_end (argp);
+
+  fflush (logfile);
+  return TRUE;
+}
Index: branches/eam_branches/ipp-20140904/Ohana/src/relastro/src/relastro_parallel_images.c
===================================================================
--- branches/eam_branches/ipp-20140904/Ohana/src/relastro/src/relastro_parallel_images.c	(revision 37705)
+++ branches/eam_branches/ipp-20140904/Ohana/src/relastro/src/relastro_parallel_images.c	(revision 37706)
@@ -17,8 +17,11 @@
   INITTIME;
 
+  client_logger_init (CATDIR);
+
   // 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);
+  client_logger_message ("started parallel images on %s\n", regionHosts->hosts[myHost].hostname);
 
   // load the subset images belonging to this host
@@ -44,4 +47,5 @@
   }
   put_astrom_table (table);
+  client_logger_message ("loaded images on %s\n", regionHosts->hosts[myHost].hostname);
 
   // once we have read this table, we should remove it for repeat runs
@@ -63,4 +67,6 @@
   free (syncfile);
   
+  client_logger_message ("loaded catalog data %s\n", regionHosts->hosts[myHost].hostname);
+
   // find ICRF QSOs for reference downstream (only if USE_ICRF_CORRECT)
   select_catalog_ICRF (catalog, Ncatalog);
@@ -84,7 +90,11 @@
   createStarMap (catalog, Ncatalog);
 
+  client_logger_message ("set up image indexes on %s\n", regionHosts->hosts[myHost].hostname);
+
   markObjects (catalog, Ncatalog);
 
   SAVEPLOT = FALSE;
+
+  client_logger_message ("starting the loops: %s\n", regionHosts->hosts[myHost].hostname);
 
   /* major modes */
@@ -105,8 +115,10 @@
 	UpdateMeasures (catalog, Ncatalog);
 	MARKTIME("reset measures, host %d: %f sec\n", REGION_HOST_ID, dtime);
+	client_logger_message ("reset measures: %s\n", regionHosts->hosts[myHost].hostname);
       }
       for (i = 0; i < NLOOP; i++) {
 	UpdateObjects (catalog, Ncatalog, (i > 0));
 	MARKTIME("update objects loop %d, host %d: %f sec\n", i, REGION_HOST_ID, dtime);
+	client_logger_message ("update objects loop %d: %s\n", i, regionHosts->hosts[myHost].hostname);
 	if ((i > 1) || !USE_GALAXY_MODEL) {
 	  // if GALAXY_MODEL is selected, we want to delay the frame correction until we have 
@@ -114,15 +126,22 @@
 	  FrameCorrectionParallelSlave (catalog, Ncatalog, regionHosts, i); 
 	  MARKTIME("frame correction loop %d, host %d: %f sec\n", i, REGION_HOST_ID, dtime);
+	  client_logger_message ("frame correction loop %d: %s\n", i, regionHosts->hosts[myHost].hostname);
 	}
 	share_mean_pos (catalog, Ncatalog, regionHosts, i);
 	slurp_mean_pos (catalog, Ncatalog, regionHosts, i);
+	client_logger_message ("slurp mags loop %d: %s\n", i, regionHosts->hosts[myHost].hostname);
 
 	UpdateChips (catalog, Ncatalog);
 	MARKTIME("update chips loop %d, host %d: %f sec\n", i, REGION_HOST_ID, dtime);
+	client_logger_message ("update chips loop %d: %s\n", i, regionHosts->hosts[myHost].hostname);
+
 	share_image_pos (regionHosts, i);
 	slurp_image_pos (catalog, Ncatalog, regionHosts, i);
+	client_logger_message ("slurp image pos loop %d: %s\n", i, regionHosts->hosts[myHost].hostname);
+
 	share_meas_pos (catalog, Ncatalog, regionHosts, i);
 	slurp_meas_pos (catalog, Ncatalog, regionHosts, i);
 	MARKTIME("done exchange loop %d, host %d: %f sec\n", i, REGION_HOST_ID, dtime);
+	client_logger_message ("slurp meas loop %d: %s\n", i, regionHosts->hosts[myHost].hostname);
       }
       // create summary plots of the process
@@ -159,4 +178,5 @@
 
   share_image_pos (regionHosts, -1);
+  client_logger_message ("share image pos loop %d: %s\n", -1, regionHosts->hosts[myHost].hostname);
 
   exit (0);
