Skip to content

Instantly share code, notes, and snippets.

@cfriedline
Last active August 29, 2015 14:02
Show Gist options
  • Save cfriedline/42a16abfa4393a364d66 to your computer and use it in GitHub Desktop.
Save cfriedline/42a16abfa4393a364d66 to your computer and use it in GitHub Desktop.
code for IPython ipcluster ssh host list in ipcluster_config.py
import subprocess
qhost = subprocess.check_output(["qhost"])
host_dict = {}
for elem in qhost.split("\n"):
if 'godel' in elem:
data = elem.split()
host = data[0]
cpu = int(data[2])
if cpu > 8:
host_dict[host] = cpu
c.SSHEngineSetLauncher.engines = host_dict
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment