CnC
Classes | Enumerations | Functions | Variables
CnC Namespace Reference

CnC API. More...

Classes

class  bitwise_serializable
 simple structs/classes are bitwise serializable. More...
 
class  cancel_tuner
 Step tuner with convenient cancelation capabilities. More...
 
class  chunk
 Serialization of arrays with and without automatic memory handling. 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  default_partitioner
 Interface for partitioners: configuring how ranges are partitioned. More...
 
struct  dist_cnc_init
 
class  explicitly_serializable
 Specifies serialization category: explicit serialization via a "serialize" function. More...
 
class  graph
 Base class for defining and using CnC (sub-)graphs. More...
 
struct  hashmap_tuner
 The tuner base for hashmap-based item-tuners. More...
 
class  item_collection
 An item collection is a mapping from tags to items. More...
 
struct  item_tuner
 Default implementations of the item-tuner interface for item-collections. More...
 
struct  pfor_tuner
 Default (NOP) implementations of the pfor_tuner interface. More...
 
struct  preserve_tuner
 
class  serializer
 Handles serilialization of data-objects. More...
 
class  step_collection
 A step collection is logical set of step instances. More...
 
struct  step_tuner
 Default (NOP) implementations of the step_tuner interface. 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  tag_partitioner
 
struct  tag_tuner
 Default implementations of the tag-tuner interface for tag-collections. More...
 
class  tuner_base
 
struct  vector_tuner
 The tuner base for vector-based item-tuners. More...
 

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 , typename Increment >
void parallel_for (Index first, Index last, Increment incr, const Functor &f, const Tuner &tuner)
 Execute f( i ) for every i in {first <= i=first+step*x < last and 0 <= x}. More...
 
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 More...
 
 CNC_BITWISE_SERIALIZABLE (short)
 short is bitwise serializable
 
 CNC_BITWISE_SERIALIZABLE (int)
 int is bitwise serializable
 
 CNC_BITWISE_SERIALIZABLE (long)
 long is bitwise serializable More...
 
 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)
 long double is bitwise serializable
 

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

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 61 of file default_tuner.h.

61  {
62  COMPUTE_ON_LOCAL = -2, ///< let tuner::compute_on return COMPUTE_ON_LOCAL if the step should be executed locally
63  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
64  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
65  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
66  PRODUCER_UNKNOWN = -6, ///< producer process of dependent item is unknown
67  PRODUCER_LOCAL = -7, ///< producer process of dependent item is local process
68  CONSUMER_UNKNOWN = -8, ///< consumer process of given item is unkown
69  CONSUMER_LOCAL = -9, ///< consumer process of given item is the local process
70  CONSUMER_ALL = -10, ///< all processes consume given item
71  CONSUMER_ALL_OTHERS = -11, ///< all processes but this consume given item
72  NO_GETCOUNT = Internal::item_properties::NO_GET_COUNT, ///< no get-count specified
73  AFFINITY_HERE = Internal::scheduler_i::AFFINITY_HERE ///< default affinity to current thread
74  };
default affinity to current thread
Definition: default_tuner.h:73
let tuner::compute_on return COMPUTE_ON_ALL_OTHERS if the step should be executed on all processes...
Definition: default_tuner.h:65
no get-count specified
Definition: default_tuner.h:72
all processes consume given item
Definition: default_tuner.h:70
consumer process of given item is unkown
Definition: default_tuner.h:68
consumer process of given item is the local process
Definition: default_tuner.h:69
producer process of dependent item is unknown
Definition: default_tuner.h:66
producer process of dependent item is local process
Definition: default_tuner.h:67
let tuner::compute_on return COMPUTE_ON_LOCAL if the step should be executed locally ...
Definition: default_tuner.h:62
all processes but this consume given item
Definition: default_tuner.h:71
let tuner::compute_on return COMPUTE_ON_ROUND_ROBIN to let the scheduler distribute it in a round-rob...
Definition: default_tuner.h:63
let tuner::compute_on return COMPUTE_ON_ALL if the step should be executed on all processes...
Definition: default_tuner.h:64

Function Documentation

◆ make_join_graph()

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 65 of file join.h.

69  {
70  return new join< TagA, TunerA, TagB, TunerB, TagC, TunerC >( ctxt, name, a, b, c );
71  }

◆ parallel_for()

void CnC::parallel_for ( Index  first,
Index  last,
Increment  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+(increment) and operator-(Index), like C++ random access iterators do. 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<>