-
Notifications
You must be signed in to change notification settings - Fork 407
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
OpenMPTarget init-join fix #6444
Conversation
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.
How is calling two functions that check preconditions fixing anything?
If the issue is related to setting the value of kokkos/core/src/OpenMPTarget/Kokkos_OpenMPTarget_Exec.cpp Lines 70 to 71 in 6a95b5f
why is initialization in OpenMPTargetExec::verify_initialized the proper place to do that?Why can't it be done at initialization of the backend? |
Yes the issue is related to |
Would there be a reason to do it more than once? |
No since the arch wont change in between the kernel invocations. I moved the call into initialize. |
OpenMPTargetExec::verify_is_process( | ||
"Kokkos::Experimental::OpenMPTarget parallel_for"); | ||
OpenMPTargetExec::verify_initialized( | ||
"Kokkos::Experimental::OpenMPTarget parallel_for"); |
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.
Are these changes still necessary?
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.
Firstly, the message label was wrong which I fixed now.
Secondly, I think yes , we are checking for those in other similar routines too. Not having here was an oversight.
OpenMPTargetExec::verify_is_process( | ||
"Kokkos::Experimental::OpenMPTarget parallel_for"); | ||
"Kokkos::Experimental::OpenMPTarget parallel_reduce"); | ||
OpenMPTargetExec::verify_initialized( | ||
"Kokkos::Experimental::OpenMPTarget parallel_for"); | ||
"Kokkos::Experimental::OpenMPTarget parallel_reduce"); |
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.
Wouldn't it be better to call these functions in execute
directly before the dispatch to execute_init_join
, execute_reducer
,...? In that case, you could also be more precise about the policy used in the error message.
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.
Edited the error message.
Kokkos::Impl::OpenMPTargetExec::MAX_ACTIVE_THREADS = | ||
Kokkos::Experimental::OpenMPTarget().concurrency(); |
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.
Kokkos::Impl::OpenMPTargetExec::MAX_ACTIVE_THREADS = | |
Kokkos::Experimental::OpenMPTarget().concurrency(); | |
Kokkos::Impl::OpenMPTargetExec::MAX_ACTIVE_THREADS = | |
concurrency(); |
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.
OK with me.
The openmptarget build passed. Not waiting on the rest |
@rgayatri23 make sure you add to the changelog |
Yeah this was introduced in when we did #6043 |
The PR adds verification for OpenMP process and initialization in init-join reducers.
This also fixes the backward_compatibility test failure with the backend.