Skip to content

Commit

Permalink
Add test options for slurm
Browse files Browse the repository at this point in the history
  • Loading branch information
VOD555 committed Feb 26, 2019
1 parent f3f93bb commit 2dc8dda
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions gromacs/qsub.py
Original file line number Diff line number Diff line change
Expand Up @@ -367,12 +367,12 @@ def write_script(template):
logger.info("Setting up queuing system script {submitscript!r}...".format(**vars()))
# These substitution rules are documented for the user in the module doc string
qsystem = detect_queuing_system(template)
if qsystem.name == 'Slurm':
if qsystem is not None and (qsystem.name == 'Slurm'):
cbook.edit_txt(template,
[('^ *DEFFNM=','(?<==)(.*)', deffnm),
('^#.*(-J)', '((?<=-J\s))\s*\w+', jobname),
('^#.*(-A|account_no)', '((?<=-A\s)|(?<=account_no\s))\s*\w+', budget),
('^#.*(-t walltime)', '(?<==)(\d+:\d+:\d+)', walltime),
('^#.*(-t)', '(?<=-t\s)(\d+:\d+:\d+)', walltime),
('^ *WALL_HOURS=', '(?<==)(.*)', wall_hours),
('^ *STARTDIR=', '(?<==)(.*)', startdir),
('^ *NPME=', '(?<==)(.*)', npme),
Expand Down
5 changes: 3 additions & 2 deletions gromacs/tests/test_qsub.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import gromacs.qsub

def test_queuing_systems(known=("Sun Gridengine", "PBS", "LoadLeveler")):
def test_queuing_systems(known=("Sun Gridengine", "PBS", "LoadLeveler", 'Slurm')):
assert len(gromacs.qsub.queuing_systems) == len(known)
for qs in gromacs.qsub.queuing_systems:
assert qs.name in known
Expand All @@ -18,7 +18,8 @@ def test_queuing_systems(known=("Sun Gridengine", "PBS", "LoadLeveler")):
@pytest.mark.parametrize("scriptfile,name", [
("foo.sge", "Sun Gridengine"),
("foo.pbs", "PBS"),
("foo.ll", "LoadLeveler")])
("foo.ll", "LoadLeveler"),
("foo.slu", "Slurm")])
def test_detect_queuing_system(scriptfile, name):
qs = gromacs.qsub.detect_queuing_system(scriptfile)
assert qs.name == name
Expand Down

0 comments on commit 2dc8dda

Please sign in to comment.