Computing preferences, version 2

This document describes a new system for "computing preferences" in BOINC. This system lets users express, as a set of logical rules, how resource usage settings vary as a function of external factors.

Note: the motivation for this is discussed here; that document is otherwise deprecated.

The goals of this system include:

  • Generality: allow the expression of any preferences.
  • Extensibility: make it possible to add new external factors (such as the current cost of electricity) without modifying the client.

Static and dynamic settings

Various "settings" control and limit BOINC's use of computing, memory, storage, and network communication.

"Dynamic" settings can change in response to factors external to BOINC (such as time of day, non-BOINC CPU usage, etc.). These include:

CPU throttling fraction (0..1)
don't run any jobs
dont_use_gpu [type][device]
don't run GPU jobs. Optional GPU type (nvidia, amd, intel) and device #.
don't do file xfers
don't do any network communication at all
max download data rate
max upload data rate
max # of CPUs to use
max % of CPUs to use
max fraction of RAM to use

"Static" settings don't vary over time. These include:

ask before creating network connection
time between rescheduling jobs
max disk usage
max % of disk to use
min free disk space
don't verify image files
hang up modem connection when done
suspend (rather than quit) non-running jobs
when request work, ask for this much beyond min
keep at least this much work

The XML representation of setting groups:

   [ <max_ncpus_pct>x</max_ncpus_pct> ]

   [ <disk_max_used_gb>x</disk_max_used_gb> ]

All elements are optional; a group can define some elements but not others. If A and B are setting groups, the "overlay of A on B" is defined as A together with any elements in B that are not defined in A.

Prefs dictionary

External factors are stored in a "prefs dictionary", which is a name -> value map. The following entries are maintained by the BOINC client:

# seconds since last user input
time of day
system is running on batteries
whether a given application is running
fraction of CPU used for non-BOINC apps recently
number of MB of file transfer in last N days
system is running on AC power (Android)
system is running on USB power (Android)
WiFi network connection exists (Android)
system thinks user is active (Android)
battery charge level, 0..100 (Android)
battery temperature, Centigrade (Android)

In addition, external programs can add items to the dictionary, and update their values, via GUI RPCs. Hence the prefs system is extensible without modifying the client.

Values are doubles; Booleans are encoded as 0/1.

Preference terms

Preferences are expressed in terms of "conditions" that are the conjunction of a set of "terms".

Each term is an assertion about a dictionary item. There are three types of assertions:

  • "greater than": the value of the item is greater than a number X.
  • "nonzero": the value of the item is nonzero (i.e. Boolean true)
  • "time range": the value of the item (usually "time") lies in a set of day/week intervals.
  • "app_running": an app of the given name is running

A term can also have a "not" flag, which if set reverses its sense.

The XML representation of a term:

   <type>x</type>                  // greater_than, nonzero, time_range, app_running
   [<thresh>x</thresh>]            // if greater than
   [<time_range>...</time_range>]  // if time range

The representation of a time range:

      <day>x</day>                 // 0 .. 6
   ... other days of week

x and y are hours (0..24). The first start/end apply to all days. This is overwritten by day_of_week elements.


A "condition" is the conjunction ("and") of a set of terms, possibly negated. XML format:

   <term> ... </term>

The conjunction of an empty set of terms is true.


A "clause" is the combination of a condition and a dynamic setting group. XML format:

   <condition> ... </condition>
   <settings> ... </settings>

Preference sets

A "preference set" is a list of clauses. XML format:

   <clause> ... </clause>
   <static_settings> ... <static_settings>

The semantics are as follows. X is a dynamic setting group, initially empty. The clauses are processed in order. For each clause C, evaluate its condition. If the condition is true, overlay X with C's dynamic settings. At the conclusion, X is the dynamic settings to be enforced by the client.


The following says to use all the CPUs and 90% of the RAM if there has been no user input in 3 minutes, and to use 50% of the CPUs and 50% of the RAM otherwise:

Last modified 2 months ago Last modified on 11/22/19 18:24:09