[GE users] Java DRMAA does not execute job ?

templedf dan.templeton at sun.com
Mon Nov 2 15:17:44 GMT 2009


OK.  My explanation was a little off, but the solution is still 
correct.  The actual reason is that with -shell no set, there is no 
shell to provide a path, hence anything without an absolute path to the 
executable will fail.  Try this: "qsub -shell no -b yes -wd /SGE6 
simple.sh"  It will also fail.  If, however, -b no is set, then the path 
to the executable is resolved on the client side, avoiding the problem.  
The reason the above qsub command sets the job into error state, whereas 
the DRMAA job fails is that there's a special shunt in the qmaster that 
fails any DRMAA job that tries to go into error state.  (There's nothing 
you can do from DRMAA about jobs in error state, so we keep DRMAA jobs 
from going there.)

Daniel

reuti wrote:
> Am 02.11.2009 um 15:38 schrieb templedf:
>
>   
>> That's because of the default assumptions DRMAA makes.  See the
>> drmaa_attributes(5) man page:
>>
>> By default DRMAA sets four options for all jobs.  These are "-p   
>> 0", "-b
>> yes", "-shell no", and "-w e".
>>
>> Setting -shell no and -b yes, means that it can't execute a  
>> script.  In
>> order to execute a script, use either the native specification or job
>> category to set either "-shell yes" or "-b no".
>>     
>
> But a script can usually also be executed as a binary - if it was  
> made executable and a path was given like ./simple.sh or it's in the  
> $PATH. This should also work in DRMAA.
>
> -- Reuti
>
>
>   
>> Daniel
>>
>> umanga wrote:
>>     
>>> Greetings all,
>>>
>>> I am a completely newbie to SGE.
>>> I am trying to use Java DRMAA to submit jobs to SGE, I used following
>>> code in one of 'submit hosts' . "/SGE6" is a shared NFS folder.
>>> I execute this program as a normal user (not sgeadmin).
>>> It always give the output "Job xx never ran".
>>> But when I run CLI as "qsub /SGE6/simple.sh" it generates expected  
>>> output.
>>> What can be the issue?
>>>
>>> Thanks in advance,
>>> umanga
>>>
>>>
>>> SessionFactory sfactory=SessionFactory.getFactory();
>>> Session  session=sfactory.getSession();
>>> session.init("");
>>>       JobTemplate jt=session.createJobTemplate();
>>> jt.setWorkingDirectory("/SGE6");
>>> jt.setRemoteCommand("simple.sh");
>>>              String id=session.runJob(jt);
>>>       System.out.println("Job has been submittied with id "+id);
>>> session.deleteJobTemplate(jt);
>>>       JobInfo info=session.wait(id,Session.TIMEOUT_WAIT_FOREVER);
>>>      if (info.wasAborted()) {
>>>    System.out.println("Job " + info.getJobId() + " never ran");
>>>        } else if (info.hasExited()) {
>>>          System.out.println("Job " + info.getJobId() +
>>>                " finished regularly with exit status " +
>>>                 info.getExitStatus());
>>>      } else if (info.hasSignaled()) {
>>>           System.out.println("Job " + info.getJobId() +
>>>                 " finished due to signal " +
>>>                 info.getTerminatingSignal());
>>>        } else {
>>>           System.out.println("Job " + info.getJobId() +
>>>                " finished with unclear conditions");
>>>        }
>>>
>>>       System.out.println("Job Usage:");
>>>
>>>       Map rmap = info.getResourceUsage();
>>>         Iterator i = rmap.keySet().iterator();
>>>
>>>        while (i.hasNext()) {
>>>            String name = (String)i.next();
>>>         String value = (String)rmap.get(name);
>>>
>>>           System.out.println("  " + name + "=" + value);
>>>        }           session.exit();
>>>
>>> ------------------------------------------------------
>>> http://gridengine.sunsource.net/ds/viewMessage.do? 
>>> dsForumId=38&dsMessageId=224562
>>>
>>> To unsubscribe from this discussion, e-mail: [users- 
>>> unsubscribe at gridengine.sunsource.net].
>>>
>>>       
>> ------------------------------------------------------
>> http://gridengine.sunsource.net/ds/viewMessage.do? 
>> dsForumId=38&dsMessageId=224619
>>
>> To unsubscribe from this discussion, e-mail: [users- 
>> unsubscribe at gridengine.sunsource.net].
>>     
>
> ------------------------------------------------------
> http://gridengine.sunsource.net/ds/viewMessage.do?dsForumId=38&dsMessageId=224624
>
> To unsubscribe from this discussion, e-mail: [users-unsubscribe at gridengine.sunsource.net].
>

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

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



More information about the gridengine-users mailing list