Changeset 8129 for trunk/Ohana/src/opihi/pantasks/CheckJobs.c
- Timestamp:
- Aug 4, 2006, 2:19:21 AM (20 years ago)
- File:
-
- 1 edited
-
trunk/Ohana/src/opihi/pantasks/CheckJobs.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/opihi/pantasks/CheckJobs.c
r7917 r8129 26 26 27 27 case JOB_CRASH: 28 /* run task[0].crash macro, if it exists */ 28 case JOB_EXIT: 29 29 /* push output buffer data to the stdout and stderr queues */ 30 if (VerboseMode()) gprint (GP_LOG, "job %s (%d) crash\n", job[0].task[0].name, job[0].JobID);30 /* XXX this will break on 0 values in output streams */ 31 31 PushNamedQueue ("stdout", job[0].stdout.buffer); 32 32 PushNamedQueue ("stderr", job[0].stderr.buffer); 33 33 34 /* set taskarg variables */ 34 35 for (i = 0; i < job[0].argc; i++) { … … 38 39 set_int_variable ("taskarg:n", job[0].argc); 39 40 40 /* XXX this will break on 0 values in output streams */41 /* perhaps define PushNamedQueueBuffer */42 if (job[0].task[0].crash != NULL) {43 exec_loop (job[0].task[0].crash);41 /* set options variables */ 42 for (i = 0; i < job[0].optc; i++) { 43 sprintf (varname, "options:%d", i); 44 set_str_variable (varname, job[0].optv[i]); 44 45 } 45 DeleteJob (job); 46 continue; 47 break; 46 set_int_variable ("options:n", job[0].optc); 48 47 49 case JOB_EXIT: 50 if (VerboseMode()) gprint (GP_LOG, "job %s (%d) exit\n", job[0].task[0].name, job[0].JobID); 51 PushNamedQueue ("stdout", job[0].stdout.buffer); 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]); 48 if (status == JOB_CRASH) { 49 /* XXX add an Ncrash element? */ 50 job[0].task[0].Nfailure ++; 51 52 /* run task[0].crash macro, if it exists */ 53 /* perhaps define PushNamedQueueBuffer */ 54 55 if (VerboseMode()) gprint (GP_LOG, "job %s (%d) crash\n", job[0].task[0].name, job[0].JobID); 56 if (job[0].task[0].crash != NULL) { 57 exec_loop (job[0].task[0].crash); 58 } 57 59 } 58 set_int_variable ("taskarg:n", job[0].argc); 60 if (status == JOB_EXIT) { 61 /* update the exit status counters */ 62 if (job[0].exit_status) { 63 job[0].task[0].Nfailure ++; 64 } else { 65 job[0].task[0].Nsuccess ++; 66 } 59 67 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 ++; 68 /* run corresponding task[0].exit macro, if it exists */ 69 if (VerboseMode()) gprint (GP_LOG, "job %s (%d) exit\n", job[0].task[0].name, job[0].JobID); 70 macro = job[0].task[0].defexit; 71 for (i = 0; i < job[0].task[0].Nexit; i++) { 72 if (job[0].exit_status == atoi(job[0].task[0].exit[i][0].name)) { 73 macro = job[0].task[0].exit[i]; 74 break; 75 } 76 } 77 if (macro != NULL) exec_loop (macro); 65 78 } 66 79 67 /* run corresponding task[0].exit macro, if it exists */68 macro = job[0].task[0].defexit;69 for (i = 0; i < job[0].task[0].Nexit; i++) {70 if (job[0].exit_status == atoi(job[0].task[0].exit[i][0].name)) {71 macro = job[0].task[0].exit[i];72 break;73 }74 }75 if (macro != NULL) exec_loop (macro);76 80 DeleteJob (job); 77 81 continue; … … 107 111 set_int_variable ("taskarg:n", job[0].argc); 108 112 113 /* set options variables */ 114 for (i = 0; i < job[0].optc; i++) { 115 sprintf (varname, "options:%d", i); 116 set_str_variable (varname, job[0].optv[i]); 117 } 118 set_int_variable ("options:n", job[0].optc); 109 119 110 120 /* run task[0].timeout macro, if it exists */
Note:
See TracChangeset
for help on using the changeset viewer.
