MADNESS  version 0.9
Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
madness::TaskAttributes Class Reference

Contains attributes of a task. More...

#include <worldthread.h>

Inheritance diagram for madness::TaskAttributes:
Inheritance graph
[legend]

Public Member Functions

 TaskAttributes (unsigned long flags=0)
 
 TaskAttributes (const TaskAttributes &attr)
 
virtual ~TaskAttributes ()
 
bool is_generator () const
 
bool is_stealable () const
 
bool is_high_priority () const
 
void set_generator (bool generator_hint)
 
void set_stealable (bool stealable)
 
void set_highpriority (bool hipri)
 
void set_nthread (int nthread)
 Are you sure this is what you want to call? More...
 
int get_nthread () const
 
template<typename Archive >
void serialize (Archive &ar)
 

Static Public Member Functions

static TaskAttributes generator ()
 
static TaskAttributes hipri ()
 
static TaskAttributes multi_threaded (int nthread)
 

Static Public Attributes

static const unsigned long NTHREAD = 0xff
 
static const unsigned long GENERATOR = 1ul<<8
 
static const unsigned long STEALABLE = GENERATOR<<1
 
static const unsigned long HIGHPRIORITY = GENERATOR<<2
 

Detailed Description

Contains attributes of a task.

generator : Setting this hints that a task will produce additional tasks and is used by the scheduler to increase/throttle parallelism. The default is false.

stealable : Setting this indicates that a task may be migrated to another process for dynamic load balancing. The default value is false.

highpriority : indicates a high priority task. The default value is false.

nthread : indicates number of threads. 0 threads is interpreted as 1 thread for backward compatibility and ease of specifying defaults. The default value is 0 (==1).

Constructor & Destructor Documentation

madness::TaskAttributes::TaskAttributes ( unsigned long  flags = 0)
inlineexplicit

Referenced by generator(), and hipri().

madness::TaskAttributes::TaskAttributes ( const TaskAttributes attr)
inline
virtual madness::TaskAttributes::~TaskAttributes ( )
inlinevirtual

Member Function Documentation

static TaskAttributes madness::TaskAttributes::generator ( )
inlinestatic
int madness::TaskAttributes::get_nthread ( ) const
inline
static TaskAttributes madness::TaskAttributes::hipri ( )
inlinestatic
bool madness::TaskAttributes::is_generator ( ) const
inline

References GENERATOR.

bool madness::TaskAttributes::is_high_priority ( ) const
inline

References HIGHPRIORITY.

Referenced by madness::ThreadPool::add().

bool madness::TaskAttributes::is_stealable ( ) const
inline

References STEALABLE.

static TaskAttributes madness::TaskAttributes::multi_threaded ( int  nthread)
inlinestatic

References set_nthread().

template<typename Archive >
void madness::TaskAttributes::serialize ( Archive &  ar)
inline
void madness::TaskAttributes::set_generator ( bool  generator_hint)
inline

References GENERATOR.

void madness::TaskAttributes::set_highpriority ( bool  hipri)
inline

References HIGHPRIORITY.

void madness::TaskAttributes::set_nthread ( int  nthread)
inline

Are you sure this is what you want to call?

Only call this for a TaskAttributes that is not a base class of a task object.

If you are trying to set the number of threads in an existing task you should call TaskInterface::set_nthread() instead. No doubt there is some virtual/protected/something voodoo to prevent you from doing harm.

References NTHREAD.

Referenced by multi_threaded(), and madness::PoolTaskInterface::set_nthread().

void madness::TaskAttributes::set_stealable ( bool  stealable)
inline

References STEALABLE.

Member Data Documentation

const unsigned long madness::TaskAttributes::GENERATOR = 1ul<<8
static

Referenced by is_generator(), and set_generator().

const unsigned long madness::TaskAttributes::HIGHPRIORITY = GENERATOR<<2
static
const unsigned long madness::TaskAttributes::NTHREAD = 0xff
static

Referenced by get_nthread(), and set_nthread().

const unsigned long madness::TaskAttributes::STEALABLE = GENERATOR<<1
static

Referenced by is_stealable(), and set_stealable().


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