--- myst: substitutions: bloc1: python: 1-5,16-73,76-79 cpp: 4-8,14-61,64-67 bloc2: python: "51" cpp: "39" bloc3: python: 63-65 cpp: 51-53 bloc4: python: 71-73 cpp: 59-61 bloc5: python: 7,8 cpp: 10,11 bloc6: python: "9" cpp: "12" bloc7: python: 2-30 cpp: 5-33 dedent: python: ":dedent:\n" cpp: "" --- (use_cases_macro_relauncher_sequential_failure)= # Macro "**relauncherCodeFlowrateSequentialFailure.{{extension}}**" ## Objective The goal of this macro is to show how to handle when a code is returning an error status. Up to version v4.5.0, the input configuration was simply discarded while from any version now, there are discarded but they can be retrieved and store in a dedicated `TDataServer` object. The code used here is the usual `flowrate` model which has been modified to return a non zero exit status without producing an output file. ## Macro {{ "```{literalinclude} " + parent_dir + "/roottest/uranie/doc/relauncher/use_cases/" + language + "/relauncherCodeFlowrateSequentialFailure." + extension + "\n" + ":language: " + language + "\n" + ":lines: " + bloc1[language] + "\n" + "```" }} Here there are very few differences with the one already introduced in [](#use_cases_macro_relauncher_sequential_macro). The first one is obviously the command line which is called using `"-rf"` argument, the f being introduced for failure. {{ "```{literalinclude} " + parent_dir + "/roottest/uranie/doc/relauncher/use_cases/" + language + "/relauncherCodeFlowrateSequentialFailure." + extension + "\n" + ":language: " + language + "\n" + ":lines: " + bloc2[language] + "\n" + "```" }} The second difference is the creation of the failure dataserver object in which all wrong configurations will be stored. Once created, it is simply passed to the launcher object through the dedicated method `setSaveError`: {{ "```{literalinclude} " + parent_dir + "/roottest/uranie/doc/relauncher/use_cases/" + language + "/relauncherCodeFlowrateSequentialFailure." + extension + "\n" + ":language: " + language + "\n" + ":lines: " + bloc3[language] + "\n" + dedent[language] + "```" }} Once done the code is run and two things are looked at: the fact that in a peculiar area of the input space there are no data anymore (by construction, as shown in {numref}`usecases_relauncherCodeFlowrateSequentialFailure`) and the fact that all configurations are now stored in a dedicated `TDataServer` object which one can dump on screen with the command line below to obtain the second part of the console output seen in [](#use_cases_macro_relauncher_sequential_failure_console) {{ "```{literalinclude} " + parent_dir + "/roottest/uranie/doc/relauncher/use_cases/" + language + "/relauncherCodeFlowrateSequentialFailure." + extension + "\n" + ":language: " + language + "\n" + ":lines: " + bloc4[language] + "\n" + dedent[language] + "```" }} The first part of the console output shown in [](#use_cases_macro_relauncher_sequential_failure_console) is a perfect illustration of the way the relauncher module is discussion failure: the first part is stating that a non-zero return value has been detected {{ "```{literalinclude} " + parent_dir + "/roottest/build/uranie/doc/relauncher/use_cases/" + language + "/relauncherCodeFlowrateSequentialFailure_clean.log" + "\n" + ":language: none\n" + ":lines: " + bloc5[language] + "\n" + "```" }} The second part is letting the user know that no output file has been found (a second reason to consider this configuration as a failure). {{ "```{literalinclude} " + parent_dir + "/roottest/build/uranie/doc/relauncher/use_cases/" + language + "/relauncherCodeFlowrateSequentialFailure_clean.log" + "\n" + ":language: none\n" + ":lines: " + bloc6[language] + "\n" + "```" }} This pattern is repeated every time a configuration is wrong. ## Graph {{ "```{" "figure" "} " + parent_dir + "/roottest/build/uranie/doc/relauncher/use_cases/" + language + "/sequential_fail/relauncherCodeFlowrateSequentialFailure.png\n" ":align: center\n" ":name: usecases_relauncherCodeFlowrateSequentialFailure\n" + figure_scale + "\n" "\n" "Representation of the output data point when the code is asked to fail on purpose.\n" "```" }} ```{raw} latex \begin{landscape} ``` (use_cases_macro_relauncher_sequential_failure_console)= ## Console {{ "```{literalinclude} " + parent_dir + "/roottest/build/uranie/doc/relauncher/use_cases/" + language + "/relauncherCodeFlowrateSequentialFailure_clean.log" + "\n" + ":language: none\n" + ":lines: " + bloc7[language] + "\n" + "```" }} ```{raw} latex \end{landscape} ```