MADNESS 0.10.1
test_vectormacrotask.cc File Reference

Tests the MacroTaskQ and MacroTask classes. More...

Include dependency graph for test_vectormacrotask.cc:

Classes

class  MicroTaskPartitioner::CustomPartitioner
 U can implement a custom partitioner by deriving from MacroTaskPartitioner. More...
struct  gaussian
class  MicroTask< T, NDIM >
class  MicroTask1
class  MicroTask2
class  MicroTaskPartitioner
 sample task with a custom partitioner More...
class  MicroTaskPriority
 sample task with a custom priority More...
class  MixedTupleTask< elementT, elementR >
 this task won't do anything, is mostly to check if the combinations compile More...
class  OwnedTask
 a task that names an owner for every batch More...
class  ScalarTask
struct  slater
class  TupleTask
class  VectorOfScalarTask

Functions

int check (World &universe, const double &ref, const double &test, const std::string msg)
int check (World &universe, const real_function_3d &ref, const real_function_3d &test, const std::string msg)
template<typename T, std::size_t NDIM>
int check_vector (World &universe, const std::vector< Function< T, NDIM > > &ref, const std::vector< Function< T, NDIM > > &test, const std::string msg)
int main (int argc, char **argv)
int test_2d_partitioning (World &universe, const std::vector< real_function_3d > &v3)
int test_deferred (World &universe, const std::vector< real_function_3d > &v3, const std::vector< real_function_3d > &ref)
template<typename T, std::size_t NDIM>
int test_immediate (World &universe, const std::vector< Function< T, NDIM > > &v3, const std::vector< Function< T, NDIM > > &ref)
int test_mixed_tuple (World &universe, const std::vector< real_function_3d > &v3)
int test_owned_tasks (World &universe, const std::vector< real_function_3d > &v3)
 run a task that owns all its batches, so the queue takes its owned-walk path
int test_priority (World &universe, const std::vector< real_function_3d > &v3)
int test_scalar_task (World &universe, const std::vector< real_function_3d > &v3)
 each task accumulates into the same result
int test_task1 (World &universe, const std::vector< real_function_3d > &v3)
int test_tuple_of_vectors (World &universe, const std::vector< real_function_3d > &v3)
 each task accumulates into the same result
int test_twice (World &universe, const std::vector< real_function_3d > &v3, const std::vector< real_function_3d > &ref)
int test_vector_of_scalar_task (World &universe, const std::vector< real_function_3d > &v3)

Variables

template<>
volatile std::list< detail::PendingMsg > WorldObject< MacroTaskQ >::pending = std::list<detail::PendingMsg>()
template<>
Spinlock WorldObject< MacroTaskQ >::pending_mutex (0)
template<>
volatile std::list< detail::PendingMsg > WorldObject< WorldContainerImpl< long, std::vector< unsignedchar >, madness::Hash< long > > >::pending = std::list<detail::PendingMsg>()
template<>
Spinlock WorldObject< WorldContainerImpl< long, std::vector< unsignedchar >, madness::Hash< long > > >::pending_mutex (0)

Detailed Description

Tests the MacroTaskQ and MacroTask classes.

For more information also see macrotask.h

The user defines a macrotask (an example is found in test_vectormacrotask.cc), the tasks are lightweight and carry only bookkeeping information, actual input and output are stored in a cloud (see cloud.h)

The user-defined MacroTask is derived from MacroTaskOperationBase and must implement the call operator method. A heterogeneous task queue is possible.

Function Documentation

◆ check() [1/2]

int check ( World & universe,
const double & ref,
const double & test,
const std::string msg )

◆ check() [2/2]

int check ( World & universe,
const real_function_3d & ref,
const real_function_3d & test,
const std::string msg )

◆ check_vector()

template<typename T, std::size_t NDIM>
int check_vector ( World & universe,
const std::vector< Function< T, NDIM > > & ref,
const std::vector< Function< T, NDIM > > & test,
const std::string msg )

◆ main()

◆ test_2d_partitioning()

int test_2d_partitioning ( World & universe,
const std::vector< real_function_3d > & v3 )

◆ test_deferred()

◆ test_immediate()

template<typename T, std::size_t NDIM>
int test_immediate ( World & universe,
const std::vector< Function< T, NDIM > > & v3,
const std::vector< Function< T, NDIM > > & ref )

◆ test_mixed_tuple()

int test_mixed_tuple ( World & universe,
const std::vector< real_function_3d > & v3 )

References madness::print(), and madness::World::rank().

Referenced by main().

◆ test_owned_tasks()

int test_owned_tasks ( World & universe,
const std::vector< real_function_3d > & v3 )

run a task that owns all its batches, so the queue takes its owned-walk path

The result has to match the same task computed directly, and the run has to complete: the owned walk shares the finalize and the collective fences that follow the scheduling loop, so an error there shows up as a hang or an aborted fence rather than a wrong number.

References check_vector(), madness::print(), madness::World::rank(), task(), and test().

Referenced by main().

◆ test_priority()

int test_priority ( World & universe,
const std::vector< real_function_3d > & v3 )

◆ test_scalar_task()

int test_scalar_task ( World & universe,
const std::vector< real_function_3d > & v3 )

each task accumulates into the same result

References check(), madness::ScalarResult< T >::get(), madness::print(), and madness::World::rank().

Referenced by main().

◆ test_task1()

int test_task1 ( World & universe,
const std::vector< real_function_3d > & v3 )

◆ test_tuple_of_vectors()

int test_tuple_of_vectors ( World & universe,
const std::vector< real_function_3d > & v3 )

each task accumulates into the same result

References check(), madness::norm2(), madness::print(), and madness::World::rank().

Referenced by main().

◆ test_twice()

int test_twice ( World & universe,
const std::vector< real_function_3d > & v3,
const std::vector< real_function_3d > & ref )

◆ test_vector_of_scalar_task()

int test_vector_of_scalar_task ( World & universe,
const std::vector< real_function_3d > & v3 )

References check(), error(), madness::print(), and madness::World::rank().

Referenced by main().

Variable Documentation

◆ WorldObject< MacroTaskQ >::pending

template<>
volatile std::list<detail::PendingMsg> WorldObject< MacroTaskQ >::pending = std::list<detail::PendingMsg>()

◆ WorldObject< MacroTaskQ >::pending_mutex

◆ WorldObject< WorldContainerImpl< long, std::vector< unsignedchar >, madness::Hash< long > > >::pending

template<>
volatile std::list<detail::PendingMsg> WorldObject< WorldContainerImpl< long, std::vector< unsignedchar >, madness::Hash< long > > >::pending = std::list<detail::PendingMsg>()

◆ WorldObject< WorldContainerImpl< long, std::vector< unsignedchar >, madness::Hash< long > > >::pending_mutex

template<>
Spinlock WorldObject< WorldContainerImpl< long, std::vector< unsignedchar >, madness::Hash< long > > >::pending_mutex(0) ( 0 )