CnC
Classes | Enumerations | Functions | Variables
CnC Namespace Reference

CnC API. More...

Classes

class  step_collection
 A step collection is logical set of step instances. More...
class  tag_collection
 A tag collection is a set of tags of the same type. It is used to prescribe steps. By default, tags are not stored. More...
class  item_collection
 An item collection is a mapping from tags to items. More...
class  graph
 Base class for defining and using CnC (sub-)graphs. More...
class  context
 CnC context bringing together collections (for steps, items and tags). More...
struct  debug
 Debugging interface providing tracing and timing capabilities. More...
class  tuner_base
struct  step_tuner
 Default (NOP) implementations of the step_tuner interface. More...
struct  pfor_tuner
 Default (NOP) implementations of the pfor_tuner interface. More...
class  cancel_tuner
 Step tuner with convenient cancelation capabilities. More...
struct  item_tuner
 Default implementations of the item-tuner interface for item-collections. More...
struct  hashmap_tuner
 The tuner base for hashmap-based item-tuners. More...
struct  vector_tuner
 The tuner base for vector-based item-tuners. More...
struct  tag_tuner
 Default implementations of the tag-tuner interface for tag-collections. More...
struct  preserve_tuner
struct  dist_cnc_init
class  explicitly_serializable
 Specifies serialization category: explicit serialization via a "serialize" function. More...
class  bitwise_serializable
 simple structs/classes are bitwise serializable. More...
class  chunk
 Serialization of arrays with and without automatic memory handling. More...
class  serializer
 Handles serilialization of data-objects. More...
class  default_partitioner
 Interface for partitioners: configuring how ranges are partitioned. More...
class  tag_partitioner

Enumerations

enum  {
  COMPUTE_ON_LOCAL = -2, COMPUTE_ON_ROUND_ROBIN = -3, COMPUTE_ON_ALL = -4, COMPUTE_ON_ALL_OTHERS = -5,
  PRODUCER_UNKNOWN = -6, PRODUCER_LOCAL = -7, CONSUMER_UNKNOWN = -8, CONSUMER_LOCAL = -9,
  CONSUMER_ALL = -10, CONSUMER_ALL_OTHERS = -11, NO_GETCOUNT = Internal::item_properties::NO_GET_COUNT, AFFINITY_HERE = Internal::scheduler_i::AFFINITY_HERE
}

Functions

template<class Index , class Functor , class Tuner >
void parallel_for (Index first, Index last, Index incr, const Functor &f, const Tuner &tuner)
 Execute f( i ) for every i in {first <= i=first+step*x < last and 0 <= x}.
template<typename Ctxt , typename TagA , typename TunerA , typename TagB , typename TunerB , typename TagC , typename TunerC >
graphmake_join_graph (CnC::context< Ctxt > &ctxt, const std::string &name, CnC::tag_collection< TagA, TunerA > &a, CnC::tag_collection< TagB, TunerB > &b, CnC::tag_collection< TagC, TunerC > &c)
template<typename Ctxt , typename ITag , typename IType , typename ITuner , typename CType , typename CTuner , typename OTag , typename OTuner , typename ReduceOp , typename Select >
graphmake_reduce_graph (CnC::context< Ctxt > &ctxt, const std::string &name, CnC::item_collection< ITag, IType, ITuner > &in, CnC::item_collection< OTag, CType, CTuner > &cnt, CnC::item_collection< OTag, IType, OTuner > &out, const ReduceOp &op, const IType &idty, const Select &sel)
template<class T >
explicitly_serializable serializer_category (const T *)
 CNC_BITWISE_SERIALIZABLE (bool)
 bool is bitwise serializable
 CNC_BITWISE_SERIALIZABLE (char)
 char is bitwise serializable
 CNC_BITWISE_SERIALIZABLE (signed char)
 signed char is bitwise serializable
 CNC_BITWISE_SERIALIZABLE (unsigned char)
 unsigend char is bitwise serializable
 CNC_BITWISE_SERIALIZABLE (short)
 short is bitwise serializable
 CNC_BITWISE_SERIALIZABLE (int)
 int is bitwise serializable
 CNC_BITWISE_SERIALIZABLE (long)
 long is bitwise serializable
 CNC_BITWISE_SERIALIZABLE (unsigned long long)
 unsigned long long is bitwise serializable
 CNC_BITWISE_SERIALIZABLE (float)
 float is bitwise serializable
 CNC_BITWISE_SERIALIZABLE (double)
 double is bitwise serializable
 CNC_BITWISE_SERIALIZABLE (long double)

Variables

const int CNC_Success = 0
 Steps return CNC_Success if execution was successful.
const int CNC_Failure = 1
 Steps return CNC_Failure if execution failed.

Detailed Description

CnC API.


Enumeration Type Documentation

anonymous enum
Enumerator:
COMPUTE_ON_LOCAL 

let tuner::compute_on return COMPUTE_ON_LOCAL if the step should be executed locally

COMPUTE_ON_ROUND_ROBIN 

let tuner::compute_on return COMPUTE_ON_ROUND_ROBIN to let the scheduler distribute it in a round-robin fashion

COMPUTE_ON_ALL 

let tuner::compute_on return COMPUTE_ON_ALL if the step should be executed on all processes, as well as locally

COMPUTE_ON_ALL_OTHERS 

let tuner::compute_on return COMPUTE_ON_ALL_OTHERS if the step should be executed on all processes, but not locally

PRODUCER_UNKNOWN 

producer process of dependent item is unknown

PRODUCER_LOCAL 

producer process of dependent item is local process

CONSUMER_UNKNOWN 

consumer process of given item is unkown

CONSUMER_LOCAL 

consumer process of given item is the local process

CONSUMER_ALL 

all processes consume given item

CONSUMER_ALL_OTHERS 

all processes but this consume given item

NO_GETCOUNT 

no get-count specified

AFFINITY_HERE 

default affinity to current thread

Definition at line 60 of file default_tuner.h.

         {
        COMPUTE_ON_LOCAL       = -2,  ///< let tuner::compute_on return COMPUTE_ON_LOCAL if the step should be executed locally
        COMPUTE_ON_ROUND_ROBIN = -3,  ///< let tuner::compute_on return COMPUTE_ON_ROUND_ROBIN to let the scheduler distribute it in a round-robin fashion
        COMPUTE_ON_ALL         = -4,  ///< let tuner::compute_on return COMPUTE_ON_ALL if the step should be executed on all processes, as well as locally
        COMPUTE_ON_ALL_OTHERS  = -5,  ///< let tuner::compute_on return COMPUTE_ON_ALL_OTHERS if the step should be executed on all processes, but not locally    
        PRODUCER_UNKNOWN    = -6,  ///< producer process of dependent item is unknown
        PRODUCER_LOCAL      = -7,  ///< producer process of dependent item is local process
        CONSUMER_UNKNOWN    = -8,  ///< consumer process of given item is unkown
        CONSUMER_LOCAL      = -9,  ///< consumer process of given item is the local process
        CONSUMER_ALL        = -10, ///< all processes consume given item
        CONSUMER_ALL_OTHERS = -11, ///< all processes but this consume given item
        NO_GETCOUNT         = Internal::item_properties::NO_GET_COUNT,   ///< no get-count specified
        AFFINITY_HERE       = Internal::scheduler_i::AFFINITY_HERE       ///< default affinity to current thread
    };

Function Documentation

graph* CnC::make_join_graph ( CnC::context< Ctxt > &  ctxt,
const std::string &  name,
CnC::tag_collection< TagA, TunerA > &  a,
CnC::tag_collection< TagB, TunerB > &  b,
CnC::tag_collection< TagC, TunerC > &  c 
)

Returns a graph that joins 2 tag-collections into a third one. Continuously produces the join product of the 2 input tag-collections and puts it into the output tag-collection.

Accepts any types; only requires that a an output tag-type provides a constructor which accepts (taga, tagb) to construct a joined tag from tag a and b.

On distributed memory duplicate output tags might be produced. To avoid duplicate step execution use tag-preservation on the output tag-collection (CnC::preserve_tuner) and suitable distribution functions on the prescribed step-collection (CnC::step_tuner).

Parameters:
ctxtthe context to which the graph belongs
namethe name of this join graph instance
afirst input collection
bsecond input collection
coutput collection

Definition at line 64 of file join.h.

    {
        return new join< TagA, TunerA, TagB, TunerB, TagC, TunerC >( ctxt, name, a, b, c );
    }
void CnC::parallel_for ( Index  first,
Index  last,
Index  incr,
const Functor &  f,
const Tuner &  tuner 
)

Execute f( i ) for every i in {first <= i=first+step*x < last and 0 <= x}.

For different values of i, function execution might occur in parallel. Returns functor object ocne all iterations have been executed. Type Index must support operator+. Executes on the local process only. No distribution to other processes supported.

Parameters:
firststarting index of parallel iteration
lastiteration stops before reaching last
incrincrement index by this value in each iteration
ffunction to be executed
tunerdefaults to pfor_tuner<>
 All Classes Namespaces Functions Variables Typedefs Enumerator Friends