Skip to content

[OpenMP][AIX] Implement __kmp_get_load_balance() for AIX #91520

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

Merged
merged 1 commit into from
May 10, 2024

Conversation

xingxue-ibm
Copy link
Contributor

AIX has the proc filesystem where /proc/<pid>/lwp/<tid>/lwpsinfo has the thread state in binary, similar to Linux's /proc/<pid>/task/<tid>/stat where the state is in ASCII. However, the definition of state info R in lwpsinfo is runnable. In Linux, state R means the thread is running. Therefore, lwpsinfo is not ideal for our purpose of getting the current load of the system. This patch uses perfstat_cpu() in AIX system library libperfstat.a to obtain the number of threads current running on logical CPUs.

@xingxue-ibm xingxue-ibm added the openmp:libomp OpenMP host runtime label May 8, 2024
@xingxue-ibm xingxue-ibm requested review from brad0, shiltian and kkwli May 8, 2024 19:05
@xingxue-ibm xingxue-ibm self-assigned this May 8, 2024
@xingxue-ibm xingxue-ibm changed the title [OpenMP][AIX] Implement kmp_load_balance() for AIX [OpenMP][AIX] Implement __kmp_get_load_balance() for AIX May 9, 2024
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.

Sounds reasonable to me. Suppose it is working.

@xingxue-ibm
Copy link
Contributor Author

Sounds reasonable to me. Suppose it is working.

Thanks, @shiltian! Yes, this has been tested.

@xingxue-ibm xingxue-ibm merged commit 561b6ab into llvm:main May 10, 2024
@xingxue-ibm xingxue-ibm deleted the load-balance branch May 24, 2024 21:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
openmp:libomp OpenMP host runtime
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants