-func readConfig(dst interface{}, path string) error {
- err := config.LoadFile(dst, path)
+func (disp *Dispatcher) renice(ctr arvados.Container) {
+ nice := disp.niceness(ctr.Priority)
+ oldnice := disp.sqCheck.GetNiceness(ctr.UUID)
+ if nice == oldnice || oldnice == -1 {
+ return
+ }
+ log.Printf("updating slurm nice value to %d (was %d)", nice, oldnice)
+ disp.sqCheck.L.Lock()
+ err := disp.slurm.Renice(ctr.UUID, nice)
+ disp.sqCheck.L.Unlock()
+
+ if err != nil {
+ log.Printf("renice: %s", err)
+ time.Sleep(time.Second)
+ return
+ }
+ if disp.sqCheck.HasUUID(ctr.UUID) {
+ log.Printf("container %s has arvados priority %d, slurm nice %d",
+ ctr.UUID, ctr.Priority, disp.sqCheck.GetNiceness(ctr.UUID))
+ }
+}
+
+func (disp *Dispatcher) readConfig(path string) error {
+ err := config.LoadFile(disp, path)