line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
{ |
2
|
|
|
|
|
|
|
package GRID::Machine::Process; |
3
|
20
|
|
|
20
|
|
117
|
use warnings; |
|
20
|
|
|
|
|
43
|
|
|
20
|
|
|
|
|
781
|
|
4
|
20
|
|
|
20
|
|
107
|
use strict; |
|
20
|
|
|
|
|
37
|
|
|
20
|
|
|
|
|
562
|
|
5
|
20
|
|
|
20
|
|
11580
|
use GRID::Machine::MakeAccessors; |
|
20
|
|
|
|
|
50
|
|
|
20
|
|
|
|
|
1505
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
my @legal = qw(machine pid stdin stdout stderr result); |
8
|
|
|
|
|
|
|
my %legal = map { $_ => 1 } @legal; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
GRID::Machine::MakeAccessors::make_accessors(@legal); |
11
|
|
|
|
|
|
|
|
12
|
20
|
|
|
|
|
145
|
use overload q("") => 'str', |
13
|
20
|
|
|
20
|
|
121
|
bool => 'alive'; |
|
20
|
|
|
|
|
35
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub waitpid { |
16
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
17
|
|
|
|
|
|
|
|
18
|
0
|
|
|
|
|
|
my $machine = $self->machine; |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
#delegate |
21
|
0
|
|
|
|
|
|
$machine->waitpid($self, @_); |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
our $separator = ':'; |
25
|
|
|
|
|
|
|
sub str { |
26
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
27
|
|
|
|
|
|
|
|
28
|
0
|
|
|
|
|
|
my $machine = $self->machine; |
29
|
|
|
|
|
|
|
|
30
|
0
|
|
|
|
|
|
"$$".$separator. |
31
|
|
|
|
|
|
|
$machine->{pid}.$separator. |
32
|
|
|
|
|
|
|
$machine->host.$separator. |
33
|
|
|
|
|
|
|
$machine->getpid.$separator. |
34
|
|
|
|
|
|
|
$self->pid; |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
sub alive { |
38
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
39
|
|
|
|
|
|
|
|
40
|
0
|
|
|
|
|
|
my $pid = $self->{pid}; |
41
|
0
|
|
|
|
|
|
$self->{machine}->poll($pid); |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
{ |
46
|
|
|
|
|
|
|
package GRID::Machine::Process::Result; |
47
|
20
|
|
|
20
|
|
6243
|
use warnings; |
|
20
|
|
|
|
|
36
|
|
|
20
|
|
|
|
|
550
|
|
48
|
20
|
|
|
20
|
|
105
|
use strict; |
|
20
|
|
|
|
|
46
|
|
|
20
|
|
|
|
|
809
|
|
49
|
20
|
|
|
20
|
|
106
|
use GRID::Machine::MakeAccessors; |
|
20
|
|
|
|
|
41
|
|
|
20
|
|
|
|
|
1377
|
|
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
my @legal = qw(stdout stderr results status waitpid descriptor machineID errmsg); |
52
|
|
|
|
|
|
|
my %legal = map { $_ => 1 } @legal; |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
GRID::Machine::MakeAccessors::make_accessors(@legal); |
55
|
|
|
|
|
|
|
|
56
|
20
|
|
|
|
|
174
|
use overload q("") => 'str', |
57
|
20
|
|
|
20
|
|
114
|
bool => 'bool'; |
|
20
|
|
|
|
|
41
|
|
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
sub bool { |
60
|
0
|
|
|
0
|
|
|
my $self = shift; |
61
|
|
|
|
|
|
|
|
62
|
0
|
0
|
|
|
|
|
0+$self->Results > 1 ? 1 : $self->result; |
63
|
|
|
|
|
|
|
} |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
sub result { |
66
|
0
|
|
|
0
|
|
|
my $self = shift; |
67
|
|
|
|
|
|
|
|
68
|
0
|
|
|
|
|
|
return $self->{results}[0]; |
69
|
|
|
|
|
|
|
} |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
sub Results { |
72
|
0
|
|
|
0
|
|
|
my $self = shift; |
73
|
|
|
|
|
|
|
|
74
|
0
|
|
|
|
|
|
return @{$self->{results}}; |
|
0
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
} |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
sub str { |
78
|
0
|
|
|
0
|
|
|
my $self = shift; |
79
|
|
|
|
|
|
|
|
80
|
0
|
|
|
|
|
|
return $self->{stdout}.$self->{stderr}.$self->{errmsg} |
81
|
|
|
|
|
|
|
} |
82
|
|
|
|
|
|
|
} |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
1; |