|
25 | 25 | skip_mpi4py_test = importlib.util.find_spec("mpi4py") is None |
26 | 26 |
|
27 | 27 |
|
| 28 | +template = """\ |
| 29 | +#!/bin/bash |
| 30 | +# flux: --job-name={{job_name}} |
| 31 | +# flux: --env=CORES={{cores}} |
| 32 | +# flux: --output=time.out |
| 33 | +# flux: --error=error.out |
| 34 | +# flux: --nslots={{cores}} |
| 35 | +# flux: --queue={{queue}} |
| 36 | +{%- if run_time_max %} |
| 37 | +# flux: --time-limit={{run_time_max}}s |
| 38 | +{%- endif %} |
| 39 | +{%- if dependency_list %} |
| 40 | +{%- for jobid in dependency_list %} |
| 41 | +# flux: --dependency=afterok:{{jobid}} |
| 42 | +{%- endfor %} |
| 43 | +{%- endif %} |
| 44 | +
|
| 45 | +{{command}} |
| 46 | +""" |
| 47 | + |
| 48 | + |
28 | 49 | def echo(i): |
29 | 50 | sleep(1) |
30 | 51 | return i |
@@ -71,6 +92,23 @@ def test_executor(self): |
71 | 92 | self.assertEqual(len(os.listdir("executorlib_cache")), 4) |
72 | 93 | self.assertTrue(fs1.done()) |
73 | 94 |
|
| 95 | + def test_executor_wrong_queue_name(self): |
| 96 | + with self.assertRaises(ValueError): |
| 97 | + with FluxClusterExecutor( |
| 98 | + resource_dict={ |
| 99 | + "cores": 2, |
| 100 | + "cwd": "executorlib_cache", |
| 101 | + "submission_template": template, |
| 102 | + "queue": "test", |
| 103 | + }, |
| 104 | + block_allocation=False, |
| 105 | + cache_directory="executorlib_cache", |
| 106 | + pmi_mode=pmi, |
| 107 | + ) as exe: |
| 108 | + cloudpickle_register(ind=1) |
| 109 | + fs1 = exe.submit(mpi_funct, 1) |
| 110 | + print(fs1.result()) |
| 111 | + |
74 | 112 | def test_executor_no_cwd(self): |
75 | 113 | with FluxClusterExecutor( |
76 | 114 | resource_dict={"cores": 2}, |
|
0 commit comments