Skip to content

Commit 619606c

Browse files
authored
Merge pull request #186 from pyiron/update_flux_tests
update flux tests
2 parents f1e8e83 + 2f86279 commit 619606c

3 files changed

Lines changed: 26 additions & 4 deletions

File tree

docs/source/queue.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,18 @@ queues:
3737
The queue named `flux` is defined based on a submission script template named `flux.sh` with the following content:
3838
```
3939
#!/bin/bash
40-
#flux: -n{{cores}} --job-name={{job_name}} --env=CORES={{cores}} --output=time.out --error=error.out
40+
# flux:--job-name={{job_name}}
41+
# flux: --env=CORES={{cores}}
42+
# flux: --output=time.out
43+
# flux: --error=error.out
44+
# flux: -n {{cores}}
45+
{%- if run_time_max %}
46+
# flux: -t {{ [1, run_time_max // 60]|max }}
47+
{%- endif %}
48+
4149
{{command}}
4250
```
43-
In this case only the number of cores `cores`, the name of the job `job_name` and the command `command` are communicated.
51+
In this case only the number of cores `cores`, the name of the job `job_name` , the maximum run time of the job `run_time_max` and the command `command` are communicated.
4452

4553
## LFS
4654
For the load sharing facility framework from IBM the `queue.yaml` file defines the `queue_type` as `LSF`:

tests/config/flux/flux.sh

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
11
#!/bin/bash
2-
#flux: -n{{cores}} --job-name={{job_name}} --env=CORES={{cores}} --output=time.out --error=error.out
2+
# flux:--job-name={{job_name}}
3+
# flux: --env=CORES={{cores}}
4+
# flux: --output=time.out
5+
# flux: --error=error.out
6+
# flux: -n {{cores}}
7+
{%- if run_time_max %}
8+
# flux: -t {{ [1, run_time_max // 60]|max }}
9+
{%- endif %}
10+
311
{{command}}

tests/test_flux.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,13 @@ def execute_command(
8282
output = f.read()
8383
content = """\
8484
#!/bin/bash
85-
#flux: -n4 --job-name=test --env=CORES=4 --output=time.out --error=error.out
85+
# flux:--job-name=test
86+
# flux: --env=CORES=4
87+
# flux: --output=time.out
88+
# flux: --error=error.out
89+
# flux: -n 4
90+
# flux: -t 2880
91+
8692
echo hello"""
8793
self.assertEqual(content, output)
8894
os.remove("run_queue.sh")

0 commit comments

Comments
 (0)