Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions BrainPortal/lib/boutiques_resource_manager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -77,20 +77,21 @@ def job_walltime_estimate #:nodoc:
end.reject { |x| x == 0 }

walltime_estimate = asked_walltimes.empty? ? super : asked_walltimes.sum
self.addlog("Job_walltime_estimate: #{walltime_estimate.inspect}")
self.addlog("walltime: #{walltime_estimate.inspect}")
return walltime_estimate
end

def job_memory_estimate #:nodoc:
@_custom_asked_resources ||= asked_resources()

asked_memories = @_custom_asked_resources.map do |resources|
resources["ram"].to_i
resources["ram"].to_i # in GB
end.compact.reject { |x| x == 0 }

memory_estimate = asked_memories.empty? ? super : asked_memories.max
self.addlog("Job_memory_estimate: #{memory_estimate.inspect}")
return(memory_estimate * 1024)
return super if asked_memories.empty?
memory_estimate = asked_memories.max # in GB
self.addlog("memory: #{memory_estimate} GB")
return(memory_estimate * 1024) # in MB
end

def job_number_of_cores #:nodoc:
Expand All @@ -101,7 +102,7 @@ def job_number_of_cores #:nodoc:
end.compact.reject { |x| x == 0 }

number_of_cores = asked_cpus.empty? ? super : asked_cpus.max
self.addlog("Job_number_of_cores: #{number_of_cores.inspect}")
self.addlog("cpu-cores: #{number_of_cores.inspect}")
return number_of_cores
end

Expand Down
Loading