-
Notifications
You must be signed in to change notification settings - Fork 423
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
UCT/API/UCP: Hide slow-path progress elem and refcount in uct_worker. #1583
Conversation
This commit does some preparations in UCT for the change in callback queue API: + Block async context outside of callback queue calls. + Keep callback reference count in a handle in uct_base_iface_t/ + Instead of exposing slow-path callback queue element in UCT API, hide it inside uct worker code. This will allocate the element internally and release when finished.
03d8b3c
to
58bf758
Compare
Test PASSed. |
Test PASSed. |
adding @bbenton for API part |
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.
I'm a bit confused with namings. So now uct_worker_progress_register_safe is used for adding to slow path? Is the intention that user should not add to fast path at all?
@@ -403,8 +403,12 @@ static void uct_mm_iface_recv_messages(uct_mm_iface_t *iface) | |||
ret = recvfrom(iface->signal_fd, &sig, sizeof(sig), 0, NULL, 0); | |||
if (ret == sizeof(sig)) { | |||
ucs_debug("mm_iface %p: got connect message", iface); | |||
ucs_callbackq_add_safe(&iface->super.worker->progress_q, | |||
uct_mm_iface_progress, iface); | |||
if (iface->super.prog.refcount++ == 0) { |
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.
why uct_worker_progress_register is not used instead?
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.
because we need to use "safe" mode here - it's called from async thread
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.
but ucs_callbackq_add_safe is the same as ucs_callbackq_add. Also UCS_ASYNC_BLOCK is called in
uct_worker_progress_register
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.
- ucs_callbackq_add_safe is currently the same as ucs_callbackq_add, but the user of callbackq should not take advantage of that knowldge, since according to API _safe version should be used if calling from another thread
- ASYNC_BLOCK is not needed from the async context itself
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.
so this will be changed to calling uct_worker_progress_register_safe with some flag in the next PR?
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.
yes
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.
the goal of this PR is mainly to make next PR fit into 500 lines
@brminich this PR allows users register only to slow-path. After next PR it would be possible to register to fast-path by passing flags. |
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.
👍
bot:ornl:retest |
Test PASSed. |
Test PASSed. |
@MattBBaker did u test it on cray ? |
@shamisp Builds and runs fine on Cray. |
src/uct/api/uct.h
Outdated
* | ||
* @note This operation could potentially be slow. | ||
* @param [in] worker Handle to worker. | ||
* @param [in] func Pointer to callback function. |
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.
Pointer to the callback function
src/uct/api/uct.h
Outdated
* @note This operation could potentially be slow. | ||
* @param [in] worker Handle to worker. | ||
* @param [in] func Pointer to callback function. | ||
* @param [in] arg Argument to the function. |
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.
Argument for the callback function
@yosefe,:q
Am I missing something? |
3ec6b75
to
6eed080
Compare
6eed080
to
e290cb0
Compare
Test PASSed. |
Test FAILed. |
Test PASSed. |
👍 for Doc/API |
@yosefe - it is ready to go |
No description provided.