Project
Loading...
Searching...
No Matches
ComputingQuotaOffer.h
Go to the documentation of this file.
1// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
11
12#ifndef O2_COMPUTINGQUOTAOFFER_H_
13#define O2_COMPUTINGQUOTAOFFER_H_
14
15#include <functional>
16#include <cstdint>
17#include <cstddef>
18
19namespace o2::framework
20{
21
25
26enum struct OfferScore {
27 // The offers seen so far are enough. We can proceed with the dataprocessing.
28 Enough,
29 // The offers seen so far are not enough, but the current one
30 // is ok and we need to look for more.
31 More,
32 // The offer is not needed, but something else in the device
33 // might use it.
35 // The offer is not suitable and should be given back to the
36 // driver.
38};
39
42 int cpu = 0;
44 int64_t memory = 0;
46 int64_t sharedMemory = 0;
49 int64_t runtime = 0;
51 int user = -1;
56 bool valid = false;
57};
58
60 // When the offer was received
61 size_t received = 0;
62 // First time it was used
63 size_t firstUsed = 0;
64 // Last time it was used
65 size_t lastUsed = 0;
66};
67
70 int64_t totalConsumedBytes = 0;
72 int64_t totalExpiredBytes = 0;
73 int64_t totalExpiredOffers = 0;
74};
75
79using ComputingQuotaRequest = std::function<OfferScore(ComputingQuotaOffer const& offer, ComputingQuotaOffer const& accumulated)>;
80
83using ComputingQuotaConsumer = std::function<void(int id, std::array<ComputingQuotaOffer, 16>&, ComputingQuotaStats&, std::function<void(ComputingQuotaOffer const&, ComputingQuotaStats& stats)>)>;
84
85} // namespace o2::framework
86
87#endif // O2_COMPUTINGQUOTAOFFER_H_
typedef void(APIENTRYP PFNGLCULLFACEPROC)(GLenum mode)
GLuint memory
Definition glcorearb.h:5234
Defining PrimaryVertex explicitly as messageable.
Definition TFIDInfo.h:20
std::function< OfferScore(ComputingQuotaOffer const &offer, ComputingQuotaOffer const &accumulated)> ComputingQuotaRequest
std::function< void(int id, std::array< ComputingQuotaOffer, 16 > &, ComputingQuotaStats &, std::function< void(ComputingQuotaOffer const &, ComputingQuotaStats &stats)>)> ComputingQuotaConsumer
OfferScore score
The score for the given offer.
int64_t sharedMemory
How much shared memory it can allocate.
int user
Which task is using the offer.
int cpu
How many cores it can use.
Statistics on the offers consumed, expired.