Changeset 4693 for trunk/Ohana/src/opihi/pantasks
- Timestamp:
- Aug 1, 2005, 4:54:17 AM (21 years ago)
- Location:
- trunk/Ohana/src/opihi/pantasks
- Files:
-
- 1 added
- 31 edited
-
CheckJobs.c (modified) (1 diff)
-
CheckSystem.c (modified) (1 diff)
-
CheckTasks.c (modified) (1 diff)
-
CheckTimeRanges.c (modified) (1 diff)
-
ControllerOps.c (modified) (3 diffs)
-
JobIDOps.c (modified) (1 diff)
-
JobOps.c (modified) (1 diff)
-
LocalJob.c (modified) (3 diffs)
-
Makefile (modified) (5 diffs)
-
TaskOps.c (modified) (1 diff)
-
controller.c (modified) (1 diff)
-
controller_check.c (modified) (1 diff)
-
controller_exit.c (modified) (1 diff)
-
controller_host.c (modified) (1 diff)
-
controller_output.c (modified) (1 diff)
-
controller_status.c (modified) (1 diff)
-
delete.c (modified) (1 diff)
-
init.c (modified) (2 diffs)
-
job.c (modified) (1 diff)
-
kill.c (modified) (1 diff)
-
psched.c (added)
-
run.c (modified) (1 diff)
-
status.c (modified) (1 diff)
-
stop.c (modified) (1 diff)
-
task.c (modified) (1 diff)
-
task_command.c (modified) (1 diff)
-
task_host.c (modified) (1 diff)
-
task_macros.c (modified) (1 diff)
-
task_nmax.c (modified) (1 diff)
-
task_periods.c (modified) (1 diff)
-
task_trange.c (modified) (1 diff)
-
verbose.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/opihi/pantasks/CheckJobs.c
r4689 r4693 1 # include " scheduler.h"1 # include "psched.h" 2 2 3 3 int CheckJobs () { -
trunk/Ohana/src/opihi/pantasks/CheckSystem.c
r4689 r4693 1 # include " scheduler.h"1 # include "psched.h" 2 2 3 3 int CheckSystem () { -
trunk/Ohana/src/opihi/pantasks/CheckTasks.c
r4689 r4693 1 # include " scheduler.h"1 # include "psched.h" 2 2 3 3 int CheckTasks () { -
trunk/Ohana/src/opihi/pantasks/CheckTimeRanges.c
r4602 r4693 1 # include " scheduler.h"1 # include "psched.h" 2 2 3 3 int CheckTimeRanges (TimeRange *ranges, int Nranges) { -
trunk/Ohana/src/opihi/pantasks/ControllerOps.c
r4689 r4693 1 # include " scheduler.h"1 # include "psched.h" 2 2 # define CONTROLLER_TIMEOUT 20 3 3 # define CONNECT_TIMEOUT 300 … … 350 350 exit (2); 351 351 case -1: /* no data in pipe */ 352 break; 353 case 0: /* pipe is closed */ 354 /** change child state? **/ 355 break; 352 case 0: /* pipe is closed, change child state? **/ 356 353 default: /* data in pipe */ 357 354 break; … … 365 362 exit (2); 366 363 case -1: /* no data in pipe */ 367 break; 368 case 0: /* pipe is closed */ 369 /** change child state? **/ 370 break; 364 case 0: /* pipe is closed, change child state? **/ 371 365 default: /* data in pipe */ 372 366 break; -
trunk/Ohana/src/opihi/pantasks/JobIDOps.c
r4689 r4693 1 # include " scheduler.h"1 # include "psched.h" 2 2 3 3 # define MAX_N_JOBS 1000 -
trunk/Ohana/src/opihi/pantasks/JobOps.c
r4689 r4693 1 # include " scheduler.h"1 # include "psched.h" 2 2 3 3 static Job **jobs; -
trunk/Ohana/src/opihi/pantasks/LocalJob.c
r4691 r4693 1 # include " scheduler.h"1 # include "psched.h" 2 2 3 3 /* this could be written a just a one-way pipe */ … … 66 66 CheckLocalJobStatus (job); 67 67 68 /* read stdout buffer */ 69 Nread = ReadtoIOBuffer (&job[0].stdout, job[0].stdout_fd); 70 switch (Nread) { 71 case -2: /* error in read (programming error? system level error?) */ 72 fprintf (stderr, "serious IO error\n"); 73 exit (2); 74 case -1: /* no data in pipe */ 75 break; 76 case 0: /* pipe is closed */ 77 /** change child state? **/ 78 break; 79 default: /* data in pipe */ 80 break; 81 } 68 if ((job[0].state == JOB_EXIT) || (job[0].state == JOB_CRASH)) { 69 EmptyIOBuffer (&job[0].stdout, job[0].stdout_fd); 70 EmptyIOBuffer (&job[0].stderr, job[0].stderr_fd); 71 } else { 72 /* read stdout buffer */ 73 Nread = ReadtoIOBuffer (&job[0].stdout, job[0].stdout_fd); 74 switch (Nread) { 75 case -2: /* error in read (programming error? system level error?) */ 76 fprintf (stderr, "serious IO error\n"); 77 exit (2); 78 case -1: /* no data in pipe */ 79 case 0: /* pipe is closed, change child state? **/ 80 default: /* data in pipe */ 81 break; 82 } 82 83 83 /* read stderr buffer */ 84 Nread = ReadtoIOBuffer (&job[0].stderr, job[0].stderr_fd); 85 switch (Nread) { 86 case -2: /* error in read (programming error? system level error?) */ 87 fprintf (stderr, "serious IO error\n"); 88 exit (2); 89 case -1: /* no data in pipe */ 90 break; 91 case 0: /* pipe is closed */ 92 /** change child state? **/ 93 break; 94 default: /* data in pipe */ 95 break; 84 /* read stderr buffer */ 85 Nread = ReadtoIOBuffer (&job[0].stderr, job[0].stderr_fd); 86 switch (Nread) { 87 case -2: /* error in read (programming error? system level error?) */ 88 fprintf (stderr, "serious IO error\n"); 89 exit (2); 90 case -1: /* no data in pipe */ 91 case 0: /* pipe is closed, change child state? **/ 92 default: /* data in pipe */ 93 break; 94 } 96 95 } 97 96 return (TRUE); … … 101 100 102 101 int result, waitstatus; 102 103 /*** if child has exited, does the pipe hang around until it is flushed? ***/ 104 /*** who closes the child stdout/stderr fd? */ 103 105 104 106 /* check local job status */ -
trunk/Ohana/src/opihi/pantasks/Makefile
r4691 r4693 7 7 LIB = $(HOME)/lib 8 8 INC = $(HOME)/include 9 SDIR = $(HOME)/ sched9 SDIR = $(HOME)/psched 10 10 # 11 11 DESTBIN = $(LBIN) … … 13 13 DESTINC = $(LINC) 14 14 DESTMAN = $(LMAN) 15 DESTHLP = $(LHLP)/ sched15 DESTHLP = $(LHLP)/psched 16 16 # 17 17 INCS = -I$(INC) -I$(LINC) -I$(XINC) … … 27 27 funcs = \ 28 28 $(SDIR)/init.$(ARCH).o \ 29 $(SDIR)/ scheduler.$(ARCH).o \29 $(SDIR)/psched.$(ARCH).o \ 30 30 $(SDIR)/CheckJobs.$(ARCH).o \ 31 31 $(SDIR)/CheckSystem.$(ARCH).o \ … … 36 36 $(SDIR)/JobOps.$(ARCH).o \ 37 37 $(SDIR)/JobIDOps.$(ARCH).o \ 38 $(SDIR)/TaskOps.$(ARCH).o \ 39 $(SDIR)/IOBufferOps.$(ARCH).o 38 $(SDIR)/TaskOps.$(ARCH).o 40 39 41 40 cmds = \ … … 67 66 $(DESTLIB)/libdatacmd.a 68 67 69 all: scheduler68 all: psched 70 69 71 scheduler: $(BIN)/scheduler.$(ARCH)70 psched: $(BIN)/psched.$(ARCH) 72 71 @echo done 73 72 74 $(BIN)/ scheduler.$(ARCH) : $(funcs) $(cmds) $(libs)73 $(BIN)/psched.$(ARCH) : $(funcs) $(cmds) $(libs) 75 74 76 install: $(DESTBIN)/ schedulerhelp75 install: $(DESTBIN)/psched help 77 76 78 help: cmd.basic.help cmd.data.help cmd.astro.help sched.help77 help: cmd.basic.help cmd.data.help cmd.astro.help psched.help 79 78 80 79 # utilities ################################################# -
trunk/Ohana/src/opihi/pantasks/TaskOps.c
r4684 r4693 1 # include " scheduler.h"1 # include "psched.h" 2 2 3 3 static Task **tasks; -
trunk/Ohana/src/opihi/pantasks/controller.c
r4689 r4693 1 # include " scheduler.h"1 # include "psched.h" 2 2 3 3 int controller_host PROTO((int, char **)); -
trunk/Ohana/src/opihi/pantasks/controller_check.c
r4573 r4693 1 # include " scheduler.h"1 # include "psched.h" 2 2 3 3 int controller_check (int argc, char **argv) { -
trunk/Ohana/src/opihi/pantasks/controller_exit.c
r4689 r4693 1 # include " scheduler.h"1 # include "psched.h" 2 2 3 3 int controller_exit (int argc, char **argv) { -
trunk/Ohana/src/opihi/pantasks/controller_host.c
r4573 r4693 1 # include " scheduler.h"1 # include "psched.h" 2 2 3 3 int controller_host (int argc, char **argv) { -
trunk/Ohana/src/opihi/pantasks/controller_output.c
r4689 r4693 1 # include " scheduler.h"1 # include "psched.h" 2 2 3 3 int controller_output (int argc, char **argv) { -
trunk/Ohana/src/opihi/pantasks/controller_status.c
r4573 r4693 1 # include " scheduler.h"1 # include "psched.h" 2 2 3 3 int controller_status (int argc, char **argv) { -
trunk/Ohana/src/opihi/pantasks/delete.c
r4689 r4693 1 # include " scheduler.h"1 # include "psched.h" 2 2 3 3 int delete_job (int argc, char **argv) { -
trunk/Ohana/src/opihi/pantasks/init.c
r4603 r4693 1 # include " scheduler.h"1 # include "psched.h" 2 2 3 3 int controller PROTO((int, char **)); … … 47 47 */ 48 48 49 void Init Sched () {49 void InitPsched () { 50 50 51 51 int i; -
trunk/Ohana/src/opihi/pantasks/job.c
r4552 r4693 1 # include " scheduler.h"1 # include "psched.h" 2 2 3 3 /* this will require a bit of care: to define a job, we need -
trunk/Ohana/src/opihi/pantasks/kill.c
r4689 r4693 1 # include " scheduler.h"1 # include "psched.h" 2 2 3 3 int kill_job (int argc, char **argv) { -
trunk/Ohana/src/opihi/pantasks/run.c
r4552 r4693 1 # include " scheduler.h"1 # include "psched.h" 2 2 3 3 int run (int argc, char **argv) { -
trunk/Ohana/src/opihi/pantasks/status.c
r4689 r4693 1 # include " scheduler.h"1 # include "psched.h" 2 2 3 3 int status_sys (int argc, char **argv) { -
trunk/Ohana/src/opihi/pantasks/stop.c
r4552 r4693 1 # include " scheduler.h"1 # include "psched.h" 2 2 3 3 int stop (int argc, char **argv) { -
trunk/Ohana/src/opihi/pantasks/task.c
r4689 r4693 1 # include " scheduler.h"1 # include "psched.h" 2 2 # define prompt "> " 3 3 -
trunk/Ohana/src/opihi/pantasks/task_command.c
r4684 r4693 1 # include " scheduler.h"1 # include "psched.h" 2 2 3 3 int task_command (int argc, char **argv) { -
trunk/Ohana/src/opihi/pantasks/task_host.c
r4689 r4693 1 # include " scheduler.h"1 # include "psched.h" 2 2 3 3 int task_host (int argc, char **argv) { -
trunk/Ohana/src/opihi/pantasks/task_macros.c
r4689 r4693 1 # include " scheduler.h"1 # include "psched.h" 2 2 # define D_NLINES 100 3 3 # define prompt "> " -
trunk/Ohana/src/opihi/pantasks/task_nmax.c
r4684 r4693 1 # include " scheduler.h"1 # include "psched.h" 2 2 3 3 int task_nmax (int argc, char **argv) { -
trunk/Ohana/src/opihi/pantasks/task_periods.c
r4689 r4693 1 # include " scheduler.h"1 # include "psched.h" 2 2 3 3 int task_periods (int argc, char **argv) { -
trunk/Ohana/src/opihi/pantasks/task_trange.c
r4689 r4693 1 # include " scheduler.h"1 # include "psched.h" 2 2 3 3 int task_trange (int argc, char **argv) { -
trunk/Ohana/src/opihi/pantasks/verbose.c
r4602 r4693 1 # include " scheduler.h"1 # include "psched.h" 2 2 3 3 static int VERBOSE = FALSE;
Note:
See TracChangeset
for help on using the changeset viewer.
