Skip to content
Snippets Groups Projects
Commit e8203d45 authored by Dominic Kempf's avatar Dominic Kempf
Browse files

Use an identifer when dumping timings

Multiple executables may share the same identifier!
parent 18222251
No related branches found
No related tags found
No related merge requests found
__name = app_conv_diff_{__exec_suffix} __name = app_conv_diff_{__exec_suffix}
__exec_suffix = deg{formcompiler.ufl_variants.degree}_{opcount_suffix} __exec_suffix = deg{formcompiler.ufl_variants.degree}_{opcount_suffix}_level{formcompiler.instrumentation_level}
opcount_suffix = opcount, nonopcount | expand opcount opcount_suffix = opcount, nonopcount | expand opcount
...@@ -26,6 +26,9 @@ extension = 1.0 | repeat {dim} ...@@ -26,6 +26,9 @@ extension = 1.0 | repeat {dim}
cells = {firstdircells} {otherdircells} cells = {firstdircells} {otherdircells}
partitioning = {ranks} {ones} partitioning = {ranks} {ones}
# Set up the timing identifier
identifier = convdiff_deg{formcompiler.ufl_variants.degree}
[wrapper.vtkcompare] [wrapper.vtkcompare]
name = {__name} name = {__name}
extension = vtu extension = vtu
...@@ -35,7 +38,7 @@ fastdg = 1 ...@@ -35,7 +38,7 @@ fastdg = 1
sumfact = 1 sumfact = 1
vectorize_quad = 1 vectorize_quad = 1
vectorize_grads = 1 vectorize_grads = 1
instrumentation_level = 2 instrumentation_level = 2, 3, 4 | expand
opcounter = 1, 0 | expand opcount opcounter = 1, 0 | expand opcount
time_opcounter = 0, 1 | expand opcount time_opcounter = 0, 1 | expand opcount
exact_solution_expression = g exact_solution_expression = g
......
__name = app_poisson_dg_{dim}d_{__exec_suffix} __name = app_poisson_dg_{__exec_suffix}
__exec_suffix = deg{formcompiler.ufl_variants.degree}_{opcount_suffix} __exec_suffix = deg{formcompiler.ufl_variants.degree}_{opcount_suffix}_level{formcompiler.instrumentation_level}
opcount_suffix = opcount, nonopcount | expand opcount opcount_suffix = opcount, nonopcount | expand opcount
...@@ -21,6 +21,9 @@ dimminusone = {dim} - 1 | eval ...@@ -21,6 +21,9 @@ dimminusone = {dim} - 1 | eval
ones = 1 | repeat {dimminusone} ones = 1 | repeat {dimminusone}
otherdircells = {cellsperdir} | repeat {dimminusone} otherdircells = {cellsperdir} | repeat {dimminusone}
# Set up the timing identifier
identifier = poisson_dg_deg{formcompiler.ufl_variants.degree}
# Setup the grid! # Setup the grid!
extension = 1.0 | repeat {dim} extension = 1.0 | repeat {dim}
cells = {firstdircells} {otherdircells} cells = {firstdircells} {otherdircells}
...@@ -35,7 +38,7 @@ fastdg = 1 ...@@ -35,7 +38,7 @@ fastdg = 1
sumfact = 1 sumfact = 1
vectorize_quad = 1 vectorize_quad = 1
vectorize_grads = 1 vectorize_grads = 1
instrumentation_level = 2 instrumentation_level = 2, 3, 4 | expand
opcounter = 1, 0 | expand opcount opcounter = 1, 0 | expand opcount
time_opcounter = 0, 1 | expand opcount time_opcounter = 0, 1 | expand opcount
......
...@@ -77,26 +77,26 @@ ...@@ -77,26 +77,26 @@
#define DUMP_TIMER(name,os,reset)\ #define DUMP_TIMER(name,os,reset)\
if (HP_TIMER_ELAPSED(name) > 1e-12) \ if (HP_TIMER_ELAPSED(name) > 1e-12) \
os << exec << " " << #name << " time " << HP_TIMER_ELAPSED(name) << std::endl; \ os << ident << " " << #name << " time " << HP_TIMER_ELAPSED(name) << std::endl; \
HP_TIMER_OPCOUNTERS(name).reportOperations(os,exec,#name,reset); HP_TIMER_OPCOUNTERS(name).reportOperations(os,ident,#name,reset);
#define DUMP_AND_ACCUMULATE_TIMER(name,os,reset,time,ops) \ #define DUMP_AND_ACCUMULATE_TIMER(name,os,reset,time,ops) \
if (HP_TIMER_ELAPSED(name) > 1e-12) \ if (HP_TIMER_ELAPSED(name) > 1e-12) \
os << exec << " " << #name << " time " << HP_TIMER_ELAPSED(name) << std::endl; \ os << ident << " " << #name << " time " << HP_TIMER_ELAPSED(name) << std::endl; \
time += HP_TIMER_ELAPSED(name); \ time += HP_TIMER_ELAPSED(name); \
ops += HP_TIMER_OPCOUNTERS(name); \ ops += HP_TIMER_OPCOUNTERS(name); \
HP_TIMER_OPCOUNTERS(name).reportOperations(os,exec,#name,reset); HP_TIMER_OPCOUNTERS(name).reportOperations(os,ident,#name,reset);
#elif defined ENABLE_HP_TIMERS #elif defined ENABLE_HP_TIMERS
#define DUMP_TIMER(name,os,reset) \ #define DUMP_TIMER(name,os,reset) \
if (HP_TIMER_ELAPSED(name) > 1e-12) \ if (HP_TIMER_ELAPSED(name) > 1e-12) \
os << exec << " " << #name << " time " << HP_TIMER_ELAPSED(name) << std::endl; \ os << ident << " " << #name << " time " << HP_TIMER_ELAPSED(name) << std::endl; \
if (reset) HP_TIMER_RESET(name); if (reset) HP_TIMER_RESET(name);
#define DUMP_AND_ACCUMULATE_TIMER(name,os,reset,time,ops) \ #define DUMP_AND_ACCUMULATE_TIMER(name,os,reset,time,ops) \
if (HP_TIMER_ELAPSED(name) > 1e-12) \ if (HP_TIMER_ELAPSED(name) > 1e-12) \
os << exec << " " << #name << " time " << HP_TIMER_ELAPSED(name) << std::endl; \ os << ident << " " << #name << " time " << HP_TIMER_ELAPSED(name) << std::endl; \
time += HP_TIMER_ELAPSED(name); \ time += HP_TIMER_ELAPSED(name); \
if (reset) HP_TIMER_RESET(name); if (reset) HP_TIMER_RESET(name);
......
...@@ -1166,9 +1166,9 @@ def define_timing_stream(name): ...@@ -1166,9 +1166,9 @@ def define_timing_stream(name):
@preamble @preamble
def dump_dof_numbers(stream): def dump_dof_numbers(stream):
exe = name_exec() ident = name_timing_identifier()
return "{} << {} << \" dofs dofs \" << {}.size() << std::endl;".format(stream, return "{} << {} << \" dofs dofs \" << {}.size() << std::endl;".format(stream,
exe, ident,
name_gfs(_driver_data['form'].coefficients()[0].ufl_element())) name_gfs(_driver_data['form'].coefficients()[0].ufl_element()))
...@@ -1222,7 +1222,7 @@ def dune_solve(): ...@@ -1222,7 +1222,7 @@ def dune_solve():
for formdata in formdatas: for formdata in formdatas:
lop_name = name_localoperator(formdata) lop_name = name_localoperator(formdata)
timestream = name_timing_stream() timestream = name_timing_stream()
print_times.append("{}.dump_timers({}, argv[0], true);".format(lop_name, timestream)) print_times.append("{}.dump_timers({}, {}, true);".format(lop_name, timestream, name_timing_identifier()))
solve = ["HP_TIMER_START(solve);", solve = ["HP_TIMER_START(solve);",
"{}".format(solve), "{}".format(solve),
...@@ -1425,13 +1425,14 @@ def setup_timer(): ...@@ -1425,13 +1425,14 @@ def setup_timer():
@preamble @preamble
def define_exec(name): def define_timing_identifier(name):
return "char* {} = argv[0];".format(name) ini = name_initree()
return "auto {} = {}.get<std::string>(\"identifier\", argv[0]);".format(name, ini)
def name_exec(): def name_timing_identifier():
name = "exec" name = "ident"
define_exec(name) define_timing_identifier(name)
return name return name
...@@ -1455,7 +1456,7 @@ def evaluate_residual_timer(): ...@@ -1455,7 +1456,7 @@ def evaluate_residual_timer():
for formdata in formdatas: for formdata in formdatas:
lop_name = name_localoperator(formdata) lop_name = name_localoperator(formdata)
if get_option('instrumentation_level') >= 3: if get_option('instrumentation_level') >= 3:
print_times.append("{}.dump_timers({}, argv[0], true);".format(lop_name, timestream)) print_times.append("{}.dump_timers({}, {}, true);".format(lop_name, timestream, name_timing_identifier()))
if get_option('instrumentation_level') >= 2: if get_option('instrumentation_level') >= 2:
evaluation = ["HP_TIMER_START(residual_evaluation);", evaluation = ["HP_TIMER_START(residual_evaluation);",
...@@ -1495,7 +1496,7 @@ def apply_jacobian_timer(): ...@@ -1495,7 +1496,7 @@ def apply_jacobian_timer():
for formdata in formdatas: for formdata in formdatas:
lop_name = name_localoperator(formdata) lop_name = name_localoperator(formdata)
if get_option('instrumentation_level') >= 3: if get_option('instrumentation_level') >= 3:
print_times.append("{}.dump_timers({}, argv[0], true);".format(lop_name, timestream)) print_times.append("{}.dump_timers({}, {}, true);".format(lop_name, timestream, name_timing_identifier()))
if get_option('instrumentation_level') >= 2: if get_option('instrumentation_level') >= 2:
evaluation = ["HP_TIMER_START(apply_jacobian);", evaluation = ["HP_TIMER_START(apply_jacobian);",
...@@ -1532,7 +1533,7 @@ def assemble_matrix_timer(): ...@@ -1532,7 +1533,7 @@ def assemble_matrix_timer():
for formdata in formdatas: for formdata in formdatas:
lop_name = name_localoperator(formdata) lop_name = name_localoperator(formdata)
if get_option('instrumentation_level') >= 3: if get_option('instrumentation_level') >= 3:
print_times.append("{}.dump_timers({}, argv[0], true);".format(lop_name, timestream)) print_times.append("{}.dump_timers({}, {}, true);".format(lop_name, timestream, name_timing_identifier()))
if get_option('instrumentation_level') >= 2: if get_option('instrumentation_level') >= 2:
assembly = ["HP_TIMER_START(matrix_assembly);", assembly = ["HP_TIMER_START(matrix_assembly);",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment