Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Stanislav Bohm
quake
Commits
4a3375a9
Commit
4a3375a9
authored
May 24, 2021
by
Stanislav Bohm
Browse files
Detecting if we are inside a job
parent
04a0ceeb
Changes
2
Hide whitespace changes
Inline
Side-by-side
quake/job/__main__.py
View file @
4a3375a9
...
...
@@ -5,6 +5,7 @@ import logging
import
uvloop
from
.job
import
Job
from
.globals
import
set_job_flag
uvloop
.
install
()
...
...
@@ -18,6 +19,7 @@ def parse_args():
async
def
main
():
set_job_flag
()
args
=
parse_args
()
job
=
Job
(
args
.
task_id
,
args
.
rank
,
args
.
ds_local_port
,
{})
await
job
.
start
()
...
...
quake/job/globals.py
0 → 100644
View file @
4a3375a9
_is_inside_job
=
False
def
is_inside_job
():
return
_is_inside_job
def
set_job_flag
():
global
_is_inside_job
_is_inside_job
=
True
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment