Skip to content

Instantly share code, notes, and snippets.

@priteau
Created September 9, 2011 09:14
Show Gist options
  • Select an option

  • Save priteau/1205814 to your computer and use it in GitHub Desktop.

Select an option

Save priteau/1205814 to your computer and use it in GitHub Desktop.
Compute the number of cores on Grid'5000
#!/usr/bin/env ruby
require 'restfully'
grid = Restfully::Session.new(:base_uri => 'https://api.grid5000.fr/sid/grid5000').root
ncores = grid.sites.inject(0) do |sum, s|
sum + s.clusters.inject(0) do |sum, c|
sum + (c.nodes.first['architecture']['smt_size'] * c.nodes.length)
end
end
puts ncores
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment