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

This class implements the communications server thread and provides the only send interface. More...

#include <worldrmi.h>

Collaboration diagram for madness::RMI:
Collaboration graph
[legend]

Classes

class  RmiTask
 

Public Types

typedef SafeMPI::Request Request
 

Static Public Member Functions

static void assert_aslr_off (const SafeMPI::Intracomm &comm=SafeMPI::COMM_WORLD)
 
static void begin (const SafeMPI::Intracomm &comm=SafeMPI::COMM_WORLD)
 
static void end ()
 
static bool get_debug ()
 
static const RMIStatsget_stats ()
 
static bool get_this_thread_is_server ()
 
static Request isend (const void *buf, size_t nbyte, ProcessID dest, rmi_handlerT func, unsigned int attr=ATTR_UNORDERED)
 Send a remote method invocation (again you should probably be looking at worldam.h instead)
 
static std::size_t max_msg_len ()
 Returns the size of recv buffers, in bytes.
 
static std::size_t maxq ()
 
static std::size_t nrecv ()
 Returns the number of recv buffers.
 
static void set_debug (bool status)
 
static void set_this_thread_is_server (bool flag=true)
 

Static Public Attributes

static const size_t ALIGNMENT = 64
 
static const attrT ATTR_ORDERED =0x1
 
static const attrT ATTR_UNORDERED =0x0
 
static const size_t HEADER_LEN = ALIGNMENT
 
static std::list< std::unique_ptr< RMISendReq > > send_req
 
static int testsome_backoff_us = 2
 

Private Types

typedef qmsg::attrT attrT
 
typedef qmsg::counterT counterT
 

Private Member Functions

 RMI (const RMI &)
 
RMIoperator= (const RMI &)
 

Static Private Member Functions

static void clear_send_req ()
 
static bool & is_server_thread_accessor ()
 

Static Private Attributes

static bool debugging = false
 
static const size_t DEFAULT_MAX_MSG_LEN = 3*512*1024
 the default size of recv buffers, in bytes; the actual size can be configured by the user via envvar MAD_BUFFER_SIZE
 
static const int DEFAULT_NRECV = 128
 the default # of recv buffers; the actual number can be configured by the user via envvar MAD_RECV_BUFFERS
 
static RMIStats stats
 
static std::unique_ptr< RmiTasktask_ptr = nullptr
 

Detailed Description

This class implements the communications server thread and provides the only send interface.

Member Typedef Documentation

◆ attrT

◆ counterT

◆ Request

Constructor & Destructor Documentation

◆ RMI()

madness::RMI::RMI ( const RMI )
private

Member Function Documentation

◆ assert_aslr_off()

void madness::RMI::assert_aslr_off ( const SafeMPI::Intracomm comm = SafeMPI::COMM_WORLD)
static

will complain to std::cerr and throw if ASLR is on by making sure that address of this function matches across comm

Parameters
[in]commthe communicator

References assert_aslr_off(), madness::detail::compare_fn_addresses(), SafeMPI::Intracomm::Get_rank(), MADNESS_ASSERT, MADNESS_EXCEPTION, MPI_LONG, SafeMPI::Op_create(), SafeMPI::Op_free(), and SafeMPI::Intracomm::Reduce().

Referenced by assert_aslr_off(), and begin().

◆ begin()

void madness::RMI::begin ( const SafeMPI::Intracomm comm = SafeMPI::COMM_WORLD)
static

◆ clear_send_req()

static void madness::RMI::clear_send_req ( )
inlinestaticprivate

◆ end()

static void madness::RMI::end ( )
inlinestatic

References task_ptr.

◆ get_debug()

static bool madness::RMI::get_debug ( )
inlinestatic

References debugging.

◆ get_stats()

static const RMIStats & madness::RMI::get_stats ( )
inlinestatic

◆ get_this_thread_is_server()

static bool madness::RMI::get_this_thread_is_server ( )
inlinestatic

◆ is_server_thread_accessor()

bool & madness::RMI::is_server_thread_accessor ( )
staticprivate
Returns
reference to the boolean variable indicating whether this thread is the server thread

Referenced by get_this_thread_is_server(), and set_this_thread_is_server().

◆ isend()

static Request madness::RMI::isend ( const void *  buf,
size_t  nbyte,
ProcessID  dest,
rmi_handlerT  func,
unsigned int  attr = ATTR_UNORDERED 
)
inlinestatic

Send a remote method invocation (again you should probably be looking at worldam.h instead)

Parameters
[in]bufPointer to the data buffer (do not modify until send is completed)
[in]nbyteSize of the data in bytes
[in]destProcess to receive the message
[in]funcThe function to handle the message on the remote end
[in]attrAttributes of the message (ATTR_UNORDERED or ATTR_ORDERED)
Returns
The status as an RMI::Request that presently is a SafeMPI::Request

References madness::func(), MADNESS_EXCEPTION, madness::print_error(), and task_ptr.

Referenced by madness::WorldAmInterface::send().

◆ max_msg_len()

static std::size_t madness::RMI::max_msg_len ( )
inlinestatic

Returns the size of recv buffers, in bytes.

Returns
The size of recv buffers, in bytes
Note
The default value is given by RMI::DEFAULT_MAX_MSG_LEN, can be overridden at runtime by the user via environment variable MAD_BUFFER_SIZE.
Warning
Cannot be smaller than 1024 bytes.

References MADNESS_ASSERT, and task_ptr.

Referenced by madness::BinSorter< T, inserterT >::BinSorter(), and Foo::Foo().

◆ maxq()

static std::size_t madness::RMI::maxq ( )
inlinestatic

References MADNESS_ASSERT, and task_ptr.

◆ nrecv()

static std::size_t madness::RMI::nrecv ( )
inlinestatic

Returns the number of recv buffers.

Returns
The number of recv buffers
Note
The default value is given by RMI::DEFAULT_NRECV, can be overridden at runtime by the user via environment variable MAD_RECV_BUFFERS
Warning
Cannot be smaller than 32.

References MADNESS_ASSERT, and task_ptr.

◆ operator=()

RMI & madness::RMI::operator= ( const RMI )
private

◆ set_debug()

static void madness::RMI::set_debug ( bool  status)
inlinestatic

References debugging, and status.

◆ set_this_thread_is_server()

static void madness::RMI::set_this_thread_is_server ( bool  flag = true)
inlinestatic

Member Data Documentation

◆ ALIGNMENT

const size_t madness::RMI::ALIGNMENT = 64
static

◆ ATTR_ORDERED

const attrT madness::RMI::ATTR_ORDERED =0x1
static

◆ ATTR_UNORDERED

const attrT madness::RMI::ATTR_UNORDERED =0x0
static

◆ debugging

bool madness::RMI::debugging = false
staticprivate

◆ DEFAULT_MAX_MSG_LEN

const size_t madness::RMI::DEFAULT_MAX_MSG_LEN = 3*512*1024
staticprivate

the default size of recv buffers, in bytes; the actual size can be configured by the user via envvar MAD_BUFFER_SIZE

Referenced by madness::RMI::RmiTask::RmiTask().

◆ DEFAULT_NRECV

const int madness::RMI::DEFAULT_NRECV = 128
staticprivate

the default # of recv buffers; the actual number can be configured by the user via envvar MAD_RECV_BUFFERS

Referenced by madness::RMI::RmiTask::RmiTask().

◆ HEADER_LEN

const size_t madness::RMI::HEADER_LEN = ALIGNMENT
static

◆ send_req

std::list< std::unique_ptr< RMISendReq > > madness::RMI::send_req
static

◆ stats

RMIStats madness::RMI::stats
staticprivate

◆ task_ptr

std::unique_ptr< RMI::RmiTask > madness::RMI::task_ptr = nullptr
staticprivate

◆ testsome_backoff_us

int madness::RMI::testsome_backoff_us = 2
static

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