Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
ensembl-gh-mirror
ensembl-hive
Commits
5c51ba12
Commit
5c51ba12
authored
Jun 13, 2017
by
Leo Gordon
Browse files
simplified the internal Valley interface since it no longer manages rc_names
parent
88e53402
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
19 deletions
+10
-19
modules/Bio/EnsEMBL/Hive/Queen.pm
modules/Bio/EnsEMBL/Hive/Queen.pm
+1
-3
modules/Bio/EnsEMBL/Hive/Valley.pm
modules/Bio/EnsEMBL/Hive/Valley.pm
+9
-16
No files found.
modules/Bio/EnsEMBL/Hive/Queen.pm
View file @
5c51ba12
...
...
@@ -361,9 +361,7 @@ sub cached_resource_mapping {
sub
registered_workers_and_resource_mapping
{
my
$self
=
shift
@_
;
my
$all_meadows_workers_deemed_alive
=
$self
->
fetch_all
("
status!='DEAD'
",
1
,
['
meadow_type
',
'
meadow_name
',
'
meadow_user
',
'
process_id
'],
['
resource_class_id
',
'
status
']
);
return
(
$all_meadows_workers_deemed_alive
,
$self
->
cached_resource_mapping
);
return
$self
->
fetch_all
("
status!='DEAD'
",
1
,
['
meadow_type
',
'
meadow_name
',
'
meadow_user
',
'
process_id
'],
['
resource_class_id
',
'
status
']
);
}
...
...
modules/Bio/EnsEMBL/Hive/Valley.pm
View file @
5c51ba12
...
...
@@ -175,7 +175,7 @@ sub generate_limiters {
my
%meadow_capacity_limiter_hashed_by_type
=
();
foreach
my
$meadow
(
@
{
$self
->
get_available_meadow_list
})
{
my
$this_worker_count
=
s
um
(
0
,
(
map
{
scalar
(
@
$_
)}
values
(
%
{
$worker_statuses
->
{
$meadow
->
signature
}{
'
RUN
'
}
}
))
);
my
$this_worker_count
=
s
calar
(
@
{
$worker_statuses
->
{
$meadow
->
signature
}{
'
RUN
'
}
||
[]
}
);
$valley_running_worker_count
+=
$this_worker_count
;
...
...
@@ -192,7 +192,7 @@ sub generate_limiters {
sub
query_worker_statuses
{
my
(
$self
,
$all_meadows_workers_deemed_alive
,
$resource_id_to_name
)
=
@_
;
my
(
$self
,
$all_meadows_workers_deemed_alive
)
=
@_
;
my
%worker_statuses
=
();
...
...
@@ -204,17 +204,12 @@ sub query_worker_statuses {
foreach
my
$vector
(
@$this_meadow_worker_status_list
)
{
# leaf though the Meadow-seen Workers
my
(
$worker_pid
,
$meadow_user
,
$status
)
=
@$vector
;
my
$rc_name
=
'
__undefined_rc_name__
';
if
(
my
$worker_found_alive
=
$this_meadow_workers_deemed_alive
->
{
$meadow_user
}{
$worker_pid
})
{
if
(
my
$db_resource_class_id
=
$worker_found_alive
->
{'
resource_class_id
'}
)
{
$rc_name
=
$resource_id_to_name
->
{
$db_resource_class_id
};
}
}
elsif
(
$status
eq
'
RUN
')
{
# running on the Meadow but not in the database => likely having hard time registering (db too busy ? registry too big ?)
$status
=
'
PEND
';
if
(
(
$status
eq
'
RUN
')
and
!
$this_meadow_workers_deemed_alive
->
{
$meadow_user
}{
$worker_pid
})
{
$status
=
'
PEND
';
# running on the Meadow but not in the database => manually scheduled & having hard time registering (db too busy ? registry too big ?)
}
push
@
{
$worker_statuses
{
$meadow_signature
}{
$status
}{
$rc_name
}
},
$worker_pid
;
push
@
{
$worker_statuses
{
$meadow_signature
}{
$status
}
},
$worker_pid
;
}
}
return
\
%worker_statuses
;
...
...
@@ -229,11 +224,9 @@ sub status_of_all_our_workers_by_meadow_signature {
my
$meadow_signature
=
$meadow
->
signature
;
$signature_and_pid_to_worker_status
{
$meadow_signature
}
=
{};
my
$statuses_rc_name
=
$worker_statuses
->
{
$meadow_signature
};
foreach
my
$status
(
keys
%$statuses_rc_name
)
{
foreach
my
$pid_list
(
values
%
{
$statuses_rc_name
->
{
$status
}
})
{
$signature_and_pid_to_worker_status
{
$meadow_signature
}{
$_
}
=
$status
for
@$pid_list
;
}
my
$status_2_pid_list
=
$worker_statuses
->
{
$meadow_signature
};
while
(
my
(
$status
,
$pid_list
)
=
each
%$status_2_pid_list
)
{
$signature_and_pid_to_worker_status
{
$meadow_signature
}{
$_
}
=
$status
for
@$pid_list
;
}
}
return
\
%signature_and_pid_to_worker_status
;
...
...
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