|
MADNESS 0.10.1
|
#include <macrotaskq.h>


Public Member Functions | |
| MacroTaskQ (const MacroTaskQFactory factory) | |
| create an empty taskq and initialize the subworlds | |
| ~MacroTaskQ () | |
| void | add_tasks (MacroTaskBase::taskqT &vtask) |
| void | drain_own_output_buffers () |
| Move the results of tasks that accumulated their own output into the universe result. | |
| double | execute_tasks () |
| Run this rank's share of the queue. | |
| nlohmann::json | get_cloud_statistics () const |
| long | get_nsubworld () const |
| MacroTaskInfo | get_policy () const |
| World & | get_subworld () |
| nlohmann::json | get_taskq_statistics () const |
| void | print_taskq () const |
| void | replicate_inputs () |
| run all tasks | |
| void | run_all () |
| void | set_printlevel (const long p) |
Public Member Functions inherited from madness::WorldObject< MacroTaskQ > | |
| WorldObject (const WorldObject &other) | |
| WorldObject (World &world) | |
| Constructor that associates an object (via the derived class) with a globally unique ID. | |
| virtual | ~WorldObject () |
| WorldObject & | operator= (const WorldObject &)=delete |
| detail::task_result_type< memfnT >::futureT | send (ProcessID dest, memfnT memfn) const |
| detail::task_result_type< memfnT >::futureT | send (ProcessID dest, memfnT memfn, const a1T &a1) const |
| detail::task_result_type< memfnT >::futureT | send (ProcessID dest, memfnT memfn, const a1T &a1, const a2T &a2) const |
| detail::task_result_type< memfnT >::futureT | send (ProcessID dest, memfnT memfn, const a1T &a1, const a2T &a2, const a3T &a3) const |
| detail::task_result_type< memfnT >::futureT | send (ProcessID dest, memfnT memfn, const a1T &a1, const a2T &a2, const a3T &a3, const a4T &a4) const |
| detail::task_result_type< memfnT >::futureT | send (ProcessID dest, memfnT memfn, const a1T &a1, const a2T &a2, const a3T &a3, const a4T &a4, const a5T &a5) const |
| detail::task_result_type< memfnT >::futureT | send (ProcessID dest, memfnT memfn, const a1T &a1, const a2T &a2, const a3T &a3, const a4T &a4, const a5T &a5, const a6T &a6) const |
| detail::task_result_type< memfnT >::futureT | send (ProcessID dest, memfnT memfn, const a1T &a1, const a2T &a2, const a3T &a3, const a4T &a4, const a5T &a5, const a6T &a6, const a7T &a7) const |
| detail::task_result_type< memfnT >::futureT | send (ProcessID dest, memfnT memfn, const a1T &a1, const a2T &a2, const a3T &a3, const a4T &a4, const a5T &a5, const a6T &a6, const a7T &a7, const a8T &a8) const |
| detail::task_result_type< memfnT >::futureT | send (ProcessID dest, memfnT memfn, const a1T &a1, const a2T &a2, const a3T &a3, const a4T &a4, const a5T &a5, const a6T &a6, const a7T &a7, const a8T &a8, const a9T &a9) const |
| detail::task_result_type< memfnT >::futureT | task (ProcessID dest, memfnT memfn, const a1T &a1, const a2T &a2, const a3T &a3, const a4T &a4, const a5T &a5, const a6T &a6, const a7T &a7, const a8T &a8, const a9T &a9, const TaskAttributes &attr=TaskAttributes()) const |
Sends task to derived class method returnT (this->*memfn)(a1,a2,a3,a4,a5,a6,a7,a8,a9). | |
| detail::task_result_type< memfnT >::futureT | task (ProcessID dest, memfnT memfn, const a1T &a1, const a2T &a2, const a3T &a3, const a4T &a4, const a5T &a5, const a6T &a6, const a7T &a7, const a8T &a8, const TaskAttributes &attr=TaskAttributes()) const |
Sends task to derived class method returnT (this->*memfn)(a1,a2,a3,a4,a5,a6,a7,a8). | |
| detail::task_result_type< memfnT >::futureT | task (ProcessID dest, memfnT memfn, const a1T &a1, const a2T &a2, const a3T &a3, const a4T &a4, const a5T &a5, const a6T &a6, const a7T &a7, const TaskAttributes &attr=TaskAttributes()) const |
Sends task to derived class method returnT (this->*memfn)(a1,a2,a3,a4,a5,a6,a7). | |
| detail::task_result_type< memfnT >::futureT | task (ProcessID dest, memfnT memfn, const a1T &a1, const a2T &a2, const a3T &a3, const a4T &a4, const a5T &a5, const a6T &a6, const TaskAttributes &attr=TaskAttributes()) const |
Sends task to derived class method returnT (this->*memfn)(a1,a2,a3,a4,a5,a6). | |
| detail::task_result_type< memfnT >::futureT | task (ProcessID dest, memfnT memfn, const a1T &a1, const a2T &a2, const a3T &a3, const a4T &a4, const a5T &a5, const TaskAttributes &attr=TaskAttributes()) const |
Sends task to derived class method returnT (this->*memfn)(a1,a2,a3,a4,a5). | |
| detail::task_result_type< memfnT >::futureT | task (ProcessID dest, memfnT memfn, const a1T &a1, const a2T &a2, const a3T &a3, const a4T &a4, const TaskAttributes &attr=TaskAttributes()) const |
Sends task to derived class method returnT (this->*memfn)(a1,a2,a3,a4). | |
| detail::task_result_type< memfnT >::futureT | task (ProcessID dest, memfnT memfn, const a1T &a1, const a2T &a2, const a3T &a3, const TaskAttributes &attr=TaskAttributes()) const |
Sends task to derived class method returnT (this->*memfn)(a1,a2,a3). | |
| detail::task_result_type< memfnT >::futureT | task (ProcessID dest, memfnT memfn, const a1T &a1, const a2T &a2, const TaskAttributes &attr=TaskAttributes()) const |
Sends task to derived class method returnT (this->*memfn)(a1,a2). | |
| detail::task_result_type< memfnT >::futureT | task (ProcessID dest, memfnT memfn, const a1T &a1, const TaskAttributes &attr=TaskAttributes()) const |
Sends task to derived class method returnT (this->*memfn)(a1). | |
| detail::task_result_type< memfnT >::futureT | task (ProcessID dest, memfnT memfn, const TaskAttributes &attr=TaskAttributes()) const |
Sends task to derived class method returnT (this->*memfn)(). | |
Public Member Functions inherited from madness::WorldObjectBase | |
| virtual | ~WorldObjectBase () |
| World & | get_world () const |
| World & | get_world_noexcept () const noexcept |
| Get the world to which this object belongs, without risking a throw. | |
| const uniqueidT & | id () const |
| Returns the globally unique object ID. | |
| bool | world_is_alive () const noexcept |
| Reports whether the world to which this object belongs still exists. | |
Static Public Member Functions | |
| static std::shared_ptr< World > | create_node_world (World &universe) |
| a World spanning the ranks that share memory with this one | |
| static std::shared_ptr< World > | create_worlds (World &universe, const std::size_t nsubworld) |
| static void | set_pmap (World &world) |
Public Attributes | |
| madness::Cloud | cloud |
Private Member Functions | |
| void | add_replicated_task (const std::shared_ptr< MacroTaskBase > &task) |
| long | get_scheduled_task_number (World &subworld) |
| scheduler is located on universe.rank==0 | |
| long | get_scheduled_task_number_local () |
| bool | printdebug () const |
| bool | printprogress () const |
| bool | printtimings () const |
| bool | printtimings_detail () const |
| void | set_complete (const long task_number) const |
| scheduler is located on rank==0 | |
| void | set_complete_local (const long task_number) const |
| scheduler is located on rank==0 | |
| std::size_t | size () const |
Private Attributes | |
| nlohmann::json | cloud_statistics |
| save cloud statistics after run_all() | |
| std::shared_ptr< World > | nodeworld_ptr |
| node-scoped World for the two-stage finalize; created on first use, reused after | |
| long | nsubworld =1 |
| std::shared_ptr< WorldDCPmapInterface< Key< 1 > > > | pmap1 |
| set the process map for the subworld | |
| std::shared_ptr< WorldDCPmapInterface< Key< 2 > > > | pmap2 |
| std::shared_ptr< WorldDCPmapInterface< Key< 3 > > > | pmap3 |
| std::shared_ptr< WorldDCPmapInterface< Key< 4 > > > | pmap4 |
| std::shared_ptr< WorldDCPmapInterface< Key< 5 > > > | pmap5 |
| std::shared_ptr< WorldDCPmapInterface< Key< 6 > > > | pmap6 |
| const MacroTaskInfo | policy |
| storage and distribution policy | |
| long | printlevel =0 |
| std::shared_ptr< World > | subworld_ptr |
| MacroTaskBase::taskqT | taskq |
| std::mutex | taskq_mutex |
| nlohmann::json | taskq_statistics |
| save taskq statistics after run_all() | |
| World & | universe |
Additional Inherited Members | |
Public Types inherited from madness::WorldObject< MacroTaskQ > | |
| typedef WorldObject< MacroTaskQ > | objT |
Protected Member Functions inherited from madness::WorldObject< MacroTaskQ > | |
| void | process_pending () |
| To be called from derived constructor to process pending messages. | |
Protected Member Functions inherited from madness::WorldObjectBase | |
| WorldObjectBase (const WorldObjectBase &other) | |
| Copy constructor; produces an unregistered object. | |
| WorldObjectBase (World &w) | |
| Construct a new WorldObjectBase. | |
| World & | get_world_unchecked () const noexcept |
| Unchecked access to the memoized world reference. | |
| template<typename DerivedT > | |
| void | register_self (DerivedT *this_ptr) |
| Registers this object with its world, making it globally addressable. | |
|
inlineexplicit |
create an empty taskq and initialize the subworlds
References madness::MacroTaskInfo::check_consistency(), cloud, madness::MacroTaskInfo::cloud_distribution_policy, create_worlds(), MADNESS_CHECK_THROW, nsubworld, policy, madness::print(), printdebug(), madness::WorldObject< MacroTaskQ >::process_pending(), madness::Cloud::set_replication_policy(), madness::Cloud::set_storing_policy(), madness::MacroTaskInfo::storage_policy, subworld_ptr, madness::MacroTaskInfo::to_cloud_storage_policy(), and universe.
|
inline |
|
inlineprivate |
References madness::WorldObject< MacroTaskQ >::task(), and taskq.
Referenced by add_tasks().
|
inline |
References add_replicated_task(), madness::nonlinear_vector_solver(), madness::World::rank(), and universe.
|
inlinestatic |
a World spanning the ranks that share memory with this one
Collective, and worth creating only once: the two-stage finalize reduces within a node first, so it needs a World with node scope.
References madness::WorldMpiInterface::comm(), madness::WorldGopInterface::fence(), madness::World::gop, madness::World::mpi, madness::nonlinear_vector_solver(), madness::World::rank(), SafeMPI::Intracomm::SHARED_SPLIT_TYPE, SafeMPI::Intracomm::Split_type(), and universe.
Referenced by drain_own_output_buffers().
|
inlinestatic |
for each process create a world using a communicator shared with other processes by round-robin copy-paste from test_world.cc
References madness::WorldMpiInterface::comm(), madness::WorldGopInterface::fence(), madness::World::gop, madness::World::mpi, madness::nonlinear_vector_solver(), nsubworld, madness::World::rank(), SafeMPI::Intracomm::Split(), and universe.
Referenced by MacroTaskQ(), main(), simple_example(), test_batch_fetch_chunked(), test_batch_fetch_of_missing_record(), test_batch_store_and_fetch(), test_copy_function_from_other_world(), test_copy_function_from_other_world_through_cloud(), and test_replication_policy().
|
inline |
Move the results of tasks that accumulated their own output into the universe result.
The ordering here is load-bearing and the comments inside say why. Two stages, so a node-local reduction can sit between them and only one rank per node scatters between nodes.
References cloud, create_node_world(), madness::WorldGopInterface::fence(), get_subworld(), madness::World::gop, nodeworld_ptr, madness::nonlinear_vector_solver(), madness::World::size(), taskq, and universe.
Referenced by run_all().
|
inline |
Run this rank's share of the queue.
Two ways in: if every task names an owner and there is one subworld per rank, each rank walks the queue and runs what it owns, since the assignment is already decided and the pull scheduler's round trip per task would buy nothing. Otherwise task numbers are handed out dynamically. Both converge on the same accounting.
References cloud, madness::cpu_time(), get_scheduled_task_number(), get_subworld(), madness::World::id(), madness::nonlinear_vector_solver(), nsubworld, policy, madness::print(), printdebug(), printprogress(), madness::World::rank(), set_complete(), madness::World::size(), madness::WorldObject< MacroTaskQ >::task(), taskq, universe, and madness::wall_time().
Referenced by run_all().
|
inline |
References cloud_statistics.
|
inline |
References policy.
scheduler is located on universe.rank==0
References madness::WorldGopInterface::broadcast_serializable(), madness::WorldGopInterface::fence(), madness::Future< T >::get(), get_scheduled_task_number_local(), madness::World::gop, madness::World::rank(), and madness::WorldObject< MacroTaskQ >::send().
Referenced by execute_tasks().
|
inlineprivate |
References MADNESS_ASSERT, madness::nonlinear_vector_solver(), madness::World::rank(), taskq, taskq_mutex, and universe.
Referenced by get_scheduled_task_number().
|
inline |
References subworld_ptr.
Referenced by drain_own_output_buffers(), execute_tasks(), and run_all().
|
inline |
References taskq_statistics.
|
inline |
References madness::WorldGopInterface::fence(), madness::World::gop, madness::print(), madness::World::rank(), taskq, and universe.
Referenced by run_all().
|
inlineprivate |
References printlevel.
Referenced by MacroTaskQ(), execute_tasks(), printprogress(), and run_all().
|
inlineprivate |
References madness::nonlinear_vector_solver(), printdebug(), and printlevel.
Referenced by execute_tasks(), and run_all().
|
inlineprivate |
References madness::nonlinear_vector_solver(), printlevel, madness::World::rank(), and universe.
|
inlineprivate |
References madness::nonlinear_vector_solver(), printlevel, madness::World::rank(), and universe.
Referenced by replicate_inputs(), and run_all().
|
inline |
run all tasks
Put the cloud where the tasks will read it from. Rank- or node-replication of the cloud, and of the targets that stored pointers refer to. Both are no-ops under a distributed policy.
References cloud, madness::cpu_time(), madness::Distributed, madness::WorldGopInterface::fence(), madness::Cloud::get_replication_policy(), madness::World::gop, madness::NodeReplicated, madness::nonlinear_vector_solver(), policy, madness::print(), printtimings_detail(), madness::MacroTaskInfo::ptr_target_distribution_policy, madness::RankReplicated, madness::Cloud::replicate(), madness::Cloud::replicate_per_node(), madness::MacroTaskInfo::storage_policy, madness::MacroTaskInfo::StoreFunction, madness::Cloud::target_replication_time, universe, and madness::Cloud::world_object_base_list.
Referenced by run_all().
|
inline |
References madness::Cloud::clear(), madness::Cloud::clear_cache(), cloud, cloud_statistics, madness::cpu_time(), madness::Cloud::distribute_targets(), madness::Distributed, drain_own_output_buffers(), execute_tasks(), madness::WorldGopInterface::fence(), madness::Cloud::gather_timings(), madness::FunctionDefaults< NDIM >::get_pmap(), madness::Cloud::get_statistics(), get_subworld(), madness::World::gop, madness::MemoryMeasurer::measure_and_print(), madness::nonlinear_vector_solver(), pmap1, pmap2, pmap3, pmap4, pmap5, pmap6, policy, madness::print(), madness::Cloud::print_memory_statistics(), madness::Cloud::print_size(), print_taskq(), madness::Cloud::print_timings(), printdebug(), printlevel, printprogress(), printtimings_detail(), madness::MacroTaskInfo::ptr_target_distribution_policy, madness::World::rank(), replicate_inputs(), madness::WorldGopInterface::set_forbid_fence(), madness::FunctionDefaults< NDIM >::set_pmap(), set_pmap(), madness::World::size(), madness::WorldGopInterface::sum(), madness::WorldObject< MacroTaskQ >::task(), taskq, taskq_statistics, universe, and madness::wall_time().
scheduler is located on rank==0
References set_complete_local(), and madness::WorldObject< MacroTaskQ >::task().
Referenced by execute_tasks().
scheduler is located on rank==0
References MADNESS_ASSERT, madness::nonlinear_vector_solver(), madness::World::rank(), taskq, and universe.
Referenced by set_complete().
References madness::FunctionDefaults< NDIM >::set_default_pmap(), and madness::WorldObjectBase::world.
Referenced by main(), run_all(), simple_example(), test_batch_fetch_chunked(), test_batch_fetch_of_missing_record(), test_batch_store_and_fetch(), test_copy_function_from_other_world(), test_copy_function_from_other_world_through_cloud(), test_custom_worldobject(), test_pointer_to_funcimpl(), test_replication_policy(), and test_tuple().
References p(), and printlevel.
|
inlineprivate |
References taskq.
| madness::Cloud madness::MacroTaskQ::cloud |
Referenced by MacroTaskQ(), drain_own_output_buffers(), execute_tasks(), replicate_inputs(), and run_all().
|
private |
save cloud statistics after run_all()
Referenced by get_cloud_statistics(), and run_all().
|
private |
node-scoped World for the two-stage finalize; created on first use, reused after
Referenced by drain_own_output_buffers().
|
private |
Referenced by MacroTaskQ(), create_worlds(), execute_tasks(), and get_nsubworld().
|
private |
set the process map for the subworld
Referenced by run_all().
|
private |
Referenced by run_all().
|
private |
Referenced by run_all().
|
private |
Referenced by run_all().
|
private |
Referenced by run_all().
|
private |
Referenced by run_all().
|
private |
storage and distribution policy
Referenced by MacroTaskQ(), execute_tasks(), get_policy(), replicate_inputs(), and run_all().
|
private |
Referenced by printdebug(), printprogress(), printtimings(), printtimings_detail(), run_all(), and set_printlevel().
|
private |
Referenced by MacroTaskQ(), and get_subworld().
|
private |
|
private |
Referenced by get_scheduled_task_number_local().
|
private |
save taskq statistics after run_all()
Referenced by get_taskq_statistics(), and run_all().
|
private |