Hi Bill and Douglas,

Thanks for your tips -  I narrowed down the issue to the fact that only one 
partition (a default partition) string is available, in all other cases it is 
not there, so the condition I'm targeting (job_desc[‘partition’] == "parallel") 
does not happen, and I don't know the reason for that - I will need to try to 
reproduce this elsewhere to confirm if it's a bug.

Thanks,
Kevin


On 12/19/18, 10:48 AM, "slurm-users on behalf of Bill Wichser" 
<slurm-users-boun...@lists.schedmd.com on behalf of b...@princeton.edu> wrote:

    Yes.  We use something like this
    
    
                  if job_desc.features == nil then
                      job_desc.features = "special"
                  else
                      job_desc.features = job_desc.features .. ",special"
                  end
    
    
    Bill
    
    On 12/19/2018 09:27 AM, Kevin Manalo wrote:
    > Is it safe to assume the value is nil if not set?
    > 
    >   if (job_desc[‘partition’] == "parallel" and job_desc[‘features’] == 
    > nil) then
    > 
    >      job_desc['features'] = "[haswell|broadwell|skylake]"
    > 
    >    end
    > 
    > -Kevin
    > 
    > *From: *slurm-users <slurm-users-boun...@lists.schedmd.com> on behalf of 
    > Douglas Jacobsen <dmjacob...@lbl.gov>
    > *Reply-To: *Slurm User Community List <slurm-users@lists.schedmd.com>
    > *Date: *Wednesday, December 19, 2018 at 9:07 AM
    > *To: *Slurm User Community List <slurm-users@lists.schedmd.com>
    > *Subject: *Re: [slurm-users] Lua Job Submit - Setting Features/Constraints
    > 
    > Hello,
    > 
    > We do this, it works like most of the other string-based fields, e.g.,
    > 
    > function job_submit(job_request, partinfo, submit_uid) {
    > 
    >       job_request['features'] = 'special'
    > 
    >       return slurm.SUCCESS
    > 
    > }
    > 
    > Is there something detailed you are looking for?
    > 
    > -Doug
    > 
    > ----
    > 
    > Doug Jacobsen, Ph.D.
    > 
    > NERSC Computer Systems Engineer
    > 
    > Acting Group Lead, Computational Systems Group
    > 
    > National Energy Research Scientific Computing Center 
<http://www.nersc.gov>
    > 
    > dmjacob...@lbl.gov <mailto:dmjacob...@lbl.gov>
    > 
    > ------------- __o
    > ---------- _ '\<,_
    > ----------(_)/  (_)__________________________
    > 
    > On Wed, Dec 19, 2018 at 5:49 AM Kevin Manalo <kman...@jhu.edu 
    > <mailto:kman...@jhu.edu>> wrote:
    > 
    >     All,
    > 
    >     Does anyone have an example of setting features (if not set) in the
    >     Lua job submission scripts?
    > 
    >     job_desc.features
    > 
    >     There was a discussion here, but it appears to be for the case where
    >     it is checked and rejected
    > 
    >     https://groups.google.com/d/topic/slurm-users/C-oYERITK9c/discussion
    > 
    >     -Kevin
    > 
    
    

Reply via email to