Thanks for your response.

What I would like to do is expand the existing logic (AND/OR) of features 
matching for reservation creation (now supporting: f1&f2&f3 or f1|f2|f3 or even 
f1&f2|f3) to include something like: f1&f2&(f3>50)&(f4<10) etc.


Using discrete string "values" such as f3low, f3med, f3high and f4low, f4med, 
f4high does not give me that flexibility.

I will also need to format the feature string to include a value. This way 
nodes can have features as plain strings and features which have values 
assigned (I may use the same convention for values as in Gres):


NodeName=boo001 Features=green,lucky,memory_GB:50,cpu_frequency_GHZ:2000

NodeName=boo002 Features=blue,lucky,memory_GB:100,cpu_frequency_GHZ:2600

And then the reservation creation may be something like:
scontrol create res start=now dur=100 user=jack nodecnt=50 
Features=lucky&(memory_GB>32)&(cpu_frequency_GHZ>2500)

My questions are:
1. do you think this is an reasonable/desireable feature to slurm
2. Is there a way (perhaps easier) to do it with a plug-in, or better to follow 
your earlier tips on where to modify the code.
3. I would like to assign many features per node. I saw that the maximum 
character length of all features assigned per node, is around 470 characters. 
Is this a hard limit ? or can it easily be expanded. This will tell me if I can 
use long meaningful names for node features such as: "memory_in_gigabytes" or 
just "mg"

Thanks
Yuval.






________________________________
 From: Moe Jette <[email protected]>
To: slurm-dev <[email protected]> 
Sent: Tuesday, July 10, 2012 7:02 PM
Subject: [slurm-dev] Re: Creating reservations based on a weight variable
 

The easiest thing for you to do may be to give nodes features like  
"high_weight", "low"weight", etc. and then specify those feature  
requirements when you create the reservation. You would need to make  
node code modifications.

If you want to add a filter specifically for node weight, the  
following would need modification:
scontrol (to accept new arguments in reservation create/modify)
the create reservation data structure (add new fields)
The un/pack logic for the data structure (add new fields)
The logic in src/slurmctld/reservation.c that picks the resources to  
satisfy the request (filter nodes using new fields)
I am not looking at the code, but that should get you started.

Quoting Yuval Leader <[email protected]>:

> Hi again -
>
> After some poking in the code: Is the reservation logic you refer to in:
> line 2416 of src/slurmctld/reservation.c which starts with:
>
>
>         /* Satisfy feature specification */
>         if (resv_desc_ptr->features) {
>                 int   op_code = FEATURE_OP_AND, last_op_code =  
> FEATURE_OP_AND;
>                 char *features = xstrdup(resv_desc_ptr->features);
>                 char *sep_ptr, *token = features;
>                 bitstr_t *feature_bitmap = bit_copy(node_bitmap);
>                 struct features_record *feature_ptr;
>                 ListIterator feature_iter;
>                 bool match;
>
>                 if (feature_bitmap == NULL)
>                         fatal("bit_copy malloc failure");
>
> etc....
>
>
> Is this the only place that needs modification ?
>
> Thanks,
> Yuval.
>
>
>
> ________________________________
>  From: Yuval Leader <[email protected]>
> To: slurm-dev <[email protected]>
> Sent: Tuesday, July 10, 2012 9:39 AM
> Subject: [slurm-dev] Re: Creating reservations based on a weight variable
>
>
> Thanks Moe ! I'll be more than happy to contribute and add it. Can  
> you point me to the exiting logic and to an explanation on how to  
> start with code modifications.
>
> Best regards
>
> Yuval.
>
>
> ________________________________
>  From: Moe Jette <[email protected]>
> To: slurm-dev <[email protected]>
> Sent: Monday, July 9, 2012 11:52 PM
> Subject: [slurm-dev] Re: Creating reservations based on a weight variable
>
>
> The current reservation logic does not support this, however SLURM is 
> open source and it would be fairly simple to add if desired.
>
> Quoting Yuval Leader <[email protected]>:
>
>> Hi,
>> I would like to create a reservation of nodes which comply with a 
>> value greater than (or less than) a constant.
>> Aternatively create a reservation of nodes which have a minimum weight.
>>
>> This can be similar to the Weight variable used for job scheduling.
>> Is there a way to do it for reservations creation ?
>>
>> Yuval

Reply via email to