[GE users] Question regarding SGE submission methods (scheduling timeouts)

Andreas.Haas at Sun.COM Andreas.Haas at Sun.COM
Thu Jun 22 18:29:31 BST 2006


Hi Sree,

note, not all qsub(1) options are supported by native specification.
Yet in drmaa_attributes(3) it says:

    drmaa_native_specification - "<native_specification>"
         Specifies Grid Engine native qsub(1) options which  will  be
         interpreted  as part of the DRMAA job template.  All options
         available  to  qsub(1)  command   may   be   used   in   the
         native_specification,  except for -help, -t, -verify, and -w
         w|v.   The  -cwd  option   may   only   be   used   if   the
         SGE_DRMAA_ALLOW_CWD  environment  variable  is set.  This is
         because the  current  parsing  algorithm  for  -cwd  is  not
         thread-safe.   Options  set in the native specification will
         be overridden by the corresponding  DRMAA  attributes.   See
         qsub(1) for more information on qsub options.

Regards,
Andreas

On Thu, 22 Jun 2006, Sreenath Nampally wrote:

> Hello all,
>
> I am trying to submit the attached script (Generated dynamically by a java 
> class)
> using DRMAA but for some reason the directives ( lines starting with 
> #SGE_DIRECTIVES)
> in the script are not honored even though the job runs on the grid.
>
> If I submit the same script at the command line using
> 'qsub -b n -C "#SGE_DIRECTIVE" sge_job' , it works fine
>
> Following is the java code that submits the job using DRMAA. Is 
> 'setNativeSpecification'
> the right method to specify the directive string or is there another way of 
> doing it?
>
> Thanks for the help.
> Sree
>
> //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 
>
> //Create a Session factory object
> SessionFactory factory = SessionFactory.getFactory();
> Session session = factory.getSession();
> String id = null;
> try {
> session.init(null);
> String sgeSubmitFile = "sge_job.sh";
> JobTemplate jobTemplate = session.createJobTemplate();
>
> System.out.println("The DRMAA submission file name is " + 
> sgeSubmitFile.getName());
> jobTemplate.setRemoteCommand(sgeSubmitFile.getAbsolutePath());
> jobTemplate.setNativeSpecification("-b n -C \"#SGE_DIRECTIVE\"");
> // I tried the following ways also
> //jobTemplate.setNativeSpecification("-b n -C #SGE_DIRECTIVE");
> //jobTemplate.setNativeSpecification("-b n -C '#SGE_DIRECTIVE'");
>
> System.out.println("Submitting job " + jobTemplate.toString());
> id = session.runJob(jobTemplate);
> System.out.println("Waiting for job " + id + " job finish");
> JobInfo jobInfo = session.wait(id, 300);
> System.out.println("Job " + id + " finished with exit value " + 
> jobInfo.getExitStatus());
> // Set job template to null
> jobTemplate = null;
> // Exit session
> session.exit();
> } catch (DrmaaException dre) {
> // TODO: handle exception
> dre.printStackTrace();
> System.out.println(dre.getMessage());
> throw dre;
> }
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe at gridengine.sunsource.net
For additional commands, e-mail: users-help at gridengine.sunsource.net




More information about the gridengine-users mailing list