Skip to content

Added support for more resource labels #11

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,8 @@ The following resources are supported by on a per-rule basis:

**node** - set the ppn resource request (defaults to the thread declaration).
**mem** - set the memory resource request (bytes).
**walltime** - set the walltime resource (secs).
**mem_mb** - set the memory resource request (megabytes).
**mem_gb** - set the memory resource request (gigabytes).
**walltime** / **time** - set the walltime resource (secs).
**walltime_min** / **time_min** - set the walltime resource (mins).
**walltime_h** / **time_h** - set the walltime resource (hours).
22 changes: 20 additions & 2 deletions {{cookiecutter.profile_name}}/pbs-submit.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,26 @@
resources = job_properties["resources"]
if "nodes" in resources: nodes="nodes=" + str(resources["nodes"])
if ppn and not nodes : nodes="nodes=1"
if "mem" in resources: mem="mem=" + str(resources["mem"])
if "walltime" in resources: walltime="walltime=" + str(resources["walltime"])

if "mem" in resources:
mem="mem=" + str(resources["mem_gb"])
elif "mem_gb" in resources:
mem="mem=" + str(resources["mem_gb"]) + "gb"
elif "mem_mb" in resources:
mem="mem=" + str(resources["mem_mb"]) + "mb"

if "walltime" in resources:
walltime="walltime=" + str(resources["walltime"])
elif "walltime_min" in resources:
walltime="walltime=" + str(resources["walltime_min"] * 60)
elif "walltime_h" in resources:
walltime="walltime=" + str(resources["walltime_h"] * 60 * 60)
elif "time" in resources:
walltime="walltime=" + str(resources["time"])
elif "time_min" in resources:
walltime="walltime=" + str(resources["time_min"] * 60)
elif "time_h" in resources:
walltime="walltime=" + str(resources["time_h"] * 60 * 60

if nodes or ppn or mem or walltime: resourceparams = " -l \""
if nodes: resourceparams = resourceparams + nodes
Expand Down