-
Notifications
You must be signed in to change notification settings - Fork 932
orte: only set the ORTE_NODE_ALIAS attribute when required #5097
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,7 +12,7 @@ | |
| * Copyright (c) 2011-2017 Los Alamos National Security, LLC. All rights | ||
| * reserved. | ||
| * Copyright (c) 2014-2017 Intel, Inc. All rights reserved. | ||
| * Copyright (c) 2015 Research Organization for Information Science | ||
| * Copyright (c) 2015-2018 Research Organization for Information Science | ||
| * and Technology (RIST). All rights reserved. | ||
| * $COPYRIGHT$ | ||
| * | ||
|
|
@@ -157,10 +157,12 @@ int orte_ras_base_node_insert(opal_list_t* nodes, orte_job_t *jdata) | |
| opal_argv_free(nalias); | ||
| } | ||
| /* and store the result */ | ||
| ptr = opal_argv_join(alias, ','); | ||
| if (0 < opal_argv_count(alias)) { | ||
| ptr = opal_argv_join(alias, ','); | ||
| orte_set_attribute(&hnp_node->attributes, ORTE_NODE_ALIAS, ORTE_ATTR_LOCAL, ptr, OPAL_STRING); | ||
| free(ptr); | ||
| } | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why split the original value that you just obtained from I ask because you're not saving the value you get back from
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We have to add the new alias to the end of the existing comma-delimited list, so we have to first fetch what we may already have, split it to get an argv array, then add only if unique, recombine and re-store. If he gets nothing back from the original "get", then he still has to store the new one. Note that the code block 151-158 should be removed - looks like a copy/paste error.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok. 👍
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @rhc54 at line 143, we get the alias(es) for note I will add a missing also, what is the rationale for testing
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @ggouaillardet You are right about the code block - I forgot that "node" may be carrying its own list of aliases. Technically, it would probably be better to check the return code instead of checking ptr for NULL. Ultimately, it doesn't matter as ptr will obviously remain NULL if the attribute isn't found. |
||
| opal_argv_free(alias); | ||
| orte_set_attribute(&hnp_node->attributes, ORTE_NODE_ALIAS, ORTE_ATTR_LOCAL, ptr, OPAL_STRING); | ||
| free(ptr); | ||
| } | ||
| /* don't keep duplicate copy */ | ||
| OBJ_RELEASE(node); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a little confused by this logic:
ORTE_NODE_ALIASto a comma-delimited list of aliases plus our local nodename.ORTE_NODE_ALIASat all -- not even to our local nodename.Is the behavior w.r.t. the local nodename intended? I.e., is the local nodename only relevant if there are aliases?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes - that is the intended behavior. Note that this also only happens if
orte_retain_aliasesis set. Otherwise, we just ignore the aliases.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok. 👍