[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [HTCondor-users] Compute personal variables in sub file



Hi,

Thanks Max and Brian for your quick and precise answers.

I tried the 2 solution you proposed and it worked fine!

Cheers,
Mathieu

On 31/01/17 19:00, htcondor-users-request@xxxxxxxxxxx wrote:
> Send HTCondor-users mailing list submissions to
> 	htcondor-users@xxxxxxxxxxx
>
> To subscribe or unsubscribe via the World Wide Web, visit
> 	https://lists.cs.wisc.edu/mailman/listinfo/htcondor-users
> or, via email, send a message with subject or body 'help' to
> 	htcondor-users-request@xxxxxxxxxxx
>
> You can reach the person managing the list at
> 	htcondor-users-owner@xxxxxxxxxxx
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of HTCondor-users digest..."
>
>
> Today's Topics:
>
>    1. Re: Compute personal variables in sub file (Brian Bockelman)
>    2. Re: Compute personal variables in sub file (Fischer, Max (SCC))
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Tue, 31 Jan 2017 07:51:49 -0600
> From: Brian Bockelman <bbockelm@xxxxxxxxxxx>
> To: HTCondor-Users Mail List <htcondor-users@xxxxxxxxxxx>
> Subject: Re: [HTCondor-users] Compute personal variables in sub file
> Message-ID: <F2CD126B-7B5F-423A-A03E-1DCF320B9D92@xxxxxxxxxxx>
> Content-Type: text/plain; charset="utf-8"
>
> Hi Mathieu,
>
> I believe you want:
>
> request_cpus = 10
> +RequestMemory = RequestCpus * 2048
>
> The "+" syntax causes RequestMemory to be inserted directly into the ad, instead of being handled by the macro expansion.  That means you can use the full ClassAd language to write the expression.
>
> I did a quick test of this using the current master; I think it should work the same way for 8.2.2.
>
> Brian
>
>> On Jan 31, 2017, at 6:27 AM, Mathieu Bahin <mathieu.bahin@xxxxxxxxxxxxxxx> wrote:
>>
>> Hi all,
>>
>> For now we are running a Condor 8.2.2 with partitionable slots configuration.
>>
>> Is there a way to say that, for a job, we want to request twice as much memory as the CPU number (in G)?
>> For example, if I request 5 CPUs, I would also like to request 10G of memory.
>>
>> From the documentation, I understood that we can only use directly a variable that we set. Example:
>> ncpus = 10
>> request_cpus = $(ncpus)
>>
>> Or compute a variable from a ClassAd one. Example:
>> arguments = --memory $$([TARGET.Memory * 0.9])
>>
>> Is there a way to do something like that?
>> ncpus = 10
>> request_memory = $$[$(ncpus) * 2048])
>>
>> Cheers,
>> Mathieu
>> -- 
>> ---------------------------------------------------------------------------------------
>> | Mathieu Bahin
>> | IE CNRS
>> |
>> | Institut de Biologie de l'Ecole Normale Sup?rieure (IBENS)
>> | Biocomp team
>> | 46 rue d'Ulm
>> | 75230 PARIS CEDEX 05
>> | 01.44.32.23.56
>> ---------------------------------------------------------------------------------------
>> _______________________________________________
>> HTCondor-users mailing list
>> To unsubscribe, send a message to htcondor-users-request@xxxxxxxxxxx with a
>> subject: Unsubscribe
>> You can also unsubscribe by visiting
>> https://lists.cs.wisc.edu/mailman/listinfo/htcondor-users
>>
>> The archives can be found at:
>> https://lists.cs.wisc.edu/archive/htcondor-users/
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <https://www-auth.cs.wisc.edu/lists/htcondor-users/attachments/20170131/858edd6e/attachment.html>
>
> ------------------------------
>
> Message: 2
> Date: Tue, 31 Jan 2017 14:07:40 +0000
> From: "Fischer, Max (SCC)" <max.fischer@xxxxxxx>
> To: HTCondor-Users Mail List <htcondor-users@xxxxxxxxxxx>
> Subject: Re: [HTCondor-users] Compute personal variables in sub file
> Message-ID: <410A0AD6-4C6C-46F0-93CD-D65475DD1BD0@xxxxxxx>
> Content-Type: text/plain; charset="utf-8"
>
> Hi,
>
> at least on 8.4, it is valid to directly use
> 	request_cpus = 10
> 	request_memory = $(request_cpus) * 2048
> which gets translated to
> 	RequestMemory = 10 * 2048
> in the job classad.
>
> Cheers,
> Max
>
>> Am 31.01.2017 um 14:51 schrieb Brian Bockelman <bbockelm@xxxxxxxxxxx>:
>>
>> Hi Mathieu,
>>
>> I believe you want:
>>
>> request_cpus = 10
>> +RequestMemory = RequestCpus * 2048
>>
>> The "+" syntax causes RequestMemory to be inserted directly into the ad, instead of being handled by the macro expansion.  That means you can use the full ClassAd language to write the expression.
>>
>> I did a quick test of this using the current master; I think it should work the same way for 8.2.2.
>>
>> Brian
>>
>>> On Jan 31, 2017, at 6:27 AM, Mathieu Bahin <mathieu.bahin@xxxxxxxxxxxxxxx> wrote:
>>>
>>> Hi all,
>>>
>>> For now we are running a Condor 8.2.2 with partitionable slots configuration.
>>>
>>> Is there a way to say that, for a job, we want to request twice as much memory as the CPU number (in G)?
>>> For example, if I request 5 CPUs, I would also like to request 10G of memory.
>>>
>>> From the documentation, I understood that we can only use directly a variable that we set. Example:
>>> ncpus = 10
>>> request_cpus = $(ncpus)
>>>
>>> Or compute a variable from a ClassAd one. Example:
>>> arguments = --memory $$([TARGET.Memory * 0.9])
>>>
>>> Is there a way to do something like that?
>>> ncpus = 10
>>> request_memory = $$[$(ncpus) * 2048])
>>>
>>> Cheers,
>>> Mathieu
>>> -- 
>>> ---------------------------------------------------------------------------------------
>>> | Mathieu Bahin
>>> | IE CNRS
>>> |
>>> | Institut de Biologie de l'Ecole Normale Sup?rieure (IBENS)
>>> | Biocomp team
>>> | 46 rue d'Ulm
>>> | 75230 PARIS CEDEX 05
>>> | 01.44.32.23.56
>>> ---------------------------------------------------------------------------------------
>>>
>>> _______________________________________________
>>> HTCondor-users mailing list
>>> To unsubscribe, send a message to htcondor-users-request@xxxxxxxxxxx with a
>>> subject: Unsubscribe
>>> You can also unsubscribe by visiting
>>> https://lists.cs.wisc.edu/mailman/listinfo/htcondor-users
>>>
>>> The archives can be found at:
>>> https://lists.cs.wisc.edu/archive/htcondor-users/
>> _______________________________________________
>> HTCondor-users mailing list
>> To unsubscribe, send a message to htcondor-users-request@xxxxxxxxxxx with a
>> subject: Unsubscribe
>> You can also unsubscribe by visiting
>> https://lists.cs.wisc.edu/mailman/listinfo/htcondor-users
>>
>> The archives can be found at:
>> https://lists.cs.wisc.edu/archive/htcondor-users/
> -------------- next part --------------
> A non-text attachment was scrubbed...
> Name: smime.p7s
> Type: application/pkcs7-signature
> Size: 5244 bytes
> Desc: not available
> URL: <https://www-auth.cs.wisc.edu/lists/htcondor-users/attachments/20170131/b27a57b4/attachment.p7s>
>
> ------------------------------
>
> Subject: Digest Footer
>
> _______________________________________________
> HTCondor-users mailing list
> HTCondor-users@xxxxxxxxxxx
> https://lists.cs.wisc.edu/mailman/listinfo/htcondor-users
>
> ------------------------------
>
> End of HTCondor-users Digest, Vol 38, Issue 38
> **********************************************

-- 
---------------------------------------------------------------------------------------
| Mathieu Bahin
| IE CNRS
|
| Institut de Biologie de l'Ecole Normale Supérieure (IBENS)
| Biocomp team
| 46 rue d'Ulm
| 75230 PARIS CEDEX 05
| 01.44.32.23.56
---------------------------------------------------------------------------------------