Fix slurm node counting, and pass along min_nodes to salloc. refs #1417
authorTom Clegg <tom@clinicalfuture.com>
Mon, 18 Mar 2013 02:02:41 +0000 (19:02 -0700)
committerTom Clegg <tom@clinicalfuture.com>
Mon, 18 Mar 2013 02:02:41 +0000 (19:02 -0700)
script/dispatch_jobs.rb

index db9fc06ecafc48ff8ceb9275910d657c7f8d1dd2..70d24e6275e9065190d4034aa535e7c6947defb8 100755 (executable)
@@ -69,7 +69,12 @@ class Dispatcher
 
     @todo.each do |job|
 
-      min_nodes = begin job.resource_limits['min_nodes'].to_i rescue 1 end
+      min_nodes = 1
+      begin
+        if job.resource_limits['min_nodes']
+          min_nodes = begin job.resource_limits['min_nodes'].to_i rescue 1 end
+        end
+      end
       next if @idle_slurm_nodes and @idle_slurm_nodes < min_nodes
 
       next if @running[job.uuid]
@@ -85,7 +90,7 @@ class Dispatcher
                     "--exclusive",
                     "--no-kill",
                     "--job-name=#{job.uuid}",
-                    "--nodes=1"]
+                    "--nodes=#{min_nodes}"]
       else
         raise "Unknown whjobmanager_wrapper: #{Server::Application.config.whjobmanager_wrapper}"
       end