Skip to content

Commit

Permalink
added test_submission_script with adjusted settings for SGE
Browse files Browse the repository at this point in the history
  • Loading branch information
QuantumChemist committed Sep 19, 2024
1 parent 2a74639 commit 573641e
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions tests/io/test_sge.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,3 +236,40 @@ def test_check_convert_qresources(self, sge_io):
UnsupportedResourcesError, match=r"Keys not supported: rerunnable"
):
sge_io.check_convert_qresources(res)

def test_submission_script(self, sge_io, maximalist_qresources):
# remove unsupported SGE options
maximalist_qresources.rerunnable = None
maximalist_qresources.project = None
maximalist_qresources.account = None
maximalist_qresources.qos = None
maximalist_qresources.process_placement = ProcessPlacement.EVENLY_DISTRIBUTED

# Set `processes` to None to avoid the conflict
maximalist_qresources.processes = None

# generate the SGE submission script
script_qresources = sge_io.get_submission_script(
commands=["ls -l"], options=maximalist_qresources
)

# assert the correctness of the generated script
assert (
script_qresources.split("\n")
== """#!/bin/bash
#$ -q test_queue
#$ -N test_job
#$ -l select=1:ncpus=1:mpiprocs=1:mem=1000mb
#$ -l h_rt=0:1:40
#$ -l s_rt=0:1:30
#$ -binding scatter
#$ -M [email protected]
#$ -m abe
#$ -o test_output_filepath
#$ -e test_error_filepath
#$ -p 1
ls -l""".split(
"\n"
)
)

0 comments on commit 573641e

Please sign in to comment.