MADNESS  0.10.1
Public Member Functions | Static Public Member Functions | Public Attributes | Private Member Functions | Private Attributes | List of all members
madness::MacroTaskQ Class Reference

#include <macrotaskq.h>

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

Public Member Functions

 MacroTaskQ (World &universe, int nworld, const long printlevel=0)
 create an empty taskq and initialize the subworlds More...
 
 ~MacroTaskQ ()
 
void add_tasks (MacroTaskBase::taskqT &vtask)
 
long get_nsubworld () const
 
Worldget_subworld ()
 
void print_taskq () const
 
void run_all (MacroTaskBase::taskqT vtask=MacroTaskBase::taskqT())
 run all tasks, tasks may store the results in the cloud More...
 
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. More...
 
virtual ~WorldObject ()
 
Worldget_world () const
 Returns a reference to the world. More...
 
const uniqueidTid () const
 Returns the globally unique object ID. More...
 
WorldObjectoperator= (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). More...
 
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). More...
 
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). More...
 
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). More...
 
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). More...
 
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). More...
 
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). More...
 
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). More...
 
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). More...
 
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)(). More...
 
- Public Member Functions inherited from madness::WorldObjectBase
virtual ~WorldObjectBase ()=default
 

Static Public Member Functions

static std::shared_ptr< Worldcreate_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 More...
 
long get_scheduled_task_number_local ()
 
bool printdebug () const
 
bool printprogress () const
 
bool printtimings () const
 
void set_complete (const long task_number) const
 scheduler is located on rank==0 More...
 
void set_complete_local (const long task_number) const
 scheduler is located on rank==0 More...
 
std::size_t size () const
 

Private Attributes

long nsubworld =1
 
std::shared_ptr< WorldDCPmapInterface< Key< 1 > > > pmap1
 
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
 
long printlevel =0
 
std::shared_ptr< Worldsubworld_ptr
 
MacroTaskBase::taskqT taskq
 
std::mutex taskq_mutex
 
Worlduniverse
 

Additional Inherited Members

- Public Types inherited from madness::WorldObject< MacroTaskQ >
typedef WorldObject< MacroTaskQobjT
 
- Protected Member Functions inherited from madness::WorldObject< MacroTaskQ >
void process_pending ()
 To be called from derived constructor to process pending messages. More...
 

Constructor & Destructor Documentation

◆ MacroTaskQ()

madness::MacroTaskQ::MacroTaskQ ( World universe,
int  nworld,
const long  printlevel = 0 
)
inline

create an empty taskq and initialize the subworlds

References create_worlds(), madness::WorldObject< MacroTaskQ >::process_pending(), subworld_ptr, and universe.

◆ ~MacroTaskQ()

madness::MacroTaskQ::~MacroTaskQ ( )
inline

Member Function Documentation

◆ add_replicated_task()

void madness::MacroTaskQ::add_replicated_task ( const std::shared_ptr< MacroTaskBase > &  task)
inlineprivate

◆ add_tasks()

void madness::MacroTaskQ::add_tasks ( MacroTaskBase::taskqT vtask)
inline

◆ create_worlds()

static std::shared_ptr<World> madness::MacroTaskQ::create_worlds ( World universe,
const std::size_t  nsubworld 
)
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, nsubworld, madness::World::rank(), SafeMPI::Intracomm::Split(), and universe.

Referenced by MacroTaskQ(), main(), and simple_example().

◆ get_nsubworld()

long madness::MacroTaskQ::get_nsubworld ( ) const
inline

References nsubworld.

◆ get_scheduled_task_number()

long madness::MacroTaskQ::get_scheduled_task_number ( World subworld)
inlineprivate

◆ get_scheduled_task_number_local()

long madness::MacroTaskQ::get_scheduled_task_number_local ( )
inlineprivate

◆ get_subworld()

World& madness::MacroTaskQ::get_subworld ( )
inline

References subworld_ptr.

Referenced by run_all().

◆ print_taskq()

void madness::MacroTaskQ::print_taskq ( ) const
inline

◆ printdebug()

bool madness::MacroTaskQ::printdebug ( ) const
inlineprivate

References printlevel.

Referenced by printprogress(), and run_all().

◆ printprogress()

bool madness::MacroTaskQ::printprogress ( ) const
inlineprivate

References printdebug(), and printlevel.

Referenced by run_all().

◆ printtimings()

bool madness::MacroTaskQ::printtimings ( ) const
inlineprivate

References printlevel, madness::World::rank(), and universe.

Referenced by run_all().

◆ run_all()

void madness::MacroTaskQ::run_all ( MacroTaskBase::taskqT  vtask = MacroTaskBase::taskqT())
inline

◆ set_complete()

void madness::MacroTaskQ::set_complete ( const long  task_number) const
inlineprivate

scheduler is located on rank==0

References set_complete_local(), and madness::WorldObject< MacroTaskQ >::task().

Referenced by run_all().

◆ set_complete_local()

void madness::MacroTaskQ::set_complete_local ( const long  task_number) const
inlineprivate

scheduler is located on rank==0

References MADNESS_ASSERT, madness::World::rank(), taskq, and universe.

Referenced by set_complete().

◆ set_pmap()

static void madness::MacroTaskQ::set_pmap ( World world)
inlinestatic

◆ set_printlevel()

void madness::MacroTaskQ::set_printlevel ( const long  p)
inline

References p(), and printlevel.

◆ size()

std::size_t madness::MacroTaskQ::size ( ) const
inlineprivate

References taskq.

Member Data Documentation

◆ cloud

madness::Cloud madness::MacroTaskQ::cloud

Referenced by run_all().

◆ nsubworld

long madness::MacroTaskQ::nsubworld =1
private

Referenced by create_worlds(), and get_nsubworld().

◆ pmap1

std::shared_ptr< WorldDCPmapInterface< Key<1> > > madness::MacroTaskQ::pmap1
private

Referenced by run_all().

◆ pmap2

std::shared_ptr< WorldDCPmapInterface< Key<2> > > madness::MacroTaskQ::pmap2
private

Referenced by run_all().

◆ pmap3

std::shared_ptr< WorldDCPmapInterface< Key<3> > > madness::MacroTaskQ::pmap3
private

Referenced by run_all().

◆ pmap4

std::shared_ptr< WorldDCPmapInterface< Key<4> > > madness::MacroTaskQ::pmap4
private

Referenced by run_all().

◆ pmap5

std::shared_ptr< WorldDCPmapInterface< Key<5> > > madness::MacroTaskQ::pmap5
private

Referenced by run_all().

◆ pmap6

std::shared_ptr< WorldDCPmapInterface< Key<6> > > madness::MacroTaskQ::pmap6
private

Referenced by run_all().

◆ printlevel

long madness::MacroTaskQ::printlevel =0
private

◆ subworld_ptr

std::shared_ptr<World> madness::MacroTaskQ::subworld_ptr
private

Referenced by MacroTaskQ(), and get_subworld().

◆ taskq

MacroTaskBase::taskqT madness::MacroTaskQ::taskq
private

◆ taskq_mutex

std::mutex madness::MacroTaskQ::taskq_mutex
private

◆ universe

World& madness::MacroTaskQ::universe
private

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