Index: trunk/Ohana/src/opihi/include/pantasks.h
===================================================================
--- trunk/Ohana/src/opihi/include/pantasks.h	(revision 40423)
+++ trunk/Ohana/src/opihi/include/pantasks.h	(revision 40424)
@@ -8,4 +8,6 @@
 
 # define DEBUG 0
+
+typedef int IDtype;
 
 typedef enum {
@@ -133,5 +135,5 @@
   
 typedef struct {
-  int JobID;				/* internal ID for job */
+  IDtype JobID;				/* internal ID for job */
   int pid;				/* external ID for job */
 
@@ -204,8 +206,7 @@
 void UpdateTaskTimerStats (Task *task, int mode, double dtime);
 
-int NextJobID (void);
+IDtype NextJobID (void);
 void InitJobIDs (void);
 void FreeJobIDs (void);
-int FreeJobID (int ID);
 
 void InitJobs (void);
@@ -213,5 +214,5 @@
 
 Job *NextJob (void);
-Job *FindJob (int JobID);
+Job *FindJob (IDtype JobID);
 void ListJobs (void);
 Job *CreateJob (Task *task);
@@ -234,5 +235,5 @@
 int SubmitControllerJob (Job *job);
 int DeleteControllerJob (Job *job);
-Job *FindControllerJob (int JobID);
+Job *FindControllerJob (IDtype JobID);
 int StartController (void);
 int ControllerCommand (char *command, char *response, IOBuffer *buffer);
Index: trunk/Ohana/src/opihi/pantasks/CheckController.c
===================================================================
--- trunk/Ohana/src/opihi/pantasks/CheckController.c	(revision 40423)
+++ trunk/Ohana/src/opihi/pantasks/CheckController.c	(revision 40424)
@@ -7,5 +7,6 @@
 
   char *p, *q;
-  int i, Njobs, status, JobID;
+  int i, Njobs, status;
+  IDtype JobID;
   Job *job;
   IOBuffer buffer;
Index: trunk/Ohana/src/opihi/pantasks/JobIDOps.c
===================================================================
--- trunk/Ohana/src/opihi/pantasks/JobIDOps.c	(revision 40423)
+++ trunk/Ohana/src/opihi/pantasks/JobIDOps.c	(revision 40424)
@@ -1,44 +1,26 @@
 # include "pantasks.h"
 
-# define MAX_N_JOBS 50000
-static char *JobIDList;
-static int   JobIDPtr;
+# define MAX_N_JOBS 0x80000000
+
+static IDtype JobIDMax = 0;
 
 void InitJobIDs () {
-
-  JobIDPtr = 0;
-  ALLOCATE (JobIDList, char, MAX_N_JOBS);
-  bzero (JobIDList, MAX_N_JOBS*sizeof(char));
+  JobIDMax = 0;
 }  
 
-void FreeJobIDs () {
-  free (JobIDList);
+void FreeJobIDs () { }
+
+/* return next unique ID, recycle every MAX_N_JOBS */
+IDtype NextJobID () {
+
+  JobIDMax ++;
+  if (JobIDMax >= MAX_N_JOBS) {
+    gprint (GP_ERR, "ERROR: too many jobs spawned: %d, aborting\n", JobIDMax);
+    abort();
+  }
+
+  return (JobIDMax);
 }
 
-/* return next unique ID, recycle every MAX_N_JOBS */
-int NextJobID () {
-
-  int Ntry;
-
-  JobIDPtr ++;
-  if (JobIDPtr >= MAX_N_JOBS) JobIDPtr = 0;
-
-  Ntry = 0;
-  while (JobIDList[JobIDPtr]) {
-    Ntry ++;
-    JobIDPtr ++;
-    if (JobIDPtr >= MAX_N_JOBS) JobIDPtr = 0;
-    if (Ntry == MAX_N_JOBS) return (-1);
-  }
-  JobIDList[JobIDPtr] = TRUE;
-  return (JobIDPtr);
-}
-
-int FreeJobID (int JobID) {
-
-  if (JobID < 0) return (FALSE);
-  if (JobID >= MAX_N_JOBS) return (FALSE);
-
-  JobIDList[JobID] = FALSE;
-  return (TRUE);
-}
+/* I am going to rework the jobID so that it just grows.  no need to ever free them
+   as an int, that allows 2^31 jobs (2e9 jobs) */
Index: trunk/Ohana/src/opihi/pantasks/JobOps.c
===================================================================
--- trunk/Ohana/src/opihi/pantasks/JobOps.c	(revision 40423)
+++ trunk/Ohana/src/opihi/pantasks/JobOps.c	(revision 40424)
@@ -41,5 +41,5 @@
 
 /* return job with given ID */
-Job *FindJob (int JobID) {
+Job *FindJob (IDtype JobID) {
 
   int i;
@@ -55,5 +55,5 @@
 
 /* return job with given controller Job ID */
-Job *FindControllerJob (int JobID) {
+Job *FindControllerJob (IDtype JobID) {
 
   int i;
@@ -82,5 +82,5 @@
   gprint (GP_LOG, " Jobs in Pantasks Queue\n");
   for (i = 0; i < Njobs; i++) {
-    gprint (GP_LOG, " %4d  %6d: %-25s %10s %20s\n", Njobs, jobs[i][0].JobID, jobs[i][0].task[0].name, JobStateToString(jobs[i][0].state), jobs[i][0].argv[0]);
+    gprint (GP_LOG, " %4d  %8d: %-25s %10s %20s\n", Njobs, jobs[i][0].JobID, jobs[i][0].task[0].name, JobStateToString(jobs[i][0].state), jobs[i][0].argv[0]);
   }
 
@@ -97,4 +97,6 @@
 
   job[0].JobID = NextJobID ();
+
+  // this should not happen; abort?
   if (job[0].JobID < 0) {
     free (job);
@@ -165,6 +167,4 @@
   if (job == NULL) return;
   
-  FreeJobID (job[0].JobID);
-
   for (i = 0; i < job[0].argc; i++) {
     free (job[0].argv[i]);
Index: trunk/Ohana/src/opihi/pantasks/delete.c
===================================================================
--- trunk/Ohana/src/opihi/pantasks/delete.c	(revision 40423)
+++ trunk/Ohana/src/opihi/pantasks/delete.c	(revision 40424)
@@ -4,5 +4,5 @@
 
   Job *job;
-  int JobID;
+  IDtype JobID;
 
   if (argc != 3) goto usage;
Index: trunk/Ohana/src/opihi/pantasks/kill.c
===================================================================
--- trunk/Ohana/src/opihi/pantasks/kill.c	(revision 40423)
+++ trunk/Ohana/src/opihi/pantasks/kill.c	(revision 40424)
@@ -4,5 +4,5 @@
 
   Job *job;
-  int JobID;
+  IDtype JobID;
 
   if (argc < 2) {
@@ -10,5 +10,5 @@
     return (FALSE);
   }
-  JobID = atoi (argv[1]);
+  JobID = atoll (argv[1]);
 
   JobTaskLock();
