OpenMPI 0.1.1

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

- File List
- Globals

Data Structures | Macros | Typedefs | Functions
bml.h File Reference

BML Management Layer (BML) More...

`#include "ompi_config.h"`
`#include "opal/mca/mca.h"`
`#include "opal/datatype/opal_convertor.h"`
`#include "opal/mca/crs/crs.h"`
`#include "opal/mca/crs/base/base.h"`
`#include "opal/util/opal_sos.h"`
`#include "ompi/mca/btl/btl.h"`
`#include "ompi/mca/bml/base/bml_base_btl.h"`
`#include "ompi/types.h"`
`#include "ompi/constants.h"`

Go to the source code of this file.

## Data Structures
struct | mca_bml_base_btl_t
struct | mca_bml_base_btl_array_t
| A dynamically growable array of mca_bml_base_btl_t instances. More...
struct | mca_bml_base_endpoint_t
| Structure associated w/ ompi_proc_t that contains the set of BTLs used to reach a destination. More...
struct | mca_bml_base_component_2_0_0_t
| BML component descriptor. More...
struct | mca_bml_base_module_t
| BML module interface functions and attributes. More...

## Macros
#define | OPAL_ENABLE_DEBUG_RELIABILITY 0
#define | MCA_BML_BASE_VERSION_2_0_0

## Typedefs
typedef struct mca_bml_base_btl_t | mca_bml_base_btl_t
typedef struct mca_bml_base_btl_array_t | mca_bml_base_btl_array_t
typedef struct mca_bml_base_endpoint_t | mca_bml_base_endpoint_t
typedef struct mca_bml_base_module_t *(* | mca_bml_base_component_init_fn_t )(int *priority, bool enable_progress_threads, bool enable_mpi_threads)
| MCA->BML Initializes the BML component and creates specific BML module(s). More...
typedef struct mca_bml_base_component_2_0_0_t | mca_bml_base_component_2_0_0_t
typedef struct mca_bml_base_component_2_0_0_t | mca_bml_base_component_t
typedef int(* | mca_bml_base_module_finalize_fn_t )(void)
| MCA->BML Clean up any resources held by BML module before the module is unloaded. More...
typedef int(* | mca_bml_base_module_add_procs_fn_t )(size_t nprocs, struct ompi_proc_t **procs, struct opal_bitmap_t *reachable)
| PML->BML notification of change in the process list. More...
typedef int(* | mca_bml_base_module_del_procs_fn_t )(size_t nprocs, struct ompi_proc_t **procs)
| Notification of change to the process list. More...
typedef int(* | mca_bml_base_module_add_btl_fn_t )(struct mca_btl_base_module_t *)
| Notification of change to the btl list. More...
typedef int(* | mca_bml_base_module_del_btl_fn_t )(struct mca_btl_base_module_t *)
| Notification of change to the btl list. More...
typedef int(* | mca_bml_base_module_del_proc_btl_fn_t )(struct ompi_proc_t *, struct mca_btl_base_module_t *)
| Notification of change to the btl list. More...
typedef int(* | mca_bml_base_module_register_fn_t )(mca_btl_base_tag_t tag, mca_btl_base_module_recv_cb_fn_t cbfunc, void *cbdata)
| Register a callback function that is called on receipt of a fragment. More...
typedef int(* | mca_bml_base_module_register_error_cb_fn_t )(mca_btl_base_module_error_cb_fn_t cbfunc)
| Register a callback function that is called of error. More...
typedef int(* | mca_bml_base_module_ft_event_fn_t )(int status)
| Fault Tolerance Event Notification Function. More...
typedef struct mca_bml_base_module_t | mca_bml_base_module_t

## Functions
OMPI_DECLSPEC | OBJ_CLASS_DECLARATION (mca_bml_base_btl_array_t)
static size_t | mca_bml_base_btl_array_get_size (mca_bml_base_btl_array_t *array)
| If required, reallocate (grow) the array to the indicate size. More...
static void | mca_bml_base_btl_array_set_size (mca_bml_base_btl_array_t *array, size_t size)
| Grow the array if required, and set the size. More...
static mca_bml_base_btl_t * | mca_bml_base_btl_array_insert (mca_bml_base_btl_array_t *array)
| Grow the array size by one and return the item at that index. More...
static bool | mca_bml_base_btl_array_remove (mca_bml_base_btl_array_t *array, struct mca_btl_base_module_t *btl)
| Remove a btl from a bml_btl. More...
static mca_bml_base_btl_t * | mca_bml_base_btl_array_get_index (mca_bml_base_btl_array_t *array, size_t item_index)
| Return an array item at the specified index. More...
static mca_bml_base_btl_t * | mca_bml_base_btl_array_get_next (mca_bml_base_btl_array_t *array)
| Return the next LRU index in the array. More...
static mca_bml_base_btl_t * | mca_bml_base_btl_array_find (mca_bml_base_btl_array_t *array, struct mca_btl_base_module_t *btl)
| Locate an element in the array. More...
OMPI_DECLSPEC | OBJ_CLASS_DECLARATION (mca_bml_base_endpoint_t)
static void | mca_bml_base_alloc (mca_bml_base_btl_t *bml_btl, mca_btl_base_descriptor_t **des, uint8_t order, size_t size, uint32_t flags)
static void | mca_bml_base_free (mca_bml_base_btl_t *bml_btl, mca_btl_base_descriptor_t *des)
static int | mca_bml_base_send (mca_bml_base_btl_t *bml_btl, mca_btl_base_descriptor_t *des, mca_btl_base_tag_t tag)
static int | mca_bml_base_send_status (mca_bml_base_btl_t *bml_btl, mca_btl_base_descriptor_t *des, mca_btl_base_tag_t tag)
static int | mca_bml_base_sendi (mca_bml_base_btl_t *bml_btl, 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)
static int | mca_bml_base_put (mca_bml_base_btl_t *bml_btl, mca_btl_base_descriptor_t *des)
static int | mca_bml_base_get (mca_bml_base_btl_t *bml_btl, mca_btl_base_descriptor_t *des)
static void | mca_bml_base_prepare_src (mca_bml_base_btl_t *bml_btl, mca_mpool_base_registration_t *reg, struct opal_convertor_t *conv, uint8_t order, size_t reserve, size_t *size, uint32_t flags, mca_btl_base_descriptor_t **des)
static void | mca_bml_base_prepare_dst (mca_bml_base_btl_t *bml_btl, mca_mpool_base_registration_t *reg, struct opal_convertor_t *conv, uint8_t order, size_t reserve, size_t *size, uint32_t flags, mca_btl_base_descriptor_t **des)

## Detailed Description

BML Management Layer (BML)

## Macro Definition Documentation

#define MCA_BML_BASE_VERSION_2_0_0

Value:
MCA_BASE_VERSION_2_0_0, \
"bml", 2, 0, 0

## Typedef Documentation

typedef struct mca_bml_base_module_t*(* mca_bml_base_component_init_fn_t)(int *priority, bool enable_progress_threads, bool enable_mpi_threads)

MCA->BML Initializes the BML component and creates specific BML module(s).

Parameters

  num_bmls | (OUT) Returns the number of bml modules created, or 0 if the transport is not available.
  enable_progress_threads | (IN) Whether this component is allowed to run a hidden/progress thread or not.
  enable_mpi_threads | (IN) Whether support for multiple MPI threads is enabled or not (i.e., MPI_THREAD_MULTIPLE), which indicates whether multiple threads may invoke this component simultaneously or not.

Returns
  Array of pointers to BML modules, or NULL if the transport is not available.

During component initialization, the BML component should discover the physical devices that are available for the given transport, and create a BML module to represent each device. Any addressing information required by peers to reach the device should be published during this function via the mca_base_modex_send() interface.

typedef int(* mca_bml_base_module_add_btl_fn_t)(struct mca_btl_base_module_t *)

Notification of change to the btl list.

Parameters

  bml | (IN) BTL module

Returns
  Status indicating if cleanup was successful

On recovery of a btl, add it to the set of forwarding entries used by the BML.

typedef int(* mca_bml_base_module_add_procs_fn_t)(size_t nprocs, struct ompi_proc_t **procs, struct opal_bitmap_t *reachable)

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

Parameters

  nprocs | (IN) Number of processes
  procs | (IN) Set of processes
  reachable | (OUT) Bitmask indicating set of peer processes that are reachable by this BML.

Returns
  OMPI_SUCCESS or error status on failure.

The mca_bml_base_module_add_procs_fn_t() is called by the PML to determine the set of BMLs that should be used to reach each process. Any addressing information exported by the peer via the mca_base_modex_send() function should be available during this call via the corresponding mca_base_modex_recv() function. The BML may utilize this information to determine reachability of each peer process.

For each process that is reachable by the BML, the bit corresponding to the index into the proc array (nprocs) should be set in the reachable bitmask. The PML provides the BML the option to return a pointer to a data structure defined by the BML that is returned to the BML on subsequent calls to the BML data transfer functions (e.g bml_send). This may be used by the BML to cache any addressing or connection information (e.g. TCP socket, IP queue pair).

Note
  This function will return OMPI_ERR_UNREACH if one or more processes can not be reached by the currently active BTLs. This is not a fatal error, and the calling layer is free to continue using the BML interface.

typedef int(* mca_bml_base_module_del_btl_fn_t)(struct mca_btl_base_module_t *)

Notification of change to the btl list.

Parameters

  bml | (IN) BTL module

Returns
  Status indicating if cleanup was successful

On failure of a btl, remove it from the set of forwarding entries used by the BML.

typedef int(* mca_bml_base_module_del_proc_btl_fn_t)(struct ompi_proc_t *, struct mca_btl_base_module_t *)

Notification of change to the btl list.

Parameters

  bml | (IN) BTL module

Returns
  Status indicating if cleanup was successful

On failure of a btl, remove it from the set of forwarding entries used by the BML.

typedef int(* mca_bml_base_module_del_procs_fn_t)(size_t nprocs, struct ompi_proc_t **procs)

Notification of change to the process list.

Parameters

  nprocs | (IN) Number of processes
  proc | (IN) Set of processes

Returns
  Status indicating if cleanup was successful

When the process list changes, the PML notifies the BML of the change, to provide the opportunity to cleanup or release any resources associated with the peer.

typedef int(* mca_bml_base_module_finalize_fn_t)(void)

MCA->BML Clean up any resources held by BML module before the module is unloaded.

Parameters

  bml | (IN) BML module.

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

typedef int(* mca_bml_base_module_ft_event_fn_t)(int status)

Fault Tolerance Event Notification Function.

Parameters

  status | Checkpoint Status

Returns
  OMPI_SUCCESS or failure status

typedef int(* mca_bml_base_module_register_error_cb_fn_t)(mca_btl_base_module_error_cb_fn_t cbfunc)

Register a callback function that is called of error.

Parameters

  bml | (IN) BML module

Returns
  Status indicating if cleanup was successful

typedef int(* mca_bml_base_module_register_fn_t)(mca_btl_base_tag_t tag, mca_btl_base_module_recv_cb_fn_t cbfunc, void *cbdata)

Register a callback function that is called on receipt of a fragment.

Parameters

  bml | (IN) BML module

Returns
  Status indicating if cleanup was successful

When the process list changes, the PML notifies the BML of the change, to provide the opportunity to cleanup or release any resources associated with the peer.

## Function Documentation

static mca_bml_base_btl_t* mca_bml_base_btl_array_find | ( | mca_bml_base_btl_array_t * | array,
|  | struct mca_btl_base_module_t * | btl
| ) |  |
| inline static

Locate an element in the array.

Parameters

  array | (IN)
  index | (IN)

References mca_bml_base_btl_array_t::arr_size, mca_bml_base_btl_array_t::bml_btls, and mca_bml_base_btl_t::btl.

Referenced by mca_pml_bfo_error_pending_packets().

static mca_bml_base_btl_t* mca_bml_base_btl_array_get_index | ( | mca_bml_base_btl_array_t * | array,
|  | size_t | item_index
| ) |  |
| inline static

Return an array item at the specified index.

Parameters

  array | (IN)
  item_index | (IN)

References mca_bml_base_btl_array_t::arr_size, mca_bml_base_btl_array_t::bml_btls, and opal_output().

static mca_bml_base_btl_t* mca_bml_base_btl_array_get_next | ( | mca_bml_base_btl_array_t * | array | ) |
| inline static

Return the next LRU index in the array.

Parameters

  array | (IN)
  index | (OUT)

References mca_bml_base_btl_array_t::arr_index, mca_bml_base_btl_array_t::arr_size, mca_bml_base_btl_array_t::bml_btls, and opal_output().

Referenced by mca_pml_bfo_error_pending_packets(), mca_pml_bfo_recv_request_recverrnotify(), mca_pml_bfo_recv_request_rndvrestartack(), mca_pml_bfo_recv_request_rndvrestartnack(), mca_pml_bfo_repost_fin(), mca_pml_bfo_repost_match_fragment(), mca_pml_bfo_send_request_restart(), and mca_pml_bfo_send_request_rndvrestartnotify().

static size_t mca_bml_base_btl_array_get_size | ( | mca_bml_base_btl_array_t * | array | ) |
| inline static

If required, reallocate (grow) the array to the indicate size.

Parameters

  array | (IN)
  size | (IN)

References mca_bml_base_btl_array_t::arr_size.

Referenced by mca_pml_bfo_send_request_restart().

static mca_bml_base_btl_t* mca_bml_base_btl_array_insert | ( | mca_bml_base_btl_array_t * | array | ) |
| inline static

Grow the array size by one and return the item at that index.

Parameters

  array | (IN)

References mca_bml_base_btl_array_t::arr_reserve, mca_bml_base_btl_array_t::arr_size, mca_bml_base_btl_array_t::bml_btls, and opal_output().

static bool mca_bml_base_btl_array_remove | ( | mca_bml_base_btl_array_t * | array,
|  | struct mca_btl_base_module_t * | btl
| ) |  |
| inline static

Remove a btl from a bml_btl.

Parameters

  array | (IN)
  btl | (IN)

References mca_bml_base_btl_array_t::arr_index, mca_bml_base_btl_array_t::arr_size, mca_bml_base_btl_array_t::bml_btls, and mca_bml_base_btl_t::btl.

static void mca_bml_base_btl_array_set_size | ( | mca_bml_base_btl_array_t * | array,
|  | size_t | size
| ) |  |
| inline static

Grow the array if required, and set the size.

Parameters

  array | (IN)
  size | (IN)

References mca_bml_base_btl_array_t::arr_reserve, and mca_bml_base_btl_array_t::arr_size.