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

Re: [Condor-users] How to 'dynamically' set the VM_MEMORY macro?

In a submit file, the $(...) syntax applies to specific macros, like
Cluster, Process, etc. You want to take attributes from the machine
add and perform operations upon them to get a value that you'll plug
into your submission file. This involves the following Macro:
$$([ClassAd expression])

For more information you can see the manual:

"An example of a job that uses this syntax may be a job that wants to
know how much memory it can use. The application cannot detect this
itself, as it would potentially use all of the memory on a multi-slot
machine. So the job determines the memory per slot, reducing it by 10%
to account for miscellaneous overhead, and passes this as a command
line argument to the application. In the submit description file will

arguments=--memory $$([TARGET.Memory * 0.9]) "

In your case you'll want to use an expression like:
$$([0.6*(Target.Memory - Target.RESERVED_MEMORY)])

That may take some experimentation, but it should enable you to get
what you need.

Hope this helps!

Good luck,

Jason A. Stowe
cell: 607.227.9686
main: 888.292.5320

Cycle Computing, LLC
Leader in Condor Grid Solutions
Enterprise Condor Support and Management Tools


On Thu, Jul 2, 2009 at 9:49 PM, Rob<spamrefuse@xxxxxxxxx> wrote:
> Hi,
> When using the VM Universe, one has to set the VM_MEMORY macro,
> to indicate how much memory will be available for the virtual machine.
> I can set VM_MEMORY to a constant, eg. VM_MEMORY = 256
> However, I'd like to have a general condor_config.local which defines the
> VM_MEMORY depending on the physical memory in the respective PC.
> We have pool PCs with different amounts of RAM (1, 2, and 4 GB).
> I'd like to set VM_MEMORY to a specific fraction of the available physical
> RAM, for example:
>   VM_MEMORY = ( $(MEMORY) - $(RESERVED_MEMORY) ) * 0.6
> The GAHP log file complains that
>   ERROR "VM_MEMORY in the condor configuration is not an integer ((  -  ) * 0.6)
> Why is this not possible? There seem to be several problems here.
> 1. The macros $(MEMORY) and $(RESERVED_MEMORY) are not automatically
>    set and instead they are empty. Are there other macros I can use here?
> 2. Even if I do "VM_MEMORY = 1024 * 0.6", the GAHP log file complains that
>    VM_MEMORY is not set to an integer value.
>    Is there no mechanism to round it off to the nearest integer value?
> =============================
> I am considering 0.6 times the physical available memory for the virtual universe.
> Is this a reasonable fraction?
> Thank you.
> Rob
> _______________________________________________
> Condor-users mailing list
> To unsubscribe, send a message to condor-users-request@xxxxxxxxxxx with a
> subject: Unsubscribe
> You can also unsubscribe by visiting
> https://lists.cs.wisc.edu/mailman/listinfo/condor-users
> The archives can be found at:
> https://lists.cs.wisc.edu/archive/condor-users/