algorithm

package
v0.0.0-...-f46da47 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 7, 2021 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DCAPS

func DCAPS(programs []*ProgramMetric, oldSchemes []*pqos.CLOSScheme, numWays, numSets, numClos int) []*pqos.CLOSScheme

DCAPS算法修改版。 oldScheme可以为nil,此时将使用初始化方案。当不为nil时,将用于平滑两次分配方案之间的改变。 numClos至少为3,前两个CLOS不会使用,预留给其他类型的进程l 为保证性能,将不会检查输入。

func LoadRthFromCsv

func LoadRthFromCsv(f io.Reader) []int

func WriteAsCsv

func WriteAsCsv(rth []int, writer io.Writer)

Types

type AETModel

type AETModel interface {
	// 论文中的P计算
	// 若t大与样本的最大再使用时间,结果将会不再准确。最大再使用时间由输入决定。
	ProbabilityReuseTimeGreaterThan(t int) float32

	// 计算出缓存行数量为cacheSize时候的Average Eviction Time。
	// 返回值单位为访问次数。
	// 如果cacheSize很大,将会达到最大样本的reuseTime值,再继续增大结果将不变
	AET(cacheSize int) int

	// 计算出缓存行数量为cacheSize时候的Miss Rate
	MR(cacheSize int) float32

	// 计算Miss Rate Curve
	MRC(cacheSize int) []float32
}

func NewAETModel

func NewAETModel(rth []int) AETModel

func NewAETModelFromFile

func NewAETModelFromFile(file io.Reader) (AETModel, error)

type ProgramMetric

type ProgramMetric struct {
	Pid      int
	MRC      []float32
	PerfStat *perf.StatResult
}

DCAPS算法输入。以进程为单位进行分配的计算。

type RTHCalculator

type RTHCalculator interface {
	Update(traces []uint64)
	GetRTH(maxTime int) []int
}

func FullTraceCalculator

func FullTraceCalculator() RTHCalculator

func ReservoirCalculator

func ReservoirCalculator(reservoirSize int) RTHCalculator

type ShenModel

type ShenModel struct {
	// contains filtered or unexported fields
}

func NewShenModel

func NewShenModel(rth []int) *ShenModel

func (*ShenModel) ReuseDistanceHistogram

func (m *ShenModel) ReuseDistanceHistogram() []float64

ReuseDistanceHistogram 根据当前的所有地址,计算出现在的Reuse Time Histogram

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL