CnC
Classes | Public Member Functions | List of all members
item_tuner< TT > Struct Template Reference

Default implementations of the item-tuner interface for item-collections. More...

Inherits tuner_base.

Classes

struct  item_allocator
 Class which manages item creation/uncreation.. More...
 
struct  table_type
 Defines the type of the internal data store. More...
 

Public Member Functions

template<typename Tag , typename Item , typename Coll >
void init_table (TT< Tag, Item, Coll > &stbl) const
 Initialize the internal storage. More...
 
template<typename Tag >
int get_count (const Tag &tag) const
 Allows specifying the number of gets to the given item. More...
 
template<typename Tag >
int consumed_on (const Tag &tag) const
 Tells the scheduler on which process(es) this item is going to be consumed. More...
 
template<typename Tag >
int produced_on (const Tag &tag) const
 Tells the scheduler on which process(es) this item is going to be produced. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from tuner_base
static int myPid ()
 
static int numProcs ()
 
template<typename Ctxt >
static int numThreads (const Ctxt &ctxt)
 returns number of threads used by scheduler in given context
 

Detailed Description

template<template< typename T, typename I, typename A > class TT>
struct CnC::item_tuner< TT >

Default implementations of the item-tuner interface for item-collections.

Usually you will not need to use this directly for anything else than documentation and interface.

Definition at line 435 of file default_tuner.h.

Member Function Documentation

◆ consumed_on()

int consumed_on ( const Tag &  tag) const
inline

Tells the scheduler on which process(es) this item is going to be consumed.

return process id where the item will be consumed (get), or CONSUMER_UNKNOWN (default) or std::vector<int>, containing all ids of consuming processes. To indicate that the consumer processes are unknown, return an empty vector. The vector must contain special values like CONSUMER_LOCAL. If not CnC::CONSUMER_UKNOWN (or empty vector), this declaration will overwrite what the step-tuner might declare in depends. Providing this method leads to the most efficient communication pattern for to getting the data to where it is needed.

Parameters
tagthe tag which identifies the item

Definition at line 496 of file default_tuner.h.

497  {
498  return CONSUMER_UNKNOWN;
499  }
consumer process of given item is unkown
Definition: default_tuner.h:68

◆ get_count()

int get_count ( const Tag &  tag) const
inline

Allows specifying the number of gets to the given item.

After get_count() many 'get()'s the item can be removed from the collection. By default, the item is not removed until the collection is deleted. Gets by the environment are ignored, use CnC::NO_GETCOUNT for items which are consumed by the environment.

Parameters
tagthe tag which identifies the item
Returns
number of expected gets to this item, or CNC::NO_GETCOUNT

Definition at line 479 of file default_tuner.h.

480  {
481  return NO_GETCOUNT;
482  }
no get-count specified
Definition: default_tuner.h:72

◆ init_table()

void init_table ( TT< Tag, Item, Coll > &  stbl) const
inline

Initialize the internal storage.

Can be used to configure the storage table. Called in the collection constructor.

Definition at line 467 of file default_tuner.h.

468  {}

◆ produced_on()

int produced_on ( const Tag &  tag) const
inline

Tells the scheduler on which process(es) this item is going to be produced.

return process id where the item will be produced. If unknown return CnC::PRODUCER_UNKNOWN. return PRODUCER_LOCAL if local process is the owner. Implementing this method reduces the communication cost for locating and sending data. Implementing item_tuner::consumed_on is more efficient, but might be more complicated. Will be evaluated only if item_tuner::consumed_on returns CnC::CONSUMER_UNKNOWN

Parameters
tagthe tag which identifies the item

Definition at line 510 of file default_tuner.h.

511  {
512  return PRODUCER_UNKNOWN;
513  }
producer process of dependent item is unknown
Definition: default_tuner.h:66

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