예제 #1
0
    def test_RSH_submit(self):
        root = os.path.join(self.nfs_work_path, getpass.getuser(), "ert-test/python/ecl_submit/RSH")
        if not os.path.exists(root):
            os.makedirs(root)
        os.chdir(root)

        num_submit = 6
        host_list = []
        for h in self.rsh_servers.split():
            tmp = h.split(":")
            if len(tmp) > 1:
                num = int(tmp[1])
            else:
                num = 1
            host_list.append((tmp[0], num))

        queue = EclQueue(RSHDriver(3, host_list), size=num_submit)
        path_list = []

        for iens in (range(num_submit)):
            run_path = self.make_run_path(iens)
            path_list.append(run_path)
            job = queue.submitDataFile("%s/%s.DATA" % (run_path, base))

        while queue.isRunning():
            time.sleep(1)

        for path in path_list:
            sum = EclSum("%s/%s" % (path, base))
            self.assertIsInstance(sum, EclSum)
            self.assertEqual(2, sum.last_report)
예제 #2
0
    def test_LSF_submit(self):
        root = os.path.join(self.nfs_work_path, getpass.getuser(), "ert-test/python/ecl_submit/LSF")
        if not os.path.exists(root):
            os.makedirs(root)
        os.chdir(root)

        num_submit = 6
        queue = EclQueue(driver_type=QueueDriverEnum.LSF_DRIVER, max_running=4, size=num_submit)
        path_list = []

        for iens in (range(num_submit)):
            run_path = self.make_run_path(iens, LSF=True)
            path_list.append(run_path)
            job = queue.submitDataFile("%s/%s.DATA" % (run_path, LSF_base))

        while queue.isRunning():
            time.sleep(1)

        for path in path_list:
            sum = EclSum("%s/%s" % (path, LSF_base))
            self.assertIsInstance(sum, EclSum)
            self.assertEqual(2, sum.last_report)
예제 #3
0
    def test_LOCAL_submit(self):
        #work_area = TestArea("python/ecl_submit/LOCAL", True)

        with TestAreaContext("python/ecl_submit/LOCAL") as work_area:
            num_submit = 4
            queue = EclQueue(driver_type=QueueDriverEnum.LOCAL_DRIVER, max_running=2)
            path_list = []

            for iens in range(num_submit):
                run_path = self.make_run_path(iens)
                path_list.append(run_path)
                job = queue.submitDataFile("%s/%s.DATA" % (run_path, base))

            queue.submit_complete()
            while queue.isRunning():
                time.sleep(1)

            for path in path_list:
                sum = EclSum("%s/%s" % (path, base))
                self.assertIsInstance(sum, EclSum)
                self.assertEqual(2, sum.last_report)
                shutil.rmtree(path)