OpenMPI  0.1.1
btl_sm.h File Reference
#include "ompi_config.h"
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include "opal/util/bit_ops.h"
#include "opal/class/opal_free_list.h"
#include "ompi/mca/btl/btl.h"
#include "ompi/mca/common/sm/common_sm.h"

Go to the source code of this file.

Data Structures

struct  sm_fifo_t
 
struct  mca_btl_sm_mem_node_t
 
struct  mca_btl_sm_component_t
 Shared Memory (SM) BTL module. More...
 
struct  mca_btl_sm_t
 SM BTL Interface. More...
 
struct  btl_sm_pending_send_item_t
 

Macros

#define SM_FIFO_FREE   (void *) (-2)
 
#define SM_CACHE_LINE_PAD   128
 
#define VIRTUAL2RELATIVE(VADDR)   ((long)(VADDR) - (long)mca_btl_sm_component.shm_bases[mca_btl_sm_component.my_smp_rank])
 
#define RELATIVE2VIRTUAL(OFFSET)   ((long)(OFFSET) + (long)mca_btl_sm_component.shm_bases[mca_btl_sm_component.my_smp_rank])
 
#define MCA_BTL_SM_SIGNAL_PEER(peer)
 

Typedefs

typedef struct sm_fifo_t sm_fifo_t
 
typedef struct
mca_btl_sm_mem_node_t 
mca_btl_sm_mem_node_t
 
typedef struct
mca_btl_sm_component_t 
mca_btl_sm_component_t
 
typedef struct mca_btl_sm_t mca_btl_sm_t
 
typedef struct
btl_sm_pending_send_item_t 
btl_sm_pending_send_item_t
 

Functions

static int sm_fifo_init (int fifo_size, mca_mpool_base_module_t *mpool, sm_fifo_t *fifo, int lazy_free)
 
static int sm_fifo_write (void *value, sm_fifo_t *fifo)
 
static void * sm_fifo_read (sm_fifo_t *fifo)
 
int mca_btl_sm_component_progress (void)
 shared memory component progress.
 
int mca_btl_sm_register_error_cb (struct mca_btl_base_module_t *btl, mca_btl_base_module_error_cb_fn_t cbfunc)
 Register a callback function that is called on error. More...
 
int mca_btl_sm_finalize (struct mca_btl_base_module_t *btl)
 Cleanup any resources held by the BTL. More...
 
int mca_btl_sm_add_procs (struct mca_btl_base_module_t *btl, size_t nprocs, struct ompi_proc_t **procs, struct mca_btl_base_endpoint_t **peers, struct opal_bitmap_t *reachability)
 PML->BTL notification of change in the process list. More...
 
int mca_btl_sm_del_procs (struct mca_btl_base_module_t *btl, size_t nprocs, struct ompi_proc_t **procs, struct mca_btl_base_endpoint_t **peers)
 PML->BTL notification of change in the process list. More...
 
mca_btl_base_descriptor_tmca_btl_sm_alloc (struct mca_btl_base_module_t *btl, struct mca_btl_base_endpoint_t *endpoint, uint8_t order, size_t size, uint32_t flags)
 Allocate a segment. More...
 
int mca_btl_sm_free (struct mca_btl_base_module_t *btl, mca_btl_base_descriptor_t *segment)
 Return a segment allocated by this BTL. More...
 
struct mca_btl_base_descriptor_tmca_btl_sm_prepare_src (struct mca_btl_base_module_t *btl, struct mca_btl_base_endpoint_t *endpoint, mca_mpool_base_registration_t *registration, struct opal_convertor_t *convertor, uint8_t order, size_t reserve, size_t *size, uint32_t flags)
 Pack data. More...
 
int mca_btl_sm_sendi (struct mca_btl_base_module_t *btl, struct mca_btl_base_endpoint_t *endpoint, struct opal_convertor_t *convertor, void *header, size_t header_size, size_t payload_size, uint8_t order, uint32_t flags, mca_btl_base_tag_t tag, mca_btl_base_descriptor_t **descriptor)
 Initiate an inlined send to the peer or return a descriptor. More...
 
int mca_btl_sm_send (struct mca_btl_base_module_t *btl, struct mca_btl_base_endpoint_t *endpoint, struct mca_btl_base_descriptor_t *descriptor, mca_btl_base_tag_t tag)
 Initiate a send to the peer. More...
 
int mca_btl_sm_ft_event (int state)
 Fault Tolerance Event Notification Function. More...
 

Variables

OMPI_MODULE_DECLSPEC
mca_btl_sm_component_t 
mca_btl_sm_component
 
OMPI_MODULE_DECLSPEC mca_btl_sm_t mca_btl_sm
 

Function Documentation

int mca_btl_sm_add_procs ( struct mca_btl_base_module_t btl,
size_t  nprocs,
struct ompi_proc_t **  procs,
struct mca_btl_base_endpoint_t **  peers,
struct opal_bitmap_t reachability 
)
mca_btl_base_descriptor_t* mca_btl_sm_alloc ( struct mca_btl_base_module_t btl,
struct mca_btl_base_endpoint_t endpoint,
uint8_t  order,
size_t  size,
uint32_t  flags 
)

Allocate a segment.

Parameters
btl(IN) BTL module
size(IN) Request segment size.

References mca_btl_base_descriptor_t::des_flags, mca_btl_sm_component_t::eager_limit, mca_btl_sm_component_t::max_frag_size, and mca_btl_base_segment_t::seg_len.

Referenced by mca_btl_sm_sendi().

int mca_btl_sm_del_procs ( struct mca_btl_base_module_t btl,
size_t  nprocs,
struct ompi_proc_t **  procs,
struct mca_btl_base_endpoint_t **  peers 
)

PML->BTL notification of change in the process list.

Parameters
btl(IN) BTL instance
proc(IN) Peer process
peer(IN) Peer addressing information.
Returns
Status indicating if cleanup was successful
int mca_btl_sm_finalize ( struct mca_btl_base_module_t btl)

Cleanup any resources held by the BTL.

Parameters
btlBTL instance.
Returns
OMPI_SUCCESS or error status on failure.

Cleanup any resources held by the BTL.

Parameters
btl(IN) BTL module.

Prior to unloading a BTL module, the MCA framework will call the BTL finalize method of the module. Any resources held by the BTL should be released and if required the memory corresponding to the BTL module freed.

int mca_btl_sm_free ( struct mca_btl_base_module_t btl,
mca_btl_base_descriptor_t des 
)

Return a segment allocated by this BTL.

Parameters
btl(IN) BTL module
segment(IN) Allocated segment.
int mca_btl_sm_ft_event ( int  state)

Fault Tolerance Event Notification Function.

Parameters
stateCheckpoint Stae
Returns
OMPI_SUCCESS or failure status
int mca_btl_sm_register_error_cb ( struct mca_btl_base_module_t btl,
mca_btl_base_module_error_cb_fn_t  cbfunc 
)

Register a callback function that is called on error.

Parameters
btl(IN) BTL module
Returns
Status indicating if cleanup was successful
int mca_btl_sm_send ( struct mca_btl_base_module_t btl,
struct mca_btl_base_endpoint_t endpoint,
struct mca_btl_base_descriptor_t descriptor,
mca_btl_base_tag_t  tag 
)
int mca_btl_sm_sendi ( struct mca_btl_base_module_t btl,
struct mca_btl_base_endpoint_t endpoint,
struct opal_convertor_t convertor,
void *  header,
size_t  header_size,
size_t  payload_size,
uint8_t  order,
uint32_t  flags,
mca_btl_base_tag_t  tag,
mca_btl_base_descriptor_t **  descriptor 
)

Initiate an inlined send to the peer or return a descriptor.

Parameters
btl(IN) BTL module
peer(IN) BTL peer addressing

Initiate an inlined send to the peer or return a descriptor.

If failure then return a descriptor.

Parameters
btl(IN) BTL module
peer(IN) BTL peer addressing

References mca_btl_base_descriptor_t::des_flags, mca_btl_sm_component_t::eager_limit, mca_btl_sm_component_t::fifo_size, mca_btl_sm_alloc(), mca_btl_sm_component_progress(), mca_btl_base_endpoint_t::my_smp_rank, mca_btl_sm_component_t::num_outstanding_frags, OPAL_THREAD_ADD32, mca_btl_base_endpoint_t::peer_smp_rank, mca_btl_base_segment_t::seg_addr, and mca_btl_base_segment_t::seg_len.