| 1 | package HPCI::Subgroup; | ||
| 2 | |||
| 3 | ### INCLUDES ################################################################## | ||
| 4 | |||
| 5 | # safe Perl | ||
| 6 | 22 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 7 | 22 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 8 | 22 | ▶ | use Carp; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 9 | 22 | ▶ | use Data::Dumper; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 10 | 22 | ▶ | use File::ShareDir; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 11 | 22 | ▶ | use File::Path qw(make_path); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 12 | 22 | ▶ | use File::Spec; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 13 | 22 | ▶ | use Time::HiRes qw(usleep gettimeofday); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 14 | 22 | ▶ | use Try::Tiny; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 15 | 22 | ▶ | use DateTime; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 16 | 22 | ▶ | use Module::Load; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 17 | 22 | ▶ | use HPCI::File; |
|
Subroutine
BEGIN: called CC=1 SCAR=2.6
| |||
| 18 | |||
| 19 | use Moose; | ||
| 20 | use MooseX::Types::Path::Class qw(Dir File); | ||
| 21 | use Moose::Util::TypeConstraints; | ||
| 22 | |||
| 23 | ## no critic BoutrosLab::HangingComma | ||
| 24 | ## no critic BoutrosLab::IndentationCheck | ||
| 25 | sub BUILD { | ||
| 26 | }; | ||
| 27 | |||
| 28 | with | ||
| 29 | 'HPCI::Sub', | ||
| 30 | 'HPCI::Super', | ||
| 31 | 'HPCI::SuperSub', | ||
| 32 | ; | ||
| 33 | |||
| 34 | =head1 NAME | ||
| 35 | |||
| 36 | HPCI::Subgroup | ||
| 37 | |||
| 38 | =head1 SYNOPSIS | ||
| 39 | |||
| 40 | Treat a collection of stages and/or subgroups like a single stage. | ||
| 41 | |||
| 42 | =head1 DESCRIPTION | ||
| 43 | |||
| 44 | A subgroup is a collection of stages and/or subgroups. | ||
| 45 | It acts both as a group and as a stage: | ||
| 46 | |||
| 47 | =over 4 | ||
| 48 | |||
| 49 | =item 1 | ||
| 50 | |||
| 51 | It acts as a stage to the group or subgroup that contains it, except | ||
| 52 | that it is created using the parent group or subgroup's C<subgroup> | ||
| 53 | method instead of the C<stage> method. The child subgroup's name | ||
| 54 | can be provided to the parent group or subgroup's C<add_deps> | ||
| 55 | method to specify order dependency between the subgroup (i.e. | ||
| 56 | all of its component stages and/or subgroups treated as a single | ||
| 57 | unit) and other components of the parent. | ||
| 58 | |||
| 59 | =item 2 | ||
| 60 | |||
| 61 | It acts as a group to the stages and/or subgroups that it contains. | ||
| 62 | For example, it has C<stage>, C<subgroup>, and C<add_deps> methods. | ||
| 63 | |||
| 64 | =back | ||
| 65 | |||
| 66 | There are a number of purposes to using a subgroup. | ||
| 67 | |||
| 68 | =over 4 | ||
| 69 | |||
| 70 | =item 1 | ||
| 71 | |||
| 72 | The subgroup can be used for assigning a dependency. A prerequisite | ||
| 73 | to a subgroup must complete before any of the components of the | ||
| 74 | subgroup can commence; a dependent to a subgroup cannot commence | ||
| 75 | until all of the components of the subgroup have completed. | ||
| 76 | |||
| 77 | =item 2 | ||
| 78 | |||
| 79 | The subgroup can list file requirements that apply to the collection. | ||
| 80 | That can define the attributes of files used in multiple stages; can | ||
| 81 | specify B<in> files that must be present before the subgroup can start; | ||
| 82 | specify B<skip> conditions that will cause the entire subgroup to | ||
| 83 | be skipped; specify B<out>, B<delete>, or B<rename> files to be verified | ||
| 84 | or processed when the subgroup has completed. | ||
| 85 | |||
| 86 | =item 3 | ||
| 87 | |||
| 88 | Allow different stages to use the "same" name. The name must still | ||
| 89 | be different from the names of all stages (and subgroups) that can | ||
| 90 | be dependency targets. That includes its parent (sub)group and all of | ||
| 91 | its other top level components, its grandparent (sub)group and all of its | ||
| 92 | top level components, and similarily for great**n grandparent groups and | ||
| 93 | all of their top level components. So, it cannot have to same name as a | ||
| 94 | sibling, (great)*parent, or (great)*uncle, but it can have the same name | ||
| 95 | as cousins and more distantly connected components. | ||
| 96 | |||
| 97 | The full name used for a stage or subgroup is actually composed like a | ||
| 98 | pathname, using the group and parent subgroups and the final component | ||
| 99 | name all separated by slashes. (e.g. GROUP/SUBGROUP/STAGE) | ||
| 100 | |||
| 101 | =back | ||
| 102 | |||
| 103 | When a subgroup is specified as a dependency, | ||
| 104 | none of its component stages or subgroups | ||
| 105 | execute until prerequisite components have completed; | ||
| 106 | and all of its component | ||
| 107 | stages and subgroups must have finished before any | ||
| 108 | dependent component will be allowed to execute. | ||
| 109 | |||
| 110 | A subgroup is creating using the subgroup method of either a | ||
| 111 | group or subgroup object. | ||
| 112 | |||
| 113 | =head1 ATTRIBUTES | ||
| 114 | |||
| 115 | The attributes for this class are pulled in from HPCI::Super | ||
| 116 | and HPCI::Sub. Super contains all the characteristics common to | ||
| 117 | container classes (Group and Subgroup), while Sub contains all | ||
| 118 | the characteristics common to contained classes (Subgroup and Stage). | ||
| 119 | |||
| 120 | =cut | ||
| 121 | |||
| 122 | =head1 AUTHOR | ||
| 123 | |||
| 124 | Christopher Lalansingh - Boutros Lab | ||
| 125 | |||
| 126 | John Macdonald - Boutros Lab | ||
| 127 | |||
| 128 | =head1 ACKNOWLEDGEMENTS | ||
| 129 | |||
| 130 | Paul Boutros, Phd, PI - Boutros http://www.omgubuntu.co.uk/2016/03/vineyard-wine-configuration-tool-linuxLab | ||
| 131 | |||
| 132 | The Ontario Institute for Cancer Research | ||
| 133 | |||
| 134 | =cut | ||
| 135 | |||
| 136 | 1; | ||
| 137 | |||