Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
pycalibration
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Model registry
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
calibration
pycalibration
Commits
5c496d77
Commit
5c496d77
authored
5 years ago
by
Karim Ahmed
Browse files
Options
Downloads
Patches
Plain Diff
give higher niceness priority to DARKs
parent
12e7bdb8
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!228
Feat/batch prioritization darks
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
webservice/webservice.py
+10
-8
10 additions, 8 deletions
webservice/webservice.py
with
10 additions
and
8 deletions
webservice/webservice.py
+
10
−
8
View file @
5c496d77
...
...
@@ -355,9 +355,10 @@ async def copy_untouched_files(file_list, out_folder, run):
logging
.
info
(
"
Copying {} to {}
"
.
format
(
f
,
of
))
async
def
run_
corre
ction
(
conn
,
cmd
,
mode
,
proposal
,
run
,
rid
):
"""
Run a
corre
ction command
async
def
run_
a
ction
(
job_db
,
cmd
,
mode
,
proposal
,
run
,
rid
):
"""
Run action command
(CORRECT OR DARK)
:param job_db: jobs database
:param cmd: to run, should be a in list for as expected by subprocess.run
:param mode:
"
prod
"
or
"
sim
"
, in the latter case nothing will be executed
but the command will be logged
...
...
@@ -377,8 +378,9 @@ async def run_correction(conn, cmd, mode, proposal, run, rid):
else
:
logging
.
info
(
Success
.
START_CORRECTION
.
format
(
proposal
,
run
))
# enter jobs in job db
c
=
conn
.
cursor
()
c
=
job_db
.
cursor
()
rstr
=
ret
.
stdout
.
decode
()
query
=
"
INSERT INTO jobs VALUES (
'
{rid}
'
,
'
{jobid}
'
,
'
{proposal}
'
,
'
{run}
'
,
'
PD
'
,
'
{now}
'
,
'
{det}
'
,
'
{act}
'
)
"
# noqa
for
r
in
rstr
.
split
(
"
\n
"
):
if
"
Submitted job:
"
in
r
:
...
...
@@ -387,7 +389,7 @@ async def run_correction(conn, cmd, mode, proposal, run, rid):
proposal
=
proposal
,
run
=
run
,
now
=
datetime
.
now
().
isoformat
(),
det
=
cmd
[
3
],
act
=
cmd
[
4
]))
conn
.
commit
()
job_db
.
commit
()
logging
.
debug
(
"
"
.
join
(
cmd
))
if
"
DARK
"
in
cmd
:
return
Success
.
START_CHAR
.
format
(
proposal
,
run
)
...
...
@@ -687,7 +689,7 @@ async def server_runner(config, mode):
"
EPIX
"
,
"
EPIX10K
"
]:
priority
=
'
0
'
cmd
=
[
"
python
"
,
"
-m
"
,
"
xfel_calibrate.calibrate
"
,
detector
,
"
DARK
"
,
'
--priority
'
,
priority
]
detector
,
"
DARK
"
,
'
--priority
'
,
priority
,
'
--slurm-priority
'
,
'
10
'
]
# Avoid giving a reservation parameter after the
# ITDM changes for giving xcal high priority by default
...
...
@@ -705,7 +707,7 @@ async def server_runner(config, mode):
cmd
=
await
parse_config
(
cmd
,
dconfig
)
ret
=
await
run_
corre
ction
(
job_db
,
cmd
,
mode
,
proposal
,
ret
=
await
run_
a
ction
(
job_db
,
cmd
,
mode
,
proposal
,
wait_runs
[
0
],
0
)
status
.
append
(
ret
)
...
...
@@ -755,13 +757,13 @@ async def server_runner(config, mode):
if
"
-
"
in
detector
:
detector
,
_
=
detector
.
split
(
"
-
"
)
cmd
=
[
"
python
"
,
"
-m
"
,
"
xfel_calibrate.calibrate
"
,
detector
,
"
CORRECT
"
]
detector
,
"
CORRECT
"
,
'
--slurm-priority
'
,
'
100
'
]
cmd
=
await
parse_config
(
cmd
,
dconfig
)
if
priority
:
cmd
+=
[
"
--priority
"
,
str
(
priority
)]
ret
=
await
run_
corre
ction
(
job_db
,
cmd
,
mode
,
proposal
,
ret
=
await
run_
a
ction
(
job_db
,
cmd
,
mode
,
proposal
,
runnr
,
rid
)
status
.
append
(
ret
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment