[ARVADOS] updated: 1.1.1-119-g1cd144f

Git user git at public.curoverse.com
Mon Dec 4 11:36:59 EST 2017


Summary of changes:
 services/crunch-dispatch-slurm/squeue.go | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)

       via  1cd144fe8da5fdc1d2e2e0ba2a3dcf47fc717251 (commit)
      from  0b1508df7ee4526340e8834422dd49ced63ee8d9 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit 1cd144fe8da5fdc1d2e2e0ba2a3dcf47fc717251
Author: Peter Amstutz <pamstutz at veritasgenetics.com>
Date:   Mon Dec 4 11:36:35 2017 -0500

    12573: Record absolute priority from squeue in additional to niceness.
    
    Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <pamstutz at veritasgenetics.com>

diff --git a/services/crunch-dispatch-slurm/squeue.go b/services/crunch-dispatch-slurm/squeue.go
index 3f73b3c..819c2d2 100644
--- a/services/crunch-dispatch-slurm/squeue.go
+++ b/services/crunch-dispatch-slurm/squeue.go
@@ -14,18 +14,23 @@ import (
 	"time"
 )
 
+type jobPriority struct {
+	niceness        int
+	currentPriority int
+}
+
 // Squeue implements asynchronous polling monitor of the SLURM queue using the
 // command 'squeue'.
 type SqueueChecker struct {
 	Period    time.Duration
-	uuids     map[string]int
+	uuids     map[string]jobPriority
 	startOnce sync.Once
 	done      chan struct{}
 	sync.Cond
 }
 
 func squeueFunc() *exec.Cmd {
-	return exec.Command("squeue", "--all", "--format=%j %y")
+	return exec.Command("squeue", "--all", "--format=%j %y %Q")
 }
 
 var squeueCmd = squeueFunc
@@ -54,7 +59,7 @@ func (sqc *SqueueChecker) GetNiceness(uuid string) int {
 
 	n, exists := sqc.uuids[uuid]
 	if exists {
-		return n
+		return n.niceness
 	} else {
 		return -1
 	}
@@ -88,13 +93,14 @@ func (sqc *SqueueChecker) check() {
 	}
 
 	lines := strings.Split(stdout.String(), "\n")
-	sqc.uuids = make(map[string]int, len(lines))
+	sqc.uuids = make(map[string]jobPriority, len(lines))
 	for _, line := range lines {
 		var uuid string
 		var nice int
-		fmt.Sscan(line, &uuid, &nice)
+		var prio int
+		fmt.Sscan(line, &uuid, &nice, &prio)
 		if uuid != "" {
-			sqc.uuids[uuid] = nice
+			sqc.uuids[uuid] = jobPriority{nice, prio}
 		}
 	}
 	sqc.Broadcast()

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list