Commits

Matthew Turk  committed 7acd9cf

Adding HTML output option

  • Participants
  • Parent commits 00c10bc

Comments (0)

Files changed (2)

File profile_support.py

 import yt.utilities.command_line as cl
 import pkg_resources, os, sys, time
 
+try:
+    import pyprof2html
+    from pyprof2html.core import Converter
+except ImportError:
+    pass
+
 def get_version_string():
     yt_provider = pkg_resources.get_provider("yt")
     path = os.path.dirname(yt_provider.module_path)
 
 profile_runner = StatefulProfileRunner()
 
-def run_all_tests(pf, ntimes = 1):
+def run_all_tests(pf, ntimes = 1, output_html = False)
     from mpi4py import MPI
     rank = MPI.COMM_WORLD.rank
     size = MPI.COMM_WORLD.size
         if MPI.COMM_WORLD.rank == 0:
             print "Results [%s]: %0.3e %0.3e %0.3e" % (
                 fname, results[fname][0], results[fname][1], results[fname][2])
+        if output_html:
+            p2h = Converter(ofn)
+            odir = "html/%s/%s/%03i" % (_my_version, fname, size)
+            p2h.printout(filetype="html", output_directory=odir,
+                         output_htmlfile="index-%03i.html" % rank,
+                         functions_number=99999)
     return results

File run_profiling.py

 #pf = load("../DD0083/DD0083", data_style="enzo_packed_3d")
 pf = load("/nics/d/home/davem/turk/tar1/DD0083/DD0083")
 
-run_all_tests(pf, 1)
+run_all_tests(pf, 1, True)