MADNESS 0.10.1
Classes | Public Member Functions | Private Types | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
madness::MacroTask< taskT > Class Template Reference

#include <macrotaskq.h>

Collaboration diagram for madness::MacroTask< taskT >:
Collaboration graph
[legend]

Classes

struct  is_vector
 
struct  is_vector< std::vector< Q > >
 
class  MacroTaskInternal
 

Public Member Functions

 MacroTask (World &world, taskT &task)
 constructor takes the task, but no arguments to the task
 
 MacroTask (World &world, taskT &task, const MacroTaskQFactory factory)
 constructor takes task and a taskq factory for customization, immediate execution
 
 MacroTask (World &world, taskT &task, std::shared_ptr< MacroTaskQ > taskq_ptr)
 constructor takes the task, and a taskq, execution is not immediate
 
std::shared_ptr< MacroTaskQget_taskq () const
 
template<typename ... Ts>
resultT operator() (const Ts &... args)
 this mimicks the original call to the task functor, called from the universe
 
MacroTaskset_debug (const bool value)
 

Private Types

typedef taskT::argtupleT argtupleT
 
template<typename Q , typename ResT >
using has_accumulate_locally_t = decltype(std::declval< Q & >().accumulate_locally(std::declval< World & >(), std::declval< const ResT & >()))
 true if: task.accumulate_locally(subworld, result_subworld)
 
template<typename Q >
using has_finalize_stage1_t = decltype(std::declval< Q & >().finalize_stage1(std::declval< World & >(), std::declval< World * >()))
 true if: task.finalize_stage1(subworld, nodeworld)
 
template<typename Q , typename ResT >
using has_finalize_stage2_t = decltype(std::declval< Q & >().finalize_stage2(std::declval< World & >(), std::declval< World * >(), std::declval< ResT & >()))
 true if: task.finalize_stage2(subworld, nodeworld, universe_result)
 
template<typename Q >
using has_prepare_owner_assignment_t = decltype(std::declval< Q & >().prepare_owner_assignment(std::declval< const MacroTaskPartitioner::partitionT & >(), 0L))
 true if: task.prepare_owner_assignment(partition, nsubworld)
 
template<typename Q , typename ArgTuple >
using has_store_batches_t = decltype(std::declval< Q & >().store_batches(std::declval< World & >(), std::declval< World & >(), std::declval< Cloud & >(), std::declval< const ArgTuple & >(), 0L))
 true if: task.store_batches(world, subworld, cloud, argtuple, nsubworld)
 
template<typename Q , typename VecT >
using has_sym_pipeline_advance_t = decltype(std::declval< Q & >().sym_pipeline_advance(std::declval< World & >(), std::declval< const VecT & >(), std::declval< const Batch_1D & >(), std::declval< const Batch_1D & >(), true))
 true if: task.sym_pipeline_advance(subworld, ket, next_col, next_row, has_next)
 
template<typename Q >
using has_wants_node_local_reduction_t = decltype(std::declval< const Q & >().wants_node_local_reduction())
 true if: task.wants_node_local_reduction()
 
using partitionT = MacroTaskPartitioner::partitionT
 
typedef Cloud::recordlistT recordlistT
 
typedef taskT::resultT resultT
 

Private Member Functions

recordlistT prepare_output_records (Cloud &cloud, resultT &result)
 store pointers to the result WorldObject in the cloud and return the recordlist
 

Private Attributes

bool debug =false
 
bool immediate_execution =false
 
taskT task
 
std::shared_ptr< MacroTaskQtaskq_ptr
 
Worldworld
 

Static Private Attributes

template<typename Q , typename ResT >
static constexpr bool has_accumulate_locally_v
 
template<typename Q >
static constexpr bool has_finalize_stage1_v
 
template<typename Q , typename ResT >
static constexpr bool has_finalize_stage2_v
 
template<typename Q >
static constexpr bool has_prepare_owner_assignment_v
 
template<typename Q , typename ArgTuple >
static constexpr bool has_store_batches_v
 
template<typename Q , typename VecT >
static constexpr bool has_sym_pipeline_advance_v
 
template<typename Q >
static constexpr bool has_wants_node_local_reduction_v
 

Member Typedef Documentation

◆ argtupleT

template<typename taskT >
typedef taskT::argtupleT madness::MacroTask< taskT >::argtupleT
private

◆ has_accumulate_locally_t

template<typename taskT >
template<typename Q , typename ResT >
using madness::MacroTask< taskT >::has_accumulate_locally_t = decltype(std::declval<Q&>().accumulate_locally( std::declval<World&>(), std::declval<const ResT&>()))
private

true if: task.accumulate_locally(subworld, result_subworld)

◆ has_finalize_stage1_t

template<typename taskT >
template<typename Q >
using madness::MacroTask< taskT >::has_finalize_stage1_t = decltype(std::declval<Q&>().finalize_stage1(std::declval<World&>(), std::declval<World*>()))
private

true if: task.finalize_stage1(subworld, nodeworld)

◆ has_finalize_stage2_t

template<typename taskT >
template<typename Q , typename ResT >
using madness::MacroTask< taskT >::has_finalize_stage2_t = decltype(std::declval<Q&>().finalize_stage2(std::declval<World&>(), std::declval<World*>(), std::declval<ResT&>()))
private

true if: task.finalize_stage2(subworld, nodeworld, universe_result)

◆ has_prepare_owner_assignment_t

template<typename taskT >
template<typename Q >
using madness::MacroTask< taskT >::has_prepare_owner_assignment_t = decltype(std::declval<Q&>().prepare_owner_assignment( std::declval<const MacroTaskPartitioner::partitionT&>(), 0L))
private

true if: task.prepare_owner_assignment(partition, nsubworld)

◆ has_store_batches_t

template<typename taskT >
template<typename Q , typename ArgTuple >
using madness::MacroTask< taskT >::has_store_batches_t = decltype(std::declval<Q&>().store_batches( std::declval<World&>(), std::declval<World&>(), std::declval<Cloud&>(), std::declval<const ArgTuple&>(), 0L))
private

true if: task.store_batches(world, subworld, cloud, argtuple, nsubworld)

◆ has_sym_pipeline_advance_t

template<typename taskT >
template<typename Q , typename VecT >
using madness::MacroTask< taskT >::has_sym_pipeline_advance_t = decltype(std::declval<Q&>().sym_pipeline_advance( std::declval<World&>(), std::declval<const VecT&>(), std::declval<const Batch_1D&>(), std::declval<const Batch_1D&>(), true))
private

true if: task.sym_pipeline_advance(subworld, ket, next_col, next_row, has_next)

◆ has_wants_node_local_reduction_t

template<typename taskT >
template<typename Q >
using madness::MacroTask< taskT >::has_wants_node_local_reduction_t = decltype(std::declval<const Q&>().wants_node_local_reduction())
private

true if: task.wants_node_local_reduction()

◆ partitionT

◆ recordlistT

template<typename taskT >
typedef Cloud::recordlistT madness::MacroTask< taskT >::recordlistT
private

◆ resultT

template<typename taskT >
typedef taskT::resultT madness::MacroTask< taskT >::resultT
private

Constructor & Destructor Documentation

◆ MacroTask() [1/3]

template<typename taskT >
madness::MacroTask< taskT >::MacroTask ( World world,
taskT task 
)
inlineexplicit

constructor takes the task, but no arguments to the task

References madness::MacroTask< taskT >::immediate_execution.

◆ MacroTask() [2/3]

template<typename taskT >
madness::MacroTask< taskT >::MacroTask ( World world,
taskT task,
const MacroTaskQFactory  factory 
)
inlineexplicit

constructor takes task and a taskq factory for customization, immediate execution

References madness::MacroTask< taskT >::immediate_execution.

◆ MacroTask() [3/3]

template<typename taskT >
madness::MacroTask< taskT >::MacroTask ( World world,
taskT task,
std::shared_ptr< MacroTaskQ taskq_ptr 
)
inlineexplicit

Member Function Documentation

◆ get_taskq()

template<typename taskT >
std::shared_ptr< MacroTaskQ > madness::MacroTask< taskT >::get_taskq ( ) const
inline

◆ operator()()

template<typename taskT >
template<typename ... Ts>
resultT madness::MacroTask< taskT >::operator() ( const Ts &...  args)
inline

this mimicks the original call to the task functor, called from the universe

store all input to the cloud, create output Function<T,NDIM> in the universe, create the batched task and shove it into the taskq. Possibly execute the taskq.

References madness::MacroTask< taskT >::debug, madness::MacroTask< taskT >::immediate_execution, madness::nonlinear_vector_solver(), madness::MacroTask< taskT >::prepare_output_records(), madness::print(), madness::World::rank(), madness::World::size(), madness::MacroTask< taskT >::task, madness::MacroTask< taskT >::taskq_ptr, and madness::MacroTask< taskT >::world.

◆ prepare_output_records()

template<typename taskT >
recordlistT madness::MacroTask< taskT >::prepare_output_records ( Cloud cloud,
resultT result 
)
inlineprivate

◆ set_debug()

template<typename taskT >
MacroTask & madness::MacroTask< taskT >::set_debug ( const bool  value)
inline

Member Data Documentation

◆ debug

template<typename taskT >
bool madness::MacroTask< taskT >::debug =false
private

◆ has_accumulate_locally_v

template<typename taskT >
template<typename Q , typename ResT >
constexpr bool madness::MacroTask< taskT >::has_accumulate_locally_v
staticconstexprprivate
Initial value:
=
madness::meta::is_detected_v<has_accumulate_locally_t, Q, ResT>

◆ has_finalize_stage1_v

template<typename taskT >
template<typename Q >
constexpr bool madness::MacroTask< taskT >::has_finalize_stage1_v
staticconstexprprivate
Initial value:
=
madness::meta::is_detected_v<has_finalize_stage1_t, Q>

◆ has_finalize_stage2_v

template<typename taskT >
template<typename Q , typename ResT >
constexpr bool madness::MacroTask< taskT >::has_finalize_stage2_v
staticconstexprprivate
Initial value:
=
madness::meta::is_detected_v<has_finalize_stage2_t, Q, ResT>

◆ has_prepare_owner_assignment_v

template<typename taskT >
template<typename Q >
constexpr bool madness::MacroTask< taskT >::has_prepare_owner_assignment_v
staticconstexprprivate
Initial value:
=
madness::meta::is_detected_v<has_prepare_owner_assignment_t, Q>

◆ has_store_batches_v

template<typename taskT >
template<typename Q , typename ArgTuple >
constexpr bool madness::MacroTask< taskT >::has_store_batches_v
staticconstexprprivate
Initial value:
=
madness::meta::is_detected_v<has_store_batches_t, Q, ArgTuple>

◆ has_sym_pipeline_advance_v

template<typename taskT >
template<typename Q , typename VecT >
constexpr bool madness::MacroTask< taskT >::has_sym_pipeline_advance_v
staticconstexprprivate
Initial value:
=
madness::meta::is_detected_v<has_sym_pipeline_advance_t, Q, VecT>

◆ has_wants_node_local_reduction_v

template<typename taskT >
template<typename Q >
constexpr bool madness::MacroTask< taskT >::has_wants_node_local_reduction_v
staticconstexprprivate
Initial value:
=
madness::meta::is_detected_v<has_wants_node_local_reduction_t, Q>

◆ immediate_execution

template<typename taskT >
bool madness::MacroTask< taskT >::immediate_execution =false
private

◆ task

template<typename taskT >
taskT madness::MacroTask< taskT >::task
private

◆ taskq_ptr

template<typename taskT >
std::shared_ptr<MacroTaskQ> madness::MacroTask< taskT >::taskq_ptr
private

◆ world

template<typename taskT >
World& madness::MacroTask< taskT >::world
private

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