~ubuntu-branches/ubuntu/trusty/nordugrid-arc/trusty-proposed

« back to all changes in this revision

Viewing changes to src/hed/libs/compute/Broker.h

  • Committer: Package Import Robot
  • Author(s): Mattias Ellert
  • Date: 2013-05-08 13:48:03 UTC
  • mfrom: (1.1.7)
  • Revision ID: package-import@ubuntu.com-20130508134803-mrhc5w4d5y7ubyj4
Tags: 3.0.1-1
3.0.1 Release

Show diffs side-by-side

added added

removed removed

Lines of Context:
68
68
    bool operator() (const ExecutionTarget& lhs, const ExecutionTarget& rhs) const;
69
69
    /// Returns true if the ExecutionTarget is allowed by BrokerPlugin.
70
70
    bool match(const ExecutionTarget& et) const;
 
71
    
71
72
    /// Perform a match between the given target and job.
72
73
    /**
73
74
     * This method is generally called by BrokerPlugins at the start of match()
74
75
     * to check that a target matches general attributes of the job such as CPU
75
76
     * and memory limits. The BrokerPlugin then does further matching depending
76
77
     * on its own criteria.
 
78
     * 
 
79
     * The table below list all the checks in order made by this method. If a
 
80
     * check fails the method returns false. Generally a check is only made if
 
81
     * the attribute in the left column are set in the JobDescription object.
 
82
     * Contrary if a resource attribute in the right column is not set, and the
 
83
     * corresponding JobDescription attribute is set, then generally the check
 
84
     * will fail and the method returns false. If all relevant checks succeeds
 
85
     * this method returns true.
 
86
     * 
 
87
       %JobDescription attribute | Comparator | %ExecutionTarget attribute 
 
88
       --------------------------|:----------:|----------------------------
 
89
       \ref Credential::GetCAName "CA DN" of \ref Credential::Credential(const UserConfig&, const std::string&) "Credentials" <sup>[\ref genericMatch_Note1 "1"]</sup> | in | \ref ComputingEndpointAttributes::TrustedCA "TrustedCA" <sup>[\ref genericMatch_Note2 "2"]</sup>
 
90
       \ref JobDescription.OtherAttributes "OtherAttributes"["nordugrid:broker;reject_queue"] | != | \ref ComputingShareAttributes.Name "ComputingShare.Name"
 
91
       \ref ResourcesType.QueueName "QueueName" | == | \ref ComputingShareAttributes.Name "ComputingShare.Name"
 
92
       \ref ApplicationType.ProcessingStartTime "ProcessingStartTime" | < | \ref ComputingEndpointAttributes.DowntimeStarts "DowntimeStarts"
 
93
       \ref ApplicationType.ProcessingStartTime "ProcessingStartTime" | > | \ref ComputingEndpointAttributes.DowntimeEnds "DowntimeEnds"
 
94
       --- | | \ref lower "lower"(\ref ComputingEndpointAttributes::HealthState "HealthState") == "ok"
 
95
       \ref ResourcesType.CEType "CEType" | \ref SoftwareRequirement.isSatisfied "isSatisfied" | \ref ComputingEndpointAttributes.Implementation "Implementation"
 
96
       \ref ResourcesType.IndividualWallTime "IndividualWallTime".max | <= | \ref ComputingShareAttributes.MaxWallTime "MaxWallTime"
 
97
       \ref ResourcesType.IndividualWallTime "IndividualWallTime".min | >= | \ref ComputingShareAttributes.MinWallTime "MinWallTime"
 
98
       \ref ResourcesType.IndividualCPUTime "IndividualCPUTime".max | <= | \ref ComputingShareAttributes.MaxCPUTime "MaxCPUTime"
 
99
       \ref ResourcesType.IndividualCPUTime "IndividualCPUTime".min | >= | \ref ComputingShareAttributes.MinCPUTime "MinCPUTime"
 
100
       \ref ResourcesType.TotalCPUTime "TotalCPUTime" | <= | \ref ComputingShareAttributes.MaxTotalCPUTime "MaxTotalCPUTime" <sup>[\ref genericMatch_Note3 "3"]</sup>
 
101
       \ref ResourcesType.TotalCPUTime "TotalCPUTime" / \ref SlotRequirementType.NumberOfSlots "NumberOfSlots" | <= | \ref ComputingShareAttributes.MaxCPUTime "MaxCPUTime" <sup>[\ref genericMatch_Note4 "4"]</sup>
 
102
       \ref ResourcesType.TotalCPUTime "TotalCPUTime" / \ref SlotRequirementType.NumberOfSlots "NumberOfSlots" | >= | \ref ComputingShareAttributes.MinCPUTime "MinCPUTime"
 
103
       \ref ResourcesType.IndividualPhysicalMemory "IndividualPhysicalMemory" | <= | \ref ExecutionEnvironmentAttributes.MainMemorySize "MainMemorySize" <sup>[\ref genericMatch_Note5 "5"]</sup>
 
104
       \ref ResourcesType.IndividualPhysicalMemory "IndividualPhysicalMemory" | <= | \ref ComputingShareAttributes.MaxMainMemory "MaxMainMemory" <sup>[\ref genericMatch_Note6 "6"]</sup>
 
105
       \ref ResourcesType.IndividualVirtualMemory "IndividualVirtualMemory" | <= | \ref ComputingShareAttributes.MaxVirtualMemory "MaxVirtualMemory"
 
106
       \ref ResourcesType.Platform "Platform" | == | \ref ExecutionEnvironmentAttributes.Platform "Platform"
 
107
       \ref ResourcesType.OperatingSystem "OperatingSystem" | \ref SoftwareRequirement.isSatisfied "isSatisfied" | \ref ExecutionEnvironmentAttributes.OperatingSystem "OperatingSystem"
 
108
       \ref ResourcesType.RunTimeEnvironment "RunTimeEnvironment" | \ref SoftwareRequirement.isSatisfied "isSatisfied" | ApplicationEnvironment
 
109
       \ref ResourcesType.NetworkInfo "NetworkInfo" | in | \ref ComputingManagerAttributes.NetworkInfo "NetworkInfo"
 
110
       \ref DiskSpaceRequirementType.SessionDiskSpace "SessionDiskSpace" | <= | 1024*\ref ComputingShareAttributes.MaxDiskSpace "MaxDiskSpace" <sup>[\ref genericMatch_Note7 "7"]</sup>
 
111
       \ref DiskSpaceRequirementType.SessionDiskSpace "SessionDiskSpace" | <= | 1024*\ref ComputingShareAttributes.WorkingAreaFree "WorkingAreaFree" <sup>[\ref genericMatch_Note7 "7"]</sup>
 
112
       \ref DiskSpaceRequirementType.DiskSpace "DiskSpace" - \ref DiskSpaceRequirementType.CacheDiskSpace "CacheDiskSpace" | <= | 1024*\ref ComputingShareAttributes.MaxDiskSpace "MaxDiskSpace" <sup>[\ref genericMatch_Note8 "8"]</sup>
 
113
       \ref DiskSpaceRequirementType.DiskSpace "DiskSpace" - \ref DiskSpaceRequirementType.CacheDiskSpace "CacheDiskSpace" | <= | 1024*\ref ComputingManagerAttributes.WorkingAreaFree "WorkingAreaFree" <sup>[\ref genericMatch_Note8 "8"]</sup>
 
114
       \ref DiskSpaceRequirementType.DiskSpace "DiskSpace" | <= | 1024*\ref ComputingShareAttributes.MaxDiskSpace "MaxDiskSpace" <sup>[\ref genericMatch_Note9 "9"]</sup>
 
115
       \ref DiskSpaceRequirementType.DiskSpace "DiskSpace" | <= | 1024*\ref ComputingManagerAttributes.WorkingAreaFree "WorkingAreaFree" <sup>[\ref genericMatch_Note9 "9"]</sup>
 
116
       \ref DiskSpaceRequirementType.CacheDiskSpace "CacheDiskSpace" | <= | 1024*\ref ComputingManagerAttributes.CacheTotal "CacheTotal"
 
117
       \ref SlotRequirementType.NumberOfSlots "NumberOfSlots" | <= | \ref ComputingManagerAttributes.TotalSlots "TotalSlots" <sup>[\ref genericMatch_Note10 "10"]</sup>
 
118
       \ref SlotRequirementType.NumberOfSlots "NumberOfSlots" | <= | \ref ComputingShareAttributes.MaxSlotsPerJob "MaxSlotsPerJob" <sup>[\ref genericMatch_Note10 "10"]</sup>
 
119
       \ref ResourcesType.SessionLifeTime "SessionLifeTime" | <= | \ref ComputingManagerAttributes.WorkingAreaLifeTime "WorkingAreaLifeTime"
 
120
       \ref ResourcesType.NodeAccess "NodeAccess" is NAT_INBOUND OR NAT_INOUTBOUND | AND | \ref ExecutionEnvironmentAttributes.ConnectivityIn "ConnectivityIn" is true
 
121
       \ref ResourcesType.NodeAccess "NodeAccess" is NAT_OUTBOUND OR NAT_INOUTBOUND | AND | \ref ExecutionEnvironmentAttributes.ConnectivityOut "ConnectivityOut" is true
 
122
     * 
 
123
     * \b Notes:
 
124
     * 1. \anchor genericMatch_Note1 Credential object is not part of
 
125
     *  JobDescription object, but is obtained from the passed UserConfig
 
126
     *  object.
 
127
     * 2. \anchor genericMatch_Note2 Check is only made if
 
128
     *  \ref ComputingEndpointAttributes::TrustedCA "TrustedCA" list is not
 
129
     *  empty.
 
130
     * 3. \anchor genericMatch_Note3 If
 
131
     *  \ref ComputingShareAttributes::MaxTotalCPUTime "MaxTotalCPUTime" is not
 
132
     *  set, the next check in the table is made.
 
133
     * 4. \anchor genericMatch_Note4 Check is only done if
 
134
     *  \ref ComputingShareAttributes::MaxTotalCPUTime "MaxTotalCPUTime" is not
 
135
     *  set.
 
136
     * 5. \anchor genericMatch_Note5 If
 
137
     *  \ref ExecutionEnvironmentAttributes::MainMemorySize "MainMemorySize" is
 
138
     *  not set, the next check in the table is made.
 
139
     * 6. \anchor genericMatch_Note6 Check is only done if
 
140
     *  \ref ExecutionEnvironmentAttributes::MainMemorySize "MainMemorySize" is
 
141
     *  not set.
 
142
     * 7. \anchor genericMatch_Note7 Check doesn't fail if
 
143
     *  \ref ComputingShareAttributes.MaxDiskSpace "MaxDiskSpace" or
 
144
     *  \ref ComputingShareAttributes.MaxMainMemory "MaxMainMemory"
 
145
     *  respectively is not set. Both attributes must be unspecified, and
 
146
     *  \ref DiskSpaceRequirementType.SessionDiskSpace "SessionDiskSpace"
 
147
     *  be specified before the checks fails.
 
148
     * 8. \anchor genericMatch_Note8 Check doesn't fail if
 
149
     *  \ref ComputingShareAttributes.MaxDiskSpace "MaxDiskSpace" or
 
150
     *  \ref ComputingShareAttributes.MaxMainMemory "MaxMainMemory"
 
151
     *  respectively is not set. Both attributes must be unspecified, and
 
152
     *  \ref DiskSpaceRequirementType.DiskSpace "DiskSpace" and
 
153
     *  \ref DiskSpaceRequirementType.CacheDiskSpace "CacheDiskSpace"
 
154
     *  be specified before the checks fails.
 
155
     * 9. \anchor genericMatch_Note9 Check doesn't fail if
 
156
     *  \ref ComputingShareAttributes.MaxDiskSpace "MaxDiskSpace" or
 
157
     *  \ref ComputingShareAttributes.MaxMainMemory "MaxMainMemory"
 
158
     *  respectively is not set. Both attributes must be unspecified, and
 
159
     *  \ref DiskSpaceRequirementType.DiskSpace "DiskSpace"
 
160
     *  be specified before the checks fails.
 
161
     * 10. \anchor genericMatch_Note10 Check doesn't fail if
 
162
     *  \ref ComputingManagerAttributes.TotalSlots "TotalSlots" or
 
163
     *  \ref ComputingShareAttributes.MaxSlotsPerJob "MaxSlotsPerJob"
 
164
     *  respectively is not set. Both attributes must be unspecified, and
 
165
     *  \ref SlotRequirementType.NumberOfSlots "NumberOfSlots"
 
166
     *  be specified before the checks fails.
 
167
     * 
77
168
     * \return True if target matches job description.
78
169
     */
79
170
    static bool genericMatch(const ExecutionTarget& et, const JobDescription& j, const Arc::UserConfig&);