IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 13540


Ignore:
Timestamp:
May 30, 2007, 12:13:00 PM (19 years ago)
Author:
eugene
Message:

added flush jobs command

Location:
trunk/Ohana/src/opihi/pantasks
Files:
3 edited

Legend:

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

    r13503 r13540  
    2323
    2424    task = job[0].task;
     25    // XXX we need to guarantee that the task exists
     26    // if we delete a task, we need to keep a copy until all task jobs are
     27    // removed
    2528
    2629    /* check poll period (ready to ask for status?) */
     
    140143        UpdateTaskTimerStats (task, TIMER_ALLJOBS, job[0].dtime);
    141144
    142         task[0].Npending --;
    143145        DeleteJob (job);
    144146        continue;
  • trunk/Ohana/src/opihi/pantasks/JobOps.c

    r13486 r13540  
    215215    ActiveJob --;
    216216  }
     217
     218  job[0].task[0].Npending --;
     219  return (TRUE);
     220}
     221
     222int FlushJobs () {
     223
     224  int i;
     225
     226  // kill outstanding jobs
     227  for (i = 0; i < Njobs; i++) {
     228    if (jobs[i][0].mode == JOB_LOCAL) {
     229      if (!KillLocalJob (jobs[i])) {
     230        jobs[i][0].state = JOB_HUNG;
     231        if (VerboseMode()) gprint (GP_LOG, "child process %d is hung, cannot kill\n", jobs[i][0].pid);
     232      }
     233    } else {
     234      if (!KillControllerJob (jobs[i])) {
     235        jobs[i][0].state = JOB_HUNG;
     236        if (VerboseMode()) gprint (GP_LOG, "child process %d is hung, cannot kill\n", jobs[i][0].pid);
     237      }
     238    }   
     239    jobs[i][0].task[0].Npending = 0;
     240    FreeJob (jobs[i]);
     241  }
     242   
     243  Njobs = 0;
     244  NJOBS = 20;
     245  REALLOCATE (jobs, Job *, NJOBS);
     246  ActiveJob = -1;
    217247  return (TRUE);
    218248}
  • trunk/Ohana/src/opihi/pantasks/Makefile

    r12842 r13540  
    6565$(SRC)/pulse.$(ARCH).o \
    6666$(SRC)/status.$(ARCH).o \
     67$(SRC)/flush.$(ARCH).o \
    6768$(SRC)/showtask.$(ARCH).o \
    6869$(SRC)/kill.$(ARCH).o \
Note: See TracChangeset for help on using the changeset viewer.