Skip to main content

CUBE .cubex library parser

Project description

cubex is a Python module for analysing CUBE (.cubex) profiles.

Quick start guide

cubex is still a work in progress, but it is currently useable and the following instructions should help you get started.

To create a new Cube object, open a new file.

>> import cubex
>> prof = cubex.open('profile.cubex')

Use the show_metrics() function to list the available metrics.

>>> prof.show_metrics()
bytes_sent
visits
time
...

By default, cubex does not load all available metrics into memory. To load the desired metric, say time, use the read_data() function.

>> prof.read_data('time')

The Cube stores the call tree in a list, prof.calltrees. For most programs, this will consist of a single entry. For profiles containing multiple executables (MPMD), each program’s calltree will be an element in the list.

The call tree can be printed using the print_calltree() function inside the profile’s calltree.

>> prof.calltrees[0].print_tree()

This displays each node of the call tree, indented by depth, and labeled with its corresponding region.

At this point, it helps if the user has some intuitive feel for the call tree in the profile. (And if anyone has feedback on how to improve this, please submit feedback.)

Having said that, if one knows the function (or “region” in CUBE parlance) of interest, then the data is accessed with the region property.

>> prof.regions[reg].cnodes
[<cubex.calltree.CallTree object at 0x7f4437892f90>,
 <cubex.calltree.CallTree object at 0x7f4437539f10>,
 ...
]

This returns a list of each node (actually subtree) in the call tree where this function was called.

To distinguish between cnodes, one can inspect its call tree (using print_tree()) or inspect its parent node.

>> cnode = prof.regions[reg].cnodes[0]
>> cnode.parent.region.name
'function_name_calling_cnode_'

One can also inspect the node index (cnode.idx) although this requires some knowledge of the tree itself, which can be checked using the CUBE graphical browser.

Finally, to get the metric values at the target cnode, access its metrics property.

>> prof.regions[reg].cnodes[0].metrics['time']
(496.59532077590507, 291.106782542039, 496.5975198073004, ...)

This returns a list of the time measured in each computational unit, such as an MPI rank or OpenMP thread.

Notes

  • Region names follow C conventions. Fortran programs will typically convert any function names to lower case and will append a _ to the end of the function name. For example, a function named GET_LAPLACIAN will be stored as get_laplacian_.

    This is the usual convention, but other compilers may deviate from thisj so it’s recommended that you inspect the regions before accessing them.

  • Currently only Score-P output is supported in the main branch. Scalasca output is slightly different and currently does not work as well in cubex.

    We have some internal versions that do work, but are not yet user-friendly and would need a bit of a cleanup before releasing publicly.

Project details


Release history Release notifications | RSS feed

This version

0.1

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cubex-0.1.tar.gz (9.7 kB view details)

Uploaded Source

File details

Details for the file cubex-0.1.tar.gz.

File metadata

  • Download URL: cubex-0.1.tar.gz
  • Upload date:
  • Size: 9.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for cubex-0.1.tar.gz
Algorithm Hash digest
SHA256 a847b3eaca37cbb848247644301c6c9d5cfa22be43f702360838cf84e4c8034e
MD5 dbce0292be33b605e5f871ab4dac3b98
BLAKE2b-256 a0205d6dc9295a96a9d356ab43f5ddced413d384bb7f5ef865dc8986ce71b5a1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page