To use these Python APIs:
- Set environment variable
PYTHONPATHto the path of the module amd_instrument.py, located in: <uProf Install Directory>/lib/x64/python/. - Import the module
amd_instrument, which defines the domain/task APIs.
There are two groups of APIs: Python APIs and C++ based APIs, for supporting domain and task. APIs from one group cannot be mixed with APIs for another group.
| API and Description | Parameters | Returns |
|---|---|---|
|
This creates the domain and the task and begins the task. |
domain_task_name: This is "::" separated domain
task combination string in the format
Example: |
Nothing |
|
amd_end_task(domain) This marks the end of the last (latest) task in the specified domain. |
domain: the domain from which the last task to be marked as end. | Nothing |
import amd_instrument as a
#... other code e.g. function calls and/or statements
a. amd_start_task("DomainABC::TaskPQR")
# ... blocking function calls and/or statements, considered within this task
# or non-blocking function calls and/or statements, not considered within tasks
a.amd_end_task(“DomainABC”)
| API and Description | Parameters | Returns |
|---|---|---|
|
This API take a domain name string and return a domain, which is used in the task_begin(...) API. |
domain: the domain name as string under which current task is being considered. | domain that was created. |
|
This API takes, a domain created in and returned by domain_create(...) API and takes the task name. It defines the starting point of the task. |
domain: the domain returned from the domain_create(...) call. task: the task name as string |
Nothing |
|
This API takes the domain_create(...) created in and returned by domain_create(...) API and marks the end of the task which was last created within the same domain. |
domain: the domain returned from the domain_create(...) call. | Nothing |
import amd_instrument as a
#... other code e.g. function calls and/or statements
d = a.domain_create("DomainABC")
a.task_begin(d, "TaskPQR")
# ... blocking function calls and/or statements, considered within this task
# or non-blocking function calls and/or statements, not considered within tasks
a.task_end(d)