MADNESS  0.10.1
Public Member Functions | List of all members
Adder Class Reference
Inheritance diagram for Adder:
Inheritance graph
[legend]
Collaboration diagram for Adder:
Collaboration graph
[legend]

Public Member Functions

void run (const TaskThreadEnv &env)
 Override this method to implement a multi-threaded task. More...
 
- Public Member Functions inherited from madness::PoolTaskInterface
 PoolTaskInterface ()
 Default constructor. More...
 
 PoolTaskInterface (const TaskAttributes &attr)
 
virtual ~PoolTaskInterface ()=default
 Destructor. More...
 
void execute ()
 
void set_nthread (int nthread)
 Call this to reset the number of threads before the task is submitted. More...
 
- Public Member Functions inherited from madness::TaskAttributes
 TaskAttributes (const TaskAttributes &attr)
 Copy constructor. More...
 
 TaskAttributes (unsigned long flags=0)
 Sets the attributes to the desired values. More...
 
virtual ~TaskAttributes ()
 
int get_nthread () const
 Get the number of threads. More...
 
bool is_generator () const
 Test if the generator attribute is true. More...
 
bool is_high_priority () const
 Test if the high priority attribute is true. More...
 
bool is_stealable () const
 Test if the stealable attribute is true. More...
 
template<typename Archive >
void serialize (Archive &ar)
 Serializes the attributes for I/O. More...
 
TaskAttributesset_generator (bool generator_hint)
 Sets the generator attribute. More...
 
TaskAttributesset_highpriority (bool hipri)
 Sets the high priority attribute. More...
 
void set_nthread (int nthread)
 Set the number of threads. More...
 
TaskAttributesset_stealable (bool stealable)
 Sets the stealable attribute. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from madness::TaskAttributes
static TaskAttributes generator ()
 
static TaskAttributes hipri ()
 
static TaskAttributes multi_threaded (int nthread)
 
- Static Public Attributes inherited from madness::TaskAttributes
static const unsigned long GENERATOR = 1ul<<8
 Mask for generator bit. More...
 
static const unsigned long HIGHPRIORITY = GENERATOR<<2
 Mask for priority bit. More...
 
static const unsigned long NTHREAD = 0xff
 Mask for nthread byte. More...
 
static const unsigned long STEALABLE = GENERATOR<<1
 Mask for stealable bit. More...
 
- Static Protected Member Functions inherited from madness::PoolTaskInterface
template<typename fnobjT >
static std::enable_if<!(detail::function_traits< fnobjT >::value||detail::memfunc_traits< fnobjT >::value) >::type make_id (std::pair< void *, unsigned short > &id, const fnobjT &)
 
template<typename fnT >
static std::enable_if< detail::function_traits< fnT >::value||detail::memfunc_traits< fnT >::value >::type make_id (std::pair< void *, unsigned short > &id, fnT fn)
 

Member Function Documentation

◆ run()

void Adder::run ( const TaskThreadEnv info)
inlinevirtual

Override this method to implement a multi-threaded task.

info.nthread() will be the number of threads collaborating on this task.

info.id() will be the index of the current thread id=0,...,nthread-1.

info.barrier() will be a barrier for all of the threads, and returns true for the last thread to enter the barrier (other threads get false).

Todo:
Description needed.
Parameters
[in]infoDescription needed.

Implements madness::PoolTaskInterface.

References NDO, ndone, and madness::sum().


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