line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package HPC::Runner::Command::draw_deps; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
our $VERSION = '3.0.0'; |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
=head1 HPC::Runner::Command::draw_deps |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
Call the hpcrunner.pl draw_deps command |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
=cut |
10
|
|
|
|
|
|
|
|
11
|
1
|
|
|
1
|
|
47733
|
use MooseX::App::Command; |
|
1
|
|
|
|
|
599720
|
|
|
1
|
|
|
|
|
4
|
|
12
|
1
|
|
|
1
|
|
649818
|
use Algorithm::Dependency::Source::HoA; |
|
1
|
|
|
|
|
2909
|
|
|
1
|
|
|
|
|
25
|
|
13
|
1
|
|
|
1
|
|
412
|
use Algorithm::Dependency::Ordered; |
|
1
|
|
|
|
|
319
|
|
|
1
|
|
|
|
|
22
|
|
14
|
1
|
|
|
1
|
|
529
|
use Data::Dumper; |
|
1
|
|
|
|
|
4405
|
|
|
1
|
|
|
|
|
63
|
|
15
|
1
|
|
|
1
|
|
1525
|
use GraphViz2; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
extends 'HPC::Runner::Command'; |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
with 'HPC::Runner::Command::Utils::Base'; |
20
|
|
|
|
|
|
|
with 'HPC::Runner::Command::Utils::Log'; |
21
|
|
|
|
|
|
|
with 'HPC::Runner::Command::submit_jobs::Utils::Scheduler'; |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
command_short_description 'Draw out a job dependency tree'; |
24
|
|
|
|
|
|
|
command_long_description |
25
|
|
|
|
|
|
|
'This command parses your input file, verifies your schedule, and draws out a dependency diagram.'; |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
=head2 Attributes |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
=head2 Subroutines |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
=cut |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
sub BUILD { |
34
|
|
|
|
|
|
|
my $self = shift; |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
$self->gen_load_plugins; |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
sub execute { |
40
|
|
|
|
|
|
|
my $self = shift; |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
$self->parse_file_slurm(); |
43
|
|
|
|
|
|
|
$self->iterate_schedule(); |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
=head3 schedule_jobs |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
Use Algorithm::Dependency to schedule the jobs |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
We are overriding this method to produce our dependency trees |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
=cut |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
sub schedule_jobs { |
55
|
|
|
|
|
|
|
my $self = shift; |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
my $source = |
58
|
|
|
|
|
|
|
Algorithm::Dependency::Source::HoA->new( $self->graph_job_deps ); |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
my $dep = Algorithm::Dependency::Ordered->new( |
61
|
|
|
|
|
|
|
source => $source, |
62
|
|
|
|
|
|
|
selected => [] |
63
|
|
|
|
|
|
|
); |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
my ($graph) = GraphViz2->new( |
66
|
|
|
|
|
|
|
edge => { color => 'grey' }, |
67
|
|
|
|
|
|
|
global => { directed => 1 }, |
68
|
|
|
|
|
|
|
graph => { rankdir => 'BT' }, |
69
|
|
|
|
|
|
|
node => { shape => 'oval' }, |
70
|
|
|
|
|
|
|
); |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
$graph -> dependency(data => $dep ); |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
my($format) = 'svg'; |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
$graph -> run(format => $format, output_file => "dependency.hpc.$format" ); |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
exit 0; |
79
|
|
|
|
|
|
|
} |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
1; |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
__END__ |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
=encoding utf-8 |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
=head1 NAME |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
HPC::Runner::Command::draw_deps - Draw out the dependency trees of HPC::Runner::Command files |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
=head1 SYNOPSIS |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
use HPC::Runner::Command::draw_deps; |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
hpcrunner.pl draw_deps --infile job_file.in |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
=head1 DESCRIPTION |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
HPC::Runner::Command::draw_deps - Draw out the dependency trees of HPC::Runner::Command files using GraphViz2. |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
=head1 AUTHOR |
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
Jillian Rowe E<lt>jillian.e.rowe@gmail.comE<gt> |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
=head1 COPYRIGHT |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
Copyright 2017- Jillian Rowe |
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
=head1 LICENSE |
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
This library is free software; you can redistribute it and/or modify |
112
|
|
|
|
|
|
|
it under the same terms as Perl itself. |
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
=head1 SEE ALSO |
115
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
=cut |