Am 20.12.2016 um 22:49 schrieb Lucas, Douglas S.:

> I got that example with the -1:
> 
> drmaa_set_attribute(jt, DRMAA_NATIVE_SPECIFICATION, "-q all.q", error, 
> DRMAA_ERROR_STRING_BUFFER - 1);

It depends for sure how it's tested internally not to overflow the allocated 
buffer space. But it should be the same value all over your application. 
Therefore it caught my eye in the two lines you posted as it's different there.

Having a look at the source: first in source/libs/japi/drmaa.c it gets +1, then 
in source/libs/uti/sge_dstring.c it's reduced again by -1 to leave space for 
the final 0x00.

One could argue: with -1 in the call you are on the safe side. If this is the 
real limit, then also all the Howto examples are wrong as they use a plain 
DRMAA_ERROR_STRING_BUFFER as size value.

-- Reuti


> from Dan Templeton's page:
> 
> https://blogs.oracle.com/templedf/entry/using_drm_specific_functionality_via
> 
> So I left it as is, except for my environment, eg "-q 1-day" and 
> "/home/user1/c/sleeper.sh".
> 
> Scott Lucas
> HPC Applications Support
> 208-776-0209
> lucas.sco...@mayo.edu
> 
> 
> -----Original Message-----
> From: Reuti [mailto:re...@staff.uni-marburg.de] 
> Sent: Tuesday, December 20, 2016 12:33 PM
> To: Lucas, Douglas S.
> Cc: users@gridengine.org
> Subject: Re: [gridengine users] default queues
> 
> 
>> Am 20.12.2016 um 18:17 schrieb Lucas, Douglas S. <lucas.sco...@mayo.edu>:
>> 
>> I'll look into requesting resources, as well specifying resource quotas. I 
>> very well may end up using a forced complex on each queue (except our 
>> shortest-running one, which was our past model) to strongly encourage users 
>> to specify a queue. As far as drmaa, we had our shortest (one hour) queue 
>> defined as the default in sge_request. It worked fine for batch scripts, but 
>> in drmaa when we defined which queue we wanted to go to (1-day, 4-days, 
>> etc.), drmaa jobs would always go to the 1-hour queue:
>> 
>> else {
>>     errnum = drmaa_set_attribute (jt, DRMAA_REMOTE_COMMAND, 
>> "/home/user1/scripts/c/sleeper.sh",
>>                                   error, DRMAA_ERROR_STRING_BUFFER);
>> 
>>     errnum = drmaa_set_attribute (jt, DRMAA_NATIVE_SPECIFICATION, "-q 
>> 4-days",
>>                                   error, DRMAA_ERROR_STRING_BUFFER -1);
> 
> Is there a reason to subtract one in the above statement?
> 
> AFAICS: -q on the command line will replace the complete list of queues set 
> in an sge_request file. OTOH -q used in DRMAA will add this queue to the list 
> of already set queues. So the one specified in sge_request is still there.
> 
> Can you check with `qstat -j <job_id>` whether you experience the same?
> 
> -- Reuti
> 
> 
>> It didn't matter whether we used drmaa with java or c, it would always go to 
>> the 1-hour queue. I haven't figured out why it is/was happening yet, but by 
>> setting up a test environment and leaving the global sge_request without a 
>> defined queue, drmaa jobs ran in whichever queue I specified using the above 
>> listed parameters. We've since done that in our production environment and 
>> everything is working as expected.
>> 
>> Scott Lucas
>> HPC Applications Support
>> 208-776-0209
>> lucas.sco...@mayo.edu
>> 
>> 
>> -----Original Message-----
>> From: Reuti [mailto:re...@staff.uni-marburg.de] 
>> Sent: Tuesday, December 20, 2016 10:47 AM
>> To: Lucas, Douglas S.
>> Cc: users@gridengine.org
>> Subject: Re: [gridengine users] default queues
>> 
>> 
>>> Am 20.12.2016 um 17:28 schrieb Lucas, Douglas S. <lucas.sco...@mayo.edu>:
>>> 
>>> Is there a way to set a default queue without using the local/user or 
>>> global sge_request file? I was setting a default queue in the global 
>>> sge_request file, but it cause problems with drmaa job submission. Should I 
>>> force users to specify a complex variable to request a certain queue? 
>>> What’s the best way to go about this?
>> 
>> Don't submit to a queue but request resources. The rest will work 
>> automatically.
>> 
>> In case you really want to address a queue you could also attach a complex 
>> to a queue which must be requested as you suggest, this could even be set to 
>> forced in case no other jobs should slip in.
>> 
>> Or use an RQS, so that certain users have zero slots in other queues.
>> 
>> What problem did you face in combination with drmaa?
>> 
>> -- Reuti
>> 
>> 
>>> Scott Lucas
>>> HPC Applications Support
>>> 208-776-0209
>>> lucas.sco...@mayo.edu
>>> 
>>> _______________________________________________
>>> users mailing list
>>> users@gridengine.org
>>> https://gridengine.org/mailman/listinfo/users
>> 
>> 
>> 
> 
> 
> 


_______________________________________________
users mailing list
users@gridengine.org
https://gridengine.org/mailman/listinfo/users

Reply via email to