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.
 
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()

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::AmArg::get_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 Symbol 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: