Changeset 10694
- Timestamp:
- Dec 13, 2006, 8:55:19 AM (20 years ago)
- Location:
- trunk/Ohana/src/opihi
- Files:
-
- 8 edited
-
include/pantasks.h (modified) (2 diffs)
-
pantasks/CheckTasks.c (modified) (1 diff)
-
pantasks/Makefile (modified) (1 diff)
-
pantasks/TaskOps.c (modified) (2 diffs)
-
pantasks/controller.c (modified) (1 diff)
-
pantasks/controller_run.c (modified) (3 diffs)
-
pantasks/init.c (modified) (2 diffs)
-
pantasks/task.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/opihi/include/pantasks.h
r9037 r10694 33 33 TASK_COMMENT, 34 34 TASK_NMAX, 35 TASK_ACTIVE, 35 36 TASK_TRANGE, 36 37 TASK_END, … … 94 95 int Nfailure; 95 96 int Ntimeout; 97 98 int active; 96 99 97 100 } Task; -
trunk/Ohana/src/opihi/pantasks/CheckTasks.c
r8191 r10694 9 9 /** test all tasks: ready to test? ready to run? **/ 10 10 while ((task = NextTask ()) != NULL) { 11 12 if (!task[0].active) continue; 11 13 12 14 /* ready to test? : check exec period */ -
trunk/Ohana/src/opihi/pantasks/Makefile
r10342 r10694 50 50 $(SDIR)/task_host.$(ARCH).o \ 51 51 $(SDIR)/task_nmax.$(ARCH).o \ 52 $(SDIR)/task_active.$(ARCH).o \ 52 53 $(SDIR)/task_macros.$(ARCH).o \ 53 54 $(SDIR)/task_trange.$(ARCH).o \ -
trunk/Ohana/src/opihi/pantasks/TaskOps.c
r9037 r10694 310 310 NewTask[0].Nfailure = 0; 311 311 NewTask[0].Ntimeout = 0; 312 313 NewTask[0].active = TRUE; 312 314 return (NewTask); 313 315 } … … 419 421 if (!strcasecmp (command, "HOST")) hash = TASK_HOST; 420 422 if (!strcasecmp (command, "NMAX")) hash = TASK_NMAX; 423 if (!strcasecmp (command, "ACTIVE")) hash = TASK_ACTIVE; 421 424 if (!strcasecmp (command, "TRANGE")) hash = TASK_TRANGE; 422 425 if (!strcasecmp (command, "STDOUT")) hash = TASK_STDOUT; -
trunk/Ohana/src/opihi/pantasks/controller.c
r8548 r10694 14 14 {"host", controller_host, "define host for controller"}, 15 15 {"check", controller_check, "check controller host/job"}, 16 {"run", controller_run, "start controller operation "},17 {"stop", controller_ stop,"stop controller (no disconnect)"},16 {"run", controller_run, "start controller operation / set run levels"}, 17 {"stop", controller_run, "stop controller (no disconnect)"}, 18 18 {"status", controller_status, "check controller status"}, 19 19 {"output", controller_output, "print controller output"}, -
trunk/Ohana/src/opihi/pantasks/controller_run.c
r8548 r10694 7 7 IOBuffer buffer; 8 8 9 if (argc != 1) { 10 gprint (GP_ERR, "USAGE: controller run\n"); 9 if ((argc > 2) || 10 get_argument (argc, argv, "help") || 11 get_argument (argc, argv, "-h") || 12 get_argument (argc, argv, "--help")) 13 { 14 if (!strcmp (argv[0], "run")) { 15 gprint (GP_ERR, "USAGE: controller run [level]\n"); 16 gprint (GP_ERR, " allowed levels:\n"); 17 gprint (GP_ERR, " all (default) : manage machines, spawn jobs, harvest jobs\n"); 18 gprint (GP_ERR, " reap : manage machines, harvest jobs\n"); 19 gprint (GP_ERR, " hosts : manage machines, not jobs\n"); 20 gprint (GP_ERR, " none : all stop\n"); 21 } else { 22 gprint (GP_ERR, "USAGE: controller stop (immediate processing halt)\n"); 23 } 11 24 return (FALSE); 12 25 } … … 19 32 } 20 33 21 sprintf (command, "run"); 34 if (argc == 1) { 35 strcpy (command, argv[0]); 36 } else { 37 sprintf (command, "run %s", argv[1]); 38 } 39 22 40 InitIOBuffer (&buffer, 0x100); 23 41 status = ControllerCommand (command, CONTROLLER_PROMPT, &buffer); … … 30 48 return (TRUE); 31 49 } 32 33 int controller_stop (int argc, char **argv) {34 35 int status;36 char command[1024];37 IOBuffer buffer;38 39 if (argc != 1) {40 gprint (GP_ERR, "USAGE: controller stop\n");41 return (FALSE);42 }43 44 /* check if controller is running */45 status = CheckControllerStatus ();46 if (!status) {47 gprint (GP_LOG, "controller is not active\n");48 return (TRUE);49 }50 51 sprintf (command, "stop");52 InitIOBuffer (&buffer, 0x100);53 status = ControllerCommand (command, CONTROLLER_PROMPT, &buffer);54 if (status) {55 gwrite (buffer.buffer, 1, buffer.Nbuffer, GP_LOG);56 } else {57 gprint (GP_LOG, "controller is not responding\n");58 }59 FreeIOBuffer (&buffer);60 return (TRUE);61 } -
trunk/Ohana/src/opihi/pantasks/init.c
r9037 r10694 5 5 int task_host PROTO((int, char **)); 6 6 int task_nmax PROTO((int, char **)); 7 int task_active PROTO((int, char **)); 7 8 int task_trange PROTO((int, char **)); 8 9 int task_macros PROTO((int, char **)); … … 26 27 {"host", task_host, "define host machine for a task"}, 27 28 {"nmax", task_nmax, "define maximum number of jobs for a task"}, 29 {"active", task_active, "define maximum number of jobs for a task"}, 28 30 {"trange", task_trange, "define valid/invalid time periods for a task"}, 29 31 {"task.exit", task_macros, "define exit macros for a task"}, -
trunk/Ohana/src/opihi/pantasks/task.c
r10647 r10694 96 96 case TASK_OPTIONS: 97 97 case TASK_PERIODS: 98 case TASK_ACTIVE: 98 99 status = command (input, &outline, TRUE); 99 100 if (outline != NULL) free (outline);
Note:
See TracChangeset
for help on using the changeset viewer.
