-
Notifications
You must be signed in to change notification settings - Fork 36
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
Get topology from external function #133
Conversation
If HWLOC_GET_TOPOLOGY_FUNCTION is defined, call it to get the hwloc topology instead of calling hwloc_topology_init and hwloc_topology_load. Signed-off-by: John H. Hartman <[email protected]>
There are some failed CI checks on this. We'll need to look into whether they are actually related to the changes in the PR. |
@jhh67 - Could you please consider resetting |
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.
This currently changes the logic beyond the intended purpose.
Using binders, this would still fail? |
I pushed a commit that fixes topology cleanup in the |
extern void * HWLOC_GET_TOPOLOGY_FUNCTION; | ||
topology = (hwloc_topology_t) HWLOC_GET_TOPOLOGY_FUNCTION; | ||
#endif | ||
if (topology == NULL) { |
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.
What about removing this conditional
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'd like to leave the conditional because it allows the external function to return NULL if it cannot provide the topology for some reason, and qthreads
will then get the topology in the normal way.
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 see your point.
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.
@jhh67 Could you please add a comment to the code that the lack of a tear_down routine makes qt_affinity_init skip topology initialization in case of qthreads reinitialization? If we update binders at some point we'd likely need to add a tear_down routine.
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.
Done.
Note that there's leftover |
hwloc_via_chapel is obviated by the --with-hwloc-get-topology-function argument to configure. Signed-off-by: John H. Hartman <[email protected]>
Added comment that binders will not reinitialize hwloc topology during re-initialization because it lacks a teardown routine. Signed-off-by: John H. Hartman <[email protected]>
LGTM |
If
HWLOC_GET_TOPOLOGY_FUNCTION
is defined, call it to get thehwloc
topology instead of callinghwloc_topology_init
andhwloc_topology_load
. This enablesqthreads
to share the samehwloc
topology with external code, and obviateshwloc_via_chapel
affinity. Theconfigure
script accepts the argument--with-hwloc-get-topology-function
to setHWLOC_GET_TOPOLOGY_FUNCTION
.