Skip to content

Commit 7ad21c5

Browse files
UCP/PROTO: Remove env var PROTO_USAGE_COUNT_MAX
1 parent 72f8f57 commit 7ad21c5

File tree

4 files changed

+7
-30
lines changed

4 files changed

+7
-30
lines changed

src/ucp/core/ucp_context.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -497,12 +497,6 @@ static ucs_config_field_t ucp_context_config_table[] = {
497497
" For example: '*tag*gpu*', '*put*fast*host*'",
498498
ucs_offsetof(ucp_context_config_t, proto_info), UCS_CONFIG_TYPE_STRING},
499499

500-
{"PROTO_USAGE_COUNT_MAX", "255",
501-
"The maximal amount of times the protocol usage would be counted.\n"
502-
"After reaching this value, counting is stopped to reduce overhead.\n"
503-
" 'inf' : Count up to UINT_MAX",
504-
ucs_offsetof(ucp_context_config_t, proto_usage_count_max), UCS_CONFIG_TYPE_UINT},
505-
506500
{"RNDV_ALIGN_THRESH", "64kB",
507501
"If the rendezvous payload size is larger than this value, it could be split\n"
508502
"in order to optimize memory alignment",

src/ucp/core/ucp_context.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,8 +180,6 @@ typedef struct ucp_context_config {
180180
size_t rndv_align_thresh;
181181
/** Print protocols information */
182182
char *proto_info;
183-
/** Maximum number of times a protocol usage would be counted */
184-
unsigned proto_usage_count_max;
185183
/** MD to compare for transport selection scores */
186184
char *select_distance_md;
187185
/** Directory to write protocol selection information */

src/ucp/core/ucp_request.c

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -736,28 +736,21 @@ ucs_status_t ucp_request_progress_counter(uct_pending_req_t *self)
736736
ucp_proto_config_t *proto_config = ucs_const_cast(ucp_proto_config_t*,
737737
req->send.proto_config);
738738
const ucp_proto_t *proto = proto_config->proto;
739-
unsigned proto_usage_count_max =
740-
req->send.ep->worker->context->config.ext.proto_usage_count_max;
741739
ucs_status_t status;
742740

743-
/* NOTE: This function is only called when `progress_wrapper_enabled` is
744-
`false`, which means that it won't be called when the log level is
745-
TRACE_REQ or higher.
746-
Because of this, `ucs_trace` is used here instead of `ucp_trace_req` */
747741

748742
status = proto->progress[UCP_PROTO_STAGE_START](self);
749743
if (ucs_unlikely(UCS_STATUS_IS_ERR(status))) {
744+
/* NOTE: This function is only called when `progress_wrapper_enabled`
745+
* is `false`, which means that it won't be called when the log level
746+
* is TRACE_REQ or higher. Because of this, `ucs_trace` is used here
747+
* instead of `ucp_trace_req` */
750748
ucs_trace("progress protocol %s returned: %s lane %d", proto->name,
751749
ucs_status_string(status), req->send.lane);
752750
return status;
753751
}
754752

755-
if (ucs_unlikely(++proto_config->selections == proto_usage_count_max)) {
756-
ucs_trace("protocol %s was selected %u times, stop tracing",
757-
proto->name, proto_config->selections);
758-
memcpy(proto_config->progress_wrapper, proto->progress,
759-
sizeof(proto_config->progress_wrapper));
760-
}
753+
++proto_config->selections;
761754

762755
return UCS_OK;
763756
}
@@ -768,8 +761,6 @@ ucs_status_t ucp_request_progress_wrapper(uct_pending_req_t *self)
768761
ucp_proto_config_t *conf = ucs_const_cast(ucp_proto_config_t *,
769762
req->send.proto_config);
770763
const ucp_proto_t *proto = conf->proto;
771-
unsigned proto_usage_count_max =
772-
req->send.ep->worker->context->config.ext.proto_usage_count_max;
773764
uct_pending_callback_t progress_cb;
774765
ucs_status_t status;
775766

@@ -789,8 +780,7 @@ ucs_status_t ucp_request_progress_wrapper(uct_pending_req_t *self)
789780
ucp_trace_req(req, "progress protocol %s returned: %s lane %d",
790781
proto->name, ucs_status_string(status), req->send.lane);
791782
} else {
792-
if (req->send.proto_stage == UCP_PROTO_STAGE_START &&
793-
conf->selections < proto_usage_count_max) {
783+
if (req->send.proto_stage == UCP_PROTO_STAGE_START) {
794784
++conf->selections;
795785
}
796786

src/ucp/proto/proto_debug.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -201,17 +201,12 @@ static void ucp_proto_selections_dump(ucp_worker_h worker,
201201
char *counter_str, size_t size,
202202
int show_used)
203203
{
204-
unsigned proto_usage_count_max =
205-
worker->context->config.ext.proto_usage_count_max;
206-
207204
if (!show_used) {
208205
*counter_str = '\0';
209206
return;
210207
}
211208

212-
ucs_snprintf_safe(counter_str, size, "%u%s ", proto_attr->selections,
213-
((proto_attr->selections >= proto_usage_count_max) ? "+" :
214-
""));
209+
ucs_snprintf_safe(counter_str, size, "%u ", proto_attr->selections);
215210
}
216211

217212
void

0 commit comments

Comments
 (0)