Created
March 11, 2014 23:53
-
-
Save minrk/9497669 to your computer and use it in GitHub Desktop.
This file contains 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
# create mapping of engine_id : hostname | |
import socket | |
host_map = rc[:].apply_async(socket.gethostname).get_dict() | |
# reverse the mapping to hostname : [eid, eid2, ...] | |
host_map_r = {} | |
for eid, host in host_map.items(): | |
host_map_r.setdefault(host, []) | |
host_map_r.append(eid) | |
fred = rc[host_map_r['Fred']] | |
barney = rc[host_map_r['Barney']] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment