# include "pantasks.h"

int kill_job (int argc, char **argv) {

  Job *job;
  int JobID;

  if (argc < 2) {
    gprint (GP_ERR, "USAGE: kill (JobID)\n");
    return (FALSE);
  }
  JobID = atoi (argv[1]);

  job = FindJob (JobID);

  if (job[0].mode == JOB_LOCAL) {
    if (!KillLocalJob (job)) {
      job[0].state = JOB_HUNG;
      if (VerboseMode()) gprint (GP_LOG, "child process %d is hung, cannot kill\n", job[0].pid);
      return (FALSE);
    }
  } else {
    if (!KillControllerJob (job)) {
      job[0].state = JOB_HUNG;
      if (VerboseMode()) gprint (GP_LOG, "child process %d is hung, cannot kill\n", job[0].pid);
      return (FALSE);
    }
  }    
    
  gprint (GP_ERR, "this function is not yet implemented\n");
  return (TRUE);
}
