[GE users] DRMAA Job submission with '-C' (directive_prefix) option

Sreenath Nampally sreenath at tigr.ORG
Thu Jun 22 18:43:57 BST 2006


Hi Andreas,

So, according to that description 'native_specification' should
honor '-C' option as well for some reason it doesn't work
when I use the DRMAA java API's.

I print the job before calling runJob and it prints this:
"Submitting job {blockEmail = false} {jobSubmissionState = ACTIVE} 
{joinFiles = false} {nativeSpecification = "-b n -C "#SGE_DIRECTIVE""} 
{remoteCommand = /local/scratch/sree/sge_job.sh}"

which shows it has the right -C option.

Also, the following from the manpage 'of drmaa_attributes' doesn't say 
anything about
'-C' option.

Attribute Correlations
The following DRMAA attributes correspond to the following qsub(1) options:

DRMAA Attribute qsub Option
-------------------------------------------------------
drmaa_remote_command script file
drmaa_v_argv script file args
drmaa_js_state = "drmaa_hold" -h
drmaa_v_env -v
drmaa_wd = $PWD -cwd
drmaa_job_category (qtsch qtask)*
drmaa_native_specification ALL*
drmaa_v_email -M
drmaa_block_email = "1" -m n
drmaa_start_time -a
drmaa_job_name -N
drmaa_input_path -i
drmaa_output_path -o
drmaa_error_path -e
drmaa_join_files -j
drmaa_transfer_files (prolog and epilog)*

Thanks,
Sree


Andreas.Haas at Sun.COM wrote:

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

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