# 4.16. Restart Reference

Restart is used in analyses that may not complete in a single job submission and might complete when continued from a previous termination time. Fuego maintains the ability to restart a previous analysis by recording the internal state variables of a problem in a restart database. In this case the input mesh is supplied from a Finite Element Model block and the restart information is obtained from the restart data. See the command reference for a detailed description of the lines possible when defining this block.

Note

Often one wishes to initialize an analysis with results from another analysis (e.g. a steady simulation fed into a transient IC). In these cases, a full restart is not necessary. Instead Input Output Region can be used to initialize specific fields of interest using the results of the other simulation.

If one believes that a simulation might run too long, and wishes to record restart databases, they need only to add a restart data block as follows:

    # Scope: Sierra > Procedure > Fuego Region
    Begin restart data data
      at step 0, increment = 1
      database name = restart.e
    End

The restart database uses the same output scheduling logic as the results/heartbeat output, and can similarly be given an output scheduler block in place of specifying the commands in the restart block.

To restart a simulation, one must specify either the restart time to start at, or enable automatic restart (latest available time, start of simulation if not found) at Sierra scope. Fuego will read the given database name for the required restart information

    Begin Sierra Job
      # Scope: Sierra!
      RESTART TIME = 0.00125
      # or: RESTART = auto

      ...
      Begin Procedure theProcedure
          ...

          Begin Fuego Region Fuego_region
            ...

            # Scope: Sierra > Procedure > Fuego Region
            Begin restart data data
              ...

              # Pointing to a previously created restart database
              database name = restart.e
            End
          End Fuego Region

        End Procedure theProcedure
    End Sierra Job

Warning

Specifying an input database name that does not exist would skip restart in previous versions, but this behavior is deprecated and moving forward will be treated as an error. To recover this behavior, one should specify only a database name line which will be used as both the input and output database. Alternatively, one can use an Aprepro switch to switch between reading and writing a restart database e.g.

    # Scope: Sierra!
    # is_restart = {is_restart = 0} # default to off
    {if(is_restart)}
    RESTART = auto
    {endif}

    # Scope: Sierra > Procedure > Fuego Region
    Begin restart data data
      ...

      {if(is_restart)}
        input database name = restart.e
      {else}
        output database name = restart.e
      {endif}
    End

The same input can then be used by adding an Aprepro definition to the restart launch line

    #First run
    launch -n 8 fuego -i fuego.i

    #Restart run
    launch -n 8 fuego -i fuego.i --define "is_restart=1"

To save space, options are provided to minimize the retained restart data. These options include

> - Cycle Count - Cycle timesteps within a single DB file

> - File Cycle Count - Cycle timesteps within individual DB files

> - Overlay Count -

>     Overwrite intermediate time steps within a single DB file