OpenMPI 0.1.1

- Main Page
- Related Pages
- Modules
- Data Structures
- Files

- File List
- Globals

Data Structures | Macros | Typedefs | Functions | Variables
btl_smcuda.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_smcuda_mem_node_t
struct | mca_btl_smcuda_component_t
| Shared Memory (SM) BTL module. More...
struct | mca_btl_smcuda_t
| SM BTL Interface. More...
struct | btl_smcuda_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_smcuda_component.shm_bases[mca_btl_smcuda_component.my_smp_rank])
#define | RELATIVE2VIRTUAL(OFFSET) ((long)(OFFSET) + (long)mca_btl_smcuda_component.shm_bases[mca_btl_smcuda_component.my_smp_rank])
#define | MCA_BTL_SMCUDA_SIGNAL_PEER(peer)

## Typedefs
typedef struct sm_fifo_t | sm_fifo_t
typedef struct mca_btl_smcuda_mem_node_t | mca_btl_smcuda_mem_node_t
typedef struct mca_btl_smcuda_component_t | mca_btl_smcuda_component_t
typedef struct mca_btl_smcuda_t | mca_btl_smcuda_t
typedef struct btl_smcuda_pending_send_item_t | btl_smcuda_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_smcuda_component_progress (void)
| shared memory component progress.
int | mca_btl_smcuda_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_smcuda_finalize (struct mca_btl_base_module_t *btl)
| Cleanup any resources held by the BTL. More...
int | mca_btl_smcuda_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_smcuda_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_t * | mca_btl_smcuda_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_smcuda_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_t * | mca_btl_smcuda_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_smcuda_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_smcuda_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_smcuda_ft_event (int state)
| Fault Tolerance Event Notification Function. More...

## Variables
OMPI_MODULE_DECLSPEC mca_btl_smcuda_component_t | mca_btl_smcuda_component
OMPI_MODULE_DECLSPEC mca_btl_smcuda_t | mca_btl_smcuda

## Function Documentation

int mca_btl_smcuda_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.

PML->BTL Notification that a receive fragment has been matched. Called for message that is send from process with the virtual address of the shared memory segment being different than that of the receiver.

Parameters

  btl | (IN)
  proc | (IN)
  peer | (OUT)

Returns
  OMPI_SUCCESS or error status on failure.

References mca_btl_smcuda_t::btl_inited, mca_btl_smcuda_component_t::fifo, mca_btl_smcuda_component_t::fifo_lazy_free, mca_btl_smcuda_component_t::fifo_size, orte_process_name_t::jobid, mca_btl_smcuda_component_t::mem_nodes, mca_btl_base_endpoint_t::my_smp_rank, mca_btl_smcuda_component_t::my_smp_rank, mca_btl_smcuda_component_t::num_smp_procs, ompi_proc_local(), opal_atomic_rmb(), opal_atomic_wmb(), opal_bitmap_set_bit(), opal_progress(), mca_btl_base_endpoint_t::peer_smp_rank, ompi_proc_t::proc_name, mca_btl_smcuda_component_t::shm_bases, mca_btl_smcuda_component_t::shm_fifo, mca_btl_smcuda_component_t::shm_mem_nodes, mca_btl_smcuda_component_t::sm_frags_eager, mca_btl_smcuda_component_t::sm_max_procs, mca_btl_smcuda_component_t::sm_mpool, and mca_btl_smcuda_component_t::sm_seg.

mca_btl_base_descriptor_t* mca_btl_smcuda_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_smcuda_component_t::eager_limit, mca_btl_smcuda_component_t::max_frag_size, and mca_btl_base_segment_t::seg_len.

Referenced by mca_btl_smcuda_sendi().

int mca_btl_smcuda_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_smcuda_finalize | ( | struct mca_btl_base_module_t * | btl | ) |

Cleanup any resources held by the BTL.

Parameters

  btl | BTL 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_smcuda_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_smcuda_ft_event | ( | int | state | ) |

Fault Tolerance Event Notification Function.

Parameters

  state | Checkpoint Stae

Returns
  OMPI_SUCCESS or failure status

struct mca_btl_base_descriptor_t* mca_btl_smcuda_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.

Parameters

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

References mca_btl_base_descriptor_t::des_dst, mca_btl_base_descriptor_t::des_dst_cnt, mca_btl_base_descriptor_t::des_flags, mca_btl_base_descriptor_t::des_src, mca_btl_base_descriptor_t::des_src_cnt, mca_btl_smcuda_component_t::eager_limit, opal_convertor_t::flags, mca_btl_base_descriptor_t::order, mca_btl_base_segment_t::seg_addr, mca_btl_base_segment_t::seg_key, and mca_btl_base_segment_t::seg_len.

int mca_btl_smcuda_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_smcuda_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.

Parameters

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

References mca_btl_base_descriptor_t::des_flags, mca_btl_smcuda_component_t::fifo_size, mca_btl_smcuda_component_progress(), mca_btl_base_endpoint_t::my_smp_rank, mca_btl_smcuda_component_t::num_outstanding_frags, OPAL_THREAD_ADD32, mca_btl_base_endpoint_t::peer_smp_rank, and mca_btl_base_segment_t::seg_len.

int mca_btl_smcuda_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_smcuda_component_t::eager_limit, mca_btl_smcuda_component_t::fifo_size, mca_btl_smcuda_alloc(), mca_btl_smcuda_component_progress(), mca_btl_base_endpoint_t::my_smp_rank, mca_btl_smcuda_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.