Index: /branches/eam_branches/ipp-20110906/Ohana/src/opihi/include/pantasks.h
===================================================================
--- /branches/eam_branches/ipp-20110906/Ohana/src/opihi/include/pantasks.h	(revision 32584)
+++ /branches/eam_branches/ipp-20110906/Ohana/src/opihi/include/pantasks.h	(revision 32585)
@@ -40,4 +40,5 @@
       TASK_END, 
       TASK_HOST, 
+      TASK_NICE, 
       TASK_STDOUT, 
       TASK_STDERR, 
Index: /branches/eam_branches/ipp-20110906/Ohana/src/opihi/pantasks/Makefile
===================================================================
--- /branches/eam_branches/ipp-20110906/Ohana/src/opihi/pantasks/Makefile	(revision 32584)
+++ /branches/eam_branches/ipp-20110906/Ohana/src/opihi/pantasks/Makefile	(revision 32585)
@@ -83,4 +83,5 @@
 $(SRC)/task.$(ARCH).o \
 $(SRC)/task_host.$(ARCH).o \
+$(SRC)/task_nice.$(ARCH).o \
 $(SRC)/task_nmax.$(ARCH).o \
 $(SRC)/task_active.$(ARCH).o \
Index: /branches/eam_branches/ipp-20110906/Ohana/src/opihi/pantasks/TaskOps.c
===================================================================
--- /branches/eam_branches/ipp-20110906/Ohana/src/opihi/pantasks/TaskOps.c	(revision 32584)
+++ /branches/eam_branches/ipp-20110906/Ohana/src/opihi/pantasks/TaskOps.c	(revision 32585)
@@ -596,4 +596,5 @@
   if (!strcasecmp (command, "END"))       hash = TASK_END;
   if (!strcasecmp (command, "HOST"))      hash = TASK_HOST;
+  if (!strcasecmp (command, "NICE"))      hash = TASK_NICE;
   if (!strcasecmp (command, "NMAX"))      hash = TASK_NMAX;
   if (!strcasecmp (command, "ACTIVE"))    hash = TASK_ACTIVE;
Index: /branches/eam_branches/ipp-20110906/Ohana/src/opihi/pantasks/init.c
===================================================================
--- /branches/eam_branches/ipp-20110906/Ohana/src/opihi/pantasks/init.c	(revision 32584)
+++ /branches/eam_branches/ipp-20110906/Ohana/src/opihi/pantasks/init.c	(revision 32585)
@@ -4,4 +4,5 @@
 int task            PROTO((int, char **));
 int task_host       PROTO((int, char **));
+int task_nice       PROTO((int, char **));
 int task_nmax       PROTO((int, char **));
 int task_npending   PROTO((int, char **));
@@ -33,4 +34,5 @@
   {1, "halt",       halt,          "halt the scheduler (no job harvesting)"},
   {1, "host",       task_host,     "define host machine for a task"},
+  {1, "nice",       task_nice,     "set nice priority level for a task"},
   {1, "ipptool2book", ipptool2book, "convert queue with ipptool output to book"},
   {1, "kill",       kill_job,      "kill job"},
Index: /branches/eam_branches/ipp-20110906/Ohana/src/opihi/pantasks/init_server.c
===================================================================
--- /branches/eam_branches/ipp-20110906/Ohana/src/opihi/pantasks/init_server.c	(revision 32584)
+++ /branches/eam_branches/ipp-20110906/Ohana/src/opihi/pantasks/init_server.c	(revision 32585)
@@ -34,4 +34,5 @@
   {1, "delete",     delete_job,    "delete job"},
   {1, "host",       task_host,     "define host machine for a task"},
+  {1, "nice",       task_nice,     "set nice priority level for a task"},
   {1, "ipptool2book", ipptool2book, "convert queue with ipptool output to book"},
   {1, "kill",       kill_job,      "kill job"},
Index: /branches/eam_branches/ipp-20110906/Ohana/src/opihi/pantasks/task.c
===================================================================
--- /branches/eam_branches/ipp-20110906/Ohana/src/opihi/pantasks/task.c	(revision 32584)
+++ /branches/eam_branches/ipp-20110906/Ohana/src/opihi/pantasks/task.c	(revision 32585)
@@ -72,4 +72,5 @@
       case TASK_NMAX:
       case TASK_HOST:
+      case TASK_NICE:
       case TASK_EXIT:
       case TASK_EXEC:
Index: /branches/eam_branches/ipp-20110906/Ohana/src/opihi/pantasks/task_nice.c
===================================================================
--- /branches/eam_branches/ipp-20110906/Ohana/src/opihi/pantasks/task_nice.c	(revision 32584)
+++ /branches/eam_branches/ipp-20110906/Ohana/src/opihi/pantasks/task_nice.c	(revision 32585)
@@ -7,5 +7,5 @@
   Task *task;
 
-  if (argc != 3) {
+  if (argc != 2) {
     gprint (GP_ERR, "USAGE: nice (priority)\n");
     return (FALSE);
Index: /branches/eam_branches/ipp-20110906/Ohana/src/opihi/pantasks/test/nice.sh
===================================================================
--- /branches/eam_branches/ipp-20110906/Ohana/src/opihi/pantasks/test/nice.sh	(revision 32585)
+++ /branches/eam_branches/ipp-20110906/Ohana/src/opihi/pantasks/test/nice.sh	(revision 32585)
@@ -0,0 +1,70 @@
+
+# a basic task which just runs 'sleep 10'
+task	       nicetask_local
+  command      sleep 10
+  host         local
+  nice         10
+
+  periods      -poll 0.1
+  periods      -exec 1.0
+  periods      -timeout 20
+  active       true
+  npending 5
+  
+  stdout tmp.txt
+  stderr tmp.txt
+
+  task.exec
+    echo "nicetask_local start"
+  end
+
+  # success
+  task.exit    0
+    echo "nicetask_local stop"
+  end
+
+  # default exit status
+  task.exit    default
+    echo       "failure: exit status: $EXIT"
+  end
+
+  # operation times out?
+  task.exit    timeout
+    echo       "timeout"
+  end
+end
+
+# a basic task which just runs 'sleep 10'
+task	       meantask_local
+  command      sleep 10
+  host         local
+
+  periods      -poll 0.1
+  periods      -exec 1.0
+  periods      -timeout 20
+  active       true
+  npending 5
+  
+  stdout tmp.txt
+  stderr tmp.txt
+
+  task.exec
+    echo "meantask_local start"
+  end
+
+  # success
+  task.exit    0
+    echo "meantask_local stop"
+  end
+
+  # default exit status
+  task.exit    default
+    echo       "failure: exit status: $EXIT"
+  end
+
+  # operation times out?
+  task.exit    timeout
+    echo       "timeout"
+  end
+end
+
Index: /branches/eam_branches/ipp-20110906/Ohana/src/opihi/pantasks/test/nice_remote.sh
===================================================================
--- /branches/eam_branches/ipp-20110906/Ohana/src/opihi/pantasks/test/nice_remote.sh	(revision 32585)
+++ /branches/eam_branches/ipp-20110906/Ohana/src/opihi/pantasks/test/nice_remote.sh	(revision 32585)
@@ -0,0 +1,70 @@
+
+# a basic task which just runs 'sleep 10'
+task	       nicetask_local
+  command      sleep 10
+  host         anyhost
+  nice         10
+
+  periods      -poll 0.1
+  periods      -exec 1.0
+  periods      -timeout 20
+  active       true
+  npending 5
+  
+  stdout tmp.txt
+  stderr tmp.txt
+
+  task.exec
+    echo "nicetask_local start"
+  end
+
+  # success
+  task.exit    0
+    echo "nicetask_local stop"
+  end
+
+  # default exit status
+  task.exit    default
+    echo       "failure: exit status: $EXIT"
+  end
+
+  # operation times out?
+  task.exit    timeout
+    echo       "timeout"
+  end
+end
+
+# a basic task which just runs 'sleep 10'
+task	       meantask_local
+  command      sleep 10
+  host         anyhost
+
+  periods      -poll 0.1
+  periods      -exec 1.0
+  periods      -timeout 20
+  active       true
+  npending 5
+  
+  stdout tmp.txt
+  stderr tmp.txt
+
+  task.exec
+    echo "meantask_local start"
+  end
+
+  # success
+  task.exit    0
+    echo "meantask_local stop"
+  end
+
+  # default exit status
+  task.exit    default
+    echo       "failure: exit status: $EXIT"
+  end
+
+  # operation times out?
+  task.exit    timeout
+    echo       "timeout"
+  end
+end
+
Index: /branches/eam_branches/ipp-20110906/Ohana/src/opihi/pclient/job.c
===================================================================
--- /branches/eam_branches/ipp-20110906/Ohana/src/opihi/pclient/job.c	(revision 32584)
+++ /branches/eam_branches/ipp-20110906/Ohana/src/opihi/pclient/job.c	(revision 32585)
@@ -3,5 +3,5 @@
 int job (int argc, char **argv) {
 
-  int i, pid, status, priority;
+  int i, N, pid, status, priority;
   char **targv;
 
Index: /branches/eam_branches/ipp-20110906/Ohana/src/opihi/pcontrol/JobOps.c
===================================================================
--- /branches/eam_branches/ipp-20110906/Ohana/src/opihi/pcontrol/JobOps.c	(revision 32584)
+++ /branches/eam_branches/ipp-20110906/Ohana/src/opihi/pcontrol/JobOps.c	(revision 32585)
@@ -272,4 +272,8 @@
 }
 
+/*** ResortJobStack can be used to adjust priorities based on some info we supply.  This
+     is not finished -- to finish this, I need to define the metric of interest and
+     arrange for that to be passed to the jobs in pcontrol
+
 void ResortJobStack (int StackID) {
 
@@ -277,19 +281,19 @@
   LockStack (stack);
 
-# define SWAPFUNC(A,B){ \
-  void *tmpObject = stack[0].object[A]; \
-  stack[0].object[A] = stack[0].object[B]; \
-  stack[0].object[B] = tmpObject; \
-  void *tmpName = stack[0].name[A]; \
-  stack[0].name[A] = stack[0].name[B]; \
-  stack[0].name[B] = tmpName; \
-  void *tmpID = stack[0].id[A]; \
-  stack[0].id[A] = stack[0].id[B]; \
-  stack[0].id[B] = tmpID; \
-}
+# define SWAPFUNC(A,B){				\
+    void *tmpObject = stack[0].object[A];	\
+    stack[0].object[A] = stack[0].object[B];	\
+    stack[0].object[B] = tmpObject;		\
+    void *tmpName = stack[0].name[A];		\
+    stack[0].name[A] = stack[0].name[B];	\
+    stack[0].name[B] = tmpName;			\
+    void *tmpID = stack[0].id[A];		\
+    stack[0].id[A] = stack[0].id[B];		\
+    stack[0].id[B] = tmpID;			\
+  }
 
 # define COMPARE(A,B)(((Job *)stack[0].object[A]).VALUE < ((Job *)stack[0].object[B]).VALUE)
 
-  OHANA_SORT (N, COMPARE, SWAPFUNC);
+  OHANA_SORT (stack[0].Nobject, COMPARE, SWAPFUNC);
 
 # undef SWAPFUNC
@@ -298,2 +302,4 @@
   UnlockStack (stack);
 }
+
+***/
Index: /branches/eam_branches/ipp-20110906/Ohana/src/opihi/pcontrol/job.c
===================================================================
--- /branches/eam_branches/ipp-20110906/Ohana/src/opihi/pcontrol/job.c	(revision 32584)
+++ /branches/eam_branches/ipp-20110906/Ohana/src/opihi/pcontrol/job.c	(revision 32585)
@@ -67,8 +67,5 @@
   }
 
-  if (argc < 2) {
-    FREE (Host);
-    goto usage;
-  }
+  if (argc < 2) goto usage;
   
   targc = argc - 1;
Index: /branches/eam_branches/ipp-20110906/Ohana/src/opihi/pcontrol/status.c
===================================================================
--- /branches/eam_branches/ipp-20110906/Ohana/src/opihi/pcontrol/status.c	(revision 32584)
+++ /branches/eam_branches/ipp-20110906/Ohana/src/opihi/pcontrol/status.c	(revision 32585)
@@ -59,8 +59,9 @@
     }
 
+    PrintID (GP_LOG, job[0].JobID);
+    gprint (GP_LOG, " %2d ", job[0].priority);
     for (j = 0; j < job[0].argc; j++) {
       gprint (GP_LOG, "%s ", job[0].argv[j]);
     }
-    PrintID (GP_LOG, job[0].JobID);
     gprint (GP_LOG, "\n");
   }
