Project
Loading...
Searching...
No Matches
o2::framework::ComputingQuotaEvaluator Class Reference

#include <ComputingQuotaEvaluator.h>

Public Member Functions

 ComputingQuotaEvaluator (ServiceRegistryRef ref)
 
bool selectOffer (int task, ComputingQuotaRequest const &request, uint64_t now)
 
void consume (int taskId, ComputingQuotaConsumer &consumed, std::function< void(ComputingQuotaOffer const &accumulatedConsumed, ComputingQuotaStats &)> &reportConsumedOffer)
 
void dispose (int taskId)
 Dispose offers for a given taskId.
 
void handleExpired (std::function< void(ComputingQuotaOffer const &, ComputingQuotaStats const &)> reportExpired)
 
void updateOffers (std::vector< ComputingQuotaOffer > &offers, uint64_t now)
 now the time (e.g. uv_now) when invoked.
 

Public Attributes

std::array< ComputingQuotaOffer, MAX_INFLIGHT_OFFERSmOffers
 All the available offerts.
 
std::vector< ComputingQuotaOfferRefmExpiredOffers
 The offers which expired and need to be given back.
 
std::array< ComputingQuotaInfo, MAX_INFLIGHT_OFFERSmInfos
 Information about a given computing offer (e.g. when it was started to be used)
 
ComputingQuotaStats mStats
 
ServiceRegistryRef mRef
 
uv_timer_tmTimer
 

Static Public Attributes

static constexpr int MAX_INFLIGHT_OFFERS = 16
 

Detailed Description

Definition at line 31 of file ComputingQuotaEvaluator.h.

Constructor & Destructor Documentation

◆ ComputingQuotaEvaluator()

o2::framework::ComputingQuotaEvaluator::ComputingQuotaEvaluator ( ServiceRegistryRef  ref)

Definition at line 31 of file ComputingQuotaEvaluator.cxx.

Member Function Documentation

◆ consume()

void o2::framework::ComputingQuotaEvaluator::consume ( int  taskId,
ComputingQuotaConsumer consumed,
std::function< void(ComputingQuotaOffer const &accumulatedConsumed, ComputingQuotaStats &)> &  reportConsumedOffer 
)

Consume offers for a given taskId reportConsumedOffer callback which reports back that an offer has been consumed.

Definition at line 190 of file ComputingQuotaEvaluator.cxx.

◆ dispose()

void o2::framework::ComputingQuotaEvaluator::dispose ( int  taskId)

Dispose offers for a given taskId.

An offer with index 0 is always there. All the others are reset.

Definition at line 198 of file ComputingQuotaEvaluator.cxx.

◆ handleExpired()

void o2::framework::ComputingQuotaEvaluator::handleExpired ( std::function< void(ComputingQuotaOffer const &, ComputingQuotaStats const &)>  reportExpired)

Handle all the offers which have timed out giving them back to the driver. expirator callback with expired offers

Whenever an offer is expired, we give back the resources to the driver.

Definition at line 242 of file ComputingQuotaEvaluator.cxx.

◆ selectOffer()

bool o2::framework::ComputingQuotaEvaluator::selectOffer ( int  task,
ComputingQuotaRequest const &  request,
uint64_t  now 
)

task the task which needs some quota request the resource request the task needs now the time (e.g. uv_now) when invoked.

We then check if the offer is suitable

Definition at line 65 of file ComputingQuotaEvaluator.cxx.

◆ updateOffers()

void o2::framework::ComputingQuotaEvaluator::updateOffers ( std::vector< ComputingQuotaOffer > &  offers,
uint64_t  now 
)

now the time (e.g. uv_now) when invoked.

Move offers from the pending list to the actual available offers.

Definition at line 223 of file ComputingQuotaEvaluator.cxx.

Member Data Documentation

◆ MAX_INFLIGHT_OFFERS

constexpr int o2::framework::ComputingQuotaEvaluator::MAX_INFLIGHT_OFFERS = 16
staticconstexpr

Definition at line 35 of file ComputingQuotaEvaluator.h.

◆ mExpiredOffers

std::vector<ComputingQuotaOfferRef> o2::framework::ComputingQuotaEvaluator::mExpiredOffers

The offers which expired and need to be given back.

Definition at line 58 of file ComputingQuotaEvaluator.h.

◆ mInfos

std::array<ComputingQuotaInfo, MAX_INFLIGHT_OFFERS> o2::framework::ComputingQuotaEvaluator::mInfos

Information about a given computing offer (e.g. when it was started to be used)

Definition at line 60 of file ComputingQuotaEvaluator.h.

◆ mOffers

std::array<ComputingQuotaOffer, MAX_INFLIGHT_OFFERS> o2::framework::ComputingQuotaEvaluator::mOffers

All the available offerts.

Definition at line 56 of file ComputingQuotaEvaluator.h.

◆ mRef

ServiceRegistryRef o2::framework::ComputingQuotaEvaluator::mRef

Definition at line 62 of file ComputingQuotaEvaluator.h.

◆ mStats

ComputingQuotaStats o2::framework::ComputingQuotaEvaluator::mStats

Definition at line 61 of file ComputingQuotaEvaluator.h.

◆ mTimer

uv_timer_t* o2::framework::ComputingQuotaEvaluator::mTimer

Definition at line 63 of file ComputingQuotaEvaluator.h.


The documentation for this class was generated from the following files: