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

Implements AM interface. More...

#include <worldam.h>

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

Classes

class  SendReq
 

Public Member Functions

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

Static Private Member Functions

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

Private Attributes

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

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. More...
 
virtual ~Mutex ()
 
void lock () const
 Acquire the mutex waiting if necessary. More...
 
pthread_mutex_t * ptr () const
 Return a pointer to the pthread mutex for use by a condition variable. More...
 
bool try_lock () const
 Try to acquire the mutex ... return true on success, false on failure. More...
 
void unlock () const
 Free a mutex owned by this thread. More...
 

Detailed Description

Implements AM interface.

Constructor & Destructor Documentation

◆ WorldAmInterface()

madness::WorldAmInterface::WorldAmInterface ( World world)

◆ ~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(), and madness::WorldGopInterface::fence_impl().

◆ handler()

static 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, and w().

Referenced by send().

◆ send()

void madness::WorldAmInterface::send ( ProcessID  dest,
am_handlerT  op,
const AmArg arg,
const int  attr = RMI::ATTR_ORDERED 
)
inline

Friends And Related Function Documentation

◆ World

friend class World
friend

◆ WorldGopInterface

friend class WorldGopInterface
friend

Member Data Documentation

◆ cur_msg

int madness::WorldAmInterface::cur_msg
private

Index of next buffer to attempt to use.

Referenced by send().

◆ DEFAULT_NSEND

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

Referenced by WorldAmInterface().

◆ 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 madness::WorldGopInterface::fence_impl().

◆ 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 madness::WorldGopInterface::fence_impl(), and send().

◆ rank

const ProcessID madness::WorldAmInterface::rank
private

Referenced by 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 madness::World::World(), and send().


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