0

I am seeking out help for setting up a priority queue within Slurm,

very much like this:

How to set the maximum priority to a Slurm job?

and

https://slurm.schedmd.com/priority_multifactor.html

but how/where do I implement this code? Is this c++, or Slurm code?

job_desc_msg_t job_update;
slurm_init_job_desc_msg(&job_update);
job_update.job_id = target_job_id;
job_update.priority = 4294967295;
slurm_update_job(&job_update);

I have tried putting this code inside the /etc/slurm/slurm.conf but this does nothing. If anyone can clarify beyond what is being said from https://slurm.schedmd.com/priority_multifactor.html since this does not give enough information about how to implement inside of slurm.

[Edit] I am trying to get sacct statistics such as currently running task of a user/ and currently pending task of a user, to calculate the next job of that user. So instead of FIFO, each user can get some jobs running. that way someone that queues at 9:00am a 100 jobs doesn't saturate the entire cluster. So everyone else has to wait for the entire 100 to finish.

[Update] Anyone looking for more info on this issue. I found that this code is c++ and is an (poor) example of a plugin. To create a plugin check these links out. https://slurm.schedmd.com/job_submit_plugins.html

https://slurm.schedmd.com/selectplugins.html

https://slurm.schedmd.com/plugins.html

Theisen
  • 43
  • 7
  • The code you quote, is used when you are setting the priority via the Slurm API. If not, you should set the priority in the configuration file. – Bub Espinja Mar 15 '19 at 07:19
  • Is there any examples of implementing Slurm APIs, or using Slurm APIs. How does one use Slurm APIs from start to finish. I have not seen any articles or guides on how to do just that? How do I go from having the code above from living in a file called text.txt to working with my Slurm server? – Theisen Mar 15 '19 at 17:09
  • Except that does not work well for factors like how many jobs are in queue or are currently running. I have tried to use the Slurm config multi-factors but still does not work the priority does not take effect. As far as I have seen priorities do not actually work. – Theisen Mar 17 '19 at 15:59
  • Also why is setting up Slurm APIs a guarded secret? Im just asking for a simple example/guide to implementing Slurm API priorities. The equivalent of a "Hello world" but for Slurm priority. – Theisen Mar 17 '19 at 16:07
  • It is not a secret: https://slurm.schedmd.com/api.html enjoy! – Bub Espinja Mar 20 '19 at 14:29
  • Thank you Bub Espinja can you please demonstrate an example of: implementing these APIs, compiling, executing, executing in conjunction with the Slurm daemon? – Theisen Mar 22 '19 at 18:43

1 Answers1

1

Without proper configuration "PriorityType=priority/multifactor" does not work, sprio command shows nothing.

First you must configure accounting and must enable "AccountingStorageEnforce" parameter in slurm.conf

These are good resources: https://wiki.fysik.dtu.dk/niflheim/Slurm_scheduler https://wiki.fysik.dtu.dk/niflheim/Slurm_accounting

WhoCares
  • 11
  • 3