Last active
August 29, 2015 14:02
-
-
Save cfriedline/42a16abfa4393a364d66 to your computer and use it in GitHub Desktop.
code for IPython ipcluster ssh host list in ipcluster_config.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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