Index: /branches/eam_branches/ipp-20140904/Ohana/src/addstar/src/loadICRF_client.c
===================================================================
--- /branches/eam_branches/ipp-20140904/Ohana/src/addstar/src/loadICRF_client.c	(revision 37649)
+++ /branches/eam_branches/ipp-20140904/Ohana/src/addstar/src/loadICRF_client.c	(revision 37650)
@@ -17,8 +17,11 @@
   SkyList *skylist = SkyRegionByCPT (sky, CPT_FILE);
 
+  char cptfile[1024];
+  snprintf (cptfile, 1024, "%s/%s.cpt", HOSTDIR, skylist[0].regions[0]->name);
+
   int Nstars;
   ICRF_Stars *stars = loadICRF_load_stars (INPUT, &Nstars);
 
-  loadICRF_catalog (stars, Nstars, skylist->regions[0], CPT_FILE, &options);
+  loadICRF_catalog (stars, Nstars, skylist->regions[0], cptfile, &options);
 
   free (stars);
Index: /branches/eam_branches/ipp-20140904/Ohana/src/addstar/src/loadICRF_io.c
===================================================================
--- /branches/eam_branches/ipp-20140904/Ohana/src/addstar/src/loadICRF_io.c	(revision 37649)
+++ /branches/eam_branches/ipp-20140904/Ohana/src/addstar/src/loadICRF_io.c	(revision 37650)
@@ -81,4 +81,6 @@
   gfits_free_table (&ftable);
 
+  fclose (f);
+
   return TRUE;
 }
@@ -143,6 +145,6 @@
   GET_COLUMN(Map     , "M_AP",        float);
   GET_COLUMN(dMap    , "dM_AP",       float);
-  GET_COLUMN(photcode, "PHOTCODE",    unsigned int);
-  GET_COLUMN(flags   , "FLAGS",       unsigned int);
+  GET_COLUMN(photcode, "PHOTCODE",    int);
+  GET_COLUMN(flags   , "FLAGS",       int);
 
   gfits_free_header (&theader);
Index: /branches/eam_branches/ipp-20140904/Ohana/src/addstar/src/loadICRF_remote_hosts.c
===================================================================
--- /branches/eam_branches/ipp-20140904/Ohana/src/addstar/src/loadICRF_remote_hosts.c	(revision 37649)
+++ /branches/eam_branches/ipp-20140904/Ohana/src/addstar/src/loadICRF_remote_hosts.c	(revision 37650)
@@ -76,4 +76,6 @@
   if ((pid == -1) && (errno != ECHILD)) myAbort ("programming error?");
 
+  if (DEBUG) fprintf (stdout, "PID %d done\n", pid);
+
   // find the host which has finished
   int i;
@@ -83,4 +85,5 @@
     if (hosts[i][0].pid != pid) continue;
     found = TRUE;
+    break;
   }
   myAssert (found, "Programming error: failed to matched finished job to known host!");
Index: /branches/eam_branches/ipp-20140904/Ohana/src/addstar/src/loadICRF_save_remote.c
===================================================================
--- /branches/eam_branches/ipp-20140904/Ohana/src/addstar/src/loadICRF_save_remote.c	(revision 37649)
+++ /branches/eam_branches/ipp-20140904/Ohana/src/addstar/src/loadICRF_save_remote.c	(revision 37650)
@@ -33,4 +33,5 @@
     char filename[1024]; // CATDIR/tmpdir/ICRF.PID.index.fits
     snprintf (filename, 1024, "%s/tmpdir/ICRF.%s.%05d.fits", CATDIR, uniquer, region->index);
+    if (!check_file_access (filename, FALSE, TRUE, TRUE)) exit (2);
 
     // write the data to the given FITS file
@@ -50,4 +51,5 @@
     HostInfo *host = NULL;
     ALLOCATE (host, HostInfo, 1);
+    InitHost (host);
 
     // we want to run this job on the host described by hostMach.  copy
@@ -69,4 +71,7 @@
     strextend (command, "-cpt %s", region->name);
     strextend (command, "-input %s", filename);
+    strextend (command, "-D ADDSTAR_RADIUS %f", options->radius);
+
+    fprintf (stderr, "command: %s\n", command);
 
     // launch the job on the remote machine (no handshake)
@@ -78,4 +83,5 @@
     }
     host->pid = pid; // save for future reference
+    fprintf (stderr, "launch cpt %s on %s @ %d\n", region->name, host->pathname, pid);
     
     save_remote_host (host);
Index: /branches/eam_branches/ipp-20140904/Ohana/src/addstar/src/loadstarpar_remote_hosts.c
===================================================================
--- /branches/eam_branches/ipp-20140904/Ohana/src/addstar/src/loadstarpar_remote_hosts.c	(revision 37649)
+++ /branches/eam_branches/ipp-20140904/Ohana/src/addstar/src/loadstarpar_remote_hosts.c	(revision 37650)
@@ -83,4 +83,5 @@
     if (hosts[i][0].pid != pid) continue;
     found = TRUE;
+    break;
   }
   myAssert (found, "Programming error: failed to matched finished job to known host!");
