9. Environment variables

There are several environment variables which you can use to control the behaviour of PopART.

9.1. Logging

PopART can output information about its activity as described in Turning on execution tracing. You can control the default level of logging information using environment variables.

9.1.1. POPART_LOG_LEVEL

This controls the amount of information written to the log output for all modules. Finer control can be achieved using POPART_LOG_CONFIG.

9.1.2. POPART_LOG_DEST

This variable defines the output for the logging information. The value can be “stdout”, “stderr” or a file name.

The default, if not defined, is “stderr”.

9.1.3. POPART_LOG_CONFIG

If set, this variable defines the name of a configuration file which specifies the logging level for each module. This is a JSON format file with pairs of module:level strings. For example, a file called conf.py can be specified by setting the environment variable:

export POPART_LOG_CONFIG=conf.py

To set the logging level of the devicex and session modules, conf.py would contain:

{
  "devicex":"INFO",
  "session":"WARN"
}

These values override the value specified in POPART_LOG_LEVEL.

9.2. Generating DOT files

9.2.1. POPART_DOT_CHECKS

PopART can output a graphical representation of the graph, in DOT format, when it constructs the intermediate representation (IR). The stages of IR construction where the DOT files is generated is controlled by this variable.

Supported values:

  • FWD0

  • FWD1

  • BWD0

  • PREALIAS

  • FINAL

  • ALL

These values may be combined using “:” as a separator. The example below shows how to set POPART_DOT_CHECKS to export DOT graphs for the FWD0 and FINAL stages.

export POPART_DOT_CHECKS=FWD0:FINAL

The values in POPART_DOT_CHECKS will be combined with any values that are defined in the session options.

9.3. Inspecting the Ir

9.3.1. POPART_IR_DUMP

If set, this variable defines the name of a file where the serialised ir will be written. The ir will be written either at the end of the ir preparation phase, or when an exception is thrown during the ir preparation phase.