Commits

Nathan Goldbaum committed ef1e561 Merge

Merging.

Comments (0)

Files changed (3)

doc/manual/source/user_guide/EnzoTestSuite.rst

     Cooling        GravitySolver    MHD                    test_results.txt 
     Cosmology      Hydro            RadiationTransport     version.txt
 
-The name of this directory will be the unique hash of the version of 
-enzo you chose to run with the testing suite.  In this case it is 
-``fe7d4298cb2``, but yours will likely be different, but equally 
-unintelligible.  Within this directory are all of the test problems 
-that you ran along with their simulation outputs, organized based on 
-test type (e.g.  ``Cooling``, ``AMR``, ``Hydro``, etc.)  Additionally, 
-you should see a file called ``test_results.txt``, which contains a 
-summary of the test runs.  
+The name of this directory will be the unique hash of the version of
+enzo you chose to run with the testing suite.  In this case it is
+``fe7d4298cb2``, but yours will likely be different, but equally
+unintelligible.  You can specify an optional additional suffix to be
+appended to this directory name using ``--run-suffix=<suffix>``. This
+may be useful to distinguish multiple runs of a given version of enzo,
+for example with different levels of optimization. Within this
+directory are all of the test problems that you ran along with their
+simulation outputs, organized based on test type (e.g.  ``Cooling``,
+``AMR``, ``Hydro``, etc.)  Additionally, you should see a file called
+``test_results.txt``, which contains a summary of the test runs.
 
 The testing suite does not expect bitwise agreement between the gold standard
 and your results, due to compiler, architecture and operating system
     Multiply simulation time limit by this factor.  Useful if you're on a slow
     machine or you cannot finish the specified tests in their allocated time.
 
+``--run-suffix=str`` default: None
+    An optional suffix to append to the test run directory. Useful 
+    to distinguish multiple runs of a given changeset.
+
 ``-v, --verbose`` default: False
     Verbose output in the testing sequence.  Very good for tracking down
     specific test failures.
     Changeset to use in simulation repo.  If supplied,
     make clean && make is also run
 
+
 **Flags not used**
 
 ``--with-answer-testing`` default: False

run/Hydro/Hydro-3D/RotatingCylinder/test_rotating_cylinder.py

         self.pf = pf
 
     def run(self):
-        # self.pf already exists
-        data = self.pf.h.all_data()
-        AngMom = []
-        AngMom.append(data.quantities["TotalQuantity"]("AngularMomentum")[0])
-        AngMomInitial = AngMom[0]
-        AngMomPercentageChange = []
-        for i, item in enumerate(AngMom):
-            AngMomPercentageChange.append(100.0*(item - AngMomInitial)/AngMomInitial)
-        return max(AngMomPercentageChange)
+        ad = self.pf.h.all_data()
+        return na.array(ad.quantities['TotalQuantity'](["AngularMomentumX", 
+                                                        "AngularMomentumY", 
+                                                        "AngularMomentumZ"]))
 
     def compare(self, new_result, old_result):
         assert_allclose(new_result, old_result, rtol=1e-3, atol=0)

run/test_runner.py

                       help="number of processors with which to compile when running bisect")
     parser.add_option("--changeset", dest="changeset", default=None, metavar='str',
                       help="Changeset to use in simulation repo.  If supplied, make clean && make is also run")
+    parser.add_option("--run-suffix", dest="run_suffix", default=None, metavar='str',
+                      help="An optional suffix to append to the test run directory. Useful to distinguish multiple runs of a given changeset.")
 
     answer_plugin = AnswerTesting()
     answer_plugin.enabled = True
     options.repository = os.path.expanduser(options.repository)
     hg_current = _get_hg_version(options.repository)
     rev_hash = hg_current.split()[0]
+
+    if options.run_suffix:
+        rev_hash += options.run_suffix
+
     answer_plugin._my_version = rev_hash
 
     answer_plugin.configure(options, None)
     # Gather results and version files for all test and tar them.
     # get current revision
     options.output_dir = os.path.join(options.output_dir, rev_hash)
+
     if not os.path.exists(options.output_dir): os.makedirs(options.output_dir)
     f = open(os.path.join(options.output_dir, version_filename), 'w')
     f.write('Enzo: %s' % hg_current)