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

Re: [HTCondor-users] limit the number of CPUS based on memory



Hi,

Thanks a lot both of you for the prompt replies.
I was aware of the $INT() cast. Very important, indeed.

Cheers,
Jose

El miÃ, 21 abr 2021 a las 0:49, John M Knoeller via HTCondor-users
(<htcondor-users@xxxxxxxxxxx>) escribiÃ:
>
> The Cpus value can be an integer.  But keep in mind that you can do
> arbitrary math by using the $INT() or $REAL() macro expansions.
>
> So, for instance you can use the classad min function to make sure that you
> configure at least 2 GB per core in the slot, but don't go over the actual number of cpus.
>
> # the CPUs calculation
> cpus_per_2gb = min( {$(DETECTED_CORES), $(DETECTED_MEMORY) / 2048} )
>
> # we evaluate the CPUs calculation to an integer when $INT() is expanded
> SLOT_TYPE_1=cpus=$INT(cpus_per_2gb),mem=100%,auto
>
> -tj
> ________________________________
> From: HTCondor-users <htcondor-users-bounces@xxxxxxxxxxx> on behalf of jcaballero.hep@xxxxxxxxx <jcaballero.hep@xxxxxxxxx>
> Sent: Tuesday, April 20, 2021 9:43 AM
> To: HTCondor-Users Mail List <htcondor-users@xxxxxxxxxxx>
> Subject: [HTCondor-users] limit the number of CPUS based on memory
>
> Hi,
>
> I guess this is mostly a question about arithmetic with classads :)
>
> So I am wondering if, in order to provide for as many cores as
> possible to run jobs that use 2 GB of mem max, I can do something like
> this:
>
>     SLOT_TYPE_1=cpus=$DETECTED_MEMORY/2048,mem=100%,auto
>
> Question 1: can cpus here be an integer, or must be a percentage?
> Question 2: if it can be an integer, would that be the right expression?
>
> Thanks,
> Jose
> _______________________________________________
> 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/