[GE users] Bug in DRMAA implementation?

templedf daniel.templeton at oracle.com
Fri Oct 8 15:16:58 BST 2010


On 10/ 8/10 06:13 AM, mdondrup wrote:
> Hi,
>
> I'm still testing the DRMAA Java API for submitting jobs to the grid engine. I stumbled over two tiny but severe problems:
> 1. Unlike with submitting using qsub, using DRMAA the PATH environment is empty. How can drmaa be configured  to pass the PATH over

You mean unlike "qsub -V"?  You can either set the path explicitly:

Properties env = new Properties();
env.setProperty("PATH", System.getenv("PATH"));
jt.setJobEnvironment();

or you can add "-V" or "-v PATH" either to the nativeSpecification:

jt.setNativeSpecification("-v PATH");

or via a job category:

jt.setJobCategory("needsPath");
[% echo "needsPath -v PATH" >> $SGE_ROOT/$SGE_CELL/common/qtask]

> 2. As a consequence, I discovered that all scripts are reported being in state finished, not failed, irrespective of its exit status
> So, how do I get the real exit status of a job other than with session.getJobProgramStatus, or is this a bug?

The only way to get a job's exit status is to call Session.wait() and 
then interrogate the returned JobInfo object:

JobInfo ji = session.wait(jobID, Session.TIMEOUT_WAIT_FOREVER);
System.out.println("Exit status = " + ji.getExitStatus();

Daniel

>
> Thank you very much
> Michael
>
> My test script:
>
> #!/bin/sh
> exit 1
> #exit 127
> #exit 0 # always the same result
>
> The relevant java code getting the status:
>
>   	    int status = session.getJobProgramStatus(this.jobid);	
> 	    switch (status) {
> 	    case Session.RUNNING:
> 		System.out.println("Job is running");
> 		break;
> 	    case Session.UNDETERMINED:
> 		System.out.println("Job status cannot be determined");
> 		break;
> 	    case Session.DONE:
> 		System.out.println("Job finished normally");
> 		break;
> 	    case Session.FAILED:
> 		System.out.println("Job finished, but failed");
> 		break;
> 	    default:
> 		System.out.println("other status code " + status);
> 	    } /* switch */
>
> ------------------------------------------------------
> http://gridengine.sunsource.net/ds/viewMessage.do?dsForumId=38&dsMessageId=286440
>
> To unsubscribe from this discussion, e-mail: [users-unsubscribe at gridengine.sunsource.net].

------------------------------------------------------
http://gridengine.sunsource.net/ds/viewMessage.do?dsForumId=38&dsMessageId=286444

To unsubscribe from this discussion, e-mail: [users-unsubscribe at gridengine.sunsource.net].



More information about the gridengine-users mailing list