Changes between Version 2 and Version 3 of Prefs2


Ignore:
Timestamp:
Sep 8, 2019, 5:50:38 PM (5 years ago)
Author:
davea
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Prefs2

    v2 v3  
    44
    55"Dynamic" parameters limit BOINC activity
    6 and change in response to various factors.
     6and change in response to various factors external to BOINC.
    77Examples include limits on #CPUs, RAM usage, network usage, etc.
    88
     
    1010
    1111The "prefs dictionary" is a name -> value map,
    12 containing values that can affect dynamic prefs.
     12containing values that can affect dynamic params.
    1313Examples:
    1414
     
    2020
    2121These values are updated by the client.
    22 
    23 External programs can add items to the dictionary,
     22In addition, external programs can add items to the dictionary,
    2423and update their values, via GUI RPCs.
    2524Hence the prefs system is extensible without modifying the client.
     
    3736 * "greater than": the value of the item is greater than a number X.
    3837 * "nonzero": the value of the item is nonzero (i.e. Boolean true)
    39  * "time range": the value of the item (a time value) lies in a set of day/week intervals.
     38 * "time range": the value of the item (usually "time") lies in a set of day/week intervals.
    4039
    4140A term can also have a "negate" flag, which if set reverses its sense.
     
    4544<term>
    4645   <item>item-name</item>
    47    <type>x</type>     // 0 = greater than, 1 = nonzero, 2 = time range
     46   <type>x</type>                  // 0 = greater than, 1 = nonzero, 2 = time range
    4847   [<negate/>]
    49    [<thresh>x</thresh>]         // if greater than
    50    [time range]                 // if time range
     48   [<thresh>x</thresh>]            // if greater than
     49   [<time_range>...</time_range>]  // if time range
    5150</term>
    5251}}}
     
    5857   [
    5958   <day>
    60       <day_of_week>x</day_of_week>
     59      <day_of_week>x</day_of_week>    // 0 .. 6
    6160      <start_hour>x</start_hour>
    6261      <end_hour>y</end_hour>
     
    7675</condition>
    7776}}}
     77
     78If the set if empty, the condition is always true.
    7879
    7980== Clauses ==
     
    105106If the condition is true, we overwrite X with C's dynamic parameters.
    106107At the conclusion, X is the dynamic parameters to be enforced by the client.
     108
     109== Example ==
     110
     111The following says to use all the CPUs and 90% of the RAM if
     112there has been no user input in 3 minutes,
     113and to use 50% of the CPUs and 50% of the RAM otherwise:
     114{{{
     115<computing_prefs>
     116   <clause>
     117      <condition></condition>
     118      <dynamic_params>
     119         <max_ncpus_pct>50</max_ncpus_pct>
     120         <ram_max_used_frac>.5</ram_max_used_frac>
     121      </dynamic_params>
     122   </clause>
     123   <clause>
     124      <condition>
     125         <term>
     126            <type>gt</type>
     127            <item>idle_time</time>
     128            <value>180</value>
     129         </term>
     130      </condition>
     131      <dynamic_params>
     132         <max_ncpus_pct>100</max_ncpus_pct>
     133         <ram_max_used_frac>.9</ram_max_used_frac>
     134      </dynamic_params>
     135   </clause>
     136</computing_prefs>
     137}}}