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
2836abf0
Commit
2836abf0
authored
Jun 14, 2004
by
Jessica Severin
Browse files
split check for dead workers into specific option
parent
2f519f39
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
10 deletions
+13
-10
scripts/local_beekeeper.pl
scripts/local_beekeeper.pl
+13
-10
No files found.
scripts/local_beekeeper.pl
View file @
2836abf0
...
...
@@ -34,6 +34,7 @@ GetOptions('help' => \$help,
'
dbuser=s
'
=>
\
$user
,
'
dbpass=s
'
=>
\
$pass
,
'
dbname=s
'
=>
\
$dbname
,
'
dead
'
=>
\
$self
->
{'
all_dead
'},
);
$self
->
{'
analysis_id
'}
=
shift
if
(
@
_
);
...
...
@@ -76,7 +77,7 @@ foreach my $rule (@{$rules}) {
}
check_for_dead_workers
(
$self
,
$self
->
{'
queen
'});
if
(
$self
->
{'
all_dead
'})
{
check_for_dead_workers
(
$self
,
$self
->
{'
queen
'});
}
run_beekeeper
(
$self
);
...
...
@@ -91,7 +92,7 @@ exit(0);
#######################
sub
usage
{
print
"
runWork
er.pl [options]
\n
";
print
"
local_beekeep
er.pl [options]
\n
";
print
"
-help : print this help
\n
";
print
"
-url <url string> : url defining where hive database is located
\n
";
print
"
-conf <path> : config file describing db connection
\n
";
...
...
@@ -103,7 +104,7 @@ sub usage {
print
"
-analysis_id <id> : analysis_id in db
\n
";
print
"
-limit <num> : #jobs to run before worker can die naturally
\n
";
print
"
-outdir <path> : directory where stdout/stderr is redirected
\n
";
print
"
runWork
er.pl v1.0
\n
";
print
"
local_beekeep
er.pl v1.0
\n
";
exit
(
1
);
}
...
...
@@ -139,6 +140,10 @@ sub run_beekeeper
#my $cmd = "./runWorker.pl -conf $conf_file -analysis_id $analysis_id";
my
$cmd
=
"
bsub -JW
$analysis_id
\
[1-
$count
\
] ./runWorker.pl -url
$url
-analysis_id
$analysis_id
";
print
("
$cmd
\n
");
# return of bsub looks like this
#Job <6392054> is submitted to default queue <normal>.
}
}
...
...
@@ -149,20 +154,18 @@ sub check_for_dead_workers {
my
$host
=
hostname
;
my
$overdueWorkers
=
$queen
->
fetch_overdue_workers
(
360
0
);
#overdue by 1hr
my
$overdueWorkers
=
$queen
->
fetch_overdue_workers
(
5
*
6
0
);
#overdue by 1hr
print
(
scalar
(
@
{
$overdueWorkers
}),
"
overdue workers
\n
");
foreach
my
$worker
(
@
{
$overdueWorkers
})
{
if
((
$worker
->
beekeeper
eq
'
local
')
and
(
$worker
->
host
eq
$host
))
{
printf
("
%10d %20s analysis_id=%d
\n
",
$worker
->
hive_id
,
$worker
->
host
,
$worker
->
analysis
->
dbID
);
if
((
$worker
->
beekeeper
eq
'')
and
(
$worker
->
host
eq
$host
))
{
print
("
is one of mine
\n
");
my
$cmd
=
"
ps -p
"
.
$worker
->
process_id
;
my
$check
=
qx/$cmd/
;
print
("
check :
$check
\n
");
printf
("
%10d %20s analysis_id=%d
\n
",
$worker
->
hive_id
,
$worker
->
host
,
$worker
->
analysis
->
dbID
);
#$queen->register_worker_death($worker);
$queen
->
register_worker_death
(
$worker
);
}
}
}
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