Skip to content
Snippets Groups Projects
Commit 06d57853 authored by Marcel Koch's avatar Marcel Koch
Browse files

push return statement to end of block

parent 4cfeaece
No related branches found
No related tags found
No related merge requests found
......@@ -304,13 +304,14 @@ def generate_driver():
add_section("instat", "Set up instationary stuff...")
add_section("printing", "Maybe print residuals and matrices to stdout...")
add_section("error", "Maybe calculate errors for test results...")
add_section("return_stmt", "Return statement...")
if get_option("instrumentation_level") >= 1:
from dune.codegen.generation import post_include
post_include("HP_DECLARE_TIMER(driver);\n", filetag="driver")
contents.insert(0, Line(text="HP_TIMER_START(driver);\n"))
contents.insert(len(contents) - 1, Line(text="HP_TIMER_STOP(driver);\n"))
contents.insert(len(contents) - 1, Line(text="DUMP_TIMER({}, driver, {}, true);\n".format(get_option("instrumentation_level"), timestream)))
contents.insert(len(contents) - 2, Line(text="HP_TIMER_STOP(driver);\n"))
contents.insert(len(contents) - 2, Line(text="DUMP_TIMER({}, driver, {}, true);\n".format(get_option("instrumentation_level"), timestream)))
contents.insert(0, Line(text="\n"))
driver_body = Block(contents)
......
......@@ -186,8 +186,7 @@ def compare_L2_squared():
" {} = true;".format(fail)]
@preamble(section="error")
@preamble(section="return_stmt")
def return_statement():
from dune.codegen.pdelab.driver.error import name_test_fail_variable
fail = name_test_fail_variable()
return "return {};".format(fail)
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