Beispiel #1
0
    def test(self, reset_config):
        n = hysplit_utils.compute_num_processes(4)
        assert isinstance(n, int) and n == 1

        n = hysplit_utils.compute_num_processes(4, num_processes=0,
            num_fires_per_process=0, num_processes_max=0)
        assert isinstance(n, int) and n == 1

        n = hysplit_utils.compute_num_processes(4, num_processes=1,
            num_fires_per_process=0, num_processes_max=0)
        assert isinstance(n, int) and n == 1

        n = hysplit_utils.compute_num_processes(4, num_processes=0,
            num_fires_per_process=1, num_processes_max=3)
        assert isinstance(n, int) and n == 3

        n = hysplit_utils.compute_num_processes(6, num_processes=0,
            num_fires_per_process=2, num_processes_max=4)
        assert isinstance(n, int) and n == 3

        n = hysplit_utils.compute_num_processes(4, num_processes=2,
            num_fires_per_process=1, num_processes_max=3)
        assert isinstance(n, int) and n == 2

        n = hysplit_utils.compute_num_processes(4, num_processes=0,
            num_fires_per_process=2, num_processes_max=3)
        assert isinstance(n, int) and n == 2

        n = hysplit_utils.compute_num_processes(4, num_processes=0,
            num_fires_per_process=2, num_processes_max=1)
        assert isinstance(n, int) and n == 1
Beispiel #2
0
    def test_with_parinit(self, reset_config):
        n = hysplit_utils.compute_num_processes(4, parinit_or_pardump=True)
        assert isinstance(n, int) and n == 1

        n = hysplit_utils.compute_num_processes(4,
                                                num_processes=0,
                                                num_fires_per_process=0,
                                                num_processes_max=0,
                                                parinit_or_pardump=True)
        assert isinstance(n, int) and n == 1

        n = hysplit_utils.compute_num_processes(4,
                                                num_processes=1,
                                                num_fires_per_process=0,
                                                num_processes_max=0,
                                                parinit_or_pardump=True)
        assert isinstance(n, int) and n == 1

        n = hysplit_utils.compute_num_processes(4,
                                                num_processes=0,
                                                num_fires_per_process=1,
                                                num_processes_max=3,
                                                parinit_or_pardump=True)
        assert isinstance(n, int) and n == 3

        n = hysplit_utils.compute_num_processes(6,
                                                num_processes=0,
                                                num_fires_per_process=2,
                                                num_processes_max=4,
                                                parinit_or_pardump=True)
        assert isinstance(n, int) and n == 4

        n = hysplit_utils.compute_num_processes(4,
                                                num_processes=2,
                                                num_fires_per_process=1,
                                                num_processes_max=3,
                                                parinit_or_pardump=True)
        assert isinstance(n, int) and n == 3

        n = hysplit_utils.compute_num_processes(4,
                                                num_processes=0,
                                                num_fires_per_process=2,
                                                num_processes_max=3,
                                                parinit_or_pardump=True)
        assert isinstance(n, int) and n == 3

        n = hysplit_utils.compute_num_processes(4,
                                                num_processes=0,
                                                num_fires_per_process=2,
                                                num_processes_max=1,
                                                parinit_or_pardump=True)
        assert isinstance(n, int) and n == 1