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
394ad647
Commit
394ad647
authored
May 23, 2012
by
Leo Gordon
Browse files
reuse the meadow->name() method to check for availability [cleanup]
parent
37e63c93
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
15 deletions
+10
-15
modules/Bio/EnsEMBL/Hive/Meadow/LOCAL.pm
modules/Bio/EnsEMBL/Hive/Meadow/LOCAL.pm
+1
-7
modules/Bio/EnsEMBL/Hive/Meadow/LSF.pm
modules/Bio/EnsEMBL/Hive/Meadow/LSF.pm
+8
-7
modules/Bio/EnsEMBL/Hive/Valley.pm
modules/Bio/EnsEMBL/Hive/Valley.pm
+1
-1
No files found.
modules/Bio/EnsEMBL/Hive/Meadow/LOCAL.pm
View file @
394ad647
...
...
@@ -8,13 +8,7 @@ use Sys::Hostname;
use
base
('
Bio::EnsEMBL::Hive::Meadow
');
sub
available
{
# always invoked as a class method
return
1
;
# for the moment assume LOCAL meadow is always available
}
sub
name
{
sub
name
{
# also called to check for availability; for the moment assume LOCAL meadow is always available
return
hostname
();
}
...
...
modules/Bio/EnsEMBL/Hive/Meadow/LSF.pm
View file @
394ad647
...
...
@@ -7,15 +7,10 @@ use strict;
use
base
('
Bio::EnsEMBL::Hive::Meadow
');
sub
available
{
# always invoked as a class method
return
`
which bjobs 2>/dev/null
`;
}
sub
name
{
sub
name
{
# also called to check for availability; assume LSF is available if LSF cluster_name can be established
my
$mcni
=
'
My cluster name is
';
if
(
my
$name
=
`
lsid | grep '
$mcni
'
`)
{
if
(
my
$name
=
`
lsid
2>/dev/null
| grep '
$mcni
'
`)
{
$name
=~
/^$mcni\s+(\w+)/
;
return
$
1
;
}
...
...
@@ -39,6 +34,7 @@ sub get_current_worker_process_id {
}
}
sub
count_pending_workers_by_rc_id
{
my
(
$self
)
=
@_
;
...
...
@@ -56,6 +52,7 @@ sub count_pending_workers_by_rc_id {
return
\
%pending_by_rc_id
;
}
sub
status_of_all_our_workers
{
# returns a hashref
my
(
$self
)
=
@_
;
...
...
@@ -76,6 +73,7 @@ sub status_of_all_our_workers { # returns a hashref
return
\
%status_hash
;
}
sub
check_worker_is_alive_and_mine
{
my
(
$self
,
$worker
)
=
@_
;
...
...
@@ -87,6 +85,7 @@ sub check_worker_is_alive_and_mine {
return
$is_alive_and_mine
;
}
sub
kill_worker
{
my
$worker
=
pop
@_
;
...
...
@@ -94,6 +93,7 @@ sub kill_worker {
system
(
$cmd
);
}
sub
find_out_causes
{
my
$self
=
shift
@_
;
...
...
@@ -118,6 +118,7 @@ sub find_out_causes {
return
\
%cod
;
}
sub
submit_workers
{
my
(
$self
,
$iteration
,
$worker_cmd
,
$worker_count
,
$rc_id
,
$rc_parameters
)
=
@_
;
...
...
modules/Bio/EnsEMBL/Hive/Valley.pm
View file @
394ad647
...
...
@@ -43,7 +43,7 @@ sub new {
# make sure modules are loaded and available ones are checked prior to setting the current one
foreach
my
$meadow_class
(
@
{
find_submodules
(
$self
->
meadow_class_path
)
})
{
eval
"
require
$meadow_class
";
if
(
$meadow_class
->
availabl
e
)
{
if
(
$meadow_class
->
nam
e
)
{
$amch
->
{
$meadow_class
->
type
}
=
$meadow_class
->
new
();
}
}
...
...
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