Example #1
0
int
lsb_openjobinfo (LS_LONG_INT jobId, char *jobName, char *userName,
                 char *queueName, char *hostName, int options)
{
    struct jobInfoHead *jobInfoHead;

    jobInfoHead = lsb_openjobinfo_a (jobId, jobName, userName, queueName, 
				     hostName, options);
    if (!jobInfoHead)
        return (-1);
    return (jobInfoHead->numJobs);

} 
Example #2
0
int
getJobIds (int argc, char **argv, char *jobName, char *user, char *queue,
	   char *host, LS_LONG_INT ** jobIds0, int extOption)
{
  int numJobIds = 0;
  int options = LAST_JOB;
  struct jobInfoHead *jobInfoHead;

  if (extOption)
    {
      options = extOption;
    }

  numJobIds = getSpecJobIds (argc, argv, jobIds0, &options);


  if (extOption & ZOMBIE_JOB)
    {
      options |= ZOMBIE_JOB;
    }

  if (numJobIds != 0)
    return (numJobIds);

  if (strstr (argv[0], "bmig"))
    {

      options &= ~CUR_JOB;
      options |= (RUN_JOB | SUSP_JOB);
    }

  if (strstr (argv[0], "brequeue"))
    {
      options = 0;
      options = extOption;
    }

  options |= JOBID_ONLY;


  if (options & DONE_JOB)
    {
      options &= ~JOBID_ONLY;
    }

  TIMEIT (0,
	  (jobInfoHead =
	   lsb_openjobinfo_a ((LS_LONG_INT) 0, jobName, user, queue, host,
			      options)), "lsb_openjobinfo");
  if (jobInfoHead == NULL)
    {
      jobInfoErr (0, jobName, user, queue, host, options);
      exit (-1);
    }

  TIMEIT (0, lsb_closejobinfo (), "lsb_closejobinfo");

  *jobIds0 = jobInfoHead->jobIds;
  return (jobInfoHead->numJobs);

}