-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
resource-hwloc: put HostName in by_rank directory #892
Conversation
Add a resource.hwloc.by_rank.<id>.HostName key containing the hwloc-provided hostname for the current rank. This key will provide an easy way to translate a rank to a hostname if needed.
Current coverage is 72.21% (diff: 80.00%)@@ master #892 diff @@
==========================================
Files 157 157
Lines 27007 27012 +5
Methods 0 0
Messages 0 0
Branches 0 0
==========================================
+ Hits 19500 19506 +6
+ Misses 7507 7506 -1
Partials 0 0
|
Seems like a fine addition to me! |
Referencing #866 and #855 where the motivation for this was discussed. One thought: do we want to support the reverse lookup, hostname to nodeset? I guess that would greatly complicate this simple PR so I dumped a couple thoughts into #893. This seems good to me, and I did give it a test and it worked. |
Maybe a little test would be good actually, like diff --git a/t/t2005-hwloc-basic.t b/t/t2005-hwloc-basic.t
index 15577f6..ee14d59 100755
--- a/t/t2005-hwloc-basic.t
+++ b/t/t2005-hwloc-basic.t
@@ -116,4 +116,10 @@ test_expect_success 'hwloc: reload fails on invalid rank' '
grep "No route to host" stderr
'
+test_expect_success 'hwloc: HostName is populated in by_rank' '
+ HW_HOST=$(flux kvs get resource.hwloc.by_rank.0.HostName) &&
+ REAL_HOST=$(hostname) &&
+ test x"$HW_HOST" = x"$REAL_HOST"
+'
+
test_done |
Seems like a good idea to me. Minimally, getting hostnames out of the kvs with this is better than the xml parsing hack I originally did in #864. |
Great idea, I'll add your enhancement to this PR or you could just push it |
Add a simple check that resource.hwloc.by_rank.0.HostName is populated in the KVS and matches the actual hostname.
Cool, that worked! |
Here's where I would push the button, but I should probably recuse myself because I pushed a commit to this PR. @chu11 want to do the honors? |
Thanks @garlick! (At home with a sick kid so not getting much work done On Nov 3, 2016 12:49 PM, "Jim Garlick" [email protected] wrote:
|
@garlick sure thing. everything LGTM too. |
Had this commit sitting on a branch for a while, getting stale. It might be useful so I'm proposing it as a PR for discussion.
Adds a resource.hwloc.by_rank..HostName key containing the hwloc-provided hostname for the current rank.