8000 added request_gpu option and fixed extra_lines issue by ibsafa · Pull Request #132 · pycondor/pycondor · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

added request_gpu option and fixed extra_lines issue #132

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 1 commit into
base: master
Choose a base branch
from
Open
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
18 changes: 11 additions & 7 deletions pycondor/job.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ class Job(BaseNode):

.. versionadded:: 0.1.0

request_gpus : int or None, optional
Number of GPUs to request in submit file.

getenv : bool or None, optional
Whether or not to use the current environment settings when running
the job (default is None).
Expand Down Expand Up @@ -125,7 +128,7 @@ class Job(BaseNode):

def __init__(self, name, executable, error=None, log=None, output=None,
submit=None, request_memory=None, request_disk=None,
request_cpus=None, getenv=None, universe=None,
request_cpus=None, request_gpus=None, getenv=None, universe=None,
initialdir=None, notification=None, requirements=None,
queue=None, extra_lines=None, dag=None, arguments=None,
retry=None, verbose=0):
Expand All @@ -139,6 +142,7 @@ def __init__(self, name, executable, error=None, log=None, output=None,
self.request_memory = request_memory
self.request_disk = request_disk
self.request_cpus = request_cpus
self.request_gpus = request_gpus
self.getenv = getenv
self.universe = universe
self.initialdir = initialdir
Expand Down Expand Up @@ -261,8 +265,8 @@ def _make_submit_script(self, makedirs=True, fancyname=True, indag=False):

lines = []
submit_attrs = ['universe', 'executable', 'request_memory',
'request_disk', 'request_cpus', 'getenv',
'initialdir', 'notification', 'requirements']
'request_disk', 'request_cpus', 'request_gpus',
'getenv', 'initialdir', 'notification', 'requirements']
for submit_attr in submit_attrs:
if getattr(self, submit_attr) is not None:
submit_attr_str = string_rep(getattr(self, submit_attr))
Expand All @@ -275,6 +279,10 @@ def _make_submit_script(self, makedirs=True, fancyname=True, indag=False):
# Add submit_file data member to job for later use
self.submit_file = submit_file

# Add any extra lines to submit file, if specified
if self.extra_lines:
lines.extend(self.extra_lines)

# Set up log, output, and error files paths
self._has_arg_names = any([arg.name for arg in self.args])
for attr in ['log', 'output', 'error']:
Expand All @@ -297,10 +305,6 @@ def _make_submit_script(self, makedirs=True, fancyname=True, indag=False):
setattr(self, '{}_file'.format(attr), file_path)
checkdir(file_path, makedirs)

# Add any extra lines to submit file, if specified
if self.extra_lines:
lines.extend(self.extra_lines)

# Add arguments and queue line
if self.queue is not None and not isinstance(self.queue, int):
raise ValueError('queue must be of type int')
Expand Down
0