def test_restart_repro(self):
        """
        Test that a run reproduces across restarts.
        """

        # First do two short (5 day) runs.
        exp = run_exp('1deg_jra55_ryf')
        exp.force_run()

        # Now do a single 10 day run. Start by copying experiment and modifying the experiment.
        exp_10day = os.path.join(exp.control_path, '1deg_jra55_ryf_10day')
        if not os.path.exists(exp_10day):
            shutil.copytree(exp.exp_path, exp_10day, symlinks=True)
        try:
            os.remove(os.path.join(exp_10day, 'archive'))
        except OSError:
            pass
        try:
            os.remove(os.path.join(exp_10day, 'work'))
        except OSError:
            pass

        # Change to a 10 day run.
        config = os.path.join(exp_10day, 'config.yaml')
        with open(config) as f:
            doc = yaml.load(f)

        doc['calendar']['runtime']['days'] = 10
        doc['jobname'] = '1deg_jra55_ryf_10day'

        with open(config, 'w') as f:
            yaml.dump(doc, f)

        exp_10day = run_exp('1deg_jra55_ryf_10day')

        # Now compare the output between our two short and one long run.
        stdout0 = os.path.join(exp.archive, 'output000', 'access-om2.out')
        two_short = self.checksums_to_list(stdout0, cpl_chksum=True)
        stdout1 = os.path.join(exp.archive, 'output001', 'access-om2.out')
        two_short = two_short + self.checksums_to_list(stdout1,
                                                       cpl_chksum=True)
        two_short.sort()

        stdout = os.path.join(exp_10day.archive, 'output000', 'access-om2.out')
        one_long = self.checksums_to_list(stdout)

        assert len(two_short) == len(one_long)
        assert two_short == one_long
    def test_bit_repro(self):
        """
        Test that a run reproduces saved checksums.
        """

        exp = run_exp('1deg_jra55_ryf')

        # Compare expected to produced.
        mom_chksums = os.path.join(exp.exp_path, 'ocean', 'checksums.txt')
        expected = self.checksums_to_list(mom_chksums)
        stdout = os.path.join(exp.archive, 'output000', 'access-om2.out')
        produced = self.checksums_to_list(stdout)

        assert len(produced) == len(expected)
        assert produced == expected
예제 #3
0
 def test_slow_run(self):
     run_exp('025deg_jra55_ryf')
예제 #4
0
 def test_run(self):
     run_exp('1deg_jra55_ryf')
예제 #5
0
 def test_1deg_core_run(self):
     run_exp('1deg_core_nyf')
예제 #6
0
파일: test_run.py 프로젝트: CWSL/access-om
 def test_slow_run(self):
     run_exp('025deg_jra55_iaf')
예제 #7
0
파일: test_run.py 프로젝트: CWSL/access-om
 def test_1deg_core_run(self):
     run_exp('1deg_core_nyf')
예제 #8
0
 def test_1deg_jra55_iaf_run(self):
     run_exp('1deg_jra55_iaf')
예제 #9
0
파일: test_run.py 프로젝트: CWSL/access-om
 def test_1deg_jra55_ryf_run(self):
     run_exp('1deg_jra55_ryf')