Author: tlinnet Date: Tue Jun 10 16:51:35 2014 New Revision: 23789 URL: http://svn.gna.org/viewcvs/relax?rev=23789&view=rev Log: Yet another small improvement for the profiling script. Task #7807 (https://gna.org/task/index.php?7807): Speed-up of dispersion models for Clustered analysis. Modified: branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_cr72.py Modified: branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_cr72.py URL: http://svn.gna.org/viewcvs/relax/branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_cr72.py?rev=23789&r1=23788&r2=23789&view=diff ============================================================================== --- branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_cr72.py (original) +++ branches/disp_spin_speed/test_suite/shared_data/dispersion/profiling/profiling_cr72.py Tue Jun 10 16:51:35 2014 @@ -54,10 +54,16 @@ # Alter setup. def main(): if True: + # Nr of iterations. + nr_iter = 1 + + # Print statistics. + verbose = True + # Calc for single. s_filename = tempfile.NamedTemporaryFile(delete=False).name # Profile for a single spin. - cProfile.run('single(iter=1000)', s_filename) + cProfile.run('single(iter=%s)'%nr_iter, s_filename) # Read all stats files into a single object s_stats = pstats.Stats(s_filename) @@ -69,13 +75,14 @@ s_stats.sort_stats('cumulative') # Print report for single. - s_stats.print_stats() + if verbose: + s_stats.print_stats() if True: # Calc for cluster. c_filename = tempfile.NamedTemporaryFile(delete=False).name # Profile for a cluster of 100 spins. - cProfile.run('cluster(iter=1000)', c_filename) + cProfile.run('cluster(iter=%s)'%nr_iter, c_filename) # Read all stats files into a single object c_stats = pstats.Stats(c_filename) @@ -87,7 +94,8 @@ c_stats.sort_stats('cumulative') # Print report for clustered. - c_stats.print_stats() + if verbose: + c_stats.print_stats() class Profile(Dispersion):