Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/ucp/core/ucp_worker.c
Original file line number Diff line number Diff line change
Expand Up @@ -604,6 +604,11 @@ void ucp_worker_iface_activate(ucp_worker_iface_t *wiface, unsigned uct_flags)

++worker->num_active_ifaces;

if (!(uct_flags & UCT_PROGRESS_IFACE_READY) &&
!(wiface->flags & UCP_WORKER_IFACE_FLAG_AM_LANE)) {
uct_flags |= UCT_PROGRESS_DISCARD;
}

uct_iface_progress_enable(wiface->iface,
UCT_PROGRESS_SEND | UCT_PROGRESS_RECV | uct_flags);
}
Expand Down Expand Up @@ -637,7 +642,7 @@ static ucs_status_t ucp_worker_iface_check_events_do(ucp_worker_iface_t *wiface,
*progress_count = uct_iface_progress(wiface->iface);
if (prev_recv_count != wiface->proxy_recv_count) {
/* Received relevant active messages, activate the interface */
ucp_worker_iface_activate(wiface, 0);
ucp_worker_iface_activate(wiface, UCT_PROGRESS_IFACE_READY);
return UCS_OK;
} else if (*progress_count == 0) {
/* Arm the interface to wait for next event */
Expand Down
4 changes: 3 additions & 1 deletion src/ucp/core/ucp_worker.h
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,11 @@ enum {
of arm_ifaces list, so
it needs to be armed
in ucp_worker_arm(). */
UCP_WORKER_IFACE_FLAG_UNUSED = UCS_BIT(2) /**< There is another UCP iface
UCP_WORKER_IFACE_FLAG_UNUSED = UCS_BIT(2), /**< There is another UCP iface
with the same caps, but
with better performance */
UCP_WORKER_IFACE_FLAG_AM_LANE = UCS_BIT(3) /**< This interface is selected
for AM lane */
};


Expand Down
5 changes: 5 additions & 0 deletions src/ucp/wireup/select.c
Original file line number Diff line number Diff line change
Expand Up @@ -1449,6 +1449,7 @@ ucp_wireup_add_am_lane(const ucp_wireup_select_params_t *select_params,
ucp_wireup_select_info_t *am_info,
ucp_wireup_select_context_t *select_ctx)
{
ucp_worker_iface_t *wiface;
ucp_worker_h worker = select_params->ep->worker;
ucp_tl_bitmap_t tl_bitmap = select_params->tl_bitmap;
unsigned ep_init_flags = ucp_wireup_ep_init_flags(select_params,
Expand Down Expand Up @@ -1502,6 +1503,10 @@ ucp_wireup_add_am_lane(const ucp_wireup_select_params_t *select_params,
continue;
}

/* Mark this interface for AM lane */
wiface = ucp_worker_iface(worker, am_info->rsc_index);
wiface->flags |= UCP_WORKER_IFACE_FLAG_AM_LANE;

return ucp_wireup_add_lane(select_params, am_info, UCP_LANE_TYPE_AM,
/* show error */ 1, select_ctx);
}
Expand Down
6 changes: 5 additions & 1 deletion src/uct/api/uct.h
Original file line number Diff line number Diff line change
Expand Up @@ -547,9 +547,13 @@ enum uct_flush_flags {
enum uct_progress_types {
UCT_PROGRESS_SEND = UCS_BIT(0), /**< Progress send operations */
UCT_PROGRESS_RECV = UCS_BIT(1), /**< Progress receive operations */
UCT_PROGRESS_THREAD_SAFE = UCS_BIT(7) /**< Enable/disable progress while
UCT_PROGRESS_THREAD_SAFE = UCS_BIT(2), /**< Enable/disable progress while
another thread may be calling
@ref ucp_worker_progress(). */
UCT_PROGRESS_IFACE_READY = UCS_BIT(3), /**< This iface already received
messages, activate now */
UCT_PROGRESS_DISCARD = UCS_BIT(7) /**< The progress check on this
interface can be discarded; */
};


Expand Down
3 changes: 2 additions & 1 deletion src/uct/base/uct_iface.c
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,8 @@ void uct_base_iface_progress_enable_cb(uct_base_iface_t *iface,
UCS_ASYNC_BLOCK(worker->async);

thread_safe = flags & UCT_PROGRESS_THREAD_SAFE;
flags &= ~UCT_PROGRESS_THREAD_SAFE;
flags &= ~(UCT_PROGRESS_THREAD_SAFE | UCT_PROGRESS_DISCARD |
UCT_PROGRESS_IFACE_READY);

/* Add callback only if previous flags are 0 and new flags != 0 */
if ((!iface->progress_flags && flags) &&
Expand Down
14 changes: 13 additions & 1 deletion src/uct/sm/mm/base/mm_iface.c
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,18 @@ ucs_status_t uct_mm_iface_flush(uct_iface_h tl_iface, unsigned flags,
return UCS_OK;
}

static void uct_mm_iface_progress_enable(uct_iface_h tl_iface, unsigned flags)
{
uct_mm_iface_t *iface = ucs_derived_of(tl_iface, uct_mm_iface_t);

if (flags & UCT_PROGRESS_DISCARD) {
return;
}

uct_base_iface_progress_enable_cb(&iface->super.super,
(ucs_callback_t)iface->super.super.super.ops.iface_progress, flags);
}

static ucs_status_t uct_mm_iface_query(uct_iface_h tl_iface,
uct_iface_attr_t *iface_attr)
{
Expand Down Expand Up @@ -523,7 +535,7 @@ static uct_iface_ops_t uct_mm_iface_ops = {
.ep_destroy = UCS_CLASS_DELETE_FUNC_NAME(uct_mm_ep_t),
.iface_flush = uct_mm_iface_flush,
.iface_fence = uct_sm_iface_fence,
.iface_progress_enable = uct_base_iface_progress_enable,
.iface_progress_enable = uct_mm_iface_progress_enable,
.iface_progress_disable = uct_base_iface_progress_disable,
.iface_progress = uct_mm_iface_progress,
.iface_event_fd_get = uct_mm_iface_event_fd_get,
Expand Down