Commit 839b7e95 authored by Sudheer Chunduri's avatar Sudheer Chunduri
Browse files

apxc: apxc analysis script

parent 474c59b9
#!/usr/bin/env python #!/usr/bin/env python
# DarshanUtils for Python for processing APXC records
# This script gives an overview of features provided by the Python bindings for DarshanUtils.
# By default all APXC module records, metadata, and the name records are loaded when opening a Darshan log:
import argparse import argparse
import darshan import darshan
import cffi
import numpy
import pandas
import matplotlib
import matplotlib.pyplot as plt
import seaborn as sns
# base counter names #import pprint
cnames = ['MPI_SEND', import pandas as pd
'MPI_RECV', import numpy as np
'MPI_ALLREDUCE'] import jinja2
import logging
def main(): from darshan.backend.cffi_backend import ffi
parser = argparse.ArgumentParser() logger = logging.getLogger(__name__)
parser.add_argument('--quiet', dest='quiet', action='store_true', default=False, help='Surpress zero count calls') from darshan.report import DarshanReport
parser.add_argument('logname', metavar="logname", type=str, nargs=1, help='Logname to parse') import darshan.backend.cffi_backend as backend
args = parser.parse_args() import darshan
import time
from matplotlib.backends.backend_pdf import FigureCanvasPdf, PdfPages
from matplotlib.figure import Figure
report = darshan.DarshanReport(args.logname[0], read_all=False)
report.info()
if ('APXC' not in report.modules): def main():
print ("This log does not contain AutoPerf XC data") parser = argparse.ArgumentParser()
return parser.add_argument(
"--quiet",
dest="quiet",
action="store_true",
default=False,
help="Surpress zero count calls",
)
parser.add_argument(
"logname", metavar="logname", type=str, nargs=1, help="Logname to parse"
)
args = parser.parse_args()
hdr = darshan.backend.cffi_backend.log_get_apxc_record(report.log) report = darshan.DarshanReport(args.logname[0], read_all=False)
report.info()
if "APXC" not in report.modules:
print("This log does not contain AutoPerf XC data")
return
r = report.mod_read_all_apxc_records("APXC")
#print("{:<8}{:<16}{:<10}{:<15}{:<18}{:<10}{:<10}{:<10}{:<10}{:<10}{:<10}\n{}".format( report.update_name_records()
# "Rank","Call", "Count", "Total Bytes", "Total Time", "0-256", "256-1K", "1K-8K", "8K-256K", "256K-1M", "1M+", "="*120)) report.info()
#pdf = matplotlib.backends.backend_pdf.PdfPages("apxc_output.pdf")
r = darshan.backend.cffi_backend.log_get_apxc_record(report.log) header_rec = report.records["APXC"][0]
print(r)
return for rec in report.records["APXC"][1:]:
# skip the first record which is header record
print(rec)
return
if __name__ == '__main__': if __name__ == '__main__':
main() main()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment