[GE users] Java DRMAA does not execute job ?

umanga aumanga at biggjapan.com
Mon Nov 2 08:34:50 GMT 2009


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].



More information about the gridengine-users mailing list