STXXL  1.4-dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
stxxl::block_scheduler_algorithm_offline_lru_prefetching< SwappableBlockType > Class Template Reference

Detailed Description

template<class SwappableBlockType>
class stxxl::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 1122 of file block_scheduler.h.

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

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 stxxl::block_scheduler_algorithm< SwappableBlockType >
 block_scheduler_algorithm (block_scheduler_type &bs)
 
 block_scheduler_algorithm (block_scheduler_algorithm *old)
 
virtual ~block_scheduler_algorithm ()
 
virtual void explicit_timestep ()
 
virtual const
prediction_sequence_type
get_prediction_sequence () const
 
virtual bool is_initialized (const swappable_block_identifier_type sbid) const
 
virtual bool is_simulating () const
 
virtual void swappable_blocks_resize (swappable_block_identifier_type)
 

Protected Types

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

Protected Member Functions

void deinit ()
 
internal_block_typeget_ready_block (const scheduled_blocks_iterator &schedule_meta)
 Wait for the write of the giver to finish and return reserved internal_block. More...
 
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)
 Schedule an internal and external block to read. More...
 
write_read_requestschedule_write (const swappable_block_identifier_type sbid)
 Schedule an internal, possibly dirty swappable_block to write. More...
 
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)
 Try to interrupt a read scheduled in a write_read_request. More...
 
void wait_on_read (const scheduled_blocks_iterator &schedule_meta)
 Wait for the read to finish. More...
 
void wait_on_write (const write_scheduled_blocks_iterator &writing_block)
 Wait for the write to finish. More...
 
void wait_on_write (const swappable_block_identifier_type &writing_block)
 Wait for the write to finish. More...
 
void wait_on_write (const scheduled_blocks_iterator &schedule_meta)
 Wait for the write of the giver to finish. More...
 
- Protected Member Functions inherited from stxxl::block_scheduler_algorithm< SwappableBlockType >
block_scheduler_algorithmget_algorithm_from_block_scheduler ()
 
internal_block_typeget_free_internal_block_from_block_scheduler ()
 Get an internal_block from the block_scheduler. More...
 
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_type
free_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_type
scheduled_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 stxxl::block_scheduler_algorithm< SwappableBlockType >
prediction_sequence_type prediction_sequence
 
std::vector< SwappableBlockType > & swappable_blocks
 

Additional Inherited Members

- Public Attributes inherited from stxxl::block_scheduler_algorithm< SwappableBlockType >
block_scheduler_typebs
 

Member Typedef Documentation

template<class SwappableBlockType >
typedef block_scheduler_algorithm<SwappableBlockType> stxxl::block_scheduler_algorithm_offline_lru_prefetching< SwappableBlockType >::block_scheduler_algorithm_type
protected

Definition at line 1129 of file block_scheduler.h.

Definition at line 1135 of file block_scheduler.h.

template<class SwappableBlockType >
typedef block_scheduler<SwappableBlockType> stxxl::block_scheduler_algorithm_offline_lru_prefetching< SwappableBlockType >::block_scheduler_type
protected

Definition at line 1126 of file block_scheduler.h.

template<class SwappableBlockType >
typedef block_scheduler_type::external_block_type stxxl::block_scheduler_algorithm_offline_lru_prefetching< SwappableBlockType >::external_block_type
protected

Definition at line 1131 of file block_scheduler.h.

template<class SwappableBlockType >
typedef block_scheduler_type::internal_block_type stxxl::block_scheduler_algorithm_offline_lru_prefetching< SwappableBlockType >::internal_block_type
protected

Definition at line 1130 of file block_scheduler.h.

Definition at line 1134 of file block_scheduler.h.

template<class SwappableBlockType >
typedef scheduled_blocks_type::iterator stxxl::block_scheduler_algorithm_offline_lru_prefetching< SwappableBlockType >::scheduled_blocks_iterator
protected

Definition at line 1139 of file block_scheduler.h.

template<class SwappableBlockType >
typedef scheduled_blocks_type::reference stxxl::block_scheduler_algorithm_offline_lru_prefetching< SwappableBlockType >::scheduled_blocks_reference
protected

Definition at line 1140 of file block_scheduler.h.

template<class SwappableBlockType >
typedef std::map<swappable_block_identifier_type, scheduled_block_meta> stxxl::block_scheduler_algorithm_offline_lru_prefetching< SwappableBlockType >::scheduled_blocks_type
protected

Definition at line 1138 of file block_scheduler.h.

Definition at line 1132 of file block_scheduler.h.

template<class SwappableBlockType >
typedef std::vector<SwappableBlockType>::iterator stxxl::block_scheduler_algorithm_offline_lru_prefetching< SwappableBlockType >::swappable_blocks_iterator
protected

Definition at line 1136 of file block_scheduler.h.

template<class SwappableBlockType >
typedef block_scheduler_algorithm_type::time_type stxxl::block_scheduler_algorithm_offline_lru_prefetching< SwappableBlockType >::time_type
protected

Definition at line 1133 of file block_scheduler.h.

template<class SwappableBlockType >
typedef write_scheduled_blocks_type::iterator stxxl::block_scheduler_algorithm_offline_lru_prefetching< SwappableBlockType >::write_scheduled_blocks_iterator
protected

Definition at line 1142 of file block_scheduler.h.

template<class SwappableBlockType >
typedef write_scheduled_blocks_type::reference stxxl::block_scheduler_algorithm_offline_lru_prefetching< SwappableBlockType >::write_scheduled_blocks_reference
protected

Definition at line 1143 of file block_scheduler.h.

template<class SwappableBlockType >
typedef std::map<swappable_block_identifier_type, write_read_request*> stxxl::block_scheduler_algorithm_offline_lru_prefetching< SwappableBlockType >::write_scheduled_blocks_type
protected

Definition at line 1141 of file block_scheduler.h.

Constructor & Destructor Documentation

Definition at line 1629 of file block_scheduler.h.

Definition at line 1634 of file block_scheduler.h.

template<class SwappableBlockType >
virtual stxxl::block_scheduler_algorithm_offline_lru_prefetching< SwappableBlockType >::~block_scheduler_algorithm_offline_lru_prefetching ( )
inlinevirtual

Definition at line 1638 of file block_scheduler.h.

References stxxl::pop_begin(), and STXXL_ERRMSG.

Member Function Documentation

template<class SwappableBlockType >
virtual internal_block_type& stxxl::block_scheduler_algorithm_offline_lru_prefetching< SwappableBlockType >::acquire ( const swappable_block_identifier_type  sbid,
const bool  uninitialized = false 
)
inlinevirtual
template<class SwappableBlockType >
void stxxl::block_scheduler_algorithm_offline_lru_prefetching< SwappableBlockType >::deinit ( )
inlineprotected

Definition at line 1599 of file block_scheduler.h.

References STXXL_MSG.

template<class SwappableBlockType >
virtual void stxxl::block_scheduler_algorithm_offline_lru_prefetching< SwappableBlockType >::deinitialize ( swappable_block_identifier_type  sbid)
inlinevirtual
template<class SwappableBlockType >
virtual bool stxxl::block_scheduler_algorithm_offline_lru_prefetching< SwappableBlockType >::evictable_blocks_empty ( )
inlinevirtual
template<class SwappableBlockType >
virtual swappable_block_identifier_type stxxl::block_scheduler_algorithm_offline_lru_prefetching< SwappableBlockType >::evictable_blocks_pop ( )
inlinevirtual
template<class SwappableBlockType >
virtual external_block_type stxxl::block_scheduler_algorithm_offline_lru_prefetching< SwappableBlockType >::extract_external_block ( swappable_block_identifier_type  sbid)
inlinevirtual
template<class SwappableBlockType >
internal_block_type* stxxl::block_scheduler_algorithm_offline_lru_prefetching< SwappableBlockType >::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 1410 of file block_scheduler.h.

template<class SwappableBlockType >
block_scheduler_algorithm_type* stxxl::block_scheduler_algorithm_offline_lru_prefetching< SwappableBlockType >::give_up ( std::string  err_msg = "detected some error in the prediction sequence")
inlineprotected

Definition at line 1489 of file block_scheduler.h.

References STXXL_ERRMSG.

template<class SwappableBlockType >
void stxxl::block_scheduler_algorithm_offline_lru_prefetching< SwappableBlockType >::init ( block_scheduler_algorithm_type old_algo)
inlineprotected
template<class SwappableBlockType >
virtual void stxxl::block_scheduler_algorithm_offline_lru_prefetching< SwappableBlockType >::initialize ( swappable_block_identifier_type  sbid,
external_block_type  eblock 
)
inlinevirtual
template<class SwappableBlockType >
void stxxl::block_scheduler_algorithm_offline_lru_prefetching< SwappableBlockType >::operation_done ( scheduled_blocks_iterator schedule_meta)
inlineprotected

Definition at line 1479 of file block_scheduler.h.

template<class SwappableBlockType >
virtual void stxxl::block_scheduler_algorithm_offline_lru_prefetching< SwappableBlockType >::release ( swappable_block_identifier_type  sbid,
const bool  dirty 
)
inlinevirtual
template<class SwappableBlockType >
void stxxl::block_scheduler_algorithm_offline_lru_prefetching< SwappableBlockType >::return_free_internal_block ( internal_block_type iblock)
inlineprotected

Definition at line 1500 of file block_scheduler.h.

template<class SwappableBlockType >
void stxxl::block_scheduler_algorithm_offline_lru_prefetching< SwappableBlockType >::schedule_next_operations ( )
inlineprotected
template<class SwappableBlockType >
void stxxl::block_scheduler_algorithm_offline_lru_prefetching< SwappableBlockType >::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 1255 of file block_scheduler.h.

template<class SwappableBlockType >
write_read_request* stxxl::block_scheduler_algorithm_offline_lru_prefetching< SwappableBlockType >::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 1210 of file block_scheduler.h.

References STXXL_ASSERT, stxxl::counting_ptr< Type >::valid(), and stxxl::block_scheduler_algorithm_offline_lru_prefetching< SwappableBlockType >::write_read_request::write_req.

template<class SwappableBlockType >
bool stxxl::block_scheduler_algorithm_offline_lru_prefetching< SwappableBlockType >::shall_be_cleaned ( const scheduled_blocks_iterator schedule_meta) const
inlineprotected

Definition at line 1445 of file block_scheduler.h.

template<class SwappableBlockType >
bool stxxl::block_scheduler_algorithm_offline_lru_prefetching< SwappableBlockType >::shall_be_read ( const scheduled_blocks_iterator schedule_meta,
const bool  ignore_first = true 
) const
inlineprotected

Definition at line 1471 of file block_scheduler.h.

template<class SwappableBlockType >
bool stxxl::block_scheduler_algorithm_offline_lru_prefetching< SwappableBlockType >::shall_keep_internal_block ( const scheduled_blocks_iterator schedule_meta,
const bool  ignore_first = true 
) const
inlineprotected

Definition at line 1418 of file block_scheduler.h.

template<class SwappableBlockType >
bool stxxl::block_scheduler_algorithm_offline_lru_prefetching< SwappableBlockType >::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 1232 of file block_scheduler.h.

template<class SwappableBlockType >
void stxxl::block_scheduler_algorithm_offline_lru_prefetching< SwappableBlockType >::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 1397 of file block_scheduler.h.

template<class SwappableBlockType >
void stxxl::block_scheduler_algorithm_offline_lru_prefetching< SwappableBlockType >::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 1365 of file block_scheduler.h.

template<class SwappableBlockType >
void stxxl::block_scheduler_algorithm_offline_lru_prefetching< SwappableBlockType >::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 1375 of file block_scheduler.h.

template<class SwappableBlockType >
void stxxl::block_scheduler_algorithm_offline_lru_prefetching< SwappableBlockType >::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 1385 of file block_scheduler.h.

Member Data Documentation

template<class SwappableBlockType >
std::set<swappable_block_identifier_type> stxxl::block_scheduler_algorithm_offline_lru_prefetching< SwappableBlockType >::free_evictable_blocks
protected

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

Definition at line 1195 of file block_scheduler.h.

template<class SwappableBlockType >
prediction_sequence_type::iterator stxxl::block_scheduler_algorithm_offline_lru_prefetching< SwappableBlockType >::next_op_to_schedule
protected

Definition at line 1203 of file block_scheduler.h.

template<class SwappableBlockType >
scheduled_blocks_type stxxl::block_scheduler_algorithm_offline_lru_prefetching< SwappableBlockType >::scheduled_blocks
protected

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

Definition at line 1199 of file block_scheduler.h.

template<class SwappableBlockType >
std::set<swappable_block_identifier_type> stxxl::block_scheduler_algorithm_offline_lru_prefetching< SwappableBlockType >::scheduled_evictable_blocks
protected

Definition at line 1196 of file block_scheduler.h.

template<class SwappableBlockType >
write_scheduled_blocks_type stxxl::block_scheduler_algorithm_offline_lru_prefetching< SwappableBlockType >::write_scheduled_blocks
protected

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

Definition at line 1202 of file block_scheduler.h.


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