Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
ensembl-gh-mirror
ensembl-hive
Commits
2952e74e
Commit
2952e74e
authored
Sep 20, 2012
by
Leo Gordon
Browse files
optimization: worker should not sync analyses it is not ready to run
parent
a744dfb2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
6 deletions
+6
-6
modules/Bio/EnsEMBL/Hive/DBSQL/AnalysisStatsAdaptor.pm
modules/Bio/EnsEMBL/Hive/DBSQL/AnalysisStatsAdaptor.pm
+2
-2
modules/Bio/EnsEMBL/Hive/Queen.pm
modules/Bio/EnsEMBL/Hive/Queen.pm
+4
-4
No files found.
modules/Bio/EnsEMBL/Hive/DBSQL/AnalysisStatsAdaptor.pm
View file @
2952e74e
...
...
@@ -99,7 +99,7 @@ sub fetch_by_needed_workers {
my
(
$self
,
$limit
,
$resource_class_id
)
=
@_
;
my
$constraint
=
"
ast.num_required_workers>0 AND ast.status in ('READY','WORKING')
"
.
(
defined
(
$resource_class_id
)
?
"
AND ast.resource_class_id =
$resource_class_id
"
:
'');
.
(
$resource_class_id
?
"
AND ast.resource_class_id =
$resource_class_id
"
:
'');
my
$final_clause
=
'
ORDER BY priority DESC,
'
.
(
(
$self
->
dbc
->
driver
eq
'
sqlite
')
?
'
RANDOM()
'
:
'
RAND()
'
)
...
...
@@ -117,7 +117,7 @@ sub fetch_by_statuses {
my
(
$self
,
$statuses
,
$resource_class_id
)
=
@_
;
my
$constraint
=
'
ast.status in (
'
.
join
('
,
',
map
{
"
'
$_
'
"
}
@$statuses
)
.
'
)
'
.
(
defined
(
$resource_class_id
)
?
"
AND ast.resource_class_id =
$resource_class_id
"
:
'');
.
(
$resource_class_id
?
"
AND ast.resource_class_id =
$resource_class_id
"
:
'');
$self
->
_final_clause
('
ORDER BY last_update
');
my
$results
=
$self
->
_generic_fetch
(
$constraint
);
...
...
modules/Bio/EnsEMBL/Hive/Queen.pm
View file @
2952e74e
...
...
@@ -934,15 +934,15 @@ sub _pick_best_analysis_for_new_worker {
return
$stats
if
((
$stats
->
status
ne
'
BLOCKED
')
and
(
$stats
->
num_required_workers
>
0
)
and
(
!
defined
(
$rc_id
)
or
(
$stats
->
resource_class_id
==
$rc_id
)));
}
# ok so no analyses 'need' workers with the given $rc_id.
# ok so no analyses 'need' workers with the given $rc_id.
if
(
$self
->
get_num_failed_analyses
())
{
return
undef
;
}
# see if anything needs an update, in case there are
# hidden jobs that haven't made it into the summary stats
# see if any analysis needs an update, in case there are hidden jobs that haven't made it into the summary stats:
print
("
QUEEN: no obvious needed workers, need to dig deeper
\n
");
my
$stats_list
=
$statsDBA
->
fetch_by_statuses
(['
LOADING
',
'
BLOCKED
',
'
ALL_CLAIMED
']);
my
$stats_list
=
$statsDBA
->
fetch_by_statuses
(['
LOADING
',
'
BLOCKED
',
'
ALL_CLAIMED
']
,
$rc_id
);
foreach
$stats
(
@$stats_list
)
{
$self
->
safe_synchronize_AnalysisStats
(
$stats
);
...
...
Write
Preview
Markdown
is supported
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