Matthew Turk avatar Matthew Turk committed 21e1e70

Switching back to cProfile from Hotshot

Comments (0)

Files changed (1)

profile_support.py

 import time
 import cProfile
-import hotshot
+import cProfile
 
 import numpy as na
 import yt.utilities.command_line as cl
     for fname in sorted(functions_to_profile):
         print "HANDLING %s on %s / %s" % (
             fname, rank, size)
-        ofn = "profiles/%s_%s_%03i_%03i.hotshot" % (
+        ofn = "profiles/%s_%s_%03i_%03i.cprof" % (
             fname, _my_version, size, rank)
         times = []
         profile_runner.func = functions_to_profile[fname]
                 func(pf)
             MPI.COMM_WORLD.Barrier()
             t1 = time.time()
-            hprof = hotshot.Profile(ofn)
+            hprof = cProfile.Profile()
             hprof.runcall(profile_runner.run, pf)
-            hprof.close()
+            hprof.dump_stats(ofn)
             MPI.COMM_WORLD.Barrier()
             t2 = time.time()
             times.append(t2-t1)
         if output_html:
             print "Writing output file on %03i / %03i" % (rank, size)
             # We step through it
-            dname = "html/%s-%s/%s" % (td,_my_version, fname)
+            dname = "html/%s-%03i_%03i-%s/%s" % (td, size, rank, _my_version, fname)
             if rank == 0 and not os.path.exists(dname):
                 os.makedirs(dname)
             MPI.COMM_WORLD.Barrier()
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.