Skip to main content
OpenDC2 is no longer being developed

This page documents OpenDC2. OpenDC3 can still run OpenDC2 experiment files with opendc --legacy run, but new features are only added to OpenDC3. See the OpenDC3 documentation, or Migrating to OpenDC3.

Allocation policy

An allocation policy decides on which host each task runs, and when. The type selects the kind of policy:

TypeDescription
prefabA ready-made policy, selected by name. See prefabs.
filterA policy built from filters and weighers.
timeshiftA filter policy that also delays tasks while the carbon intensity is high. See time-shifting.

Filter policies​

A filter policy places each task in two steps:

  1. The filters remove the hosts that cannot run the task.
  2. The weighers rank the remaining hosts. Each weigher's score is weighted by its multiplier. A negative multiplier prefers low values instead of high ones.

The task goes to the best host, or to a random host among the subsetSize best hosts.

FieldTypeDefaultDescription
filterslist of filters[{ "type": "Compute" }]The filters, all of which a host must pass.
weigherslist of weighers[]The weighers that rank the hosts.
subsetSizeinteger1The number of best hosts from which one is picked at random.
{
"type": "filter",
"filters": [
{ "type": "Compute" },
{ "type": "VCpu", "allocationRatio": 1.0 },
{ "type": "Ram" }
],
"weighers": [
{ "type": "Ram", "multiplier": 1.0 }
]
}

Filters​

TypeFieldsKeeps the hosts that
Computeare up.
VCpuallocationRatio (default 1.0)have enough free CPU cores. An allocationRatio above 1 allows overcommitting cores.
VCpuCapacityhave cores at least as fast as the task needs.
RamallocationRatio (default 1.0)have enough free memory. Do not change allocationRatio: overcommitting memory is not supported.
InstanceCountlimitrun fewer than limit tasks.
SameHostCurrently has no effect.
DifferentHostCurrently has no effect.

Weighers​

Every weigher has a multiplier (default 1.0).

TypeScores a host by
Ramits free memory.
CoreRamits free memory per core.
InstanceCountthe number of tasks it runs.
VCpuCapacityits CPU capacity.
VCpuhow few CPU cores are provisioned on it. A higher score means fewer cores in use.

Time-shifting​

A timeshift policy filters and weighs hosts like a filter policy, but also delays deferrable tasks while the carbon intensity is high, as long as they can still meet their deadline. Tasks shorter than two hours use shortForecastThreshold, longer tasks use longForecastThreshold. The carbon intensity comes from the carbon trace of the power source.

FieldTypeDefaultDescription
filterslist of filters[{ "type": "Compute" }]The filters, all of which a host must pass.
weigherslist of weighers[]The weighers that rank the hosts.
subsetSizeinteger1The number of best hosts from which one is picked at random.
forecastbooleantrueCompare the carbon intensity with a forecast. Otherwise, compare it with the mean of the last windowSize values.
forecastSizeinteger24The number of forecasted values to compare with.
shortForecastThresholdnumber0.2The carbon intensity is low for short tasks when it is below this quantile of the forecast.
longForecastThresholdnumber0.35The same, for long tasks.
windowSizeinteger168The number of past values in the mean.
memorizebooleantrueUse the faster memorizing scheduler, which places each task on a fitting host with the fewest tasks and ignores the weighers.
taskStoppertask stoppernoneAlso pauses running tasks while the carbon intensity is high.

Task stopper​

FieldTypeDefaultDescription
forecastbooleantrueUse a forecast instead of past values.
forecastSizeinteger24The number of forecasted values.
forecastThresholdnumber0.6The threshold, between 0 and 1, above which tasks are paused.
windowSizeinteger168The number of past values used.
{
"type": "timeshift",
"filters": [{ "type": "Compute" }, { "type": "VCpu" }, { "type": "Ram" }],
"weighers": [{ "type": "Ram" }],
"shortForecastThreshold": 0.2,
"longForecastThreshold": 0.35,
"taskStopper": { "forecastThreshold": 0.6 }
}

Prefabs​

A prefab is a ready-made policy, selected by name. The name is not case-sensitive.

{ "type": "prefab", "policyName": "Mem" }

Unless noted otherwise, the prefabs use the Compute, VCpu and Ram filters. The GPU prefabs also check that a host has enough free GPU cores.

PrefabWeighersNotes
MemRam (1.0)The default policy. Uses only the VCpu and Ram filters.
MemInvRam (-1.0)
CoreMemCoreRam (1.0)
CoreMemInvCoreRam (-1.0)
ActiveServersInstanceCount (-1.0)
ActiveServersInvInstanceCount (1.0)
ProvisionedCoresVCpu (1.0)
ProvisionedCoresInvVCpu (-1.0)
RandomnonePicks a random host that passes the filters.
TaskNumMemorizingnonePlaces each task on a fitting host with the fewest tasks.
TimeshiftRam (1.0)With time-shifting, using its defaults.
ProvisionedCpuGpuCoresVCpu (1.0), GPU cores (1.0)GPU prefab.
ProvisionedCpuGpuCoresInvVCpu (-1.0), GPU cores (-1.0)GPU prefab.
GpuTaskMemorizingnoneGPU prefab. Places each task on a fitting host with the fewest tasks.