Skip to content

Commit

Permalink
Quote loop names in loop-report and spot (LLNL#348)
Browse files Browse the repository at this point in the history
  • Loading branch information
daboehme authored Mar 11, 2021
1 parent edf720c commit 637bba4
Show file tree
Hide file tree
Showing 10 changed files with 49 additions and 49 deletions.
2 changes: 1 addition & 1 deletion src/mpi/controllers/LoopReportController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ class LoopReportController : public cali::ChannelController
{ "let", block },
{ "select", select },
{ "group by", "Block" },
{ "where", std::string("loop=")+loopname }
{ "where", std::string("loop=\"")+loopname+"\"" }
}, false);

return local_aggregate(c, db, CalQLParser(query.c_str()).spec());
Expand Down
2 changes: 1 addition & 1 deletion src/mpi/controllers/SpotController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ class SpotTimeseriesController : public cali::ChannelController
{ "let", block },
{ "select", select },
{ "group by", "cali.channel,loop,block" },
{ "where", std::string("loop.start_iteration,loop=") + loopname }
{ "where", std::string("loop.start_iteration,loop=\"") + loopname + "\"" }
}, false /* no aliases */);

local_aggregate(query.c_str(), c, channel(), db, output_agg);
Expand Down
2 changes: 1 addition & 1 deletion test/ci_app_tests/ci_test_macros.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ int main(int argc, char* argv[])
count = std::max(1, std::stoi(argv[3]));
}

CALI_CXX_MARK_LOOP_BEGIN(mainloop, "mainloop");
CALI_CXX_MARK_LOOP_BEGIN(mainloop, "main loop");

for (int i = 0; i < count; ++i) {
CALI_CXX_MARK_LOOP_ITERATION(mainloop, i);
Expand Down
6 changes: 3 additions & 3 deletions test/ci_app_tests/test_basictrace.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,8 +230,8 @@ def test_macros(self):
self.assertTrue(cat.has_snapshot_with_attributes(
snapshots, {
'function' : 'main',
'loop' : 'mainloop',
'iteration#mainloop' : '3' }))
'loop' : 'main loop',
'iteration#main loop' : '3' }))
self.assertTrue(cat.has_snapshot_with_attributes(
snapshots, {
'function' : 'main/foo',
Expand All @@ -244,7 +244,7 @@ def test_macros(self):
self.assertTrue(cat.has_snapshot_with_attributes(
snapshots, {
'function' : 'main/foo',
'loop' : 'mainloop/fooloop',
'loop' : 'main loop/fooloop',
'iteration#fooloop' : '3' }))

def test_property_override(self):
Expand Down
8 changes: 4 additions & 4 deletions test/ci_app_tests/test_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def test_jsontree(self):

target_cmd = [ './ci_test_macros' ]
query_cmd = [ '../../src/tools/cali-query/cali-query',
'-q', 'SELECT count(),sum(time.inclusive.duration),loop,iteration#mainloop group by loop,iteration#mainloop format json-split' ]
'-q', 'SELECT count(),sum(time.inclusive.duration),loop,iteration#main\ loop group by loop,iteration#main\ loop format json-split' ]

caliper_config = {
'CALI_CONFIG_PROFILE' : 'serial-trace',
Expand All @@ -77,7 +77,7 @@ def test_jsontree(self):

columns = obj['columns']

self.assertEqual( { 'path', 'iteration#mainloop', 'count', 'sum#time.inclusive.duration' }, set(columns) )
self.assertEqual( { 'path', 'iteration#main loop', 'count', 'sum#time.inclusive.duration' }, set(columns) )

data = obj['data']

Expand All @@ -92,13 +92,13 @@ def test_jsontree(self):

nodes = obj['nodes']

self.assertEqual(nodes[0]['label' ], 'mainloop')
self.assertEqual(nodes[0]['label' ], 'main loop')
self.assertEqual(nodes[0]['column'], 'path')
self.assertEqual(nodes[1]['label' ], 'fooloop')
self.assertEqual(nodes[1]['column'], 'path')
self.assertEqual(nodes[1]['parent'], 0)

iterindex = columns.index('iteration#mainloop')
iterindex = columns.index('iteration#main loop')

# Note: this is a pretty fragile test
self.assertEqual(data[9][iterindex], 3)
Expand Down
8 changes: 4 additions & 4 deletions test/ci_app_tests/test_loopreport.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ def test_loopreport_summary(self):

log_targets = [
'Loop summary:',
'Loop Iterations Time (s)',
'mainloop 20'
'Loop Iterations Time (s)',
'main loop 20'
]

report_out,_ = cat.run_test(target_cmd, caliper_config)
Expand All @@ -40,7 +40,7 @@ def test_loopreport_timeseries(self):
}

log_targets = [
'Iteration summary (mainloop):',
'Iteration summary (main loop):',
'Block Iterations Time (s)',
' 0 15',
' 30 15',
Expand Down Expand Up @@ -95,7 +95,7 @@ def test_loopreport_target_loop_selection(self):

log_targets = [
'Iteration summary (fooloop):',
'mainloop/fooloop 400',
'main loop/fooloop 400',
'Block Iterations Time (s)',
' 0 100',
' 5 100',
Expand Down
24 changes: 12 additions & 12 deletions test/ci_app_tests/test_monitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def test_loopmonitor_iter_interval(self):
caliper_config = {
'CALI_SERVICES_ENABLE' : 'loop_monitor,trace,report',
'CALI_LOOP_MONITOR_ITERATION_INTERVAL' : '5',
'CALI_REPORT_CONFIG' : 'select * where iteration#mainloop format expand',
'CALI_REPORT_CONFIG' : 'select * where iteration#main\ loop format expand',
'CALI_REPORT_FILENAME' : 'stdout',
'CALI_LOG_VERBOSITY' : '0'
}
Expand All @@ -24,8 +24,8 @@ def test_loopmonitor_iter_interval(self):

self.assertTrue(len(snapshots) == 2)
self.assertTrue(cat.has_snapshot_with_attributes(
snapshots, { 'iteration#mainloop' : '4',
'loop.iterations' : '5'
snapshots, { 'iteration#main loop' : '4',
'loop.iterations' : '5'
}))

def test_loopmonitor_time_interval(self):
Expand Down Expand Up @@ -67,16 +67,16 @@ def test_loopmonitor_target_loop(self):

self.assertEqual(len(snapshots), 20)
self.assertTrue(cat.has_snapshot_with_attributes(
snapshots, { 'iteration#mainloop' : '3',
'iteration#fooloop' : '4',
'loop.iterations' : '5',
'loop' : 'mainloop/fooloop'
snapshots, { 'iteration#main loop' : '3',
'iteration#fooloop' : '4',
'loop.iterations' : '5',
'loop' : 'main loop/fooloop'
}))
self.assertTrue(cat.has_snapshot_with_attributes(
snapshots, { 'iteration#mainloop' : '7',
'iteration#fooloop' : '9',
'loop.iterations' : '5',
'loop' : 'mainloop/fooloop'
snapshots, { 'iteration#main loop' : '7',
'iteration#fooloop' : '9',
'loop.iterations' : '5',
'loop' : 'main loop/fooloop'
}))

def test_regionmonitor_time_interval(self):
Expand All @@ -95,7 +95,7 @@ def test_regionmonitor_time_interval(self):

self.assertTrue(len(snapshots) == 4)
self.assertTrue(cat.has_snapshot_with_attributes(
snapshots, { 'loop' : 'mainloop/fooloop',
snapshots, { 'loop' : 'main loop/fooloop',
'function' : 'main/foo'
}))
self.assertFalse(cat.has_snapshot_with_attributes(
Expand Down
36 changes: 18 additions & 18 deletions test/ci_app_tests/test_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def test_report_nested_key(self):

caliper_config = {
'CALI_SERVICES_ENABLE' : 'event,trace,report',
'CALI_REPORT_CONFIG' : 'select *,count() group by prop:nested,iteration#mainloop format expand',
'CALI_REPORT_CONFIG' : 'select *,count() group by prop:nested,iteration#main\ loop format expand',
'CALI_LOG_VERBOSITY' : '0'
}

Expand All @@ -61,16 +61,16 @@ def test_report_nested_key(self):

self.assertTrue(cat.has_snapshot_with_attributes(
snapshots, { 'function' : 'main/foo',
'loop' : 'mainloop',
'loop' : 'main loop',
'annotation' : 'pre-loop',
'statement' : 'foo.init',
'iteration#mainloop' : '2',
'iteration#main loop' : '2',
'count' : '1'
}))
self.assertTrue(cat.has_snapshot_with_attributes(
snapshots, { 'function' : 'main/foo',
'loop' : 'mainloop/fooloop',
'iteration#mainloop' : '3',
'loop' : 'main loop/fooloop',
'iteration#main loop' : '3',
'count' : '9'
}))

Expand All @@ -88,8 +88,8 @@ def test_report_class_iteration(self):

self.assertTrue(cat.has_snapshot_with_attributes(
snapshots, { 'function' : 'main/foo',
'loop' : 'mainloop/fooloop',
'iteration#mainloop' : '3',
'loop' : 'main loop/fooloop',
'iteration#main loop' : '3',
'iteration#fooloop' : '1',
'count' : '1'
}))
Expand All @@ -99,7 +99,7 @@ def test_report_aggregation_aliases(self):

caliper_config = {
'CALI_SERVICES_ENABLE' : 'event,trace,report',
'CALI_REPORT_CONFIG' : 'select *,count() as my\\ count\\ alias group by prop:nested,iteration#mainloop format expand',
'CALI_REPORT_CONFIG' : 'select *,count() as my\\ count\\ alias group by prop:nested,iteration#main\ loop format expand',
'CALI_LOG_VERBOSITY' : '0'
}

Expand All @@ -108,17 +108,17 @@ def test_report_aggregation_aliases(self):

self.assertTrue(cat.has_snapshot_with_attributes(
snapshots, { 'function' : 'main/foo',
'loop' : 'mainloop',
'loop' : 'main loop',
'annotation' : 'pre-loop',
'statement' : 'foo.init',
'iteration#mainloop' : '2',
'my count alias' : '1'
'iteration#main loop' : '2',
'my count alias' : '1'
}))
self.assertTrue(cat.has_snapshot_with_attributes(
snapshots, { 'function' : 'main/foo',
'loop' : 'mainloop/fooloop',
'iteration#mainloop' : '3',
'my count alias' : '9'
'loop' : 'main loop/fooloop',
'iteration#main loop' : '3',
'my count alias' : '9'
}))

def test_report_tree_formatter(self):
Expand All @@ -133,7 +133,7 @@ def test_report_tree_formatter(self):
report_targets = [
'Path Count',
'main 1',
' mainloop 5',
' main loop 5',
' foo 4',
' fooloop 20',
' pre-loop 4',
Expand Down Expand Up @@ -161,9 +161,9 @@ def test_report_table_formatter(self):
}

report_targets = [
'loop count',
'mainloop/fooloop 4',
'mainloop 1'
'loop count',
'main loop/fooloop 4',
'main loop 1'
]

report_output,_ = cat.run_test(target_cmd, caliper_config)
Expand Down
4 changes: 2 additions & 2 deletions test/ci_app_tests/test_runtimereport.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def test_runtime_report_default(self):
log_targets = [
'Path',
'main',
' mainloop',
' main loop',
' foo',
' fooloop'
]
Expand All @@ -43,7 +43,7 @@ def test_runtime_report_nompi(self):
log_targets = [
'Time (E) Time (I) Time % (E) Time % (I)',
'main',
' mainloop',
' main loop',
' foo',
' fooloop'
]
Expand Down
6 changes: 3 additions & 3 deletions test/ci_app_tests/test_textlog.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ def test_textlog(self):

caliper_config = {
'CALI_SERVICES_ENABLE' : 'event,textlog',
'CALI_TEXTLOG_TRIGGER' : 'iteration#mainloop',
'CALI_TEXTLOG_FORMATSTRING' : '%function% iteration: %[2]iteration#mainloop',
'CALI_TEXTLOG_TRIGGER' : 'iteration#main\ loop',
'CALI_TEXTLOG_FORMATSTRING' : '%function% iteration: %[2]iteration#main loop%',
'CALI_LOG_VERBOSITY' : '0',
}

Expand Down Expand Up @@ -44,7 +44,7 @@ def test_textlog_autostring(self):
}

log_targets = [
'loop=mainloop/fooloop'
'loop=main loop/fooloop'
]

report_out,_ = cat.run_test(target_cmd, caliper_config)
Expand Down

0 comments on commit 637bba4

Please sign in to comment.