Author: tlinnet Date: Sun Jun 8 19:48:29 2014 New Revision: 23734 URL: http://svn.gna.org/viewcvs/relax?rev=23734&view=rev Log: Made it easier to switch between single and cluster reporting in 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=23734&r1=23733&r2=23734&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 Sun Jun 8 19:48:29 2014 @@ -53,40 +53,41 @@ # Alter setup. def main(): - # Calc for single. - s_filename = tempfile.NamedTemporaryFile(delete=False).name - # Profile for a single spin. - cProfile.run('single(iter=1000)', s_filename) - - # Read all stats files into a single object - s_stats = pstats.Stats(s_filename) - - # Clean up filenames for the report - s_stats.strip_dirs() - - # Sort the statistics by the cumulative time spent in the function. cumulative, time, calls - s_stats.sort_stats('cumulative') - - # Print report for single. - s_stats.print_stats() - - # Calc for cluster. - c_filename = tempfile.NamedTemporaryFile(delete=False).name - # Profile for a cluster of 100 spins. - cProfile.run('cluster(iter=1000)', c_filename) - - # Read all stats files into a single object - c_stats = pstats.Stats(c_filename) - #stats.add(c_filename) - - # Clean up filenames for the report - c_stats.strip_dirs() - - # Sort the statistics by the cumulative time spent in the function. cumulative, time, calls - c_stats.sort_stats('cumulative') - - # Print report for clustered. - c_stats.print_stats() + if True: + # Calc for single. + s_filename = tempfile.NamedTemporaryFile(delete=False).name + # Profile for a single spin. + cProfile.run('single(iter=1000)', s_filename) + + # Read all stats files into a single object + s_stats = pstats.Stats(s_filename) + + # Clean up filenames for the report + s_stats.strip_dirs() + + # Sort the statistics by the cumulative time spent in the function. cumulative, time, calls + s_stats.sort_stats('cumulative') + + # Print report for single. + 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) + + # Read all stats files into a single object + c_stats = pstats.Stats(c_filename) + + # Clean up filenames for the report + c_stats.strip_dirs() + + # Sort the statistics by the cumulative time spent in the function. cumulative, time, calls + c_stats.sort_stats('cumulative') + + # Print report for clustered. + c_stats.print_stats() class Profile(Dispersion):