diff --git a/src/psij/executors/batch/cobalt/cobalt.mustache b/src/psij/executors/batch/cobalt/cobalt.mustache index 444de0aed..20ef241f6 100644 --- a/src/psij/executors/batch/cobalt/cobalt.mustache +++ b/src/psij/executors/batch/cobalt/cobalt.mustache @@ -1,7 +1,7 @@ #!/bin/bash -{{#job.name}} +{{#job.spec.name}} #COBALT --jobname={{.}} -{{/job.name}} +{{/job.spec.name}} {{#job.spec.directory}} #COBALT --cwd={{.}} {{/job.spec.directory}} diff --git a/src/psij/executors/batch/lsf/lsf.mustache b/src/psij/executors/batch/lsf/lsf.mustache index 19c4cb804..71957268b 100644 --- a/src/psij/executors/batch/lsf/lsf.mustache +++ b/src/psij/executors/batch/lsf/lsf.mustache @@ -1,8 +1,8 @@ #!/bin/bash -{{#job.name}} +{{#job.spec.name}} #BSUB -J "{{.}}" -{{/job.name}} +{{/job.spec.name}} {{#job.spec.directory}} #BSUB -cwd "{{.}}" diff --git a/src/psij/executors/batch/pbs/pbs_classic.mustache b/src/psij/executors/batch/pbs/pbs_classic.mustache index a987dfb21..15466969f 100644 --- a/src/psij/executors/batch/pbs/pbs_classic.mustache +++ b/src/psij/executors/batch/pbs/pbs_classic.mustache @@ -1,9 +1,9 @@ #!/bin/bash -{{#job.name}} +{{#job.spec.name}} #PBS -N="{{.}}" -{{/job.name}} +{{/job.spec.name}} {{#job.spec.inherit_environment}} #PBS -V diff --git a/src/psij/executors/batch/pbs/pbspro.mustache b/src/psij/executors/batch/pbs/pbspro.mustache index a70b2b705..399cd3959 100644 --- a/src/psij/executors/batch/pbs/pbspro.mustache +++ b/src/psij/executors/batch/pbs/pbspro.mustache @@ -1,9 +1,9 @@ #!/bin/bash -{{#job.name}} +{{#job.spec.name}} #PBS -N="{{.}}" -{{/job.name}} +{{/job.spec.name}} {{#job.spec.inherit_environment}} #PBS -V diff --git a/src/psij/executors/batch/slurm/slurm.mustache b/src/psij/executors/batch/slurm/slurm.mustache index 8d943d406..b6c7ee9eb 100644 --- a/src/psij/executors/batch/slurm/slurm.mustache +++ b/src/psij/executors/batch/slurm/slurm.mustache @@ -1,9 +1,9 @@ #!/bin/bash -{{#job.name}} +{{#job.spec.name}} #SBATCH --job-name="{{.}}" -{{/job.name}} +{{/job.spec.name}} {{#job.spec.directory}} #SBATCH --chdir="{{.}}" diff --git a/tests/plugins1/_batch_test/test/test.mustache b/tests/plugins1/_batch_test/test/test.mustache index 5fc00bfe0..8c9633396 100644 --- a/tests/plugins1/_batch_test/test/test.mustache +++ b/tests/plugins1/_batch_test/test/test.mustache @@ -4,6 +4,10 @@ exec &> "{{psij.script_dir}}/$PSIJ_BATCH_TEST_JOB_ID.out" {{> batch_lib}} +{{#job.spec.name}} +# job name: {{.}} +{{/job.spec.name}} + {{#job.spec.directory}} cd "{{.}}" {{/job.spec.directory}} diff --git a/tests/test_executor.py b/tests/test_executor.py index 83090ecc0..04cddd484 100644 --- a/tests/test_executor.py +++ b/tests/test_executor.py @@ -236,7 +236,7 @@ def test_submit_script_generation(exec_name: str) -> None: job = Job(spec=spec) prefix = _get_attr_prefix(exec_name) - _check_str_attrs(ex, job, ['executable', 'directory'], + _check_str_attrs(ex, job, ['executable', 'directory', 'name'], lambda k, v: setattr(spec, k, v)) _check_str_attrs(ex, job, ['queue_name', 'account', 'reservation_id'], lambda k, v: setattr(attrs, k, v))