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

release/18x: [OpenMP][AIX] Affinity implementation for AIX (#84984) #86695

Merged
merged 1 commit into from
Apr 1, 2024

Conversation

xingxue-ibm
Copy link
Contributor

This patch implements affinity for AIX, which is quite different from platforms such as Linux.

  • Setting CPU affinity through masks and related functions are not supported. System call bindprocessor() is used to bind a thread to one CPU per call.
  • There are no system routines to get the affinity info of a thread. The implementation of get_system_affinity() for AIX gets the mask of all available CPUs, to be used as the full mask only.
  • Topology is not available from the file system. It is obtained through system SRAD (Scheduler Resource Allocation Domain).

This patch has run through the libomp LIT tests successfully with affinity enabled.

(cherry picked from commit d394f3a)

Note: We need to include this patch in the libomp of the next IBM OpenXL for AIX compiler deliverable which is built off LLVM v18. This cherry-pick has been re-based on release/18.x. Changes in this patch are guarded for AIX and should not affect other platforms.

@shiltian
Copy link
Contributor

I think it's fine. WDYT? @tstellar

@tstellar
Copy link
Collaborator

@kkwli What do you think about this?

Copy link
Contributor

@shiltian shiltian left a comment

Choose a reason for hiding this comment

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

Since this feature is needed for the vendor release, we can make exception for this patch.

This patch implements `affinity` for AIX, which is quite different from
platforms such as Linux.
- Setting CPU affinity through masks and related functions are not
supported. System call `bindprocessor()` is used to bind a thread to one
CPU per call.
- There are no system routines to get the affinity info of a thread. The
implementation of `get_system_affinity()` for AIX gets the mask of all
available CPUs, to be used as the full mask only.
- Topology is not available from the file system. It is obtained through
system SRAD (Scheduler Resource Allocation Domain).

This patch has run through the libomp LIT tests successfully with
`affinity` enabled.

(cherry picked from commit d394f3a)
@xingxue-ibm
Copy link
Contributor Author

Thanks so much, @shiltian and @brad0! Appreciate it! @kkwli is on vacation and we were discussing the option to build libomp off a downstream branch, which is not ideal.

@tstellar
Copy link
Collaborator

tstellar commented Apr 1, 2024

Hi @xingxue-ibm (or anyone else). If you would like to add a note about this fix in the release notes (completely optional). Please reply to this comment with a one or two sentence description of the fix.

@tstellar tstellar merged commit 47aac49 into llvm:release/18.x Apr 1, 2024
4 checks passed
@xingxue-ibm
Copy link
Contributor Author

Hi @xingxue-ibm (or anyone else). If you would like to add a note about this fix in the release notes (completely optional). Please reply to this comment with a one or two sentence description of the fix.

Thank you very much, @tstellar! We don't have anything specific to add to the release notes at this point.

@xingxue-ibm xingxue-ibm deleted the backport-84984 branch May 24, 2024 21:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Development

Successfully merging this pull request may close these issues.

None yet

4 participants