Skip to content

mantidproject/mantid-profiler

 
 

Repository files navigation

mantid-profiler

Use psrecord and Plotly.js to profile a Mantid workflow.

It monitors CPU and RAM usage, and reports the time span of each algorithm (currently, only algorithms are recorded).

screenshot of AlignAndFocusPowderFromFiles

Usage

To profile the SNSPowderReduction.py workflow:

python SNSPowderReduction.py & mantidprofiler $!

The script attaches to the last spawned process, so you can also use the profiler if you are working with MantidPlot:

./MantidPlot & mantidprofiler $!

Requires

  • psutil
  • You need to build Mantid with the -DPROFILE_ALGORITHM_LINUX=ON CMake flag to get the timing output from the algorithms.

Results

After running on the SNSPowderReduction.py workflow, the profiler produces a profile.html file to be viewed with an internet browser. SNS Powder Reduction profile

You can interact with a demo profile here.

Controls:

  • Mouse wheel to zoom (horizontal zoom only)
  • Left click to select zoom region (horizontal zoom only)
  • Double-click to reset axes
  • Hold shift and mouse click to pan

More options for mantid-profiler.py

  • -h, --help show this help message and exit
  • --outfile OUTFILE name of output html file (default: profile.html)
  • --infile INFILE name of input file containing algorithm timings (default: algotimeregister.out)
  • --logfile LOGFILE name of output file containing process monitor data (default: mantidprofile.txt)
  • --diskfile DISKFILE name of output file containing process disk usage data (default: mantiddisk.txt)
  • --interval INTERVAL how long to wait between each sample (in seconds). By default the process is sampled as often as possible. (default: None)
  • --noclean remove files upon successful completion (default: False)
  • --height HEIGHT height for html plot (default: 800)
  • --bytes Report disk speed in GBps rather than Gbps (default: False)
  • --mintime MINTIME minimum duration for an algorithm to appear inthe profiling graph (in seconds). (default: 0.1)

Similar projects

viztracer creates similar information for generic python software

Related Documentation

Contact

Neil Vaytet, European Spallation Source

License: GPL v3 pre-commit.ci status

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 100.0%