Changeset 4705 for trunk/Ohana/src/opihi/pantasks
- Timestamp:
- Aug 3, 2005, 5:50:08 PM (21 years ago)
- Location:
- trunk/Ohana/src/opihi/pantasks
- Files:
-
- 1 added
- 17 edited
-
CheckJobs.c (modified) (2 diffs)
-
ControllerOps.c (modified) (15 diffs)
-
JobOps.c (modified) (5 diffs)
-
Makefile (modified) (1 diff)
-
TaskOps.c (modified) (5 diffs)
-
controller_check.c (modified) (2 diffs)
-
controller_host.c (modified) (3 diffs)
-
controller_status.c (modified) (2 diffs)
-
init.c (modified) (2 diffs)
-
psched.c (modified) (1 diff)
-
pulse.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) (3 diffs)
-
task_macros.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/opihi/pantasks/CheckJobs.c
r4697 r4705 26 26 case JOB_CRASH: 27 27 /* run task[0].crash macro, if it exists */ 28 /* set the stdout and stderr variables with job.stdout, job.stderr */ 29 /* XXX this will break on 0 values in output streams */ 28 /* push output buffer data to the stdout and stderr queues */ 30 29 if (VerboseMode()) fprintf (stderr, "job %s (%d) crash\n", job[0].task[0].name, job[0].JobID); 31 30 PushNamedQueue ("stdout", job[0].stdout.buffer); 32 31 PushNamedQueue ("stderr", job[0].stderr.buffer); 32 /* XXX this will break on 0 values in output streams */ 33 /* perhaps define PushNamedQueueBuffer */ 33 34 if (job[0].task[0].crash != NULL) { 34 35 exec_loop (job[0].task[0].crash); … … 43 44 PushNamedQueue ("stderr", job[0].stderr.buffer); 44 45 /* run corresponding task[0].exit macro, if it exists */ 45 macro = job[0].task[0].def ;46 macro = job[0].task[0].defexit; 46 47 for (i = 0; i < job[0].task[0].Nexit; i++) { 47 48 if (job[0].exit_status == atoi(job[0].task[0].exit[i][0].name)) { -
trunk/Ohana/src/opihi/pantasks/ControllerOps.c
r4697 r4705 1 1 # include "psched.h" 2 # define CONTROLLER_TIMEOUT 20 2 /* adding a new host can delay controller up to a second or so */ 3 # define CONTROLLER_TIMEOUT 200 3 4 # define CONNECT_TIMEOUT 300 4 5 5 6 /* local static variables to hold the connection to the controller */ 6 static int status = FALSE;7 static int ControllerStatus = FALSE; 7 8 static int stdin_cntl, stdout_cntl, stderr_cntl; 8 9 static IOBuffer stdout_buffer; 9 10 static IOBuffer stderr_buffer; 11 static int ControllerPID = 0; 10 12 11 13 /* test if the controller is running */ 12 14 int CheckControllerStatus () { 13 return ( status);15 return (ControllerStatus); 14 16 } 15 17 … … 29 31 int CheckControllerJobStatus (Job *job) { 30 32 31 int outstate ;33 int outstate, status; 32 34 char cmd[128], status_string[64]; 33 35 char *p; … … 41 43 switch (status) { 42 44 case CONTROLLER_DOWN: 43 fprintf (stderr, "controller is down\n");45 if (VerboseMode()) fprintf (stderr, "controller is down\n"); 44 46 FreeIOBuffer (&buffer); 45 47 return (FALSE); 46 48 47 49 case CONTROLLER_HUNG: 48 fprintf (stderr, "controller is not responding\n");50 if (VerboseMode()) fprintf (stderr, "controller is not responding\n"); 49 51 FreeIOBuffer (&buffer); 50 52 return (FALSE); 51 53 52 54 case CONTROLLER_GOOD: 53 fprintf (stderr, "message received (CheckControllerJobStatus)\n");55 if (VerboseMode()) fprintf (stderr, "message received (CheckControllerJobStatus)\n"); 54 56 break; 55 57 56 58 default: 57 fprintf (stderr, "unknown status for controller command: programming error\n");59 if (VerboseMode()) fprintf (stderr, "unknown status for controller command: programming error\n"); 58 60 exit (1); 59 61 } … … 105 107 106 108 /* send command to get appropriate channel */ 107 ALLOCATE (line, char, MAX (1, strlen(cmd) + 15)); 108 sprintf (line, "%s %d\n", cmd, pid); 109 status = write (stdin_cntl, line, strlen(line)); 110 free (line); 109 status = write_fmt (stdin_cntl, "%s %d\n", cmd, pid); 111 110 112 111 /* is pipe still open? */ … … 126 125 if (status == -1) return (CONTROLLER_HUNG); 127 126 128 fprintf (stderr, "message received (GetJobOutput : %s)\n", cmd);127 if (VerboseMode()) fprintf (stderr, "message received (GetJobOutput : %s)\n", cmd); 129 128 /* drop extra bytes from pcontrol (not pclient:job) */ 130 129 buffer[0].Nbuffer = Nstart + Nbytes; … … 161 160 162 161 /* construct the controller command portion */ 163 if (!strc mp (job[0].task[0].host, "NONE")) {162 if (!strcasecmp (job[0].task[0].host, "ANYHOST")) { 164 163 sprintf (cmd, "job"); 165 164 } else { … … 177 176 } 178 177 179 fprintf (stderr, "sending command to controller: %s\n", cmd);180 178 InitIOBuffer (&buffer, 0x100); 181 179 ControllerCommand (cmd, CONTROLLER_PROMPT, &buffer); 182 180 free (cmd); 183 184 fprintf (stderr, "response from controller: %s\n", buffer.buffer);185 181 186 182 /* extract the job PID from the controller response */ … … 203 199 char *p; 204 200 char **argv, cmd[128]; 205 int i, pid ;201 int i, pid, status; 206 202 int stdin_fd[2], stdout_fd[2], stderr_fd[2]; 207 203 IOBuffer buffer; 208 204 209 if ( status) return (TRUE);205 if (ControllerStatus) return (TRUE); 210 206 211 207 if (VarConfig ("CONTROLLER", "%s", cmd) == NULL) strcpy (cmd, "pcontrol"); … … 262 258 263 259 /* send handshake command */ 264 sprintf (cmd, "echo CONNECTED\n"); 265 status = write (stdin_fd[1], cmd, strlen(cmd)); 260 status = write_fmt (stdin_fd[1], "echo CONNECTED\n"); 266 261 if ((status == -1) && (errno == EPIPE)) goto pipe_error; 267 262 … … 286 281 InitIOBuffer (&stderr_buffer, 0x100); 287 282 283 ControllerPID = pid; 284 ControllerStatus = TRUE; 288 285 fprintf (stderr, "Connected\n"); 289 286 return (TRUE); … … 316 313 FlushIOBuffer (buffer); 317 314 318 fprintf (stderr, "send: %s\n", cmd); 319 320 /* send command to client (adding on \n) */ 321 ALLOCATE (line, char, MAX (1, strlen(cmd))); 322 sprintf (line, "%s\n", cmd); 323 status = write (stdin_cntl, line, strlen(line)); 324 free (line); 325 326 /* is pipe still open? */ 315 if (VerboseMode()) fprintf (stderr, "send: %s\n", cmd); 316 317 /* send command, is pipe still open? */ 318 status = write_fmt (stdin_cntl, "%s\n", cmd); 327 319 if ((status == -1) && (errno == EPIPE)) return (CONTROLLER_DOWN); 328 320 … … 335 327 if (status == -1) usleep (10000); 336 328 } 337 if (status == 0) return (CONTROLLER_DOWN); 329 if (status == 0) { 330 ControllerStatus = FALSE; 331 return (CONTROLLER_DOWN); 332 } 338 333 if (status == -1) return (CONTROLLER_HUNG); 339 /* fprintf (stderr, "buffer.buffer: %s\n", buffer[0].buffer); */ 334 335 /* need to strip off the prompt */ 336 line = memstr (buffer[0].buffer, response, buffer[0].Nbuffer); 337 if (line != NULL) { 338 buffer[0].Nbuffer = line - buffer[0].buffer; 339 bzero (buffer[0].buffer + buffer[0].Nbuffer, buffer[0].Nalloc - buffer[0].Nbuffer); 340 } 340 341 return (CONTROLLER_GOOD); 341 342 } … … 345 346 int Nread; 346 347 347 if (! status) return (TRUE);348 if (!ControllerStatus) return (TRUE); 348 349 349 350 /* read stdout buffer */ … … 390 391 IOBuffer buffer; 391 392 392 if (!C heckControllerStatus()) return (TRUE);393 if (!ControllerStatus) return (TRUE); 393 394 394 395 sprintf (cmd, "kill %d", job[0].pid); … … 403 404 int QuitController () { 404 405 405 int status;406 int i, status, waitstatus, result; 406 407 char cmd[128]; 407 408 IOBuffer buffer; 408 409 409 if (!C heckControllerStatus()) return (TRUE);410 if (!ControllerStatus) return (TRUE); 410 411 411 412 sprintf (cmd, "quit"); 412 413 InitIOBuffer (&buffer, 0x100); 413 414 status = ControllerCommand (cmd, CONTROLLER_PROMPT, &buffer); 414 return (TRUE); 415 } 416 417 /* memstr returns a view, not an allocated string : don't free */ 415 ControllerStatus = FALSE; 416 result = waitpid (ControllerPID, &waitstatus, WNOHANG); 417 for (i = 0; (i < 10) && (result == 0); i++) { 418 usleep (10000); /* 10 ms is min */ 419 result = waitpid (ControllerPID, &waitstatus, WNOHANG); 420 } 421 ControllerPID = 0; 422 close (stdin_cntl); 423 close (stdout_cntl); 424 close (stderr_cntl); 425 426 return (TRUE); 427 } -
trunk/Ohana/src/opihi/pantasks/JobOps.c
r4693 r4705 50 50 int i; 51 51 52 fprintf (stderr, "\n"); 52 53 if (Njobs == 0) { 53 fprintf (stderr, " no defined jobs\n");54 fprintf (stderr, " no defined jobs\n"); 54 55 return; 55 56 } 56 57 58 fprintf (stderr, " Jobs\n"); 57 59 for (i = 0; i < Njobs; i++) { 58 fprintf (stderr, " %d: %-15s %5d %20s (%lx)\n", Njobs, jobs[i][0].task[0].name, jobs[i][0].JobID, jobs[i][0].argv[0], (long) jobs[i][0].argv);60 fprintf (stderr, " %d: %-15s %5d %20s (%lx)\n", Njobs, jobs[i][0].task[0].name, jobs[i][0].JobID, jobs[i][0].argv[0], (long) jobs[i][0].argv); 59 61 } 60 62 return; … … 76 78 } 77 79 78 /* we need our own copy of task[0].argv 79 * argc is the number of valid args, like the usual command line. 80 * we allocate one extra element, with value 0 to be passed to execvp 80 /* we need our own copy of task[0].argv argc is the number of valid args, like the usual command line. we 81 * allocate one extra element, with value 0 to be passed to execvp 81 82 */ 82 83 job[0].argc = task[0].argc; … … 87 88 job[0].argv[i] = 0; 88 89 89 /* other data from the task is needed by the job 90 we carry a pointer back to the task. this means we 91 cannot modify the task once a job is created, or the changes will 92 be applied to the existing jobs */ 90 /* Other data from the task is needed by the job. We carry a pointer back to the task. Changes to an 91 executing task are applied to the existing jobs (exit macros, poll_period, timeout) */ 93 92 94 93 job[0].task = task; 95 94 96 /* if we decide we need to be able to dynamically set task qualities 97 (like host, timeouts, etc), the we will need to have matched 98 entries to these quantites in the job structure */ 95 /* if we decide we need to be able to dynamically set task qualities (like host, timeouts, etc), the we will 96 need to have matched entries to these quantites in the job structure */ 99 97 100 98 jobs[Njobs] = job; … … 122 120 } 123 121 124 /* * are we deleting the active job?? **/122 /* delete the job from the job list & adjust ActiveJob counter */ 125 123 int DeleteJob (Job *job) { 126 124 … … 140 138 141 139 FreeJob (jobs[Nm]); 142 for (i = Nm + 1; i < Njobs; i++) 143 jobs[i - 1] = jobs[i]; 140 for (i = Nm; i < Njobs - 1; i++) { 141 jobs[i] = jobs[i + 1]; 142 } 144 143 Njobs --; 145 144 -
trunk/Ohana/src/opihi/pantasks/Makefile
r4693 r4705 41 41 $(SDIR)/run.$(ARCH).o \ 42 42 $(SDIR)/stop.$(ARCH).o \ 43 $(SDIR)/pulse.$(ARCH).o \ 43 44 $(SDIR)/status.$(ARCH).o \ 44 45 $(SDIR)/kill.$(ARCH).o \ -
trunk/Ohana/src/opihi/pantasks/TaskOps.c
r4697 r4705 54 54 int i, valid; 55 55 56 fprintf (stderr, "\n"); 56 57 if (Ntasks == 0) { 57 fprintf (stderr, " no defined tasks\n");58 fprintf (stderr, " no defined tasks\n"); 58 59 return; 59 60 } 60 61 61 fprintf (stderr, " Task Status\n");62 fprintf (stderr, " name Njobs command\n");62 fprintf (stderr, " Task Status\n"); 63 fprintf (stderr, " * Name Njobs Command\n"); 63 64 for (i = 0; i < Ntasks; i++) { 64 65 valid = CheckTimeRanges (tasks[i][0].ranges, tasks[i][0].Nranges); 66 if (verbose) fprintf (stderr, "\n"); 65 67 if (valid) { 66 fprintf (stderr, " + ");68 fprintf (stderr, " + "); 67 69 } else { 68 fprintf (stderr, " - ");70 fprintf (stderr, " - "); 69 71 } 70 72 if (tasks[i][0].argv == NULL) { 71 fprintf (stderr, "%-15s % 4d %-20s\n", tasks[i][0].name, tasks[i][0].Njobs, "dynamic");73 fprintf (stderr, "%-15s %5d %-20s\n", tasks[i][0].name, tasks[i][0].Njobs, "(dynamic)"); 72 74 } else { 73 fprintf (stderr, "%-15s % 4d%-20s\n", tasks[i][0].name, tasks[i][0].Njobs, tasks[i][0].argv[0]);75 fprintf (stderr, "%-15s %5d %-20s\n", tasks[i][0].name, tasks[i][0].Njobs, tasks[i][0].argv[0]); 74 76 } 75 77 if (verbose) { 76 78 fprintf (stderr, " spawn period: %f, polling period: %f, timeout period: %f\n", 77 tasks[i][0].poll_period, tasks[i][0].poll_period, tasks[i][0].poll_period); 78 if (tasks[i][0].host != NULL) { 79 if (tasks[i][0].host_required) { 80 fprintf (stderr, " host %s (required)\n", tasks[i][0].host); 81 } else { 82 fprintf (stderr, " host %s (desired)\n", tasks[i][0].host); 83 } 79 tasks[i][0].exec_period, tasks[i][0].poll_period, tasks[i][0].timeout_period); 80 if (tasks[i][0].host == NULL) { 81 fprintf (stderr, " task runs locally\n"); 82 continue; 83 } 84 if (!strcasecmp(tasks[i][0].host, "ANYHOST")) { 85 fprintf (stderr, " task host selected by controller\n"); 86 continue; 87 } 88 if (tasks[i][0].host_required) { 89 fprintf (stderr, " host %s (required)\n", tasks[i][0].host); 84 90 } else { 85 fprintf (stderr, " task runs locally\n");86 } 91 fprintf (stderr, " host %s (desired)\n", tasks[i][0].host); 92 } 87 93 } 88 94 } … … 102 108 } 103 109 104 fprintf (stderr, " macro %s\n", task[0].name);105 106 fprintf (stderr, " command: ");110 fprintf (stderr, "\n macro %s\n", task[0].name); 111 112 fprintf (stderr, "\n command: "); 107 113 for (i = 0; i < task[0].argc; i++) { 108 114 fprintf (stderr, "%s ", task[0].argv[i]); 109 115 } 110 111 fprintf (stderr, "host: %s\n", task[0].host); 112 fprintf (stderr, "time periods: exec: %f poll: %f timeout: %f\n", 116 fprintf (stderr, "\n\n"); 117 118 if (task[0].host == NULL) { 119 fprintf (stderr, " task runs locally\n"); 120 goto periods; 121 } 122 if (!strcasecmp(task[0].host, "ANYHOST")) { 123 fprintf (stderr, " task host selected by controller\n"); 124 goto periods; 125 } 126 if (task[0].host_required) { 127 fprintf (stderr, " host %s (required)\n", task[0].host); 128 } else { 129 fprintf (stderr, " host %s (desired)\n", task[0].host); 130 } 131 132 periods: 133 fprintf (stderr, " time periods: exec: %f poll: %f timeout: %f\n", 113 134 task[0].exec_period, task[0].poll_period, task[0].timeout_period); 114 135 115 fprintf (stderr, " pre-execute macro\n");136 fprintf (stderr, "\n pre-execute macro\n"); 116 137 ListMacro (task[0].exec); 117 138 118 fprintf (stderr, " timeout macro\n");139 fprintf (stderr, "\n timeout macro\n"); 119 140 ListMacro (task[0].timeout); 120 141 121 fprintf (stderr, " crash macro\n");142 fprintf (stderr, "\n crash macro\n"); 122 143 ListMacro (task[0].crash); 123 144 124 fprintf (stderr, " default exit macro\n");125 ListMacro (task[0].def );145 fprintf (stderr, "\n default exit macro\n"); 146 ListMacro (task[0].defexit); 126 147 127 148 for (i = 0; i < task[0].Nexit; i++) { 128 fprintf (stderr, " exit macro (status == %d)\n", atoi(task[0].exit[i][0].name));149 fprintf (stderr, "\n exit macro (status == %d)\n", atoi(task[0].exit[i][0].name)); 129 150 ListMacro (task[0].exit[i]); 130 151 } … … 192 213 NewTask[0].crash = NULL; 193 214 NewTask[0].timeout = NULL; 215 NewTask[0].defexit = NULL; 194 216 195 217 NewTask[0].Nexit = 0; … … 211 233 212 234 return (NewTask); 235 } 236 237 /* remove the task from the task list */ 238 int RemoveTask (Task *task) { 239 240 int i, Nt; 241 242 /* find task in task list */ 243 Nt = -1; 244 for (i = 0; i < Ntasks; i++) { 245 if (task == tasks[i]) { 246 Nt = i; 247 break; 248 } 249 } 250 if (Nt == -1) { 251 fprintf (stderr, "programming error: task not found\n"); 252 return (FALSE); 253 } 254 for (i = Nt; i < Ntasks - 1; i++) { 255 tasks[i] = tasks[i+1]; 256 } 257 Ntasks --; 258 return (TRUE); 213 259 } 214 260 … … 263 309 } 264 310 return (TRUE); 311 } 312 313 Task *SetNewTask (Task *task) { 314 NewTask = task; 315 return (task); 265 316 } 266 317 -
trunk/Ohana/src/opihi/pantasks/controller_check.c
r4693 r4705 21 21 InitIOBuffer (&buffer, 0x100); 22 22 status = ControllerCommand (command, CONTROLLER_PROMPT, &buffer); 23 if (VerboseMode()) { 24 fprintf (stderr, "controller command sent\n"); 25 fwrite (buffer.buffer, 1, buffer.Nbuffer, stderr); 26 fprintf (stderr, "\n Nbytes received: %d\n", buffer.Nbuffer); 27 } 23 28 FreeIOBuffer (&buffer); 24 29 … … 34 39 35 40 case CONTROLLER_GOOD: 36 fprintf (stderr, "controller command sent\n");37 fwrite (buffer.buffer, 1, buffer.Nbuffer, stderr);38 41 return (TRUE); 39 42 -
trunk/Ohana/src/opihi/pantasks/controller_host.c
r4693 r4705 7 7 IOBuffer buffer; 8 8 9 if (argc != 2) {10 fprintf (stderr, "USAGE: controller host ( hostname)\n");9 if (argc != 3) { 10 fprintf (stderr, "USAGE: controller host (command) (hostname)\n"); 11 11 return (FALSE); 12 12 } … … 15 15 StartController (); 16 16 17 sprintf (command, "host %s ", argv[1]);17 sprintf (command, "host %s %s", argv[1], argv[2]); 18 18 InitIOBuffer (&buffer, 0x100); 19 19 status = ControllerCommand (command, CONTROLLER_PROMPT, &buffer); 20 fwrite (buffer.buffer, 1, buffer.Nbuffer, stderr); 20 21 FreeIOBuffer (&buffer); 21 22 … … 31 32 32 33 case CONTROLLER_GOOD: 33 fprintf (stderr, "controller command sent\n");34 fwrite (buffer.buffer, 1, buffer.Nbuffer, stderr);35 fprintf (stderr, "\n Nbytes received: %d\n", buffer.Nbuffer);36 34 return (TRUE); 37 35 -
trunk/Ohana/src/opihi/pantasks/controller_status.c
r4693 r4705 22 22 InitIOBuffer (&buffer, 0x100); 23 23 status = ControllerCommand (command, CONTROLLER_PROMPT, &buffer); 24 FreeIOBuffer (&buffer);25 24 26 25 /* check on success of controller command */ … … 28 27 case CONTROLLER_DOWN: 29 28 fprintf (stderr, "controller is down\n"); 29 FreeIOBuffer (&buffer); 30 30 return (FALSE); 31 31 32 32 case CONTROLLER_HUNG: 33 33 fprintf (stderr, "controller is not responding\n"); 34 FreeIOBuffer (&buffer); 34 35 return (FALSE); 35 36 36 37 case CONTROLLER_GOOD: 37 fprintf (stderr, "controller command sent\n");38 38 fwrite (buffer.buffer, 1, buffer.Nbuffer, stderr); 39 fprintf (stderr, "\n Nbytes received: %d\n", buffer.Nbuffer);39 FreeIOBuffer (&buffer); 40 40 return (TRUE); 41 41 -
trunk/Ohana/src/opihi/pantasks/init.c
r4693 r4705 11 11 int run PROTO((int, char **)); 12 12 int stop PROTO((int, char **)); 13 int pulse PROTO((int, char **)); 13 14 int status_sys PROTO((int, char **)); 14 15 int kill_job PROTO((int, char **)); … … 28 29 {"run", run, "run the scheduler"}, 29 30 {"stop", stop, "stop the scheduler"}, 31 {"pulse", pulse, "set the scheduler update period"}, 30 32 {"status", status_sys, "get system status"}, 31 33 {"kill", kill_job, "kill job"}, -
trunk/Ohana/src/opihi/pantasks/psched.c
r4693 r4705 39 39 rl_attempted_completion_function = command_completer; 40 40 rl_event_hook = NULL; 41 rl_set_keyboard_input_timeout (100000 0);41 rl_set_keyboard_input_timeout (100000); 42 42 43 43 set_str_variable ("HISTORY", opihi_history); -
trunk/Ohana/src/opihi/pantasks/run.c
r4693 r4705 10 10 InitTaskTimers (); 11 11 rl_event_hook = CheckSystem; 12 rl_set_keyboard_input_timeout (1000000);13 12 14 13 return (TRUE); -
trunk/Ohana/src/opihi/pantasks/status.c
r4693 r4705 3 3 int status_sys (int argc, char **argv) { 4 4 5 fprintf (stderr, "\n"); 5 6 if (rl_event_hook == NULL) { 6 fprintf (stderr, " scheduler is stopped\n");7 fprintf (stderr, " Scheduler is stopped\n"); 7 8 } else { 8 fprintf (stderr, "scheduler is running\n"); 9 fprintf (stderr, " Scheduler is running\n"); 10 } 11 if (CheckControllerStatus ()) { 12 fprintf (stderr, " Controller is running\n"); 13 } else { 14 fprintf (stderr, " Controller is stopped\n"); 9 15 } 10 16 ListTasks (FALSE); -
trunk/Ohana/src/opihi/pantasks/stop.c
r4693 r4705 9 9 10 10 rl_event_hook = NULL; 11 rl_set_keyboard_input_timeout (1000000);12 11 13 12 return (TRUE); -
trunk/Ohana/src/opihi/pantasks/task.c
r4697 r4705 36 36 if (task == NULL) { /**** new task ****/ 37 37 task = CreateTask (argv[1]); 38 } else { 39 RemoveTask (task); 40 SetNewTask (task); 38 41 } 39 /* temporary task is saved statically 40 add to list after definition is complete */ 42 /* While a task is being defined, it is removed from the task list. The new task is added to the task list 43 when the definition process is complete. 44 XXX If an outstanding job has a task deleted, it will not be able to complete... */ 41 45 42 46 /* read in task from appropriate source (keyboard or list) until end */ 43 47 44 /* allowed tokens: command, host, stderr, periods, end */48 /* allowed tokens: command, host, stderr, periods, trange, nmax, task.exit, task.exec, end */ 45 49 46 50 ThisList = Nlists; -
trunk/Ohana/src/opihi/pantasks/task_command.c
r4697 r4705 8 8 if (argc < 2) { 9 9 fprintf (stderr, "USAGE: command <command> <arg>. ..\n"); 10 fprintf (stderr, " (define command machine for this task (or 'none'))\n");10 fprintf (stderr, " (define command for this task)\n"); 11 11 return (FALSE); 12 12 } -
trunk/Ohana/src/opihi/pantasks/task_host.c
r4693 r4705 17 17 fprintf (stderr, " -required flags indicates controller must use this host\n"); 18 18 fprintf (stderr, " value of 'local' for host indicates process not using controller\n"); 19 fprintf (stderr, " value of ' none' for host indicates controller may assign at will\n");19 fprintf (stderr, " value of 'anyhost' for host indicates controller may assign at will\n"); 20 20 return (FALSE); 21 21 } … … 23 23 task = GetNewTask (); 24 24 if (task == NULL) { 25 fprintf (stderr, "ERROR: not defining or running a task\n"); 26 return (FALSE); 25 task = GetActiveTask (); 26 if (task == NULL) { 27 fprintf (stderr, "ERROR: not defining or running a task\n"); 28 return (FALSE); 29 } 27 30 } 28 31 task[0].host_required = RequiredHost; … … 36 39 return (TRUE); 37 40 } 41 42 /* apparently, local is the default! */ -
trunk/Ohana/src/opihi/pantasks/task_macros.c
r4693 r4705 62 62 } 63 63 if (!strcmp (argv[0], "task.exit") && !strcmp (argv[1], "default")) { 64 if (task[0].def != NULL) {65 FreeMacro (task[0].def );66 free (task[0].def );64 if (task[0].defexit != NULL) { 65 FreeMacro (task[0].defexit); 66 free (task[0].defexit); 67 67 } 68 ALLOCATE (task[0].def , Macro, 1);69 macro = task[0].def ;68 ALLOCATE (task[0].defexit, Macro, 1); 69 macro = task[0].defexit; 70 70 macro[0].name = strcreate ("default"); 71 71 goto found;
Note:
See TracChangeset
for help on using the changeset viewer.
