[ARVADOS] created: 1.1.0-36-g8dc4be8

Git user git at public.curoverse.com
Thu Oct 26 15:03:36 EDT 2017


        at  8dc4be851bd9a896c377e19cfbb06eeb70d5269a (commit)


commit 8dc4be851bd9a896c377e19cfbb06eeb70d5269a
Author: Ward Vandewege <wvandewege at veritasgenetics.com>
Date:   Thu Oct 26 15:02:28 2017 -0400

    This is a crude first cut of a feature to effectively turn
    min_cores_per_node into exact_cores_per_node. Azure specific.
    
    Definitely not merge ready.
    
    refs #12199
    
    Arvados-DCO-1.1-Signed-off-by: Ward Vandewege <wvandewege at veritasgenetics.com>

diff --git a/services/api/lib/crunch_dispatch.rb b/services/api/lib/crunch_dispatch.rb
index 3cabc1e..b41f33c 100644
--- a/services/api/lib/crunch_dispatch.rb
+++ b/services/api/lib/crunch_dispatch.rb
@@ -155,8 +155,20 @@ class CrunchDispatch
     # Otherwise, return nil.
     need_procs = NODE_CONSTRAINT_MAP.each_pair.map do |job_key, node_key|
       Proc.new do |node|
-        positive_int(node.properties[node_key], 0) >=
-          positive_int(job.runtime_constraints[job_key], 0)
+        if job_key == 'min_cores_per_node'
+          cores_needed = positive_int(job.runtime_constraints[job_key], 1)
+          # if cores_needed is not a power of 2, get the next largest power of 2.
+          # azure nodes come in 1,2,4,8,16 cores
+          cores_needed = 2**Math.log2(cores_needed).ceil
+          # there is no 32 core node, but there's a 20 core one
+          if cores_needed > 16
+            cores_needed = 20
+          end
+          positive_int(node.properties[node_key], 0) == cores_needed
+        else
+          positive_int(node.properties[node_key], 0) >=
+            positive_int(job.runtime_constraints[job_key], 0)
+        end
       end
     end
     min_node_count = positive_int(job.runtime_constraints['min_nodes'], 1)

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list