Index: /trunk/Ohana/src/opihi/include/pantasks.h
===================================================================
--- /trunk/Ohana/src/opihi/include/pantasks.h	(revision 9036)
+++ /trunk/Ohana/src/opihi/include/pantasks.h	(revision 9037)
@@ -36,4 +36,6 @@
       TASK_END, 
       TASK_HOST, 
+      TASK_STDOUT, 
+      TASK_STDERR, 
       TASK_COMMAND, 
       TASK_OPTIONS, 
@@ -73,4 +75,7 @@
 
   char   *name;
+
+  char   *stdout_dump;
+  char   *stderr_dump;
 
   int       Nranges;
@@ -124,4 +129,7 @@
   IOBuffer    stderr;			/* stderr storage buffer */
   JobMode     mode;			/* local or controller? */
+
+  char   *stdout_dump;
+  char   *stderr_dump;
 
   int         stdout_size;		/* size of pending stdout buffer (controller) */
@@ -209,14 +217,4 @@
 void *ListenClients (void *data);
 
-/*
-void InitPrint ();
-void SetOutBuffer ();
-IOBuffer *GetOutBuffer ();
-void SetOutfile (char *outname);
-FILE *GetOutFile ();
-int ioprint (IOBuffer *buffer, char *format, ...);
-int gprintf (char *format, ...);
-*/
-
 // functions related to the server threads
 void CheckTasksSetState (int state);
Index: /trunk/Ohana/src/opihi/pantasks/CheckJobs.c
===================================================================
--- /trunk/Ohana/src/opihi/pantasks/CheckJobs.c	(revision 9036)
+++ /trunk/Ohana/src/opihi/pantasks/CheckJobs.c	(revision 9037)
@@ -3,4 +3,5 @@
 int CheckJobs () {
 
+  FILE *f;
   Job *job;
   Macro *macro;
@@ -31,4 +32,24 @@
 	PushNamedQueue ("stdout", job[0].stdout.buffer);
 	PushNamedQueue ("stderr", job[0].stderr.buffer);
+
+	/* save the stdout and stderr if desired */
+	if (job[0].stdout_dump != NULL) {
+	  f = fopen (job[0].stdout_dump, "a");
+	  if (f == NULL) {
+	    gprint (GP_ERR, "unable to open stdout dump file %s\n", job[0].stdout_dump);
+	  } else {
+	    fwrite (job[0].stdout.buffer, 1, job[0].stdout.Nbuffer, f);
+	    fclose (f);
+	  }
+	}
+	if (job[0].stderr_dump != NULL) {
+	  f = fopen (job[0].stderr_dump, "a");
+	  if (f == NULL) {
+	    gprint (GP_ERR, "unable to open stderr dump file %s\n", job[0].stderr_dump);
+	  } else {
+	    fwrite (job[0].stderr.buffer, 1, job[0].stderr.Nbuffer, f);
+	    fclose (f);
+	  }
+	}
 
 	/* set taskarg variables */
Index: /trunk/Ohana/src/opihi/pantasks/JobOps.c
===================================================================
--- /trunk/Ohana/src/opihi/pantasks/JobOps.c	(revision 9036)
+++ /trunk/Ohana/src/opihi/pantasks/JobOps.c	(revision 9037)
@@ -121,4 +121,9 @@
   InitIOBuffer (&job[0].stderr, 0x100);
 
+  job[0].stdout_dump = NULL;
+  job[0].stderr_dump = NULL;
+  if (task[0].stdout_dump != NULL) job[0].stdout_dump = strcreate (task[0].stdout_dump);
+  if (task[0].stderr_dump != NULL) job[0].stderr_dump = strcreate (task[0].stderr_dump);
+
   jobs[Njobs] = job;
   Njobs ++;
@@ -148,4 +153,7 @@
   free (job[0].optv);
 
+  if (job[0].stdout_dump != NULL) free (job[0].stdout_dump);
+  if (job[0].stderr_dump != NULL) free (job[0].stderr_dump);
+
   FreeIOBuffer (&job[0].stdout);
   FreeIOBuffer (&job[0].stderr);
Index: /trunk/Ohana/src/opihi/pantasks/Makefile
===================================================================
--- /trunk/Ohana/src/opihi/pantasks/Makefile	(revision 9036)
+++ /trunk/Ohana/src/opihi/pantasks/Makefile	(revision 9037)
@@ -62,4 +62,5 @@
 $(SDIR)/task_macros.$(ARCH).o \
 $(SDIR)/task_trange.$(ARCH).o \
+$(SDIR)/task_stdout.$(ARCH).o \
 $(SDIR)/task_periods.$(ARCH).o \
 $(SDIR)/task_command.$(ARCH).o \
Index: /trunk/Ohana/src/opihi/pantasks/TaskOps.c
===================================================================
--- /trunk/Ohana/src/opihi/pantasks/TaskOps.c	(revision 9036)
+++ /trunk/Ohana/src/opihi/pantasks/TaskOps.c	(revision 9037)
@@ -282,4 +282,7 @@
   NewTask[0].optv = NULL;
 
+  NewTask[0].stdout_dump = NULL;
+  NewTask[0].stderr_dump = NULL;
+
   NewTask[0].exec = NULL;
   NewTask[0].crash = NULL;
@@ -417,4 +420,6 @@
   if (!strcasecmp (command, "NMAX"))      hash = TASK_NMAX;
   if (!strcasecmp (command, "TRANGE"))    hash = TASK_TRANGE;
+  if (!strcasecmp (command, "STDOUT"))    hash = TASK_STDOUT;
+  if (!strcasecmp (command, "STDERR"))    hash = TASK_STDERR;
   if (!strcasecmp (command, "COMMAND"))   hash = TASK_COMMAND;
   if (!strcasecmp (command, "OPTIONS"))   hash = TASK_OPTIONS;
Index: /trunk/Ohana/src/opihi/pantasks/init.c
===================================================================
--- /trunk/Ohana/src/opihi/pantasks/init.c	(revision 9036)
+++ /trunk/Ohana/src/opihi/pantasks/init.c	(revision 9037)
@@ -10,4 +10,6 @@
 int task_options    PROTO((int, char **));
 int task_periods    PROTO((int, char **));
+int task_stdout     PROTO((int, char **));
+int task_stderr     PROTO((int, char **));
 int run             PROTO((int, char **));
 int stop            PROTO((int, char **));
@@ -30,4 +32,6 @@
   {"options",    task_options, "define optional variables associated with the job task"},
   {"periods",    task_periods, "define time scales for a task"},
+  {"stdout",     task_stdout,  "define a file for the job stdout dump"},
+  {"stderr",     task_stderr,  "define a file for the job stderr dump"},
   {"run",        run,          "run the scheduler"},
   {"stop",       stop,         "stop the scheduler"},
Index: /trunk/Ohana/src/opihi/pantasks/scheduler.c
===================================================================
--- /trunk/Ohana/src/opihi/pantasks/scheduler.c	(revision 9036)
+++ /trunk/Ohana/src/opihi/pantasks/scheduler.c	(revision 9037)
@@ -30,5 +30,4 @@
   InitBasic ();
   InitData ();
-  InitOutfile ();
   InitSched ();
   InitTasks ();
Index: /trunk/Ohana/src/opihi/pantasks/task.c
===================================================================
--- /trunk/Ohana/src/opihi/pantasks/task.c	(revision 9036)
+++ /trunk/Ohana/src/opihi/pantasks/task.c	(revision 9037)
@@ -91,4 +91,6 @@
       case TASK_EXIT:
       case TASK_EXEC:
+      case TASK_STDOUT:
+      case TASK_STDERR:
       case TASK_COMMAND:
       case TASK_OPTIONS:
Index: /trunk/Ohana/src/opihi/pantasks/task_stdout.c
===================================================================
--- /trunk/Ohana/src/opihi/pantasks/task_stdout.c	(revision 9037)
+++ /trunk/Ohana/src/opihi/pantasks/task_stdout.c	(revision 9037)
@@ -0,0 +1,51 @@
+# include "pantasks.h"
+
+int task_stdout (int argc, char **argv) {
+
+  int N, RequiredHost;
+  Task *task;
+
+  if (argc != 2) {
+    gprint (GP_ERR, "USAGE: stdout <name>\n");
+    gprint (GP_ERR, "  define dump file for job stdout for this task\n");
+    return (FALSE);
+  }
+
+  task = GetNewTask ();
+  if (task == NULL) {
+    task = GetActiveTask ();
+    if (task == NULL) {
+      gprint (GP_ERR, "ERROR: not defining or running a task\n");
+      return (FALSE);
+    }
+  }
+  if (task[0].stdout_dump != NULL) free (task[0].stdout_dump);
+  task[0].stdout_dump = strcreate (argv[1]);
+  return (TRUE);
+}
+
+int task_stderr (int argc, char **argv) {
+
+  int N, RequiredHost;
+  Task *task;
+
+  if (argc != 2) {
+    gprint (GP_ERR, "USAGE: stderr <name>\n");
+    gprint (GP_ERR, "  define dump file for job stderr for this task\n");
+    return (FALSE);
+  }
+
+  task = GetNewTask ();
+  if (task == NULL) {
+    task = GetActiveTask ();
+    if (task == NULL) {
+      gprint (GP_ERR, "ERROR: not defining or running a task\n");
+      return (FALSE);
+    }
+  }
+  if (task[0].stderr_dump != NULL) free (task[0].stderr_dump);
+  task[0].stderr_dump = strcreate (argv[1]);
+  return (TRUE);
+}
+
+/* apparently, local is the default! */
