(vector<TJobStatus>::const_iterator k = statuses.begin();
95k != statuses.end(); ++k)
105vector<unsigned int> counters;
108 for(vector<TJobStatus>::const_iterator k = statuses.begin();
109k != statuses.end(); ++k)
118 unsigned int cnt= 0;
173 for(vector<TJobStatus>::const_iterator k = statuses.begin();
174k != statuses.end(); ++k)
205 "State matrix was damaged, more than one status " 206 "active for job "+ to_string(job_id));
272bv.
set(job_id, set_clear);
289 boolrestricted)
const 296 unsigned intjob_id = *en;
297 if(unwanted_jobs.
get_bit(job_id))
300 if(restrict_jobs.
get_bit(job_id))
314 boolrestricted)
const 320 for(vector<TJobStatus>::const_iterator k = statuses.begin();
321k != statuses.end(); ++k)
324 for(en = jobs.
first(); en.
valid(); ++en) {
325 unsigned intjob_id = *en;
326 if(unwanted_jobs.
get_bit(job_id))
329 if(restrict_jobs.
get_bit(job_id))
345 for(vector<TJobStatus>::const_iterator k = statuses.begin();
346k != statuses.end(); ++k)
365 static unsigned ints_LastCheckedJobID = 0;
366 static const size_tkMaxCandidates = 100;
378 if(s_LastTimeout != timeout) {
379s_LastTimeout = timeout;
380s_LastCheckedJobID = 0;
385 unsigned intjob_id = *en;
386 if(job_id <= s_LastCheckedJobID) {
387 result.set_bit(job_id,
true);
391s_LastCheckedJobID = job_id;
392 result.set_bit(job_id,
true);
410 static unsigned ints_LastCheckedJobID = 0;
411 static const size_tkMaxCandidates = 100;
428candidates -= read_jobs;
430 if(s_LastTimeout != timeout) {
431s_LastTimeout = timeout;
432s_LastCheckedJobID = 0;
437 unsigned intjob_id = *en;
438 if(job_id <= s_LastCheckedJobID) {
439 result.set_bit(job_id,
true);
443s_LastCheckedJobID = job_id;
444 result.set_bit(job_id,
true);
Algorithms for bvector<> (main include)
CNSPreciseTime GetPreciseReadVacantTime(unsigned int job_id) const
CNSPreciseTime GetPreciseSubmitTime(unsigned int job_id) const
unsigned GetNext(TJobStatus status, unsigned job_id) const
void SetStatus(unsigned int job_id, TJobStatus status)
TStatusStorage m_StatusStor
void Erase(unsigned job_id)
void GetJobs(const vector< TJobStatus > &statuses, TNSBitVector &jobs) const
void AddPendingJob(unsigned int job_id)
void StatusStatistics(TJobStatus status, TNSBitVector::statistics *st) const
vector< unsigned int > GetJobCounters(const vector< TJobStatus > &statuses) const
void SetExactStatusNoLock(unsigned int job_id, TJobStatus status, bool set_clear)
unsigned int GetMinJobID(void) const
unsigned int CountStatus(TJobStatus status) const
TJobStatus GetStatus(unsigned job_id) const
TNSBitVector GetOutdatedReadVacantJobs(CNSPreciseTime timeout, const TNSBitVector &read_jobs, const CJobGCRegistry &gc_registry) const
void AddPendingBatch(unsigned job_id_from, unsigned job_id_to)
unsigned int GetJobByStatus(TJobStatus status, const TNSBitVector &unwanted_jobs, const TNSBitVector &restrict_jobs, bool restricted) const
TNSBitVector GetOutdatedPendingJobs(CNSPreciseTime timeout, const CJobGCRegistry &gc_registry) const
unsigned int Count(void) const
static CNSPreciseTime Current(void)
NetSchedule internal exception.
Constant iterator designed to enumerate "ON" bits.
bool valid() const noexcept
Checks if iterator is still valid.
Bitvector Bit-vector container with runtime compression of bits.
@ opt_free_01
Free unused 0 and 1 blocks.
@ opt_free_0
Free unused 0 blocks.
bool get_bit(size_type n) const noexcept
returns true if bit n is set and false is bit n is 0.
bool any() const noexcept
Returns true if any bits in this bitset are set, and otherwise returns false.
bvector< Alloc > & set(size_type n, bool val=true)
Sets bit n if val is true, clears bit n if val is false.
void optimize(bm::word_t *temp_block=0, optmode opt_mode=opt_compress, statistics *stat=0)
Optimize memory bitvector's memory allocation.
bool set_bit(size_type n, bool val=true)
Sets bit n.
enumerator first() const
Returns enumerator pointing on the first non-zero bit.
size_type get_next(size_type prev) const noexcept
Finds the number of the next bit ON.
void clear(const size_type *ids, size_type ids_size, bm::sort_order so=bm::BM_UNKNOWN)
clear list of bits in this bitset
void calc_stat(struct bm::bvector< Alloc >::statistics *st) const noexcept
Calculates bitvector statistics.
size_type get_first() const noexcept
find first 1 bit in vector. Function may return 0 and this requires an extra check if bit 0 is actual...
static DLIST_TYPE *DLIST_NAME() first(DLIST_LIST_TYPE *list)
#define NCBI_THROW(exception_class, err_code, message)
Generic macro to throw an exception, given the exception class, error code and message string.
EJobStatus
Job status codes.
@ eDone
Job is ready (computed successfully)
@ eCanceled
Explicitly canceled.
@ eJobNotFound
No such job.
@ eLastStatus
Fake status (do not use)
@ ePending
Waiting for execution.
@ eFailed
Failed to run (execution timeout)
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
void set_bit(unsigned *dest, unsigned bitpos) noexcept
Set 1 bit in a block.
unsigned int
A callback function used to compare two keys in a database.
NetSchedule job status tracker.
const size_t g_ValidJobStatusesSize
const CNetScheduleAPI::EJobStatus g_ValidJobStatuses[]
Compressed bitset (entry point to bm.h)
NetSchedule client specs.
NetSchedule garbage collection registry.
const CNSPreciseTime kTimeZero
static SLJIT_INLINE sljit_ins st(sljit_gpr r, sljit_s32 d, sljit_gpr x, sljit_gpr b)
Statistical information about bitset's memory allocation details.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4