MADNESS 0.10.1
madness::WorldAmInterface Class Reference

Implements AM interface. More...

#include <worldam.h>

Inheritance diagram for madness::WorldAmInterface:
Collaboration diagram for madness::WorldAmInterface:

Classes

class  SendReq

Public Member Functions

 WorldAmInterface (World &world)
virtual ~WorldAmInterface ()
void fence ()
 Currently a noop.
int free_managed_buffers ()
 Frees as many send buffers as possible, returning the number that are free.
void send (ProcessID dest, am_handlerT op, const AmArg *arg, const int attr=RMI::ATTR_ORDERED)
 Sends a managed non-blocking active message.

Static Private Member Functions

static void handler (void *buf, std::size_t nbyte)
 This handles all incoming RMI messages for all instances.

Private Attributes

int cur_msg
 Index of next buffer to attempt to use.
std::vector< int > map_to_comm_world
 Maps rank in current MPI communicator to SafeMPI::COMM_WORLD.
const int nproc
unsigned long nrecv
 Counts no. of AM received for purpose of termination detection.
int nsend
 Max no. of pending sends.
unsigned long nsent
 Counts no. of AM sent for purpose of termination detection.
const ProcessID rank
std::unique_ptr< SendReq[]> send_req
 Send requests and managed buffers.
unsigned long worldid
 The world which contains this instance of WorldAmInterface.

Static Private Attributes

static const int DEFAULT_NSEND = 128

Friends

class World
class WorldGopInterface

Additional Inherited Members

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.

Detailed Description

Implements AM interface.

Constructor & Destructor Documentation

◆ WorldAmInterface()

◆ ~WorldAmInterface()

madness::WorldAmInterface::~WorldAmInterface ( )
virtual

Member Function Documentation

◆ fence()

void madness::WorldAmInterface::fence ( )
inline

Currently a noop.

◆ free_managed_buffers()

int madness::WorldAmInterface::free_managed_buffers ( )
inline

Frees as many send buffers as possible, returning the number that are free.

References nsend, send_req, and madness::Mutex::try_lock().

Referenced by ~WorldAmInterface().

◆ handler()

void madness::WorldAmInterface::handler ( void * buf,
std::size_t nbyte )
inlinestaticprivate

This handles all incoming RMI messages for all instances.

References madness::arg(), madness::func(), MADNESS_ASSERT, w(), and World.

Referenced by send().

◆ send()

◆ World

friend class World
friend

References DEFAULT_NSEND, and World.

Referenced by WorldAmInterface(), handler(), and World.

◆ WorldGopInterface

friend class WorldGopInterface
friend

References WorldGopInterface.

Referenced by WorldGopInterface.

Member Data Documentation

◆ cur_msg

int madness::WorldAmInterface::cur_msg
private

Index of next buffer to attempt to use.

Referenced by WorldAmInterface(), and send().

◆ DEFAULT_NSEND

const int madness::WorldAmInterface::DEFAULT_NSEND = 128
staticprivate

Referenced by WorldAmInterface(), and World.

◆ map_to_comm_world

std::vector<int> madness::WorldAmInterface::map_to_comm_world
private

Maps rank in current MPI communicator to SafeMPI::COMM_WORLD.

Referenced by WorldAmInterface(), and send().

◆ nproc

const int madness::WorldAmInterface::nproc
private

Referenced by WorldAmInterface().

◆ nrecv

unsigned long madness::WorldAmInterface::nrecv
private

Counts no. of AM received for purpose of termination detection.

Referenced by WorldAmInterface().

◆ nsend

int madness::WorldAmInterface::nsend
private

Max no. of pending sends.

Referenced by WorldAmInterface(), ~WorldAmInterface(), free_managed_buffers(), and send().

◆ nsent

unsigned long madness::WorldAmInterface::nsent
private

Counts no. of AM sent for purpose of termination detection.

Referenced by WorldAmInterface(), and send().

◆ rank

const ProcessID madness::WorldAmInterface::rank
private

Referenced by WorldAmInterface(), and send().

◆ send_req

std::unique_ptr<SendReq []> madness::WorldAmInterface::send_req
private

Send requests and managed buffers.

Referenced by WorldAmInterface(), free_managed_buffers(), and send().

◆ worldid

unsigned long madness::WorldAmInterface::worldid
private

The world which contains this instance of WorldAmInterface.

Referenced by WorldAmInterface(), and send().


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