IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jan 29, 2006, 9:36:21 AM (20 years ago)
Author:
eugene
Message:

adding to queue options, psched handling

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/opihi/pantasks/CheckJobs.c

    r4763 r6249  
    66  Macro *macro;
    77  int i, status;
     8  char varname[64];
    89
    910  /** test all jobs: ready to test?  finished? **/
     
    3031        PushNamedQueue ("stdout", job[0].stdout.buffer);
    3132        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
    3240        /* XXX this will break on 0 values in output streams */
    3341        /* perhaps define PushNamedQueueBuffer */
     
    4351        PushNamedQueue ("stdout", job[0].stdout.buffer);
    4452        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
    4567        /* run corresponding task[0].exit macro, if it exists */
    4668        macro = job[0].task[0].defexit;
     
    6890      if (GetTaskTimer(job[0].start) < job[0].task[0].timeout_period) continue;
    6991      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
    7096      if (!KillLocalJob (job)) {
    7197        job[0].state = JOB_HUNG;
     
    7399        continue;
    74100      }
     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
    75110      /* run task[0].timeout macro, if it exists */
    76111      if (job[0].task[0].timeout != NULL) {
Note: See TracChangeset for help on using the changeset viewer.