Author: bugman Date: Wed Sep 2 14:10:30 2009 New Revision: 9427 URL: http://svn.gna.org/viewcvs/relax?rev=9427&view=rev Log: Created a script to test optimisation on various systems. This just runs the optimisation system tests, collecting and printing the architecture info and optimisation stats. Added: 1.3/scripts/optimisation_testing.py Added: 1.3/scripts/optimisation_testing.py URL: http://svn.gna.org/viewcvs/relax/1.3/scripts/optimisation_testing.py?rev=9427&view=auto ============================================================================== --- 1.3/scripts/optimisation_testing.py (added) +++ 1.3/scripts/optimisation_testing.py Wed Sep 2 14:10:30 2009 @@ -1,0 +1,61 @@ +# Script for testing optimisation for software version and architecture differences. + +# Python module imports. +from re import search +from string import split +import sys + +# relax module imports. +from test_suite.system_tests import model_free + +# The testing class. +mf = model_free.Mf('run') + +# Add the relax namespace to the class. +mf.relax = self.relax + +# Don't quit. +self.relax.interpreter._Interpreter__quit_flag = False + +# Execute the tests, storing the messages. +tests = [] +messages = [] +for name in dir(mf): + # Skip all non-opt tests. + if not search('test_opt', name): + continue + + # Print out. + sys.stderr.write("Test: %s\n" % name) + + # Set up. + mf.setUp() + + # Run the test. + test = getattr(mf, name) + test() + + # Alias the relevent spin container. + spin = cdp.mol[0].res[1].spin[0] + + # Get the message. + tests.append(name) + messages.append(split(mf.mesg_opt_debug(spin), '\n')) + + # Tear down. + mf.tearDown() + +# Write the messages to STDERR. +for i in range(len(messages)): + # Header. + sys.stderr.write("\n\n\n\nTest: %s\n" % tests[i]) + + # The message lines. + for j in range(len(messages[i])): + # Clean up. + if j < 2 or j == len(messages[i]) - 1: + continue + + # Write the line. + sys.stderr.write(" # %s\n" % messages[i][j]) +sys.stderr.write("\n\n")