Skip to content

Commit

Permalink
Remove unused CALI_CALIPER_ALLOW_REGION_OVERLAP setting (#570)
Browse files Browse the repository at this point in the history
  • Loading branch information
daboehme authored Jul 9, 2024
1 parent 2d46914 commit 469caeb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 38 deletions.
18 changes: 5 additions & 13 deletions src/caliper/Caliper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -315,8 +315,6 @@ struct Caliper::GlobalData

// --- data

bool allow_region_overlap;

mutable std::mutex attribute_lock;
map<string, Attribute> attribute_map;

Expand Down Expand Up @@ -399,8 +397,6 @@ struct Caliper::GlobalData
attribute_default_scope = CALI_ATTR_SCOPE_THREAD;
else
log_invalid_cfg_value("CALI_CALIPER_ATTRIBUTE_DEFAULT_SCOPE", scope_str.c_str());

allow_region_overlap = config.get("allow_region_overlap").to_bool();
}

void init() {
Expand Down Expand Up @@ -523,10 +519,6 @@ const ConfigSet::Entry Caliper::GlobalData::s_configdata[] = {
" process: Process scope\n"
" thread: Thread scope"
},
{ "allow_region_overlap", CALI_TYPE_BOOL, "false",
"Allow overlapping regions for all attributes",
"Allow overlapping begin/end regions for all attributes."
},

ConfigSet::Terminator
};
Expand Down Expand Up @@ -658,7 +650,7 @@ struct BlackboardEntry
};

inline BlackboardEntry
load_current_entry(const Attribute& attr, cali_id_t key, Blackboard& blackboard, bool allow_overlap)
load_current_entry(const Attribute& attr, cali_id_t key, Blackboard& blackboard)
{
Entry merged_entry = blackboard.get(key);
Entry entry = merged_entry.get(attr);
Expand All @@ -668,7 +660,7 @@ load_current_entry(const Attribute& attr, cali_id_t key, Blackboard& blackboard,
log_stack_error(nullptr, attr);
return { Entry(), Entry() };
}
if (key != UNALIGNED_KEY && !allow_overlap) {
if (key != UNALIGNED_KEY) {
log_stack_error(merged_entry.node(), attr);
return { Entry(), Entry() };
}
Expand Down Expand Up @@ -1028,7 +1020,7 @@ Caliper::end(const Attribute& attr)
std::lock_guard<::siglock>
g(sT->lock);

auto current = load_current_entry(attr, key, *blackboard, sG->allow_region_overlap);
auto current = load_current_entry(attr, key, *blackboard);

if (current.entry.empty()) {
sT->stack_error = true;
Expand Down Expand Up @@ -1068,7 +1060,7 @@ Caliper::end_with_value_check(const Attribute& attr, const Variant& data)
std::lock_guard<::siglock>
g(sT->lock);

auto current = load_current_entry(attr, key, *blackboard, sG->allow_region_overlap);
auto current = load_current_entry(attr, key, *blackboard);

if (current.entry.empty() || data != current.entry.value()) {
log_stack_value_error(current.entry, attr, data);
Expand Down Expand Up @@ -1143,7 +1135,7 @@ Caliper::end(Channel* channel, const Attribute& attr)
g(sT->lock);

BlackboardEntry current =
load_current_entry(attr, key, channel->mP->channel_blackboard, sG->allow_region_overlap);
load_current_entry(attr, key, channel->mP->channel_blackboard);

if (current.entry.empty()) {
sT->stack_error = true;
Expand Down
25 changes: 0 additions & 25 deletions test/ci_app_tests/test_validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,31 +6,6 @@
class CaliperValidatorTest(unittest.TestCase):
""" Caliper validator service test cases """

def test_validator_nesting_error(self):
target_cmd = [ '../cali-test', 'nesting-error' ]

env = {
'CALI_LOG_VERBOSITY' : '1',
'CALI_LOG_LOGFILE' : 'stdout',
'CALI_SERVICES_ENABLE' : 'validator',
'CALI_CALIPER_ALLOW_REGION_OVERLAP' : 'true'
}

log_targets = [
'validator: incorrect nesting: trying to end "test.nesting-error.a"="11" but current attribute is "test.nesting-error.b"',
'validator: Annotation nesting errors found'
]

report_out,_ = cat.run_test(target_cmd, env)
lines = report_out.decode().splitlines()

for target in log_targets:
for line in lines:
if target in line:
break
else:
self.fail('%s not found in log' % target)

def test_validator_unclosed_region(self):
target_cmd = [ '../cali-test', 'unclosed-region' ]

Expand Down

0 comments on commit 469caeb

Please sign in to comment.