本文整理汇总了Java中org.ggf.drmaa.Session.QUEUED_ACTIVE属性的典型用法代码示例。如果您正苦于以下问题:Java Session.QUEUED_ACTIVE属性的具体用法?Java Session.QUEUED_ACTIVE怎么用?Java Session.QUEUED_ACTIVE使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.ggf.drmaa.Session
的用法示例。
在下文中一共展示了Session.QUEUED_ACTIVE属性的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: statustoString
public String statustoString(int jobstatus) {
switch (jobstatus) {
case Session.QUEUED_ACTIVE:
return "Job is pending";
case Session.SYSTEM_ON_HOLD:
return "Job is on hold by system.";
case Session.USER_ON_HOLD:
return "Job is on hold by user.";
case Session.USER_SYSTEM_ON_HOLD:
return "Job is on hold by system or user.";
case Session.RUNNING:
return "Job is running";
case Session.SYSTEM_SUSPENDED:
return "Job is suspended by system.";
case Session.USER_SUSPENDED:
return "Job is suspended by user.";
case Session.USER_SYSTEM_SUSPENDED:
return "Job is suspended by system or user.";
case Session.DONE:
return "Job has completed";
case Session.FAILED:
return "Job has failed.";
}
return "Job status is unknown";
}
示例2: getRunningInstances
@Override
public int getRunningInstances() {
int comp = 0;
try {
for (String job : jobs) {
int status = session.getJobProgramStatus(job);
comp += 1;
//if( status == session.FAILED )
//System.err.println( "[" + job + "] failed." );
if (status == Session.QUEUED_ACTIVE || status == Session.DONE || status == Session.FAILED) {
comp -= 1;
}
}
} catch (DrmaaException e) {
return 0;
}
return comp;
}
示例3: getQueuedInstances
@Override
public int getQueuedInstances() {
int queued = 0;
try {
for (String job : jobs) {
int status = session.getJobProgramStatus(job);
if (status == Session.QUEUED_ACTIVE) {
queued += 1;
}
}
} catch (DrmaaException e) {
return 0;
}
return queued;
}
示例4: isPending
@Override
public boolean isPending() throws IOException, InterruptedException, DrmaaException {
int status = session.getJobProgramStatus(jobID);
if(status == Session.QUEUED_ACTIVE) return true;
if(status == Session.SYSTEM_ON_HOLD) return true;
if(status == Session.USER_ON_HOLD) return true;
if(status == Session.USER_SYSTEM_ON_HOLD) return true;
return false;
}
示例5: getJobProgramStatus
@Override
public int getJobProgramStatus(String jobId) throws DrmaaException {
Job job = parseJobs(jobId).get(0);
/**
* PBS Professional S The job's state:
*
* B Array job has at least one subjob running.
*
* E Job is exiting after having run.
*
* F Job is finished.
*
* H Job is held.
*
* M Job was moved to another server.
*
* Q Job is queued.
*
* R Job is running.
*
* S Job is suspended.
*
* T Job is being moved to new location.
*
* U Cycle-harvesting job is suspended due to keyboard activity.
*
* W Job is waiting for its submitter-assigned start time to be reached.
*
* X Subjob has completed execution or has been deleted.
*
*/
String state = job.getState();
LOGGER.finest("state : " + state);
switch (state) {
case "B":
return Session.RUNNING;
case "E":
return Session.RUNNING;
case "F":
return job.getExitStatus() == 0 ? Session.DONE : Session.FAILED;
case "H":
return Session.SUSPEND;
case "M":
return Session.RUNNING;
case "Q":
return Session.QUEUED_ACTIVE;
case "R":
return Session.RUNNING;
case "S":
return Session.SUSPEND;
case "T":
return Session.RUNNING;
case "U":
return Session.SUSPEND;
case "W":
return Session.QUEUED_ACTIVE;
case "X":
return job.getExitStatus() == 0 ? Session.DONE : Session.FAILED;
}
return Session.UNDETERMINED;
}