Documentation ¶
Index ¶
- Variables
- func CalcCoverageScore(coverage *CovStats, obj Objective) float64
- func CalcFullCoverageScore(allCoverage map[int]*CovStats, obj Objective) float64
- func CoverageUnion(cov1, cov2 *CovStats)
- func GetCoverageEstimate(allCoverage map[int]*CovStats, newCoverage *CovStats, procID int, ...) float64
- type Action
- type ActionType
- type BlockInfo
- type CovStats
- type Explorer
- func (e *Explorer) BuildActionStats()
- func (e *Explorer) GetNextAction(threads *[]ProcThread, events *[]dara.Event, coverage *CovStats, ...) Action
- func (e *Explorer) GetNextProcess(numProcs int) int
- func (e *Explorer) GetNextThread(nextPossibleThreads *[]ProcThread, events *[]dara.Event, coverage *CovStats) *ProcThread
- func (e *Explorer) GetNextTimer(clock *VirtualClock, ProcID int) *ProcTimer
- func (e *Explorer) PrintCurrentCoverage()
- func (e *Explorer) RestartExploration()
- func (e *Explorer) SaveStateSpaceResults(filename string) error
- func (e *Explorer) SaveVisitedSchedules() error
- func (e *Explorer) SetMaxDepth(depth int)
- func (e *Explorer) UpdateActionCoverage(events *[]dara.Event, coverage *CovStats)
- func (e *Explorer) UpdateCurrentActionStats(events *[]dara.Event, coverage *CovStats)
- type Objective
- type ProcThread
- type ProcTimer
- type State
- type Strategy
- type TimeEvent
- type TimeEventType
- type VirtualClock
- func (v *VirtualClock) AddTimerEvent(eventID int, eventType TimeEventType, when uint64, period uint64, gid int64, ...)
- func (v *VirtualClock) GetNextEvent() *TimeEvent
- func (v *VirtualClock) IsSleeping(gid int) bool
- func (v *VirtualClock) SetTick(amount uint64)
- func (v *VirtualClock) Tick(amount uint64)
Constants ¶
This section is empty.
Variables ¶
var (
LogLevel int
)
Functions ¶
func CalcCoverageScore ¶
CalcCoverageScore calculates the coverage score for the coverage of 1 single node for a given objective
func CalcFullCoverageScore ¶
CalcFullCoverageScore calculates the total coverage across all nodes Currently, 3 objective functions are supported. UNIQUE: Score is calculated as total number of unique blocks covered across all nodes (Union-Count) FREQUENCY: Score is calculated as \Sum_{b \in Blocks} \frac{1}{frequency(b)}. Higher score will be for coverage
where all the blocks covered have fewer duplicate blocks
NODE_FREQUENCY: Score is calculated as \Sum_{b \in Blocks} \frac{1}{frequency(b)} * NodeCount(b). Higher score will
be for coverage where more nodes cover a lot of unique blocks without any duplication
func CoverageUnion ¶
func CoverageUnion(cov1, cov2 *CovStats)
CoverageUnion merges the coverage information from cov2 into cov1 cov1 is modified as part of the execution of this function
Types ¶
type Action ¶
type Action struct { Type ActionType Arg interface{} }
Action represents an action that can be scheduled by the system
type ActionType ¶
type ActionType int
ActionType represents the various actions that can be taken by the explorer
const ( RESTART ActionType = iota SCHEDULE TIMER )
Possible Actions
type BlockInfo ¶
BlockInfo represents the information necessary for calculating the coverage score for the block. Currently, it has 2 fields: (i) NumNodes : Number of nodes that covered this block (ii) Frequency : Total number of times this block was covered
type CovStats ¶
CovStats represents the coverage information captured during runtime. It is essentially a pseudonym for a map[string]uint64 Each key is a unique BlockID and value is the # of times the block was reached.
func CoverageDifference ¶
CoverageDifference returns the set difference between cov1 and cov2. For input coverage A, B the output is the set difference A - B.
type Explorer ¶
type Explorer struct {
// contains filtered or unexported fields
}
Explorer is the exploration unit that performs the exploration
func MountExplorer ¶
func MountExplorer(logFilePath string, explorationStrategy Strategy, seed *dara.Schedule, numProcs int, level int) (*Explorer, error)
MountExplorer initializes an explorer
func (*Explorer) BuildActionStats ¶
func (e *Explorer) BuildActionStats()
BuildActionStats builds the action history from the seed schedule. This is important as it prevents
func (*Explorer) GetNextAction ¶
func (e *Explorer) GetNextAction(threads *[]ProcThread, events *[]dara.Event, coverage *CovStats, clocks *map[int]*VirtualClock, isblocked map[int]bool) Action
GetNextAction gets the next action to be executed threads: List of all goroutines in the system events: Events that were executed by the last action coverage: Coverage statistics of the last action clocks: Virtual Clocks of all the processes allCoverage: Total Coverage across all nodes across all runs
func (*Explorer) GetNextProcess ¶
GetNextProcess returns the next process to be scheduled based on the selected strategy
func (*Explorer) GetNextThread ¶
func (e *Explorer) GetNextThread(nextPossibleThreads *[]ProcThread, events *[]dara.Event, coverage *CovStats) *ProcThread
GetNextThread returns the next goroutine to be scheduled based on the previously selected strategy
func (*Explorer) GetNextTimer ¶
func (e *Explorer) GetNextTimer(clock *VirtualClock, ProcID int) *ProcTimer
func (*Explorer) PrintCurrentCoverage ¶
func (e *Explorer) PrintCurrentCoverage()
func (*Explorer) RestartExploration ¶
func (e *Explorer) RestartExploration()
RestartExploration restarts the exploration from scratch Explorer essentially resets its state.
func (*Explorer) SaveStateSpaceResults ¶
func (*Explorer) SaveVisitedSchedules ¶
SaveVisitedSchedules saves the already seen schedules in a log file This is to persist state of the explorer across multiple invocations Currently not enabled. TODO: Make saving/using of old run files an option.
func (*Explorer) SetMaxDepth ¶
SetMaxDepth sets the maximum depth for Depth-Based Exploration
func (*Explorer) UpdateActionCoverage ¶
type Objective ¶
type Objective int
Objective is the type that encapsulates the type of scoring function that needs to be applied
type ProcThread ¶
type ProcThread struct { ProcID int Thread dara.RoutineInfo }
ProcThread represents a unique goroutine in the system The uniqueness is given by a combination of the ProcessID and Goroutine ID
func (*ProcThread) GetStatus ¶
func (p *ProcThread) GetStatus() dara.DaraProcStatus
GetStatus returns the status of the specific goroutine
func (*ProcThread) String ¶
func (p *ProcThread) String() string
String returns a unique string representation for a goroutine in the distributed system The unique string is "P" + DaraProcessID + "T" + goroutineID + "H" + hex_representation of Gpc
type ProcTimer ¶
ProcTimer represents a unique timer in the system The unique ness is given by a combination of the ProcessID and Timer ID
type TimeEvent ¶
type TimeEvent struct { Type TimeEventType When uint64 // When do we need to perform the time related action Period uint64 // if it is a periodic event then it must be fired, well, periodically. GoRoutineID int64 // if it is a sleeping event, we need to know which goroutine to wake up! TimerID int64 // Need to know which timer to fire off }
type VirtualClock ¶
type VirtualClock struct { CurrentTick uint64 WaitingQ map[int]*TimeEvent // The queues are mainly arrays ReadyQ []*TimeEvent // contains filtered or unexported fields }
func NewClock ¶
func NewClock() *VirtualClock
func (*VirtualClock) AddTimerEvent ¶
func (v *VirtualClock) AddTimerEvent(eventID int, eventType TimeEventType, when uint64, period uint64, gid int64, timerID int64)
func (*VirtualClock) GetNextEvent ¶
func (v *VirtualClock) GetNextEvent() *TimeEvent
func (*VirtualClock) IsSleeping ¶
func (v *VirtualClock) IsSleeping(gid int) bool
func (*VirtualClock) SetTick ¶
func (v *VirtualClock) SetTick(amount uint64)
func (*VirtualClock) Tick ¶
func (v *VirtualClock) Tick(amount uint64)