Skip to main content

Python bindings for the sst-dumpi trace format.

Project description

SST-DUMPI Python Bindings

Python bindings for the SST-DUMPI Trace Library.

Install

Pydumpi is available at PyPi:

pip install pydumpi

Note: The PyPI package contains a prebuilt shared library, this might not work on very old systems, and is linux only. If this does not work for you installing from source is your only option.

Install from Source

Clone this repository and install the package with pip in a virtual environment, e.g:

git clone http://github.com/justacid/pydumpi
cd myproject
source venv/bin/activate
pip install ../pydumpi

The install might take some time - if the dumpi library can not be found on the path it will be downloaded and compiled during the install process. You can also install libundumpi globally, for more information on how to install globally refer to the sst-dumpi repository.

Usage Examples

Inherit from DumpiTrace and override the callbacks you are interested in. Every MPI function has an available callback. A complete list can be found in dumpi/callbacks.py.

from pydumpi import DumpiTrace


class MyTrace(DumpiTrace):

    def __init__(self, file_name):
        super().__init__(file_name)
        self.message_count = 0

    def on_send(self, data, thread, cpu_time, wall_time, perf_info):
        self.message_count += 1
        time_diff = wall_time.stop - wall_time.start
        print(f"Time elapsed in 'MPI_Send': {time_diff.to_ms()} milliseconds.")

    def on_recv(self, data, thread, cpu_time, wall_time, perf_info):
        print(f"Message received on thread '{thread}' from thread '{data.source}'.")


with MyTrace("path/to/some/trace.bin") as trace:
    trace.print_header()
    trace.read_stream()
    print(trace.message_count)

Important: Since the C backend frees the data after a callback returns, it is only valid within a callback (including wall and cpu time). If you need to store it perform a deep copy, otherwise you get garbage values.

Meta Data

You can inspect the meta data of a dumpi trace by printing the header and footer. In particular the footer prints a list of all MPI functions that were called during a trace - this information can help guide you in deciding which callbacks need to be overriden for further analysis.

with DumpiTrace("path/to/some/trace.bin") as trace:
    trace.print_header()
    trace.print_footer()

There also is a utilty function to read all binary traces in a folder. The function will search for a meta file in a given directory, do some basic sanity checks and return a list with all binary traces.

from pydumpi.util import trace_files_from_dir

for fname in trace_files_from_dir("path/to/data_dir"):
    print(fname)

Project details


Download files

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

Source Distribution

pydumpi-0.1.3.tar.gz (730.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pydumpi-0.1.3-py3-none-any.whl (735.1 kB view details)

Uploaded Python 3

File details

Details for the file pydumpi-0.1.3.tar.gz.

File metadata

  • Download URL: pydumpi-0.1.3.tar.gz
  • Upload date:
  • Size: 730.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pydumpi-0.1.3.tar.gz
Algorithm Hash digest
SHA256 fb0675eed8d5c58fb522142119971173381797c056830fcd024a4902001b8c03
MD5 1dce445bc6a69b81a615f5e70bb532ec
BLAKE2b-256 5ef002101d3833306403042767a813c0c1d97fefda23403513a933d6b618429e

See more details on using hashes here.

File details

Details for the file pydumpi-0.1.3-py3-none-any.whl.

File metadata

File hashes

Hashes for pydumpi-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 55223609629739c96fd2ccf7e95c00ad32080c60ced477b0ea9540a4267764f6
MD5 f806201368465020a670685c60560f8c
BLAKE2b-256 e6937a8aeccf1f9042502bbc6b031c5b7d22ae08c732bbac81fdd7cc921949cb

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