MADNESS 0.10.1
Classes | Public Member Functions | Static Public Member Functions | Public Attributes | Private Member Functions | Static Private Member Functions | List of all members
madness::RMI::RmiTask Class Reference
Inheritance diagram for madness::RMI::RmiTask:
Inheritance graph
[legend]
Collaboration diagram for madness::RMI::RmiTask:
Collaboration graph
[legend]

Classes

struct  header
 

Public Member Functions

 RmiTask (const SafeMPI::Intracomm &comm=SafeMPI::COMM_WORLD)
 
virtual ~RmiTask ()
 
void exit ()
 
Request isend (const void *buf, size_t nbyte, ProcessID dest, rmi_handlerT func, attrT attr)
 
void post_pending_huge_msg ()
 
void post_recv_buf (int i)
 
void process_some ()
 
void run ()
 

Static Public Member Functions

static void huge_msg_handler (void *buf, size_t nbytein)
 
static bool is_ordered (attrT attr)
 
static void set_rmi_task_is_running (bool flag=true)
 

Public Attributes

SafeMPI::Intracomm comm
 
std::atomic< bool > finished
 
std::list< std::tuple< int, size_t, int > > hugeq
 q of huge messages, each msg = {source,nbytes,tag}
 
std::unique_ptr< int[]> ind
 
std::size_t max_msg_len_
 
std::size_t maxq_
 
int n_in_q
 
const int nproc
 
std::size_t nrecv_
 
long nssend_
 
std::unique_ptr< qmsg[]> q
 
const ProcessID rank
 
std::unique_ptr< void *[]> recv_buf
 
std::unique_ptr< counterT[]> recv_counters
 
std::unique_ptr< SafeMPI::Request[]> recv_req
 
std::unique_ptr< counterT[]> send_counters
 
std::unique_ptr< SafeMPI::Status[]> status
 

Private Member Functions

int unique_tag () const
 
- Private Member Functions inherited from madness::Mutex
 Mutex (int junk=0)
 Make and initialize a mutex ... initial state is unlocked.
 
virtual ~Mutex ()
 
void lock () const
 Acquire the mutex waiting if necessary.
 
pthread_mutex_t * ptr () const
 Return a pointer to the pthread mutex for use by a condition variable.
 
bool try_lock () const
 Try to acquire the mutex ... return true on success, false on failure.
 
void unlock () const
 Free a mutex owned by this thread.
 

Static Private Member Functions

static constexpr int unique_tag_period ()
 

Constructor & Destructor Documentation

◆ RmiTask()

madness::RMI::RmiTask::RmiTask ( const SafeMPI::Intracomm comm = SafeMPI::COMM_WORLD)

◆ ~RmiTask()

madness::RMI::RmiTask::~RmiTask ( )
virtual

Member Function Documentation

◆ exit()

void madness::RMI::RmiTask::exit ( )
inline

◆ huge_msg_handler()

void madness::RMI::RmiTask::huge_msg_handler ( void *  buf,
size_t  nbytein 
)
static

◆ is_ordered()

static bool madness::RMI::RmiTask::is_ordered ( attrT  attr)
inlinestatic

References madness::RMI::ATTR_ORDERED.

Referenced by process_some().

◆ isend()

Request madness::RMI::RmiTask::isend ( const void *  buf,
size_t  nbyte,
ProcessID  dest,
rmi_handlerT  func,
attrT  attr 
)

◆ post_pending_huge_msg()

void madness::RMI::RmiTask::post_pending_huge_msg ( )

◆ post_recv_buf()

void madness::RMI::RmiTask::post_recv_buf ( int  i)

◆ process_some()

void madness::RMI::RmiTask::process_some ( )

◆ run()

void madness::RMI::RmiTask::run ( )
inline

◆ set_rmi_task_is_running()

void madness::RMI::RmiTask::set_rmi_task_is_running ( bool  flag = true)
static

References madness::rmi_task_is_running.

Referenced by run().

◆ unique_tag()

int madness::RMI::RmiTask::unique_tag ( ) const
private

thread-safely round-robins through tags in [first_tag, first_tag+period) range

Returns
new tag to be used in messaging

should be able to do this with atomics

◆ unique_tag_period()

static constexpr int madness::RMI::RmiTask::unique_tag_period ( )
inlinestaticconstexprprivate

the period of tags returned by unique_tag()

Warning
this bounds how many huge messages each RmiTask will be able to process

Referenced by huge_msg_handler().

Member Data Documentation

◆ comm

SafeMPI::Intracomm madness::RMI::RmiTask::comm

◆ finished

std::atomic<bool> madness::RMI::RmiTask::finished

Referenced by exit(), and run().

◆ hugeq

std::list< std::tuple<int,size_t,int> > madness::RMI::RmiTask::hugeq

q of huge messages, each msg = {source,nbytes,tag}

◆ ind

std::unique_ptr<int[]> madness::RMI::RmiTask::ind

Referenced by RmiTask(), and process_some().

◆ max_msg_len_

std::size_t madness::RMI::RmiTask::max_msg_len_

Referenced by RmiTask().

◆ maxq_

std::size_t madness::RMI::RmiTask::maxq_

Referenced by RmiTask(), and process_some().

◆ n_in_q

int madness::RMI::RmiTask::n_in_q

Referenced by process_some().

◆ nproc

const int madness::RMI::RmiTask::nproc

Referenced by RmiTask().

◆ nrecv_

std::size_t madness::RMI::RmiTask::nrecv_

Referenced by RmiTask().

◆ nssend_

long madness::RMI::RmiTask::nssend_

Referenced by RmiTask().

◆ q

std::unique_ptr<qmsg[]> madness::RMI::RmiTask::q

Referenced by RmiTask(), and process_some().

◆ rank

const ProcessID madness::RMI::RmiTask::rank

Referenced by exit(), and process_some().

◆ recv_buf

std::unique_ptr<void*[]> madness::RMI::RmiTask::recv_buf

Referenced by RmiTask(), and process_some().

◆ recv_counters

std::unique_ptr<counterT[]> madness::RMI::RmiTask::recv_counters

Referenced by RmiTask(), and process_some().

◆ recv_req

std::unique_ptr<SafeMPI::Request[]> madness::RMI::RmiTask::recv_req

Referenced by RmiTask(), and process_some().

◆ send_counters

std::unique_ptr<counterT[]> madness::RMI::RmiTask::send_counters

Referenced by RmiTask().

◆ status

std::unique_ptr<SafeMPI::Status[]> madness::RMI::RmiTask::status

Referenced by RmiTask(), and process_some().


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