|
MADNESS 0.10.1
|
Tests the MacroTaskQ and MacroTask classes.
More...
#include <madness/mra/mra.h>#include <madness/world/cloud.h>#include <madness/mra/macrotaskq.h>#include <madness/world/world.h>#include <madness/world/timing_utilities.h>#include <madness/mra/macrotaskpartitioner.h>#include "test_utilities.h"
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) |
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.
| int check | ( | World & | universe, |
| const double & | ref, | ||
| const double & | test, | ||
| const std::string | msg ) |
References error(), madness::print(), madness::World::rank(), and test().
Referenced by test_priority(), test_scalar_task(), test_task1(), test_tuple_of_vectors(), and test_vector_of_scalar_task().
| int check | ( | World & | universe, |
| const real_function_3d & | ref, | ||
| const real_function_3d & | test, | ||
| const std::string | msg ) |
References error(), madness::Function< T, NDIM >::norm2(), madness::norm2(), madness::print(), madness::World::rank(), and test().
| int check_vector | ( | World & | universe, |
| const std::vector< Function< T, NDIM > > & | ref, | ||
| const std::vector< Function< T, NDIM > > & | test, | ||
| const std::string | msg ) |
References error(), madness::norm2(), madness::print(), madness::World::rank(), and test().
Referenced by test_2d_partitioning(), test_owned_tasks(), and test_twice().
| int main | ( | int | argc, |
| char ** | argv ) |
References f1, madness::WorldGopInterface::fence(), madness::finalize(), madness::FunctionFactory< T, NDIM >::functor(), madness::World::gop, madness::World::id(), madness::initialize(), madness::print(), madness::World::rank(), madness::FunctionDefaults< NDIM >::set_cubic_cell(), madness::FunctionDefaults< NDIM >::set_k(), madness::FunctionDefaults< NDIM >::set_tensor_type(), madness::FunctionDefaults< NDIM >::set_thresh(), madness::World::size(), slater(), madness::startup(), madness::timer::tag(), test_2d_partitioning(), test_deferred(), test_immediate(), test_mixed_tuple(), test_owned_tasks(), test_priority(), test_scalar_task(), test_task1(), test_tuple_of_vectors(), test_twice(), test_vector_of_scalar_task(), and madness::TT_2D.
| int test_2d_partitioning | ( | World & | universe, |
| const std::vector< real_function_3d > & | v3 ) |
References check_vector(), madness::MacroTaskOperationBase::partitioner, madness::MacroTaskInfo::preset(), madness::print(), madness::World::rank(), and task().
Referenced by main().
| int test_deferred | ( | World & | universe, |
| const std::vector< real_function_3d > & | v3, | ||
| const std::vector< real_function_3d > & | ref ) |
References madness::test_output::checkpoint(), madness::test_output::end(), error(), madness::MacroTaskInfo::get_all_preset_names(), madness::norm2(), madness::MacroTaskInfo::preset(), madness::print(), madness::World::rank(), madness::test_output::set_cout_to_terminal(), stats, madness::MacroTaskInfo::StoreFunction, madness::MacroTaskInfo::StoreFunctionViaPointer, and task().
Referenced by main().
| int test_mixed_tuple | ( | World & | universe, |
| const std::vector< real_function_3d > & | v3 ) |
References madness::print(), and madness::World::rank().
Referenced by main().
| 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().
| int test_priority | ( | World & | universe, |
| const std::vector< real_function_3d > & | v3 ) |
References check(), madness::print(), madness::World::rank(), and madness::MacroTask< taskT >::set_debug().
Referenced by main().
| 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().
| int test_task1 | ( | World & | universe, |
| const std::vector< real_function_3d > & | v3 ) |
References check(), madness::print(), madness::print_size(), madness::World::rank(), and madness::MacroTask< taskT >::set_debug().
Referenced by main().
| 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().
| int test_twice | ( | World & | universe, |
| const std::vector< real_function_3d > & | v3, | ||
| const std::vector< real_function_3d > & | ref ) |
References check_vector(), madness::MacroTaskInfo::preset(), madness::print(), madness::World::rank(), and task().
Referenced by main().
| 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().
| volatile std::list<detail::PendingMsg> WorldObject< MacroTaskQ >::pending = std::list<detail::PendingMsg>() |
| Spinlock WorldObject< MacroTaskQ >::pending_mutex(0) | ( | 0 | ) |
| volatile std::list<detail::PendingMsg> WorldObject< WorldContainerImpl< long, std::vector< unsignedchar >, madness::Hash< long > > >::pending = std::list<detail::PendingMsg>() |
| Spinlock WorldObject< WorldContainerImpl< long, std::vector< unsignedchar >, madness::Hash< long > > >::pending_mutex(0) | ( | 0 | ) |