Skip to content
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

HPCBIND: Prevent hwloc-ls from opening graphic windows unintentionally #7010

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

DanielRichtmann
Copy link

@DanielRichtmann DanielRichtmann commented May 14, 2024

I noticed that hpcbind unconditionally opens two lstopo X windows when a display is present. The command I ran to trigger this behavior was

hpcbind --distribute=2 --distribute-partition=1 -v

in combination with hwloc version 2.7.0 on ubuntu 22.04 lts.

This PR changes this behavior to only open these windows when the --lstopo flag is passed at the command line.

@@ -635,7 +635,9 @@ if [[ ${HPCBIND_TEE} -eq 0 || ${HPCBIND_VERBOSE} -eq 0 ]]; then

if [[ ${HPCBIND_HAS_HWLOC} -eq 1 ]]; then
echo "[BINDINGS]" >> ${HPCBIND_LOG}
hwloc-ls --restrict "${HPCBIND_HWLOC_CPUSET}" >> ${HPCBIND_LOG}
if [[ ${HPCBIND_LSTOPO} -eq 1 && ! -z ${DISPLAY} ]]; then
hwloc-ls --restrict "${HPCBIND_HWLOC_CPUSET}" >> ${HPCBIND_LOG}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would passing --output-format console resolve your issue?
(I have no experience with hpcbind nor hwloc)

Copy link
Contributor

@ajpowelsnl ajpowelsnl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe a fix that should occur on the user's machine?

@@ -635,7 +635,9 @@ if [[ ${HPCBIND_TEE} -eq 0 || ${HPCBIND_VERBOSE} -eq 0 ]]; then

if [[ ${HPCBIND_HAS_HWLOC} -eq 1 ]]; then
echo "[BINDINGS]" >> ${HPCBIND_LOG}
hwloc-ls --restrict "${HPCBIND_HWLOC_CPUSET}" >> ${HPCBIND_LOG}
if [[ ${HPCBIND_LSTOPO} -eq 1 && ! -z ${DISPLAY} ]]; then
hwloc-ls --restrict "${HPCBIND_HWLOC_CPUSET}" >> ${HPCBIND_LOG}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't $DISPLAY set / unset on the user's machine? Assuming that's the case, then conditioning hwloc-ls --restrict "${HPCBIND_HWLOC_CPUSET}" >> ${HPCBIND_LOG} upon ${DISPLAY} being non zero (if it's set at all) could have negative downstream effects for users who wish to use hpcbind , but do not have $DISPLAY set. I checked a couple of (non-Windows) machines, and $DISPLAY wasn't set, appearing to be the default scenario. Would it be possible for you to simply unset $DISPLAY before using hpcbind?

hwloc-ls --restrict "${HPCBIND_HWLOC_CPUSET}" --no-io --no-bridges > >(tee -a ${HPCBIND_LOG})
if [[ ${HPCBIND_LSTOPO} -eq 1 && ! -z ${DISPLAY} ]]; then
hwloc-ls --restrict "${HPCBIND_HWLOC_CPUSET}" --no-io --no-bridges > >(tee -a ${HPCBIND_LOG})
fi
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See comment above above the logic and potential risk of the proposed change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants