MADNESS 0.10.1
Public Types | Public Member Functions | Public Attributes | Friends | List of all members
madness::MacroTaskPartitioner Class Reference

partition one (two) vectors into 1D (2D) batches. More...

#include <macrotaskpartitioner.h>

Inheritance diagram for madness::MacroTaskPartitioner:
Inheritance graph
[legend]
Collaboration diagram for madness::MacroTaskPartitioner:
Collaboration graph
[legend]

Public Types

typedef std::list< std::pair< Batch, double > > partitionT
 

Public Member Functions

 MacroTaskPartitioner ()
 
virtual ~MacroTaskPartitioner ()
 
virtual double compute_priority (const Batch &batch) const
 
partitionT do_1d_partition (const std::size_t vsize, const std::string policy) const
 
partitionT do_2d_partition (const std::size_t vsize, const std::size_t v2size, const std::string policy) const
 outer product of 2 1d-partitionings – result batches correspond to first input batches
 
virtual partitionT do_partitioning (const std::size_t &vsize1, const std::size_t &vsize2, const std::string policy) const
 override this if you want your own partitioning
 
template<typename tupleT >
partitionT partition_tasks (const tupleT &argtuple) const
 this will be called by MacroTask, it will always partition first (and possibly second) vector of arguments
 
MacroTaskPartitionerset_dimension (const std::size_t &n)
 
MacroTaskPartitionerset_max_batch_size (const long &n)
 
MacroTaskPartitionerset_min_batch_size (const long &n)
 
MacroTaskPartitionerset_nsubworld (const long &n)
 
MacroTaskPartitionerset_policy (const std::string &n)
 

Public Attributes

std::size_t dimension = 1
 partition one or two vectors
 
std::size_t max_batch_size = 10
 maximum batch size (for memory management)
 
std::size_t min_batch_size =5
 minimum batch size
 
std::size_t nsubworld =1
 number of worlds (try to have enough batches for all worlds)
 
std::string policy = "guided"
 how to partition the batches
 

Friends

class Batch
 

Detailed Description

partition one (two) vectors into 1D (2D) batches.

derive from this class and override the \it{do_partitioning} method if you want to implement your custom partitioner

Member Typedef Documentation

◆ partitionT

typedef std::list<std::pair<Batch,double> > madness::MacroTaskPartitioner::partitionT

Constructor & Destructor Documentation

◆ MacroTaskPartitioner()

madness::MacroTaskPartitioner::MacroTaskPartitioner ( )
inline

◆ ~MacroTaskPartitioner()

virtual madness::MacroTaskPartitioner::~MacroTaskPartitioner ( )
inlinevirtual

Member Function Documentation

◆ compute_priority()

virtual double madness::MacroTaskPartitioner::compute_priority ( const Batch batch) const
inlinevirtual

◆ do_1d_partition()

partitionT madness::MacroTaskPartitioner::do_1d_partition ( const std::size_t  vsize,
const std::string  policy 
) const
inline

◆ do_2d_partition()

partitionT madness::MacroTaskPartitioner::do_2d_partition ( const std::size_t  vsize,
const std::size_t  v2size,
const std::string  policy 
) const
inline

outer product of 2 1d-partitionings – result batches correspond to first input batches

[begin1,end1) <– [begin1,end1) [begin2,end2)

References compute_priority(), do_1d_partition(), and policy.

Referenced by do_partitioning().

◆ do_partitioning()

virtual partitionT madness::MacroTaskPartitioner::do_partitioning ( const std::size_t &  vsize1,
const std::size_t &  vsize2,
const std::string  policy 
) const
inlinevirtual

◆ partition_tasks()

template<typename tupleT >
partitionT madness::MacroTaskPartitioner::partition_tasks ( const tupleT &  argtuple) const
inline

this will be called by MacroTask, it will always partition first (and possibly second) vector of arguments

References dimension, do_partitioning(), MADNESS_EXCEPTION, madness::name(), and policy.

Referenced by test_partitioner().

◆ set_dimension()

MacroTaskPartitioner & madness::MacroTaskPartitioner::set_dimension ( const std::size_t &  n)
inline

◆ set_max_batch_size()

MacroTaskPartitioner & madness::MacroTaskPartitioner::set_max_batch_size ( const long &  n)
inline

References max_batch_size.

◆ set_min_batch_size()

MacroTaskPartitioner & madness::MacroTaskPartitioner::set_min_batch_size ( const long &  n)
inline

References min_batch_size.

◆ set_nsubworld()

MacroTaskPartitioner & madness::MacroTaskPartitioner::set_nsubworld ( const long &  n)
inline

References nsubworld.

Referenced by test_partitioner().

◆ set_policy()

MacroTaskPartitioner & madness::MacroTaskPartitioner::set_policy ( const std::string &  n)
inline

References policy.

Friends And Related Symbol Documentation

◆ Batch

friend class Batch
friend

Member Data Documentation

◆ dimension

std::size_t madness::MacroTaskPartitioner::dimension = 1

◆ max_batch_size

std::size_t madness::MacroTaskPartitioner::max_batch_size = 10

maximum batch size (for memory management)

Referenced by madness::MP3::MacroTaskMP3::Partitioner::Partitioner(), do_1d_partition(), and set_max_batch_size().

◆ min_batch_size

std::size_t madness::MacroTaskPartitioner::min_batch_size =5

◆ nsubworld

std::size_t madness::MacroTaskPartitioner::nsubworld =1

number of worlds (try to have enough batches for all worlds)

Referenced by do_1d_partition(), and set_nsubworld().

◆ policy

std::string madness::MacroTaskPartitioner::policy = "guided"

how to partition the batches

Referenced by do_1d_partition(), do_2d_partition(), do_partitioning(), partition_tasks(), and set_policy().


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