Skip to content

Commit da12926

Browse files
committed
Fix custom attributes generation and some other attributes.
1 parent 2ccdabd commit da12926

File tree

5 files changed

+51
-17
lines changed

5 files changed

+51
-17
lines changed

src/psij/executors/batch/cobalt/cobalt.mustache

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,23 @@
2020
{{#queue_name}}
2121
#COBALT --queue={{.}}
2222
{{/queue_name}}
23+
{{!Like PBS, Cobalt uses specially named queues for reservations, so we send the job to the
24+
respective queue when a reservation ID is specified.}}
25+
{{#reservation_id}}
26+
#COBALT --queue={{.}}
27+
{{/reservation_id}}
2328
{{#project_name}}
2429
#COBALT --project={{.}}
2530
{{/project_name}}
26-
{{#custom_attributes.COBALT}}
27-
#COBALT --{{key}}="{{value}}"
28-
{{/custom_attributes.COBALT}}
2931
{{/job.spec.attributes}}
3032

33+
{{#custom_attributes}}
34+
{{#cobalt}}
35+
#COBALT --{{key}}="{{value}}"
36+
{{/cobalt}}
37+
{{/custom_attributes}}
38+
39+
3140
{{#env}}
3241
#COBALT --env {{name}}={{value}}
3342
{{/env}}

src/psij/executors/batch/lsf/lsf.mustache

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,13 @@
5959

6060
{{/job.spec.attributes}}
6161

62+
{{#custom_attributes}}
63+
{{#lsf}}
64+
#BSUB -{{key}} "{{value}}"
65+
{{/lsf}}
66+
{{/custom_attributes}}
67+
68+
6269
{{!since we redirect the output manually, below, tell LSF not to do its own thing, since it
6370
only results in empty files that are not cleaned up}}
6471
#BSUB -e /dev/null

src/psij/executors/batch/pbspro/pbspro.mustache

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,25 @@
1616
{{/formatted_job_duration}}
1717

1818
{{#job.spec.attributes}}
19-
{{#projectName}}
19+
{{#project_name}}
2020
#PBS -P {{.}}
21-
{{/projectName}}
22-
{{#queueName}}
21+
{{/project_name}}
22+
{{#queue_name}}
2323
#PBS -q {{.}}
24-
{{/queueName}}
25-
{{#custom_attributes.pbs}}
24+
{{/queue_name}}
25+
{{!PBS uses specially named queues for reservations, so we send the job to the respective
26+
queue when a reservation ID is specified.}}
27+
{{#reservation_id}}
28+
#PBS -q {{.}}
29+
{{/reservation_id}}
30+
{{/job.spec.attributes}}
31+
32+
{{#custom_attributes}}
33+
{{#pbs}}
2634
#PBS -{{key}} "{{value}}"
27-
{{/custom_attributes.pbs}}
35+
{{/pbs}}
36+
{{/custom_attributes}}
2837

29-
{{/job.spec.attributes}}
3038

3139
{{!since we redirect the output manually, below, tell pbs not to do its own thing, since it
3240
only results in empty files that are not cleaned up}}

src/psij/executors/batch/slurm/slurm.mustache

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,13 @@
6161
{{#reservation_id}}
6262
#SBATCH --reservation="{{.}}"
6363
{{/reservation_id}}
64+
{{/job.spec.attributes}}
6465

65-
{{#custom_attributes.slurm}}
66+
{{#custom_attributes}}
67+
{{#slurm}}
6668
#SBATCH --{{key}}="{{value}}"
67-
{{/custom_attributes.slurm}}
68-
69-
{{/job.spec.attributes}}
69+
{{/slurm}}
70+
{{/custom_attributes}}
7071

7172
{{!since we redirect the output manually, below, tell slurm not to do its own thing, since it
7273
only results in empty files that are not cleaned up}}

tests/plugins1/_batch_test/test/test.mustache

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,23 @@ export PSIJ_TEST_BATCH_EXEC_COUNT={{.}}
1313
{{/job.spec.resources}}
1414

1515
{{#job.spec.attributes}}
16+
{{#queue_name}}
17+
export PSIJ_TEST_BATCH_EXEC_QUEUE="{{.}}"
18+
{{/queue_name}}
1619
{{#project_name}}
1720
export PSIJ_TEST_BATCH_EXEC_PROJECT="{{.}}"
1821
{{/project_name}}
22+
{{#reservation_id}}
23+
export PSIJ_TEST_BATCH_EXEC_RES_ID="{{.}}"
24+
{{/reservation_id}}
25+
{{/job.spec.attributes}}
1926

20-
{{#custom_attributes.test}}
27+
{{#custom_attributes}}
28+
{{#batch-test}}
2129
export {{key}}="{{value}}"
22-
{{/custom_attributes.test}}
23-
{{/job.spec.attributes}}
30+
{{/batch-test}}
31+
{{/custom_attributes}}
32+
2433

2534
{{#job.spec.inherit_environment}}env \{{/job.spec.inherit_environment}}{{^job.spec.inherit_environment}}env --ignore-environment \{{/job.spec.inherit_environment}}{{#env}}
2635
{{name}}="{{value}}" \

0 commit comments

Comments
 (0)