Skip to content

Commit 6177e3a

Browse files
committed
UCP/CORE: Optional warnings about unused config modifications. Reverted.
This reverts commit 9b13ceb.
1 parent 7cb0dac commit 6177e3a

File tree

4 files changed

+18
-50
lines changed

4 files changed

+18
-50
lines changed

src/ucp/core/ucp_context.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -592,11 +592,6 @@ static ucs_config_field_t ucp_context_config_table[] = {
592592
"resulting performance.",
593593
ucs_offsetof(ucp_context_config_t, node_local_id), UCS_CONFIG_TYPE_ULUNITS},
594594

595-
{UCP_WARN_UNUSED_CONFIG_MODIFICATIONS, "y",
596-
"Issue a warning about configuration modifications which were not applied.",
597-
ucs_offsetof(ucp_context_config_t, warn_unused_config_modifications),
598-
UCS_CONFIG_TYPE_BOOL},
599-
600595
{NULL}
601596
};
602597

src/ucp/core/ucp_context.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -221,8 +221,6 @@ typedef struct ucp_context_config {
221221
int proto_use_single_net_device;
222222
/** Local identificator on a single node */
223223
unsigned long node_local_id;
224-
/** Issue a warning in case of unused configuration modifications */
225-
int warn_unused_config_modifications;
226224
} ucp_context_config_t;
227225

228226

@@ -596,9 +594,6 @@ typedef struct ucp_tl_iface_atomic_flags {
596594
ucs_assert(ucp_memory_type_detect(_context, _buffer, _length) == (_mem_type))
597595

598596

599-
#define UCP_WARN_UNUSED_CONFIG_MODIFICATIONS "WARN_UNUSED_CONFIG_MODIFICATIONS"
600-
601-
602597
extern ucp_am_handler_t *ucp_am_handlers[];
603598
extern const char *ucp_feature_str[];
604599

src/ucp/core/ucp_worker.c

Lines changed: 18 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2294,37 +2294,30 @@ ucs_thread_mode_t ucp_worker_get_thread_mode(uint64_t worker_flags)
22942294
return UCS_THREAD_MODE_SINGLE;
22952295
}
22962296

2297-
static void ucp_warn_unused_config_modifications(const ucp_context_h context)
2297+
static void ucp_warn_unused_uct_config(ucp_context_h context)
22982298
{
2299-
const ucs_config_cached_key_t *key;
2300-
ucs_string_buffer_t unused_modifications;
2301-
unsigned num_unused_modifications;
2299+
unsigned num_unused_cached_kv = 0;
2300+
ucs_string_buffer_t unused_cached_uct_cfg;
2301+
ucs_config_cached_key_t *key_val;
23022302

2303-
if (!context->config.ext.warn_unused_config_modifications) {
2304-
return;
2305-
}
2306-
2307-
ucs_string_buffer_init(&unused_modifications);
2308-
num_unused_modifications = 0;
2303+
ucs_string_buffer_init(&unused_cached_uct_cfg);
23092304

2310-
ucs_list_for_each(key, &context->cached_key_list, list) {
2311-
if (!key->used) {
2312-
ucs_string_buffer_appendf(&unused_modifications, "%s=%s,", key->key,
2313-
key->value);
2314-
++num_unused_modifications;
2305+
ucs_list_for_each(key_val, &context->cached_key_list, list) {
2306+
if (!key_val->used) {
2307+
ucs_string_buffer_appendf(&unused_cached_uct_cfg, "%s=%s,",
2308+
key_val->key, key_val->value);
2309+
++num_unused_cached_kv;
23152310
}
23162311
}
23172312

2318-
if (num_unused_modifications > 0) {
2319-
ucs_string_buffer_rtrim(&unused_modifications, ",");
2320-
ucs_warn("unused configuration%s: %s\n"
2321-
"(set %s%s=n to suppress this warning)",
2322-
(num_unused_modifications > 1) ? "s" : "",
2323-
ucs_string_buffer_cstr(&unused_modifications),
2324-
UCS_DEFAULT_ENV_PREFIX, UCP_WARN_UNUSED_CONFIG_MODIFICATIONS);
2313+
if (num_unused_cached_kv > 0) {
2314+
ucs_string_buffer_rtrim(&unused_cached_uct_cfg , ",");
2315+
ucs_warn("invalid configuration%s: %s",
2316+
(num_unused_cached_kv > 1) ? "s" : "",
2317+
ucs_string_buffer_cstr(&unused_cached_uct_cfg));
23252318
}
23262319

2327-
ucs_string_buffer_cleanup(&unused_modifications);
2320+
ucs_string_buffer_cleanup(&unused_cached_uct_cfg);
23282321
}
23292322

23302323
static void
@@ -2684,7 +2677,8 @@ ucs_status_t ucp_worker_create(ucp_context_h context,
26842677
*/
26852678
ucs_config_parser_print_env_vars_once(context->config.env_prefix);
26862679

2687-
ucp_warn_unused_config_modifications(context);
2680+
/* Warn unused cached uct configuration */
2681+
ucp_warn_unused_uct_config(context);
26882682

26892683
ucp_worker_set_max_am_header(worker);
26902684

test/gtest/ucp/test_ucp_context.cc

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -118,19 +118,3 @@ UCS_TEST_P(test_ucp_version, version_string) {
118118
}
119119

120120
UCP_INSTANTIATE_TEST_CASE_TLS(test_ucp_version, all, "all")
121-
122-
class test_unused_config_modifications : public test_ucp_context {
123-
public:
124-
test_unused_config_modifications()
125-
{
126-
ucp_config_modify(m_ucp_config, "QWERTY", "QWERTY");
127-
ucp_config_modify(m_ucp_config, "WARN_UNUSED_CONFIG_MODIFICATIONS",
128-
"n");
129-
}
130-
};
131-
132-
UCS_TEST_P(test_unused_config_modifications, hidden_warning)
133-
{
134-
}
135-
136-
UCP_INSTANTIATE_TEST_CASE_TLS(test_unused_config_modifications, self, "self")

0 commit comments

Comments
 (0)