Configuration

From sygnm
Jump to: navigation, search

General information

sygnm usually reads its configuration from a configuration file. In some clients, this can be specified as a command line argument (--core.config_file <filename>) and further configurations can be passed as command line arguments. When used as a library, the configuration must be passed as an argument to the initialization function.

In some clients, if there is no user-specified configuration file given, sygnm tries to read its configuration from the user configuration path, or if there is no such configuration file, tries to create it based on the default configuration (if available). However, this behavior must be enabled explicitly when sygnm is used as a library. For more information on the behavior of specific clients, see Using sygnm.

The current user configuration path is read from the environment in the following order (first valid one is used):

  • SYGNM_USER_CONFIG_PATH environment variable
  • XDG_CONFIG_HOME environment variable (on Linux)
  • HOME/.config (on Linux)
  • The .config directory in the user's home folder, looked up by syscall (on Linux)
  • The current working directory (where sygnm was started from)

The used path is written to the log at startup. sygnm must have write access to this path.

Configuration file format

The configuration is stored in text files using the INI format. Most configuration options are required, and an error is raised the first time sygnm tries to read their value if they don't appear in the configuration file. All configuration options in the configuration file must have a non-empty value, empty values will raise an error when the configuration is loaded.

List of configuration options

The following is a list of configuration options for all sygnm components.

Name

Component

Type

Required[1]

Description

core.config_file

sygnm-core

String

No

Name of the configuration file to be loaded (this option is useful as a command line argument).

core.load_user_config

sygnm-core

Boolean

No

If true and core.config_file is not specified, sygnm will try to load (or create) the user configuration file in the user configuration path.

core.locale

sygnm-core

String

Yes

The locale to be used (for example en_US.UTF-8).

core.maximum_thread_count

sygnm-core

Integer

Yes

The maximal number of threads the sygnm system can use beside the main thread (including packages), -1 means no limit.

core.use_implementation_name_aliases

sygnm-core

Boolean

Yes

If enabled, sygnm functions can be called using their C++ implementation names in interactive mode.

core.skip_startup_consistency_checks

sygnm-core

Boolean

No

If enabled, sygnm will not check type system consistency at startup. This check may take a long time and is only necessary if changes were made to the packages in use (i.e. a new package was added, a package was removed or an existing package was changed).

core.package_paths

sygnm-core

String list

Yes

List of paths where sygnm looks for packages.

core.automatic_package_discovery

sygnm-core

Boolean

Yes

If enabled, sygnm will automatically load all packages it finds (otherwise packages will only be loaded if explicitly listed in the configuration).

core.packages

sygnm-core

String list

Yes

List of packages to be loaded, used only if automatic packages discovery is disabled.

core.enable_opencl

sygnm-core

Boolean

Yes

Enables OpenCL management in sygnm core.

core.opencl.preferred_platforms

sygnm-core

Integer list

Yes

A list of OpenCL platform IDs in order of preference.

opencl.platform.<platform id>.preferred_devices

sygnm-core

Integer list

Yes

A list of OpenCL device IDs for the given platform, in order of preference.

core.enable_logging

sygnm-core

Boolean

Yes

Enables logging. This option in itself will not cause any log messages to be displayed.

core.log_to_internal_buffer

sygnm-core

Boolean

Yes

If logging is enabled, this option will store previous log messages in a buffer which can be accessed throught the sygnm API.

core.internal_log_buffer_size

sygnm-core

Integer

Yes

Maximal number of log messages stored in the internal log buffer.

core.log_to_stderr

sygnm-core

Boolean

Yes

Enables printing log messages to the standard error stream (stderr).

core.log_to_syslog

sygnm-core

Boolean

Yes

Enables logging to the syslog daemon. This option requires that sygnm was compiled with the SYGNM_ENABLE_SYSLOG[2] option.

core.log_message_format

sygnm-core

String

Yes

Log message format.

core.node_renderer

sygnm-core

String

Yes

The ID of the renderer which is used by the sygnm::node::rdr() and sygnm::node::urdr() functions in the sygnm API.

core.log_to_file

sygnm-core

Boolean

Yes

Enables logging to a log file.

core.logfile

sygnm-core

String

Yes

The path and name of the log file.

core.syslog.local_address

sygnm-core

Network address

Yes

Syslog local address. This option requires that sygnm was compiled with the SYGNM_ENABLE_SYSLOG[3] option.

core.syslog.local_port

sygnm-core

Integer

Yes

Syslog local port. This option requires that sygnm was compiled with the SYGNM_ENABLE_SYSLOG[4] option.

core.syslog.target_address

sygnm-core

Network address

Yes

Syslog target address. This option requires that sygnm was compiled with the SYGNM_ENABLE_SYSLOG[5] option.

core.syslog.target_port

sygnm-core

Integer

Yes

Syslog target port. This option requires that sygnm was compiled with the SYGNM_ENABLE_SYSLOG[6] option.

core.io_interface

sygnm-core

String

Yes

The ID of the I/O interface which is loaded on starting sygnm as a standalone executable.

core.history.default.maximum_history_item_count

sygnm-core

Integer

Yes

Maximal number of previous results to keep in the default history object.

core.history.<id>.maximum_history_item_count

sygnm-core

Integer

Yes

Maximal number of previous results to keep in the history object with the given ID.

core.cache.default.maximum_cache_item_count

sygnm-core

Integer

Yes

Maximal number of items in the default cache.

core.cache.<id>.maximum_cache_item_count

sygnm-core

Integer

Yes

Maximal number of items in the cache with the given ID.

global_evaluation_context_init_parser

sygnm-core

String

Yes

The ID of the parser which is used to parse global evaluation context key-value pairs at initialization.

global_evaluation_context.precision

sygnm-core

sygnm expression[7]

Yes

Precision of numerical evaluation.

global_evaluation_context.<key>

sygnm-core

sygnm expression

No

User-specified key-value pairs which are loaded into the global evaluation context at initialization.

<package name>.dependencies

sygnm packages

String list

No

List of packages which this package depends on.

flint.reserved_threads

sygnm packages

Integer

Yes

Number of threads reserverd for functions in the FLINT library. The threads are reserved from the global thread limit of sygnm core.

irc.parser

sygnm-irc

String

Yes

Parser to use in the IRC client.

irc.renderer

sygnm-irc

String

Yes

Renderer to use in the IRC client.

irc.server.address

sygnm-irc

Network address

Yes

The address of the IRC server.

irc.server.port

sygnm-irc

Integer

Yes

The port of the IRC server.

irc.username

sygnm-irc

String

Yes

Nickname to use on the IRC server.

irc.channel

sygnm-irc

String

Yes

Name of the channel to join on the IRC server.

cli.parser

sygnm-cli

String

Yes

Parser to use in the command line client.

cli.renderer

sygnm-cli

String

Yes

Renderer to use in the command line client.

discord.token

sygnm-discord

String

Yes

Discord bot token.

discord.parser

sygnm-discord

String

Yes

Parser to use in the Discord bot.

discord.renderer

sygnm-discord

String

Yes

Renderer to use in the Discord bot.

  1. ^  sygnm-core configuration options are required for all sygnm components, however configuration options of other components are required only if the component is used.
  2. ^  Syslog support is disabled by default, since the syslog daemon can transmit log messages over the network which is against the sygnm core policy of no network connections and no telemetry.
  3. ^  Must evaluate to a signed machine integer.