rocp_sdk: multithreaded component test#603
Open
dbarry9 wants to merge 1 commit into
Open
Conversation
3290fac to
c0438e8
Compare
Treece-Burgess
requested changes
May 21, 2026
|
|
||
| // Check if there was an error in any of the threads. | ||
| if( 0 != overall_status ) { | ||
| test_fail(__FILE__, __LINE__, "Encountered an error in one of the threads", PAPI_EMISC); |
Contributor
There was a problem hiding this comment.
nit: For myself, I avoid using test_fail unless it is associated with a PAPI function call, i.e.:
int retval = PAPI_add_named_event( ... )
if (retval != PAPI_OK) {
test_fail(__FILE__, __LINE__, "PAPI_add_named_event", retval);
}
As currently the output appears as:
Line # 81 Error in Encountered an error in one of the threads: Unknown error code
I tend to use, fprintf(stderr, "..."); exit(EXIT_FAILURE).
| // PAPI front matter. | ||
| int retval = PAPI_library_init(PAPI_VER_CURRENT); | ||
| if( retval != PAPI_VER_CURRENT ) { | ||
| test_fail(__FILE__, __LINE__, "PAPI_library_init() failed", retval); |
Contributor
There was a problem hiding this comment.
nit: I would drop failed. As it would read better due to the format shown in the comment on line 81.
|
|
||
| // Create event set. | ||
| int stat; | ||
| pthread_barrier_wait(&barrier); |
Contributor
There was a problem hiding this comment.
Q: For the PAPI calls, you setup pthread_barrier_wait, why do we need to wait at the barriers until all threads reach the barrier? Each thread appears that it will be self-contained.
| // Join the threads. | ||
| for(int thdIdx = 0; thdIdx < ONT; ++thdIdx) { | ||
| pthread_join(tid[thdIdx], NULL); | ||
| if( status[thdIdx] != 0 ) { |
Contributor
There was a problem hiding this comment.
nit: I would suggest differentiating status to be papi_status and hip_status (or rocm_status).
c0438e8 to
6f0371a
Compare
Add a component test that uses multiple threads. These changes have been tested on the AMD MI300A architecture using ROCm version 7.2.0.
6f0371a to
6bb2fa4
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request Description
Add a component test that uses multiple threads.
These changes have been tested on the AMD MI300A architecture using ROCm version 7.2.0.
Author Checklist
Why this PR exists. Reference all relevant information, including background, issues, test failures, etc
Commits are self contained and only do one thing
Commits have a header of the form:
module: short descriptionCommits have a body (whenever relevant) containing a detailed description of the addressed problem and its solution
The PR needs to pass all the tests