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
