Changeset 6249 for trunk/Ohana/src/opihi/pantasks
- Timestamp:
- Jan 29, 2006, 9:36:21 AM (20 years ago)
- Location:
- trunk/Ohana/src/opihi/pantasks
- Files:
-
- 3 edited
-
CheckJobs.c (modified) (5 diffs)
-
TaskOps.c (modified) (1 diff)
-
task_periods.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/opihi/pantasks/CheckJobs.c
r4763 r6249 6 6 Macro *macro; 7 7 int i, status; 8 char varname[64]; 8 9 9 10 /** test all jobs: ready to test? finished? **/ … … 30 31 PushNamedQueue ("stdout", job[0].stdout.buffer); 31 32 PushNamedQueue ("stderr", job[0].stderr.buffer); 33 /* set taskarg variables */ 34 for (i = 0; i < job[0].argc; i++) { 35 sprintf (varname, "taskarg:%d", i); 36 set_str_variable (varname, job[0].argv[i]); 37 } 38 set_int_variable ("taskarg:n", job[0].argc); 39 32 40 /* XXX this will break on 0 values in output streams */ 33 41 /* perhaps define PushNamedQueueBuffer */ … … 43 51 PushNamedQueue ("stdout", job[0].stdout.buffer); 44 52 PushNamedQueue ("stderr", job[0].stderr.buffer); 53 /* set taskarg variables */ 54 for (i = 0; i < job[0].argc; i++) { 55 sprintf (varname, "taskarg:%d", i); 56 set_str_variable (varname, job[0].argv[i]); 57 } 58 set_int_variable ("taskarg:n", job[0].argc); 59 60 /* update the exit status counters */ 61 if (job[0].exit_status) { 62 job[0].task[0].Nfailure ++; 63 } else { 64 job[0].task[0].Nsuccess ++; 65 } 66 45 67 /* run corresponding task[0].exit macro, if it exists */ 46 68 macro = job[0].task[0].defexit; … … 68 90 if (GetTaskTimer(job[0].start) < job[0].task[0].timeout_period) continue; 69 91 if (VerboseMode()) fprintf (stderr, "timeout on %s\n", job[0].task[0].name); 92 93 /* update the timeout counter */ 94 job[0].task[0].Ntimeout ++; 95 70 96 if (!KillLocalJob (job)) { 71 97 job[0].state = JOB_HUNG; … … 73 99 continue; 74 100 } 101 102 /* set taskarg variables */ 103 for (i = 0; i < job[0].argc; i++) { 104 sprintf (varname, "taskarg:%d", i); 105 set_str_variable (varname, job[0].argv[i]); 106 } 107 set_int_variable ("taskarg:n", job[0].argc); 108 109 75 110 /* run task[0].timeout macro, if it exists */ 76 111 if (job[0].task[0].timeout != NULL) { -
trunk/Ohana/src/opihi/pantasks/TaskOps.c
r4705 r6249 229 229 /* init task timer (is reset by 'run') */ 230 230 gettimeofday (&NewTask[0].last, (void *) NULL); 231 NewTask[0].Nmax = 0; /* default value means 'no limit' */ 232 231 233 NewTask[0].Njobs = 0; 232 NewTask[0].Nmax = 0; /* default value means 'no limit' */ 233 234 NewTask[0].Nsuccess = 0; 235 NewTask[0].Nfailure = 0; 236 NewTask[0].Ntimeout = 0; 234 237 return (NewTask); 235 238 } -
trunk/Ohana/src/opihi/pantasks/task_periods.c
r4693 r6249 42 42 task = GetNewTask (); 43 43 if (task == NULL) { 44 fprintf (stderr, "ERROR: not defining or running a task\n"); 45 return (FALSE); 44 task = GetActiveTask (); 45 if (task == NULL) { 46 fprintf (stderr, "ERROR: not defining or running a task\n"); 47 return (FALSE); 48 } 46 49 } 47 50
Note:
See TracChangeset
for help on using the changeset viewer.
