I have observed the size limit when I ran the command:
scontrol update nodename=myhost features=LONG_FEATURES_STRING
It could only save LONG_FEATURES_STRING of 474 characters or less.
Example: add a feature which is 600 chars long
# scontrol update node=sqadell001
features=123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
Only the first 474 characters are saved:
# scontrol show node sqadell001
NodeName=sqadell001 CoresPerSocket=1 CPUAlloc=0 CPUErr=0 CPUTot=1
Features=12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123
Gres=(null) NodeAddr=10.0.3.123 NodeHostName=sqadell001 RealMemory=1
Sockets=1 State=IDLE ThreadsPerCore=1 TmpDisk=0 Weight=1 BootTime=None
SlurmdStartTime=None Reason=(null)
-----Original Message-----
From: Moe Jette [mailto:[email protected]]
Sent: Thursday, July 12, 2012 6:56 PM
To: slurm-dev
Subject: [slurm-dev] Re: Creating reservations based on a weight variable
The select plugin is designed to provide a common interface to different
architectures (BlueGene, Cray, etc.) and what you want should be in code common
to all architectures (i.e. in src/slurmctld/reservation.c).
I'm not sure if anyone else would be interested in this feature, but SLURM is
open source, so you can customize it as desired.
I'm not sure where the size limit would be coming from. There shouldn't be any
inherit limit o the string length.
Quoting Yuval Leader <[email protected]>:
> Hi,
> I saw the following plug-in:
>
> bitstr_t * select_p_resv_test(bitstr_t *avail_bitmap, uint32_t
> node_cnt)
>
> Description: Identify the nodes which best satisfy a reservation
> request taking system topology into consideration if applicable.
>
> Arguments:
>
> avail_bitmap (input) a bitmap of the nodes which are available
> for use in creating the reservation.
>
> node_cnt (input) number of nodes required to satisfy the
> reservation request.
>
> Returns: A bitmap of the nodes which should be used for the advanced
> reservation or NULL if the selected nodes can not be used for an
> advanced reservation.
>
> My question is:
> Alternatively to modifying src/slurmctld/reservation.c, Does it makes
> sense to write a plugin that : Identifies the nodes which best satisfy
> a reservation request taking their “Features” set values into
> consideration if applicable ?
> Which option (code change or plugin) is better in this case ?
>
> Thanks,
> Yuval.
>
> From: Yuval Leader [mailto:[email protected]]
> Sent: Wednesday, July 11, 2012 11:10 PM
> To: slurm-dev
> Subject: [slurm-dev] Re: Creating reservations based on a weight
> variable
>
> 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]<mailto:[email protected]>>
> To: slurm-dev <[email protected]<mailto:[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]<mailto:[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]<mailto:[email protected]>>
>> To: slurm-dev <[email protected]<mailto:[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]<mailto:[email protected]>>
>> To: slurm-dev <[email protected]<mailto:[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]<mailto:[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
>
>
>