-
-func (cmd *command) renice(ctr arvados.Container) {
- nice := cmd.niceness(ctr.Priority)
- oldnice := cmd.sqCheck.GetNiceness(ctr.UUID)
- if nice == oldnice || oldnice == -1 {
- return
- }
- log.Printf("updating slurm nice value to %d (was %d)", nice, oldnice)
- cmd.sqCheck.L.Lock()
- err := cmd.slurm.Renice(ctr.UUID, nice)
- cmd.sqCheck.L.Unlock()
-
- if err != nil {
- log.Printf("renice: %s", err)
- time.Sleep(time.Second)
- return
- }
- if cmd.sqCheck.HasUUID(ctr.UUID) {
- log.Printf("container %s has arvados priority %d, slurm nice %d",
- ctr.UUID, ctr.Priority, cmd.sqCheck.GetNiceness(ctr.UUID))
- }
-}
-
-func (cmd *command) readConfig(path string) error {
- err := config.LoadFile(cmd, path)
- if err != nil && os.IsNotExist(err) && path == defaultConfigPath {
- log.Printf("Config not specified. Continue with default configuration.")
- err = nil
- }
- return err
-}