From f02ce7204a4eda4f04d7d18e5c1409c20d2c692c Mon Sep 17 00:00:00 2001 From: Jan Janssen Date: Mon, 16 Dec 2024 21:37:04 -0700 Subject: [PATCH] Add test --- tests/test_executor_backend_flux.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/tests/test_executor_backend_flux.py b/tests/test_executor_backend_flux.py index 8ab11569..ebedb998 100644 --- a/tests/test_executor_backend_flux.py +++ b/tests/test_executor_backend_flux.py @@ -100,6 +100,28 @@ def test_single_task(self): [[(1, 2, 0), (1, 2, 1)], [(2, 2, 0), (2, 2, 1)], [(3, 2, 0), (3, 2, 1)]], ) + def test_output_files(self): + file_stdout = os.path.join(os.path.dirname(__file__), "flux.out") + file_stderr = os.path.join(os.path.dirname(__file__), "flux.err") + with Executor( + max_cores=2, + resource_dict={"cores": 2}, + flux_executor=self.executor, + backend="flux_allocation", + block_allocation=True, + flux_executor_pmi_mode=pmi, + flux_log_files=True, + ) as p: + output = p.map(mpi_funct, [1, 2, 3]) + self.assertEqual( + list(output), + [[(1, 2, 0), (1, 2, 1)], [(2, 2, 0), (2, 2, 1)], [(3, 2, 0), (3, 2, 1)]], + ) + self.assertTrue(os.path.exists(file_stdout)) + self.assertTrue(os.path.exists(file_stderr)) + os.remove(file_stdout) + os.remove(file_stderr) + def test_internal_memory(self): with Executor( max_cores=1,