Python API General Description

Interface Overview

The Profiling module provides the msPTI Python API to collect performance data of each module.

For details about the functions and usage examples of the msPTI API, see msPTI Tool.

Interface List

APIs are listed below.

Table 1 msPTI Python APIs

InterfaceDescription
HcclMonitor TypeHcclMonitor Description
HcclMonitor.startMarks the start of the communication operator profiling.
HcclMonitor.stopMarks the end of the communication operator profiling.
HcclMonitor.flush_allCalls the callback function to write all activity data in the buffer to the user memory.
HcclMonitor.set_buffer_sizeSets the size of the activity buffer before profiling starts.
KernelMonitor TypeKernelMonitor Description
KernelMonitor.startMarks the start of the Kernel profiling.
KernelMonitor.stopMarks the end of the Kernel profiling.
KernelMonitor.flush_allCalls the callback function to write all activity data in the buffer to the user memory.
KernelMonitor.set_buffer_sizeSets the size of the activity buffer before profiling starts.
MstxMonitor TypeDescription of MstxMonitor
MstxMonitor.startMarks the start of msTX marker data collection.
MstxMonitor.stopMarks the end of msTX marker data collection.
MstxMonitor.enable_domainEnables the profiling for a specific domain.
MstxMonitor.disable_domainDisables the profiling for a specific domain.
MstxMonitor.flush_allCalls the callback function to write all activity data in the buffer to the user memory.
MstxMonitor.set_buffer_sizeSets the size of the activity buffer before profiling starts.
CommunicationMonitor TypeCommunicationMonitor Description
CommunicationMonitor.startMarks the start of the communication operator profiling.
CommunicationMonitor.stopMarks the end of the communication operator profiling.
CommunicationMonitor.flush_allCalls the callback function to write all activity data in the buffer to the user memory.
CommunicationMonitor.set_buffer_sizeSets the size of the activity buffer before profiling starts.
Data structure typeDescription of Data Structure
HcclDataStruct corresponding to the activity record type MSPTI_ACTIVITY_KIND_HCCL.
KernelDataStruct corresponding to the activity record type MSPTI_ACTIVITY_KIND_KERNEL.
MarkerDataStruct corresponding to the activity record type MSPTI_ACTIVITY_KIND_MARKER.
RangeMarkerDataStructure corresponding to MSPTI_ACTIVITY_KIND_MARKER of the activity record type.
CommunicationDataStruct corresponding to the activity record type MSPTI_ACTIVITY_KIND_COMMUNICATION.
Enumeration typeEnumeration description
msptiResultError and result code returned by msPTI.
msptiActivityKindAll activity types supported by msPTI.
msptiActivityFlagActivity record flag.
msptiActivitySourceKindActivity data source.
msptiCommunicationDataTypeData type transmitted by the communication operator.