Thrill  0.1
block_scheduler_algorithm_offline_lru_prefetching< SwappableBlockType > Class Template Reference

Detailed Description

template<class SwappableBlockType>
class foxxll::block_scheduler_algorithm_offline_lru_prefetching< SwappableBlockType >

Block scheduling algorithm caching via the least recently used policy (offline), and prefetching in addition.

Definition at line 1149 of file block_scheduler.hpp.

+ Inheritance diagram for block_scheduler_algorithm_offline_lru_prefetching< SwappableBlockType >:
+ Collaboration diagram for block_scheduler_algorithm_offline_lru_prefetching< SwappableBlockType >:

#include <block_scheduler.hpp>

Classes

struct  read_after_write
 
struct  scheduled_block_meta
 
struct  write_read_request
 

Public Member Functions

 block_scheduler_algorithm_offline_lru_prefetching (block_scheduler_type &bs)
 
 block_scheduler_algorithm_offline_lru_prefetching (block_scheduler_algorithm_type *old)
 
virtual ~block_scheduler_algorithm_offline_lru_prefetching ()
 
virtual internal_block_typeacquire (const swappable_block_identifier_type sbid, const bool uninitialized=false)
 
virtual void deinitialize (swappable_block_identifier_type sbid)
 
virtual bool evictable_blocks_empty ()
 
virtual swappable_block_identifier_type evictable_blocks_pop ()
 
virtual external_block_type extract_external_block (swappable_block_identifier_type sbid)
 
virtual void initialize (swappable_block_identifier_type sbid, external_block_type eblock)
 
virtual void release (swappable_block_identifier_type sbid, const bool dirty)
 
- Public Member Functions inherited from block_scheduler_algorithm< SwappableBlockType >
 block_scheduler_algorithm (block_scheduler_type &bs)
 
 block_scheduler_algorithm (block_scheduler_algorithm *old)
 
 block_scheduler_algorithm (const block_scheduler_algorithm &)=delete
 non-copyable: delete copy-constructor More...
 
virtual ~block_scheduler_algorithm ()
 
virtual void explicit_timestep ()
 
virtual const prediction_sequence_typeget_prediction_sequence () const
 
virtual bool is_initialized (const swappable_block_identifier_type sbid) const
 
virtual bool is_simulating () const
 
block_scheduler_algorithmoperator= (const block_scheduler_algorithm &)=delete
 non-copyable: delete assignment operator More...
 
virtual void swappable_blocks_resize (swappable_block_identifier_type)
 

Protected Types

using block_scheduler_algorithm_type = block_scheduler_algorithm< SwappableBlockType >
 
using block_scheduler_operation = typename block_scheduler_type::block_scheduler_operation
 
using block_scheduler_type = block_scheduler< SwappableBlockType >
 
using external_block_type = typename block_scheduler_type::external_block_type
 
using internal_block_type = typename block_scheduler_type::internal_block_type
 
using prediction_sequence_type = typename block_scheduler_type::prediction_sequence_type
 
using scheduled_blocks_iterator = typename scheduled_blocks_type::iterator
 
using scheduled_blocks_reference = typename scheduled_blocks_type::reference
 
using scheduled_blocks_type = std::map< swappable_block_identifier_type, scheduled_block_meta >
 
using swappable_block_identifier_type = typename block_scheduler_type::swappable_block_identifier_type
 
using swappable_blocks_iterator = typename std::vector< SwappableBlockType >::iterator
 
using time_type = typename block_scheduler_algorithm_type::time_type
 
using write_scheduled_blocks_iterator = typename write_scheduled_blocks_type::iterator
 
using write_scheduled_blocks_reference = typename write_scheduled_blocks_type::reference
 
using write_scheduled_blocks_type = std::map< swappable_block_identifier_type, write_read_request * >
 
- Protected Types inherited from block_scheduler_algorithm< SwappableBlockType >
using block_scheduler_type = block_scheduler< SwappableBlockType >
 
using external_block_type = typename block_scheduler_type::external_block_type
 
using internal_block_type = typename block_scheduler_type::internal_block_type
 
using prediction_sequence_type = typename block_scheduler_type::prediction_sequence_type
 
using swappable_block_identifier_type = typename block_scheduler_type::swappable_block_identifier_type
 
using time_type = typename block_scheduler_type::time_type
 

Protected Member Functions

void deinit ()
 
internal_block_typeget_ready_block (const scheduled_blocks_iterator &schedule_meta)
 
block_scheduler_algorithm_typegive_up (std::string err_msg="detected some error in the prediction sequence")
 
void init (block_scheduler_algorithm_type *old_algo)
 
void operation_done (scheduled_blocks_iterator &schedule_meta)
 
void return_free_internal_block (internal_block_type *iblock)
 
void schedule_next_operations ()
 
void schedule_read (scheduled_blocks_iterator block_to_read)
 
write_read_requestschedule_write (const swappable_block_identifier_type sbid)
 
bool shall_be_cleaned (const scheduled_blocks_iterator &schedule_meta) const
 
bool shall_be_read (const scheduled_blocks_iterator &schedule_meta, const bool ignore_first=true) const
 
bool shall_keep_internal_block (const scheduled_blocks_iterator &schedule_meta, const bool ignore_first=true) const
 
bool try_interrupt_read (const write_scheduled_blocks_iterator &writing_block)
 
void wait_on_read (const scheduled_blocks_iterator &schedule_meta)
 
void wait_on_write (const write_scheduled_blocks_iterator &writing_block)
 
void wait_on_write (const swappable_block_identifier_type &writing_block)
 
void wait_on_write (const scheduled_blocks_iterator &schedule_meta)
 
- Protected Member Functions inherited from block_scheduler_algorithm< SwappableBlockType >
block_scheduler_algorithmget_algorithm_from_block_scheduler ()
 
internal_block_typeget_free_internal_block_from_block_scheduler ()
 
void return_free_internal_block_to_block_scheduler (internal_block_type *iblock)
 Return an internal_block to the block_scheduler. More...
 

Protected Attributes

std::set< swappable_block_identifier_typefree_evictable_blocks
 Holds swappable blocks, whose internal block can be freed, i.e. that are internal but unacquired. More...
 
prediction_sequence_type::iterator next_op_to_schedule
 
scheduled_blocks_type scheduled_blocks
 Holds not internal swappable_blocks, whose next access has already been scheduled. More...
 
std::set< swappable_block_identifier_typescheduled_evictable_blocks
 
write_scheduled_blocks_type write_scheduled_blocks
 Holds swappable_blocks, whose internal block has been taken away but the clean did not finish yet. More...
 
- Protected Attributes inherited from block_scheduler_algorithm< SwappableBlockType >
prediction_sequence_type prediction_sequence
 
std::vector< SwappableBlockType > & swappable_blocks
 

Additional Inherited Members

- Public Attributes inherited from block_scheduler_algorithm< SwappableBlockType >
block_scheduler_typebs
 

Member Typedef Documentation

◆ block_scheduler_algorithm_type

using block_scheduler_algorithm_type = block_scheduler_algorithm<SwappableBlockType>
protected

Definition at line 1156 of file block_scheduler.hpp.

◆ block_scheduler_operation

◆ block_scheduler_type

using block_scheduler_type = block_scheduler<SwappableBlockType>
protected

Definition at line 1155 of file block_scheduler.hpp.

◆ external_block_type

Definition at line 1158 of file block_scheduler.hpp.

◆ internal_block_type

Definition at line 1157 of file block_scheduler.hpp.

◆ prediction_sequence_type

◆ scheduled_blocks_iterator

using scheduled_blocks_iterator = typename scheduled_blocks_type::iterator
protected

Definition at line 1166 of file block_scheduler.hpp.

◆ scheduled_blocks_reference

using scheduled_blocks_reference = typename scheduled_blocks_type::reference
protected

Definition at line 1167 of file block_scheduler.hpp.

◆ scheduled_blocks_type

◆ swappable_block_identifier_type

◆ swappable_blocks_iterator

using swappable_blocks_iterator = typename std::vector<SwappableBlockType>::iterator
protected

Definition at line 1163 of file block_scheduler.hpp.

◆ time_type

Definition at line 1160 of file block_scheduler.hpp.

◆ write_scheduled_blocks_iterator

using write_scheduled_blocks_iterator = typename write_scheduled_blocks_type::iterator
protected

Definition at line 1169 of file block_scheduler.hpp.

◆ write_scheduled_blocks_reference

using write_scheduled_blocks_reference = typename write_scheduled_blocks_type::reference
protected

Definition at line 1170 of file block_scheduler.hpp.

◆ write_scheduled_blocks_type

Constructor & Destructor Documentation

◆ block_scheduler_algorithm_offline_lru_prefetching() [1/2]

◆ block_scheduler_algorithm_offline_lru_prefetching() [2/2]

◆ ~block_scheduler_algorithm_offline_lru_prefetching()

Definition at line 1679 of file block_scheduler.hpp.

References foxxll::pop_begin(), and TLX_LOG1.

Member Function Documentation

◆ acquire()

virtual internal_block_type& acquire ( const swappable_block_identifier_type  sbid,
const bool  uninitialized = false 
)
inlinevirtual

Implements block_scheduler_algorithm< SwappableBlockType >.

Definition at line 1701 of file block_scheduler.hpp.

References tlx::unused().

◆ deinit()

void deinit ( )
inlineprotected

Definition at line 1639 of file block_scheduler.hpp.

References TLX_LOG1.

◆ deinitialize()

virtual void deinitialize ( swappable_block_identifier_type  sbid)
inlinevirtual

Implements block_scheduler_algorithm< SwappableBlockType >.

Definition at line 1812 of file block_scheduler.hpp.

References TLX_LOG1.

◆ evictable_blocks_empty()

virtual bool evictable_blocks_empty ( )
inlinevirtual

◆ evictable_blocks_pop()

virtual swappable_block_identifier_type evictable_blocks_pop ( )
inlinevirtual

◆ extract_external_block()

virtual external_block_type extract_external_block ( swappable_block_identifier_type  sbid)
inlinevirtual

◆ get_ready_block()

internal_block_type* get_ready_block ( const scheduled_blocks_iterator schedule_meta)
inlineprotected

Wait for the write of the giver to finish and return reserved internal_block.

side-effect: erases entry for the write of the giver from write_scheduled_blocks

Definition at line 1442 of file block_scheduler.hpp.

◆ give_up()

block_scheduler_algorithm_type* give_up ( std::string  err_msg = "detected some error in the prediction sequence")
inlineprotected

Definition at line 1523 of file block_scheduler.hpp.

References TLX_LOG1.

◆ init()

void init ( block_scheduler_algorithm_type old_algo)
inlineprotected

◆ initialize()

virtual void initialize ( swappable_block_identifier_type  sbid,
external_block_type  eblock 
)
inlinevirtual

◆ operation_done()

void operation_done ( scheduled_blocks_iterator schedule_meta)
inlineprotected

Definition at line 1513 of file block_scheduler.hpp.

◆ release()

virtual void release ( swappable_block_identifier_type  sbid,
const bool  dirty 
)
inlinevirtual

◆ return_free_internal_block()

void return_free_internal_block ( internal_block_type iblock)
inlineprotected

Definition at line 1534 of file block_scheduler.hpp.

◆ schedule_next_operations()

void schedule_next_operations ( )
inlineprotected

◆ schedule_read()

void schedule_read ( scheduled_blocks_iterator  block_to_read)
inlineprotected

Schedule an internal and external block to read.

If the giver is still writing, schedule read via its write_read_request.

Definition at line 1285 of file block_scheduler.hpp.

References tlx::swap().

◆ schedule_write()

write_read_request* schedule_write ( const swappable_block_identifier_type  sbid)
inlineprotected

Schedule an internal, possibly dirty swappable_block to write.

The block becomes not dirty. if it was dirty, an entry in write_scheduled_blocks is made referencing the write_read_request.

Parameters
sbidblock to write
Returns
pointer to the write_read_request

Definition at line 1238 of file block_scheduler.hpp.

References tlx::unused(), CountingPtr< Type, Deleter >::valid(), and block_scheduler_algorithm_offline_lru_prefetching< SwappableBlockType >::write_read_request::write_req.

◆ shall_be_cleaned()

bool shall_be_cleaned ( const scheduled_blocks_iterator schedule_meta) const
inlineprotected

Definition at line 1479 of file block_scheduler.hpp.

◆ shall_be_read()

bool shall_be_read ( const scheduled_blocks_iterator schedule_meta,
const bool  ignore_first = true 
) const
inlineprotected

Definition at line 1505 of file block_scheduler.hpp.

◆ shall_keep_internal_block()

bool shall_keep_internal_block ( const scheduled_blocks_iterator schedule_meta,
const bool  ignore_first = true 
) const
inlineprotected

Definition at line 1450 of file block_scheduler.hpp.

◆ try_interrupt_read()

bool try_interrupt_read ( const write_scheduled_blocks_iterator writing_block)
inlineprotected

Try to interrupt a read scheduled in a write_read_request.

side-effect: possibly erases entry from write_scheduled_blocks, so the iterator writing_block may become invalid

Returns
if successful

Definition at line 1262 of file block_scheduler.hpp.

◆ wait_on_read()

void wait_on_read ( const scheduled_blocks_iterator schedule_meta)
inlineprotected

Wait for the read to finish.

side-effect: erases entry for the write of the giver from write_scheduled_blocks

Definition at line 1429 of file block_scheduler.hpp.

◆ wait_on_write() [1/3]

void wait_on_write ( const write_scheduled_blocks_iterator writing_block)
inlineprotected

Wait for the write to finish.

side-effect: erases entry from write_scheduled_blocks

Definition at line 1397 of file block_scheduler.hpp.

◆ wait_on_write() [2/3]

void wait_on_write ( const swappable_block_identifier_type writing_block)
inlineprotected

Wait for the write to finish.

side-effect: erases entry from write_scheduled_blocks

Definition at line 1407 of file block_scheduler.hpp.

◆ wait_on_write() [3/3]

void wait_on_write ( const scheduled_blocks_iterator schedule_meta)
inlineprotected

Wait for the write of the giver to finish.

side-effect: erases entry from write_scheduled_blocks

Definition at line 1417 of file block_scheduler.hpp.

Member Data Documentation

◆ free_evictable_blocks

std::set<swappable_block_identifier_type> free_evictable_blocks
protected

Holds swappable blocks, whose internal block can be freed, i.e. that are internal but unacquired.

Definition at line 1223 of file block_scheduler.hpp.

◆ next_op_to_schedule

prediction_sequence_type::iterator next_op_to_schedule
protected

Definition at line 1231 of file block_scheduler.hpp.

◆ scheduled_blocks

scheduled_blocks_type scheduled_blocks
protected

Holds not internal swappable_blocks, whose next access has already been scheduled.

Definition at line 1227 of file block_scheduler.hpp.

◆ scheduled_evictable_blocks

std::set<swappable_block_identifier_type> scheduled_evictable_blocks
protected

Definition at line 1224 of file block_scheduler.hpp.

◆ write_scheduled_blocks

write_scheduled_blocks_type write_scheduled_blocks
protected

Holds swappable_blocks, whose internal block has been taken away but the clean did not finish yet.

Definition at line 1230 of file block_scheduler.hpp.


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