Python API General Description
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.
APIs are listed below.
Table 1 msPTI Python APIs
| Interface | Description |
|---|---|
| HcclMonitor Type | HcclMonitor Description |
| HcclMonitor.start | Marks the start of the communication operator profiling. |
| HcclMonitor.stop | Marks the end of the communication operator profiling. |
| HcclMonitor.flush_all | Calls the callback function to write all activity data in the buffer to the user memory. |
| HcclMonitor.set_buffer_size | Sets the size of the activity buffer before profiling starts. |
| KernelMonitor Type | KernelMonitor Description |
| KernelMonitor.start | Marks the start of the Kernel profiling. |
| KernelMonitor.stop | Marks the end of the Kernel profiling. |
| KernelMonitor.flush_all | Calls the callback function to write all activity data in the buffer to the user memory. |
| KernelMonitor.set_buffer_size | Sets the size of the activity buffer before profiling starts. |
| MstxMonitor Type | Description of MstxMonitor |
| MstxMonitor.start | Marks the start of msTX marker data collection. |
| MstxMonitor.stop | Marks the end of msTX marker data collection. |
| MstxMonitor.enable_domain | Enables the profiling for a specific domain. |
| MstxMonitor.disable_domain | Disables the profiling for a specific domain. |
| MstxMonitor.flush_all | Calls the callback function to write all activity data in the buffer to the user memory. |
| MstxMonitor.set_buffer_size | Sets the size of the activity buffer before profiling starts. |
| CommunicationMonitor Type | CommunicationMonitor Description |
| CommunicationMonitor.start | Marks the start of the communication operator profiling. |
| CommunicationMonitor.stop | Marks the end of the communication operator profiling. |
| CommunicationMonitor.flush_all | Calls the callback function to write all activity data in the buffer to the user memory. |
| CommunicationMonitor.set_buffer_size | Sets the size of the activity buffer before profiling starts. |
| Data structure type | Description of Data Structure |
| HcclData | Struct corresponding to the activity record type MSPTI_ACTIVITY_KIND_HCCL. |
| KernelData | Struct corresponding to the activity record type MSPTI_ACTIVITY_KIND_KERNEL. |
| MarkerData | Struct corresponding to the activity record type MSPTI_ACTIVITY_KIND_MARKER. |
| RangeMarkerData | Structure corresponding to MSPTI_ACTIVITY_KIND_MARKER of the activity record type. |
| CommunicationData | Struct corresponding to the activity record type MSPTI_ACTIVITY_KIND_COMMUNICATION. |
| Enumeration type | Enumeration description |
| msptiResult | Error and result code returned by msPTI. |
| msptiActivityKind | All activity types supported by msPTI. |
| msptiActivityFlag | Activity record flag. |
| msptiActivitySourceKind | Activity data source. |
| msptiCommunicationDataType | Data type transmitted by the communication operator. |