Documentation
¶
Overview ¶
Package noctracing provides a speficied tracer implementation for the mesh.
Index ¶
- Constants
- Variables
- func DiscretizeVTimeInSecToSlicedTimeInUint(time sim.VTimeInSec) (uint, bool)
- func ParseTileIDFromTaskWhereString(where string) (from, to [3]int)
- type MeshEdgeInfo
- type MeshInfo
- type MeshMetaInfo
- type MeshNetworkTracer
- type MeshNodeInfo
- type MeshOverviewInfoFrameToDump
- type MeshTraceRecord
- type TaskWorkers
- type TwoDimMapForEdgeInfo
Constants ¶
const (
TimeSliceUnit sim.VTimeInSec = 0.000001000
)
Variables ¶
var MeshMsgDataOrCommandMap = map[string]string{
"*cache.FlushReq": "C",
"*cache.FlushRsp": "C",
"*mem.DataReadyRsp": "D",
"*mem.ReadReq": "C",
"*mem.WriteDoneRsp": "C",
"*mem.WriteReq": "D",
"*protocol.FlushReq": "C",
"*protocol.LaunchKernelReq": "C",
"*protocol.MapWGReq": "C",
"*protocol.WGCompletionMsg": "C",
"*vm.TranslationReq": "C",
"*vm.TranslationRsp": "D",
}
MeshMsgDataOrCommandMap maps the msg type string to a binary classification, i.e., data or command msg.
var MeshMsgTypesGroupMap = map[string]string{
"*cache.FlushReq": "Others",
"*cache.FlushRsp": "Others",
"*mem.DataReadyRsp": "Read",
"*mem.ReadReq": "Read",
"*mem.WriteDoneRsp": "Write",
"*mem.WriteReq": "Write",
"*protocol.FlushReq": "Others",
"*protocol.LaunchKernelReq": "Others",
"*protocol.MapWGReq": "Others",
"*protocol.WGCompletionMsg": "Others",
"*vm.TranslationReq": "Translation",
"*vm.TranslationRsp": "Translation",
}
MeshMsgTypesGroupMap maps the msg type string to a classification, like Read/ Write/Translation/Others.
var MeshMsgTypesToTrace = map[string]uint8{
"*cache.FlushReq": 0,
"*cache.FlushRsp": 1,
"*mem.DataReadyRsp": 2,
"*mem.ReadReq": 3,
"*mem.WriteDoneRsp": 4,
"*mem.WriteReq": 5,
"*protocol.FlushReq": 6,
"*protocol.LaunchKernelReq": 7,
"*protocol.MapWGReq": 8,
"*protocol.WGCompletionMsg": 9,
"*vm.TranslationReq": 10,
"*vm.TranslationRsp": 11,
}
MeshMsgTypesToTrace maps the msg type string to an enumerated ID.
var MeshMsgTypesToTraceList = []string{
"*cache.FlushReq",
"*cache.FlushRsp",
"*mem.DataReadyRsp",
"*mem.ReadReq",
"*mem.WriteDoneRsp",
"*mem.WriteReq",
"*protocol.FlushReq",
"*protocol.LaunchKernelReq",
"*protocol.MapWGReq",
"*protocol.WGCompletionMsg",
"*vm.TranslationReq",
"*vm.TranslationRsp",
}
MeshMsgTypesToTraceList is a slice of the msg type strings.
var NumMeshMsgTypesToTrace = 12
NumMeshMsgTypesToTrace is the total number of msg types to trace.
Functions ¶
func DiscretizeVTimeInSecToSlicedTimeInUint ¶
func DiscretizeVTimeInSecToSlicedTimeInUint(time sim.VTimeInSec) (uint, bool)
DiscretizeVTimeInSecToSlicedTimeInUint discretize the time into uint.
func ParseTileIDFromTaskWhereString ¶
ParseTileIDFromTaskWhereString is a parser to extract tile IDs from string related to network tracing records.
Types ¶
type MeshEdgeInfo ¶
type MeshEdgeInfo struct { // Data only for backend compution Time2ValArray map[uint]([]uint64) `json:"-"` // Data for JSON-format serialization to feed frontend as edge info SourceID uint32 `json:"source"` TargetID uint32 `json:"target"` ValArray []uint64 `json:"value"` LinkName string `json:"label,omitempty"` // not used at present Detail string `json:"detail,omitempty"` // not used at present }
MeshEdgeInfo is used to store mesh edge info.
type MeshInfo ¶
type MeshInfo struct { Meta *MeshMetaInfo Nodes []*MeshNodeInfo Edges []*MeshEdgeInfo Overview map[uint]([]uint64) // contains filtered or unexported fields }
MeshInfo is used to store all info of a certain mesh.
func MakeMeshInfo ¶
MakeMeshInfo builds a MeshInfo struct with some arguments as meta info.
func (*MeshInfo) AppendEdgeInfo ¶
AppendEdgeInfo appends edge info, then update edge matrix and count buffers.
func (*MeshInfo) AppendOverviewInfo ¶
AppendOverviewInfo appends overview with time slice and msg type.
func (*MeshInfo) DumpToFiles ¶
DumpToFiles dumps MeshInfo to directory `meshmetrics` or something similar, this method is NOT reentrant due to `padBlankFrameAfterTimeEnd` operation.
type MeshMetaInfo ¶
type MeshMetaInfo struct { Width string `json:"width"` Height string `json:"height"` TimeSliceUnit string `json:"slice"` // time slice size of simulation Elapse string `json:"elapse"` }
MeshMetaInfo is used to store mesh meta info (e.g., width, height).
type MeshNetworkTracer ¶
type MeshNetworkTracer struct {
// contains filtered or unexported fields
}
MeshNetworkTracer is a task tracer that can store the tasks of mesh tracing into a series metrics files.
func NewMeshNetworkTracer ¶
func NewMeshNetworkTracer( timeTeller sim.TimeTeller, numHungryConsumer int, tileWidth, tileHeight uint16, outputDirName string, ) *MeshNetworkTracer
NewMeshNetworkTracer returns a new MeshNetworkTracer.
func NewMeshNetworkTracerWithTimeRange ¶
func NewMeshNetworkTracerWithTimeRange( timeTeller sim.TimeTeller, startTime, endTime sim.VTimeInSec, numHungryConsumer int, tileWidth, tileHeight uint16, outputDirName string, ) *MeshNetworkTracer
NewMeshNetworkTracerWithTimeRange creates a MeshTracer which can only trace the tasks that at least partially overlaps with the given start and end time. If the start time is negative, the tracer will start tracing at the beginning of the simulation. If the end time is negative, the tracer will not stop tracing until the end of the simulation.
func (*MeshNetworkTracer) EndTask ¶
func (t *MeshNetworkTracer) EndTask(task tracing.Task)
EndTask writes the task into the database.
func (*MeshNetworkTracer) Init ¶
func (t *MeshNetworkTracer) Init()
Init create the goroutines for task workers.
func (*MeshNetworkTracer) StartTask ¶
func (t *MeshNetworkTracer) StartTask(task tracing.Task)
StartTask marks the start of a task.
func (*MeshNetworkTracer) StepTask ¶
func (t *MeshNetworkTracer) StepTask(task tracing.Task)
StepTask marks a milestone during the execution of a task.
type MeshNodeInfo ¶
type MeshNodeInfo struct { // Data only for backend compution X uint16 `json:"-"` Y uint16 `json:"-"` // Data for JSON-format serialization to feed frontend as node info ID uint32 `json:"id"` Name string `json:"label,omitempty"` Detail string `json:"detail,omitempty"` }
MeshNodeInfo is used to store mesh node info.
type MeshOverviewInfoFrameToDump ¶
type MeshOverviewInfoFrameToDump struct { FrameIdx uint `json:"id"` MsgExactType string `json:"type"` MsgTypeGroup string `json:"group"` MsgDataOrCommand string `json:"doc"` Count uint64 `json:"count"` MaxFlits uint64 `json:"max_flits"` }
MeshOverviewInfoFrameToDump is used to store mesh overview. Note: only support time bar overview here.
type MeshTraceRecord ¶
type MeshTraceRecord struct {
// contains filtered or unexported fields
}
MeshTraceRecord is the record of a mesh tracing. Note: only support one GPU with one mesh currently
type TaskWorkers ¶
type TaskWorkers struct {
// contains filtered or unexported fields
}
TaskWorkers stores the data to the trace file.
func (*TaskWorkers) AppendRecord ¶
func (w *TaskWorkers) AppendRecord(r MeshTraceRecord)
AppendRecord appends a record to the task worker.
func (*TaskWorkers) LaunchHungryConsumers ¶
func (w *TaskWorkers) LaunchHungryConsumers()
LaunchHungryConsumers launches the hungry consumer worker.
func (*TaskWorkers) LaunchWriteWorker ¶
func (w *TaskWorkers) LaunchWriteWorker(m *MeshInfo)
LaunchWriteWorker launches the write worker.
type TwoDimMapForEdgeInfo ¶
type TwoDimMapForEdgeInfo = map[uint32]map[uint32](*MeshEdgeInfo)
TwoDimMapForEdgeInfo maps [x, y] to the edge(x -> y) info.