CnC
Public Member Functions | List of all members
cancel_tuner< Tag, check_deps, Hasher, Equality > Class Template Reference

Step tuner with convenient cancelation capabilities. More...

Inherits step_tuner< check_deps >, and distributable.

Public Member Functions

void cancel (const Tag &t, bool from_msg=false)
 cancel given step (identified by tag)
 
void cancel_all (bool from_msg=false)
 cancel all steps
 
template<typename Arg >
int was_canceled (const Tag &tag, Arg &) const
 implements/overwrites step_tuner::was_canceled(...)
 
- Public Member Functions inherited from step_tuner< check_deps >
template<typename Tag , typename Arg >
int priority (const Tag &tag, Arg &arg) const
 Allows definition of priorities to individual steps (which are identified by the tag). More...
 
template<typename Tag , typename Arg , typename T >
void depends (const Tag &tag, Arg &arg, T &dC) const
 Allows declaration of data dependencies (to items) of given step (identified by the tag). More...
 
bool preschedule () const
 Returns whether the step should be pre-scheduled. More...
 
template<typename Tag , typename Arg >
int affinity (const Tag &, Arg &) const
 Tell the scheduler the preferred thread for executing given step. More...
 
template<typename Tag , typename Arg >
int compute_on (const Tag &, Arg &) const
 tell the scheduler on which process to run the step (or range of steps) (distCnC) More...
 
template<typename Tag , typename Arg >
int was_canceled (const Tag &, Arg &) const
 check for cancelation of given step More...
 
template<typename Tag , typename Arg >
bool sequentialize (const Tag &, Arg &) const
 check if given step-instance needs to be executed sequentially 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
 
- Static Public Attributes inherited from step_tuner< check_deps >
static const bool check_deps_in_ranges = check_deps
 true if steps launched through ranges consume items or need global locking, false otherwise. More...
 

Detailed Description

template<typename Tag, bool check_deps = true, typename Hasher = cnc_hash< Tag >, typename Equality = cnc_equal< Tag >>
class CnC::cancel_tuner< Tag, check_deps, Hasher, Equality >

Step tuner with convenient cancelation capabilities.

Allows cancelation of individual step-instances by their tags as well as canceling all instances at once. All cancelation requests are "active" until unsafe_reset() is called (or the tuner is destructed).

To use it, you need a cancel_tuner object in your context which you pass to the constructor of the respective step_collection.

It works on distributed memory but might perform poorly if used frequently.

Parameters
Tagtag-type
check_depsif false, avoid some mechanics to handle unavailable items
Hasherhash-functor for Tag, defaults to tbb::tbb_hash< Tag >
Equalityequality operator for Tag, defaults to std::equal_to< Tag >
Note
It is assumed that cancelation per instance happens relatively rarely. Hence no automatic garbage collection of the tags is provided. If you cancel individual step-instances frequently, it is recommended to prune the internal data structure from time to time in a safe state through unsafe_reset().
See also
also CNCROOT/samples/floyd_warshall

Definition at line 324 of file default_tuner.h.


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