.. _userguide-execute_case:

********
Run case
********

To execute a case, you have to go to the *History View*.


Select stages to execute
========================

.. |stage_reuse| image:: /images/rt_reuse.png
.. |stage_run| image:: /images/rt_run.png
.. |stage_skip| image:: /images/rt_skip.png

Before starting the calculation, the user must choose the stages to perform.
To do this, he must click on the icons of the stages he wants to execute in his
calculation:

* |stage_run| to execute a stage,
* |stage_skip| to skip a stage,
* |stage_reuse| to reuse results of the previous calculation for a stage (see
  below).

.. note::
    If a stage is selected for execution, the previous stages are also
    automatically selected.

    Likewise, if a stage is skipped, the following stages are skipped as well.

    By default, if there are previous results, they are reused.

The **Reusable** check box allows the user to specify whether or not to collect
results from a previous calculation.

To start the calculation, the user have to specify the parameters of execution
and press **Run** button. Execution parameters panel allows the user defining
the execution parameters, such as a server to use, a maximum memory size,
a maximum execution time...

.. figure:: /images/execute_case.png
    :alt: Execution parameters
    :align: center

    **Execution parameters**


The selected stages are then executed one after another.

Animated hourglass icon indicates a stage (or stages) being calculated.

.. figure:: /images/case_execution.png
   :alt: Case execution
   :align: center

   **Case execution**


The stages for which the calculation is succeeded appears in **green**,
failed stages are shown in **red**.

Stages for which previous results have not been kept are displayed in a lighter
color.

.. figure:: /images/case_execution2.png
   :alt: Calculation results
   :align: center

   **Calculation results**


Track calculations
==================

The user can follow the execution using the tools located in the lower part of
the window.

.. figure:: /images/results.png
    :alt: Track calculations toolbar
    :align: center

    **Track calculations toolbar**


Output and messages
===================

The lower part of the window provides access to the output files of the
execution and messages issued during the calculation (informations, alerts,
errors).

The *Output* tab allows viewing the log output produced for each run case.

The drop-down list allows displaying a message file generated during the
execution.

The search box on the right allows you searching the text.
The searched text is highlighted, and the user can browse its occurrences with
the previous / next buttons.

.. figure:: /images/execution_output.png
    :alt: Output tab
    :align: center

    **Output tab**


The *Messages* tab allows viewing the error, warning or information messages
generated during the execution.

The user can filter out the messages by categories by activating the buttons
corresponding to each of the types of messages. It can also filter out 
messages by stages or by source by selecting the desired elements from the
drop-down lists.

.. figure:: /images/execution_messages.png
    :alt: Messages tab
    :align: center

    **Messages tab**


Re-run case
===========

It is possible to re-run a case by re-executing only some of its stages and
starting from the results of previous executions.

To do this, the user must select the run of which he wishes to reuse the
results, then select from the context menu *Copy As Current*.

.. figure:: /images/reuse_case.png
   :alt: Reuse case results
   :align: center

   **Reuse case results**


The user can then choose to re-use the results of the first stages by choosing
the option "reuse" |stage_reuse|.

.. figure:: /images/reuse_case2.png
    :alt: Run case with reusing previous results
    :align: center

    **Run case with reusing previous results**


It is thus possible to make several successive calculations.

.. figure:: /images/reuse_case3.png
    :alt: Successive executions
    :align: center

    **Successive executions**


.. warning::
    You must **always select** the *Current Case* (first node of the tree)
    to start a calculation.

The *Operations > Re-run* main menu (*Case View* tab) allows quickly re-execute
the *Current case* with the same parameters as were used in the previous
execution.
