Skip to main content

DFTracer logo

DFTracer

Version: $(cat PACKAGE_VERSION 2>/dev/null || echo "2.0.2")

Build and Test Coverage Status Documentation Status PyPI - Version PyPI - Wheel PyPI - Python Version PyPI - License

Overview

DFTracer is a tracing tool designed to capture both application-code and I/O-call level events from workflows. It provides a unified tracing interface, optimized trace format, and compression mechanism to enable efficient distributed analysis for large-scale AI-driven workloads.

Prerequisites

Requirements for DFTracer

  1. Python>=3.7
  2. pybind11

Requirements for DFAnalyzer

  1. bokeh>=2.4.2
  2. dask>=2023.5.0
  3. distributed
  4. matplotlib>=3.7.3
  5. numpy>=1.24.3
  6. pandas>=2.0.3
  7. pyarrow>=12.0.1
  8. pybind11
  9. python-intervals>=1.10.0.post1
  10. rich>=13.6.0
  11. seaborn>=0.13.2
  12. zindex_py

Installation

Users can easily install DFTracer using pip, the standard tool for installing Python packages. This method works for both native Python and Conda environments.

From PyPI

pip install dftracer
pip install dftracer[dfanalyzer]
# if you want to use old version of DFAnalyzer
# pip install dftracer[dfanalyzer_old]

From Github

DFTRACER_VERSION=develop
pip install git+https://github.com/LLNL/dftracer.git@${DFTRACER_VERSION}
pip install git+https://github.com/LLNL/dftracer.git@${DFTRACER_VERSION}#egg=dftracer[dfanalyzer]
# if you want to use old version of DFAnalyzer
# pip install git+https://github.com/LLNL/dftracer.git@${DFTRACER_VERSION}#egg=dftracer[dfanalyzer_old]

From Source

git clone git@github.com:LLNL/dftracer.git
cd dftracer
# You can skip this for installing the dev branch.
# for latest stable version use master branch.
git checkout tags/<Release> -b <Release>
pip install .

For detailed build instructions, click here.

Usage

from dftracer.python import dftracer, dft_fn
log_inst = dftracer.initialize_log(logfile=None, data_dir=None, process_id=-1)
dft_fn = dft_fn("COMPUTE")

# Example of using function decorators
@dft_fn.log
def log_events(index):
    sleep(1)

# Example of function spawning and implicit I/O calls
def posix_calls(val):
    index, is_spawn = val
    path = f"{cwd}/data/demofile{index}.txt"
    f = open(path, "w+")
    f.write("Now the file has more content!")
    f.close()
    if is_spawn:
        print(f"Calling spawn on {index} with pid {os.getpid()}")
        log_inst.finalize() # This need to be called to correctly finalize DFTracer.
    else:
        print(f"Not calling spawn on {index} with pid {os.getpid()}")

# NPZ calls internally calls POSIX calls.
def npz_calls(index):
    path = f"{cwd}/data/demofile{index}.npz"
    if os.path.exists(path):
        os.remove(path)
    records = np.random.randint(255, size=(8, 8, 1024), dtype=np.uint8)
    record_labels = [0] * 1024
    np.savez(path, x=records, y=record_labels)

def main():
    log_events(0)
    npz_calls(1)
    with get_context('spawn').Pool(1, initializer=init) as pool:
        pool.map(posix_calls, ((2, True),))
    log_inst.finalize()

if __name__ == "__main__":
    main()

For this example, as the dftracer.initialize_log do not pass logfile or data_dir, we need to set DFTRACER_LOG_FILE and DFTRACER_DATA_DIR. By default the DFTracer mode is set to FUNCTION. Example of running this configurations are:

# The process id, app_name and .pfw will be appended by DFTracer for each app and process.
# The name of the final log file will be ~/log_file-<APP_NAME>-<PID>.pfw
DFTRACER_LOG_FILE=~/log_file
# Colon separated paths to include in the tracing
DFTRACER_DATA_DIR=/dev/shm/:/p/gpfs1/$USER/dataset:$PWD/data
# Enable DFTracer
DFTRACER_ENABLE=1

For more examples, click here.

Documentation

Citation and Reference

The original SC'24 paper describes the design and implementation of the DFTracer code. Please cite this paper and the code if you use DFTracer in your research.

@inproceedings{devarajan_dftracer_2024,
    address = {Atlanta, GA},
    title = {{DFTracer}: {An} {Analysis}-{Friendly} {Data} {Flow} {Tracer} for {AI}-{Driven} {Workflows}},
    shorttitle = {{DFTracer}},
    urldate = {2024-07-31},
    booktitle = {{SC24}: {International} {Conference} for {High} {Performance} {Computing}, {Networking}, {Storage} and {Analysis}},
    publisher = {IEEE},
    author = {Devarajan, Hariharan and Pottier, Loic and Velusamy, Kaushik and Zheng, Huihuo and Yildirim, Izzet and Kogiou, Olga and Yu, Weikuan and Kougkas, Anthony and Sun, Xian-He and Yeom, Jae Seung and Mohror, Kathryn},
    month = nov,
    year = {2024},
}

@misc{devarajan_dftracer_code_2024,
    type = {Github},
    title = {Github {DFTracer}},
    shorttitle = {{DFTracer}},
    url = {https://github.com/LLNL/dftracer.git},
    urldate = {2024-07-31},
    journal = {DFTracer: A multi-level dataflow tracer for capture I/O calls from worklows.},
    author = {Devarajan, Hariharan and Pottier, Loic and Velusamy, Kaushik and Zheng, Huihuo and Yildirim, Izzet and Kogiou, Olga and Yu, Weikuan and Kougkas, Anthony and Sun, Xian-He and Yeom, Jae Seung and Mohror, Kathryn},
    month = jun,
    year = {2024},
}

Acknowledgments

This work was performed under the auspices of the U.S. Department of Energy by Lawrence Livermore National Laboratory under Contract DE-AC52-07NA27344; and under the auspices of the National Cancer Institute (NCI) by Frederick National Laboratory for Cancer Research (FNLCR) under Contract 75N91019D00024. This research used resources of the Argonne Leadership Computing Facility, a U.S. Department of Energy (DOE) Office of Science user facility at Argonne National Laboratory and is based on research supported by the U.S. DOE Office of Science-Advanced Scientific Computing Research Program, under Contract No. DE-AC02-06CH11357. Office of Advanced Scientific Computing Research under the DOE Early Career Research Program. Also, This material is based upon work partially supported by LLNL LDRD 23-ERD-045 and 24-SI-005. LLNL-CONF-857447.

Download files

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

Source Distribution

dftracer-2.1.0.tar.gz (13.4 MB view details)

Uploaded Source

Built Distributions

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

dftracer-2.1.0-cp312-cp312-manylinux_2_39_x86_64.whl (10.0 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.39+ x86-64

dftracer-2.1.0-cp312-cp312-manylinux_2_34_x86_64.whl (10.0 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.34+ x86-64

dftracer-2.1.0-cp311-cp311-manylinux_2_39_x86_64.whl (10.0 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.39+ x86-64

dftracer-2.1.0-cp311-cp311-manylinux_2_34_x86_64.whl (10.0 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.34+ x86-64

dftracer-2.1.0-cp310-cp310-manylinux_2_39_x86_64.whl (10.0 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.39+ x86-64

dftracer-2.1.0-cp310-cp310-manylinux_2_34_x86_64.whl (9.9 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.34+ x86-64

dftracer-2.1.0-cp39-cp39-manylinux_2_39_x86_64.whl (10.0 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.39+ x86-64

dftracer-2.1.0-cp39-cp39-manylinux_2_34_x86_64.whl (9.9 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.34+ x86-64

File details

Details for the file dftracer-2.1.0.tar.gz.

File metadata

  • Download URL: dftracer-2.1.0.tar.gz
  • Upload date:
  • Size: 13.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.25

File hashes

Hashes for dftracer-2.1.0.tar.gz
Algorithm Hash digest
SHA256 0d08b3c0c90b094020324a00081098340c48e4cd035602330a67b5ccc5cb1561
MD5 c0565a479fe0c03a2716e7aa9a18a405
BLAKE2b-256 c69a902f1a105f199b6d83a85004e81a891df32d1c512c9b36fc8cc2f5fa47c5

See more details on using hashes here.

File details

Details for the file dftracer-2.1.0-cp312-cp312-manylinux_2_39_x86_64.whl.

File metadata

File hashes

Hashes for dftracer-2.1.0-cp312-cp312-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 6f170baf34b587e933294b71c7b7bcebb00116d84e7b770eeaed4a64d234f983
MD5 fe61c506aff16165f63c28663bc5b36e
BLAKE2b-256 b6346a5cda60701ec9ea3601705613c809e13305326ec440d1ae530c3acbcf3e

See more details on using hashes here.

File details

Details for the file dftracer-2.1.0-cp312-cp312-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for dftracer-2.1.0-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 7fa047f1629b5c3f84baf4c7114712acbdf15b49ea32b2370b09093210595733
MD5 1b4dd0bd3b9545af972d5b533c96da58
BLAKE2b-256 e3038ecd9d622406d5a7f73762674e0680b391fc6b592cbd4a0fba6cc4f2760d

See more details on using hashes here.

File details

Details for the file dftracer-2.1.0-cp311-cp311-manylinux_2_39_x86_64.whl.

File metadata

File hashes

Hashes for dftracer-2.1.0-cp311-cp311-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 c03085b39a22027feb91f7b91cb8f1373ae44d2d8fba928c5354770100b2e96f
MD5 3e9c4f8af3072cdf9a410c8018d3fe44
BLAKE2b-256 7a55d6921378082520cf972f490e0391e9882daa20ebbc613510325c2f3d1236

See more details on using hashes here.

File details

Details for the file dftracer-2.1.0-cp311-cp311-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for dftracer-2.1.0-cp311-cp311-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 adf9c4ed046ba65674cf3576ed2d9cca1031f059ba54df12fa79b5300f3d45a3
MD5 0f3650bd36ae26f0a19540718f802de5
BLAKE2b-256 d64e98e8d53a9d514bedd83db0b14a8719e3f1689e92cacdd8017d2984a85b2f

See more details on using hashes here.

File details

Details for the file dftracer-2.1.0-cp310-cp310-manylinux_2_39_x86_64.whl.

File metadata

File hashes

Hashes for dftracer-2.1.0-cp310-cp310-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 bbb2fc62a33d2a792cd9c45ca711c158973e804e8ac1ee1a1d4e5bfbb2b3ca8c
MD5 809d256bb252c32c0fa2f9327991b443
BLAKE2b-256 d14d0481c0e363f73badfac26138d6aac584ee9eccf831ce5a94e73419a91d18

See more details on using hashes here.

File details

Details for the file dftracer-2.1.0-cp310-cp310-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for dftracer-2.1.0-cp310-cp310-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 b61af85ef74a1197cf9821abe04fa0f753535f83a48c07b995143507eab0a170
MD5 3abe3b24cad144ed730cb68dec083732
BLAKE2b-256 f4c03b87d5bb2b40e35bd3e61f228b0bfdc3fbf1356f161a9061c713bb7b6714

See more details on using hashes here.

File details

Details for the file dftracer-2.1.0-cp39-cp39-manylinux_2_39_x86_64.whl.

File metadata

File hashes

Hashes for dftracer-2.1.0-cp39-cp39-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 0622a08e8b17908871507ff440d3e7b8cef762e29bcbb2f64446b455ae2d8cfb
MD5 dad1cf7fe39ab47b0f8785849024a7fe
BLAKE2b-256 4f02efa4cea33795c151b371eb46f03412fbb1912c43016b2103a3f410862be2

See more details on using hashes here.

File details

Details for the file dftracer-2.1.0-cp39-cp39-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for dftracer-2.1.0-cp39-cp39-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 4b404853f3d6c7ee454166da522dc7826d8f36065032eb9d572fc482b5078a4b
MD5 29320bbec0afe235e0ec897791bbd211
BLAKE2b-256 38114a253544ff5b36362c015eec7ce81cac17d7c3848f58281af88fb70f0b38

See more details on using hashes here.

Release history Release notifications | RSS feed

2.1.0.post21

6 files

This release

2.1.0 This release

9 files

2.0.3

9 files

2.0.2

9 files

2.0.1

9 files

2.0.0

9 files

1.0.15

4 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page