2005-06-30 09:50:55 +04:00
|
|
|
/*
|
2007-03-17 02:11:45 +03:00
|
|
|
* Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana
|
2005-11-05 22:57:48 +03:00
|
|
|
* University Research and Technology
|
|
|
|
* Corporation. All rights reserved.
|
2006-08-24 20:38:08 +04:00
|
|
|
* Copyright (c) 2004-2006 The University of Tennessee and The University
|
2005-11-05 22:57:48 +03:00
|
|
|
* of Tennessee Research Foundation. All rights
|
|
|
|
* reserved.
|
2005-06-30 09:50:55 +04:00
|
|
|
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
|
|
|
* University of Stuttgart. All rights reserved.
|
|
|
|
* Copyright (c) 2004-2005 The Regents of the University of California.
|
|
|
|
* All rights reserved.
|
2007-07-25 21:26:23 +04:00
|
|
|
* Copyright (c) 2006-2007 Los Alamos National Security, LLC. All rights
|
|
|
|
* reserved.
|
2005-06-30 09:50:55 +04:00
|
|
|
* $COPYRIGHT$
|
|
|
|
*
|
|
|
|
* Additional copyrights may follow
|
|
|
|
*
|
|
|
|
* $HEADER$
|
|
|
|
*/
|
|
|
|
/**
|
|
|
|
* @file
|
|
|
|
*
|
2007-07-25 21:26:23 +04:00
|
|
|
* Byte Transfer Layer (BTL)
|
2005-06-30 09:50:55 +04:00
|
|
|
*
|
|
|
|
*
|
|
|
|
* BTL Initialization:
|
|
|
|
*
|
|
|
|
* During library initialization, all available BTL components are
|
|
|
|
* loaded and opened via their mca_base_open_component_fn_t
|
|
|
|
* function. The BTL open function should register any mca parameters
|
|
|
|
* used to tune/adjust the behaviour of the BTL (mca_base_param_register_int(),
|
|
|
|
* mca_base_param_register_string()). Note that the open function may fail
|
|
|
|
* if the resources (e.g. shared libraries, etc) required by the network
|
|
|
|
* transport are not available.
|
|
|
|
*
|
|
|
|
* The mca_btl_base_component_init_fn_t() is then called for each of the
|
|
|
|
* components that are succesfully opened. The component init function may
|
|
|
|
* return either:
|
|
|
|
*
|
|
|
|
* (1) a NULL list of BTL modules if the transport is not available,
|
2007-07-25 21:26:23 +04:00
|
|
|
* (2) a list containing a one or more single BTL modules, where the BTL provides
|
|
|
|
* a layer of abstraction over one or more physical devices (e.g. NICs),
|
2006-09-19 11:55:41 +04:00
|
|
|
*
|
2005-06-30 09:50:55 +04:00
|
|
|
* During module initialization, the module should post any addressing
|
|
|
|
* information required by its peers. An example would be the TCP
|
|
|
|
* listen port opened by the TCP module for incoming connection
|
|
|
|
* requests. This information is published to peers via the
|
2007-07-09 21:16:34 +04:00
|
|
|
* ompi_modex_send() interface. Note that peer information is not
|
|
|
|
* guaranteed to be available via ompi_modex_recv() during the
|
2006-09-19 11:55:41 +04:00
|
|
|
* module's init function. However, it will be available during
|
2005-06-30 09:50:55 +04:00
|
|
|
* BTL selection (mca_btl_base_add_proc_fn_t()).
|
|
|
|
*
|
|
|
|
* BTL Selection:
|
|
|
|
*
|
2006-09-19 11:55:41 +04:00
|
|
|
* The upper layer builds an ordered list of the available BTL modules sorted
|
2005-06-30 09:50:55 +04:00
|
|
|
* by their exclusivity ranking. This is a relative ranking that is used
|
2006-09-19 11:55:41 +04:00
|
|
|
* to determine the set of BTLs that may be used to reach a given destination.
|
|
|
|
* During startup the BTL modules are queried via their
|
2005-06-30 09:50:55 +04:00
|
|
|
* mca_btl_base_add_proc_fn_t() to determine if they are able to reach
|
2006-09-19 11:55:41 +04:00
|
|
|
* a given destination. The BTL module with the highest ranking that
|
|
|
|
* returns success is selected. Subsequent BTL modules are selected only
|
2005-06-30 09:50:55 +04:00
|
|
|
* if they have the same exclusivity ranking.
|
2006-09-19 11:55:41 +04:00
|
|
|
*
|
2005-06-30 09:50:55 +04:00
|
|
|
* An example of how this might be used:
|
|
|
|
*
|
|
|
|
* BTL Exclusivity Comments
|
|
|
|
* -------- ----------- ------------------
|
|
|
|
* LO 100 Selected exclusively for local process
|
|
|
|
* SM 50 Selected exclusively for other processes on host
|
|
|
|
* IB 0 Selected based on network reachability
|
|
|
|
* IB 0 Selected based on network reachability
|
|
|
|
* TCP 0 Selected based on network reachability
|
|
|
|
* TCP 0 Selected based on network reachability
|
|
|
|
*
|
2007-07-25 21:26:23 +04:00
|
|
|
* When mca_btl_base_add_proc_fn_t() is called on a BTL module, the BTL
|
|
|
|
* will populate an OUT variable with mca_btl_base_endpoint_t pointers.
|
|
|
|
* Each pointer is treated as an opaque handle by the upper layer and is
|
2006-09-19 11:55:41 +04:00
|
|
|
* returned to the BTL on subsequent data transfer calls to the
|
|
|
|
* corresponding destination process. The actual contents of the
|
|
|
|
* data structure are defined on a per BTL basis, and may be used to
|
|
|
|
* cache addressing or connection information, such as a TCP socket
|
2005-06-30 09:50:55 +04:00
|
|
|
* or IB queue pair.
|
|
|
|
*
|
|
|
|
* Progress:
|
|
|
|
*
|
|
|
|
* By default, the library provides for polling based progress of outstanding
|
2006-09-19 11:55:41 +04:00
|
|
|
* requests. The BTL component exports an interface function (btl_progress)
|
2005-06-30 09:50:55 +04:00
|
|
|
* that is called in a polling mode by the PML during calls into the MPI
|
2007-07-25 21:26:23 +04:00
|
|
|
* library. Note that the btl_progress() function is called on the BTL component
|
2005-06-30 09:50:55 +04:00
|
|
|
* rather than each BTL module. This implies that the BTL author is responsible
|
2006-09-19 11:55:41 +04:00
|
|
|
* for iterating over the pending operations in each of the BTL modules associated
|
2005-06-30 09:50:55 +04:00
|
|
|
* with the component.
|
2006-09-19 11:55:41 +04:00
|
|
|
*
|
2005-06-30 09:50:55 +04:00
|
|
|
* On platforms where threading support is provided, the library provides the
|
2006-09-19 11:55:41 +04:00
|
|
|
* option of building with asynchronous threaded progress. In this case, the BTL
|
2005-06-30 09:50:55 +04:00
|
|
|
* author is responsible for providing a thread to progress pending operations.
|
2006-09-19 11:55:41 +04:00
|
|
|
* A thread is associated with the BTL component/module such that transport specific
|
|
|
|
* functionality/APIs may be used to block the thread until a pending operation
|
|
|
|
* completes. This thread MUST NOT poll for completion as this would oversubscribe
|
|
|
|
* the CPU.
|
2005-06-30 09:50:55 +04:00
|
|
|
*
|
|
|
|
* Note that in the threaded case the PML may choose to use a hybrid approach,
|
|
|
|
* such that polling is implemented from the user thread for a fixed number of
|
2006-09-19 11:55:41 +04:00
|
|
|
* cycles before relying on the background thread(s) to complete requests. If
|
|
|
|
* possible the BTL should support the use of both modes concurrently.
|
2005-06-30 09:50:55 +04:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2006-02-12 04:33:29 +03:00
|
|
|
#include "opal/mca/mca.h"
|
2005-06-30 09:50:55 +04:00
|
|
|
|
|
|
|
#ifndef MCA_BTL_H
|
|
|
|
#define MCA_BTL_H
|
|
|
|
|
2006-02-12 04:33:29 +03:00
|
|
|
#include "ompi/types.h"
|
2006-06-14 21:43:50 +04:00
|
|
|
#include "ompi/mca/mpool/mpool.h"
|
2005-06-30 09:50:55 +04:00
|
|
|
|
2007-03-17 02:11:45 +03:00
|
|
|
#include "opal/mca/crs/crs.h"
|
|
|
|
#include "opal/mca/crs/base/base.h"
|
|
|
|
|
2006-08-24 20:38:08 +04:00
|
|
|
#if defined(c_plusplus) || defined(__cplusplus)
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2005-06-30 09:50:55 +04:00
|
|
|
/*
|
|
|
|
* BTL types
|
|
|
|
*/
|
|
|
|
|
|
|
|
struct mca_btl_base_module_t;
|
|
|
|
struct mca_btl_base_endpoint_t;
|
|
|
|
struct mca_btl_base_descriptor_t;
|
|
|
|
struct mca_mpool_base_resources_t;
|
2005-08-12 18:08:40 +04:00
|
|
|
struct ompi_proc_t;
|
2005-06-30 09:50:55 +04:00
|
|
|
|
|
|
|
|
|
|
|
/* send/recv operations require tag matching */
|
|
|
|
typedef uint8_t mca_btl_base_tag_t;
|
|
|
|
|
2007-05-24 23:51:26 +04:00
|
|
|
#define MCA_BTL_NO_ORDER 255
|
|
|
|
|
2005-06-30 09:50:55 +04:00
|
|
|
/* reserved tag values */
|
2006-01-28 18:38:37 +03:00
|
|
|
#define MCA_BTL_TAG_BTL 0
|
|
|
|
#define MCA_BTL_TAG_PML 1
|
2006-08-03 04:10:19 +04:00
|
|
|
#define MCA_BTL_TAG_OSC_RDMA 2
|
2006-01-28 18:38:37 +03:00
|
|
|
#define MCA_BTL_TAG_USR 3
|
|
|
|
#define MCA_BTL_TAG_MAX 255 /* 1 + highest allowed tag num */
|
2005-06-30 09:50:55 +04:00
|
|
|
|
|
|
|
/* prefered protocol */
|
2007-07-12 01:21:40 +04:00
|
|
|
#define MCA_BTL_FLAGS_SEND 0x0001
|
|
|
|
#define MCA_BTL_FLAGS_PUT 0x0002
|
|
|
|
#define MCA_BTL_FLAGS_GET 0x0004
|
2005-09-13 01:38:31 +04:00
|
|
|
#define MCA_BTL_FLAGS_RDMA (MCA_BTL_FLAGS_GET|MCA_BTL_FLAGS_PUT)
|
2005-08-12 20:56:46 +04:00
|
|
|
|
|
|
|
/* btl can send directly from user buffer w/out registration */
|
2007-07-12 01:21:40 +04:00
|
|
|
#define MCA_BTL_FLAGS_SEND_INPLACE 0x0008
|
2005-08-12 20:56:46 +04:00
|
|
|
|
2007-07-25 21:26:23 +04:00
|
|
|
/* btl transport reliability flags - currently used only by the DR PML */
|
2007-07-12 01:21:40 +04:00
|
|
|
#define MCA_BTL_FLAGS_NEED_ACK 0x0010
|
|
|
|
#define MCA_BTL_FLAGS_NEED_CSUM 0x0020
|
|
|
|
|
|
|
|
/** RDMA put/get calls must have a matching prepare_{src,dst} call
|
|
|
|
on the target with the same base (and possibly bound). */
|
|
|
|
#define MCA_BTL_FLAGS_RDMA_MATCHED 0x0040
|
2005-09-13 01:38:31 +04:00
|
|
|
|
2007-05-24 23:51:26 +04:00
|
|
|
/* btl needs local rdma completion */
|
2007-07-12 01:21:40 +04:00
|
|
|
#define MCA_BTL_FLAGS_RDMA_COMPLETION 0x0080
|
2007-05-24 23:51:26 +04:00
|
|
|
|
2005-08-12 20:56:46 +04:00
|
|
|
/* Default exclusivity levels */
|
2007-07-12 01:21:40 +04:00
|
|
|
#define MCA_BTL_EXCLUSIVITY_HIGH (64*1024) /* internal loopback */
|
2005-08-12 20:56:46 +04:00
|
|
|
#define MCA_BTL_EXCLUSIVITY_DEFAULT 1024 /* GM/IB/etc. */
|
|
|
|
#define MCA_BTL_EXCLUSIVITY_LOW 0 /* TCP used as a last resort */
|
2005-06-30 09:50:55 +04:00
|
|
|
|
2006-08-17 00:21:38 +04:00
|
|
|
/* error callback flags */
|
|
|
|
#define MCA_BTL_ERROR_FLAGS_FATAL 0x1
|
2005-06-30 09:50:55 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Asynchronous callback function on completion of an operation.
|
2007-07-25 21:26:23 +04:00
|
|
|
* Completion Semantics: The descriptor can be reused or returned to the
|
|
|
|
* BTL via mca_btl_base_module_free_fn_t. The operation has been queued to
|
|
|
|
* the network device or will otherwise make asynchronous progress without
|
|
|
|
* subsequent calls to btl_progress.
|
|
|
|
*
|
|
|
|
* @param[IN] module the BTL module
|
|
|
|
* @param[IN] endpoint the BTL endpoint
|
|
|
|
* @param[IN] descriptor the BTL descriptor
|
|
|
|
*
|
2005-06-30 09:50:55 +04:00
|
|
|
*/
|
|
|
|
typedef void (*mca_btl_base_completion_fn_t)(
|
2007-07-25 21:26:23 +04:00
|
|
|
struct mca_btl_base_module_t* module,
|
|
|
|
struct mca_btl_base_endpoint_t* endpoint,
|
|
|
|
struct mca_btl_base_descriptor_t* descriptor,
|
2005-06-30 09:50:55 +04:00
|
|
|
int status);
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Describes a region/segment of memory that is addressable
|
|
|
|
* by an BTL.
|
|
|
|
*/
|
|
|
|
|
|
|
|
struct mca_btl_base_segment_t {
|
2007-07-25 21:26:23 +04:00
|
|
|
/** Address of the memory */
|
|
|
|
ompi_ptr_t seg_addr;
|
|
|
|
/** Length in bytes */
|
|
|
|
uint32_t seg_len;
|
2006-12-04 23:11:42 +03:00
|
|
|
#if OMPI_ENABLE_HETEROGENEOUS_SUPPORT
|
2007-07-25 21:26:23 +04:00
|
|
|
/** Heterogeneous padding */
|
|
|
|
uint8_t seg_padding[4];
|
2006-12-04 23:11:42 +03:00
|
|
|
#endif
|
2007-07-25 21:26:23 +04:00
|
|
|
/** Memory segment key required by some RDMA networks */
|
2005-06-30 09:50:55 +04:00
|
|
|
union {
|
|
|
|
uint32_t key32[2];
|
|
|
|
uint64_t key64;
|
|
|
|
uint8_t key8[8];
|
2007-07-25 21:26:23 +04:00
|
|
|
} seg_key;
|
2005-06-30 09:50:55 +04:00
|
|
|
};
|
|
|
|
typedef struct mca_btl_base_segment_t mca_btl_base_segment_t;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* A descriptor that holds the parameters to a send/put/get
|
|
|
|
* operation along w/ a callback routine that is called on
|
|
|
|
* completion of the request.
|
2007-07-25 21:26:23 +04:00
|
|
|
* Note: from the initiator of a PUT operation des_src is the local memory
|
|
|
|
* and des_dst is the remote memory
|
|
|
|
* from the initiator of a GET operations des_dst is the local memory
|
|
|
|
* and des_src is the remote memory
|
|
|
|
* from the initiator of a SEND operation des_src is the local memory
|
|
|
|
* and des_dst is not used
|
2005-06-30 09:50:55 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
struct mca_btl_base_descriptor_t {
|
|
|
|
ompi_free_list_item_t super;
|
2007-07-25 21:26:23 +04:00
|
|
|
mca_btl_base_segment_t *des_src; /**< source segments */
|
|
|
|
size_t des_src_cnt; /**< number of source segments */
|
|
|
|
mca_btl_base_segment_t *des_dst; /**< destination segments */
|
|
|
|
size_t des_dst_cnt; /**< number of destination segments */
|
|
|
|
mca_btl_base_completion_fn_t des_cbfunc; /**< local callback function */
|
|
|
|
void* des_cbdata; /**< opaque callback data */
|
|
|
|
void* des_context; /**< more opaque callback data */
|
|
|
|
int32_t des_flags; /**< hints to BTL */
|
|
|
|
/** order value, this is only
|
|
|
|
valid in the local completion callback
|
|
|
|
and may be used in subsequent calls to
|
|
|
|
btl_alloc, btl_prepare_src/dst to request
|
|
|
|
a descriptor that will be ordered w.r.t.
|
|
|
|
this descriptor
|
|
|
|
*/
|
|
|
|
uint8_t order;
|
2005-06-30 09:50:55 +04:00
|
|
|
};
|
|
|
|
typedef struct mca_btl_base_descriptor_t mca_btl_base_descriptor_t;
|
|
|
|
|
2006-08-24 20:38:08 +04:00
|
|
|
OMPI_DECLSPEC OBJ_CLASS_DECLARATION(mca_btl_base_descriptor_t);
|
2005-06-30 09:50:55 +04:00
|
|
|
|
2007-07-25 21:26:23 +04:00
|
|
|
|
|
|
|
|
2005-06-30 09:50:55 +04:00
|
|
|
#define MCA_BTL_DES_FLAGS_DEREGISTER 0x0001
|
2007-04-27 01:03:38 +04:00
|
|
|
#define MCA_BTL_DES_FLAGS_PRIORITY 0x0002
|
2005-06-30 09:50:55 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Maximum number of allowed segments in src/dst fields of a descriptor.
|
|
|
|
*/
|
|
|
|
#define MCA_BTL_DES_MAX_SEGMENTS 16
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
* BTL base header, stores the tag at a minimum
|
|
|
|
*/
|
|
|
|
struct mca_btl_base_header_t{
|
|
|
|
mca_btl_base_tag_t tag;
|
|
|
|
};
|
|
|
|
typedef struct mca_btl_base_header_t mca_btl_base_header_t;
|
|
|
|
|
2006-02-26 03:45:54 +03:00
|
|
|
#define MCA_BTL_BASE_HEADER_HTON(hdr)
|
|
|
|
#define MCA_BTL_BASE_HEADER_NTOH(hdr)
|
|
|
|
|
2005-06-30 09:50:55 +04:00
|
|
|
/*
|
|
|
|
* BTL component interface functions and datatype.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* MCA->BTL Initializes the BTL component and creates specific BTL
|
|
|
|
* module(s).
|
|
|
|
*
|
|
|
|
* @param num_btls (OUT) Returns the number of btl modules created, or 0
|
|
|
|
* if the transport is not available.
|
|
|
|
*
|
|
|
|
* @param enable_progress_threads (IN) Whether this component is
|
|
|
|
* allowed to run a hidden/progress thread or not.
|
|
|
|
*
|
|
|
|
* @param 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.
|
|
|
|
*
|
|
|
|
* @return Array of pointers to BTL modules, or NULL if the transport
|
|
|
|
* is not available.
|
|
|
|
*
|
|
|
|
* During component initialization, the BTL component should discover
|
|
|
|
* the physical devices that are available for the given transport,
|
|
|
|
* and create a BTL module to represent each device. Any addressing
|
|
|
|
* information required by peers to reach the device should be published
|
2007-07-09 21:16:34 +04:00
|
|
|
* during this function via the ompi_modex_send() interface.
|
2005-06-30 09:50:55 +04:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
typedef struct mca_btl_base_module_t** (*mca_btl_base_component_init_fn_t)(
|
|
|
|
int *num_btls,
|
|
|
|
bool enable_progress_threads,
|
|
|
|
bool enable_mpi_threads
|
|
|
|
);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* MCA->BTL Called to progress outstanding requests for
|
|
|
|
* non-threaded polling environments.
|
|
|
|
*
|
2007-07-25 21:26:23 +04:00
|
|
|
* @return Count of "completions", a metric of
|
|
|
|
* how many items where completed in the call
|
|
|
|
* to progress.
|
2005-06-30 09:50:55 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
typedef int (*mca_btl_base_component_progress_fn_t)(void);
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* BTL component descriptor. Contains component version information
|
|
|
|
* and component open/close/init functions.
|
|
|
|
*/
|
|
|
|
|
2006-08-18 02:02:01 +04:00
|
|
|
struct mca_btl_base_component_1_0_1_t {
|
2005-06-30 09:50:55 +04:00
|
|
|
mca_base_component_t btl_version;
|
|
|
|
mca_base_component_data_1_0_0_t btl_data;
|
|
|
|
mca_btl_base_component_init_fn_t btl_init;
|
|
|
|
mca_btl_base_component_progress_fn_t btl_progress;
|
|
|
|
};
|
2006-08-18 02:02:01 +04:00
|
|
|
typedef struct mca_btl_base_component_1_0_1_t mca_btl_base_component_1_0_1_t;
|
|
|
|
typedef struct mca_btl_base_component_1_0_1_t mca_btl_base_component_t;
|
2005-06-30 09:50:55 +04:00
|
|
|
|
2007-07-25 21:26:23 +04:00
|
|
|
/* add the 1_0_0_t typedef for source compatibility
|
|
|
|
* we can do this safely because 1_0_0 components are the same as
|
2006-08-22 20:25:36 +04:00
|
|
|
* 1_0_1 components, the difference is in the btl module.
|
|
|
|
* Fortunately the only difference in the module is an additional interface
|
|
|
|
* function added to 1_0_1. We can therefore safely treat an older module just
|
|
|
|
* just like the new one so long as we check the component version
|
|
|
|
* prior to invoking the new interface function.
|
|
|
|
*/
|
|
|
|
typedef struct mca_btl_base_component_1_0_1_t mca_btl_base_component_1_0_0_t;
|
|
|
|
|
|
|
|
|
2005-06-30 09:50:55 +04:00
|
|
|
|
|
|
|
/*
|
|
|
|
* BTL module interface functions and datatype.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* MCA->BTL Clean up any resources held by BTL module
|
|
|
|
* before the module is unloaded.
|
|
|
|
*
|
|
|
|
* @param btl (IN) BTL module.
|
2007-07-25 21:26:23 +04:00
|
|
|
* @return OMPI_SUCCESS or error status on failure.
|
2005-06-30 09:50:55 +04:00
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
typedef int (*mca_btl_base_module_finalize_fn_t)(
|
|
|
|
struct mca_btl_base_module_t* btl
|
|
|
|
);
|
|
|
|
|
|
|
|
/**
|
2007-07-25 21:26:23 +04:00
|
|
|
* BML->BTL notification of change in the process list.
|
2005-06-30 09:50:55 +04:00
|
|
|
*
|
|
|
|
* @param btl (IN) BTL module
|
|
|
|
* @param nprocs (IN) Number of processes
|
2007-07-25 21:26:23 +04:00
|
|
|
* @param procs (IN) Array of processes
|
|
|
|
* @param endpoint (OUT) Array of mca_btl_base_endpoint_t structures by BTL.
|
2005-06-30 09:50:55 +04:00
|
|
|
* @param reachable (OUT) Bitmask indicating set of peer processes that are reachable by this BTL.
|
|
|
|
* @return OMPI_SUCCESS or error status on failure.
|
|
|
|
*
|
2007-07-25 21:26:23 +04:00
|
|
|
* The mca_btl_base_module_add_procs_fn_t() is called by the BML to
|
2005-06-30 09:50:55 +04:00
|
|
|
* determine the set of BTLs that should be used to reach each process.
|
2007-07-09 21:16:34 +04:00
|
|
|
* Any addressing information exported by the peer via the ompi_modex_send()
|
2005-06-30 09:50:55 +04:00
|
|
|
* function should be available during this call via the corresponding
|
2007-07-09 21:16:34 +04:00
|
|
|
* ompi_modex_recv() function. The BTL may utilize this information to
|
2005-06-30 09:50:55 +04:00
|
|
|
* determine reachability of each peer process.
|
|
|
|
*
|
|
|
|
* For each process that is reachable by the BTL, the bit corresponding to the index
|
2007-07-25 21:26:23 +04:00
|
|
|
* into the proc array (nprocs) should be set in the reachable bitmask. The BTL
|
|
|
|
* will return an array of pointers to a data structure defined
|
|
|
|
* by the BTL that is then returned to the BTL on subsequent calls to the BTL data
|
2005-06-30 09:50:55 +04:00
|
|
|
* transfer functions (e.g btl_send). This may be used by the BTL to cache any addressing
|
2007-04-27 01:03:38 +04:00
|
|
|
* or connection information (e.g. TCP socket, IB queue pair).
|
2005-06-30 09:50:55 +04:00
|
|
|
*/
|
|
|
|
typedef int (*mca_btl_base_module_add_procs_fn_t)(
|
|
|
|
struct mca_btl_base_module_t* btl,
|
|
|
|
size_t nprocs,
|
|
|
|
struct ompi_proc_t** procs,
|
|
|
|
struct mca_btl_base_endpoint_t** endpoints,
|
|
|
|
struct ompi_bitmap_t* reachable
|
|
|
|
);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Notification of change to the process list.
|
|
|
|
*
|
|
|
|
* @param btl (IN) BTL module
|
|
|
|
* @param nprocs (IN) Number of processes
|
|
|
|
* @param proc (IN) Set of processes
|
|
|
|
* @param peer (IN) Set of peer addressing information.
|
|
|
|
* @return Status indicating if cleanup was successful
|
|
|
|
*
|
2007-07-25 21:26:23 +04:00
|
|
|
* When the process list changes, the BML notifies the BTL of the
|
2005-06-30 09:50:55 +04:00
|
|
|
* change, to provide the opportunity to cleanup or release any
|
|
|
|
* resources associated with the peer.
|
|
|
|
*/
|
|
|
|
typedef int (*mca_btl_base_module_del_procs_fn_t)(
|
|
|
|
struct mca_btl_base_module_t* btl,
|
|
|
|
size_t nprocs,
|
|
|
|
struct ompi_proc_t** procs,
|
2007-04-27 01:03:38 +04:00
|
|
|
struct mca_btl_base_endpoint_t** peer
|
2005-06-30 09:50:55 +04:00
|
|
|
);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Callback function that is called asynchronously on receipt
|
2005-09-13 01:38:31 +04:00
|
|
|
* of data by the transport layer.
|
2007-07-25 21:26:23 +04:00
|
|
|
* Note that the the mca_btl_base_descriptor_t is only valid within the
|
|
|
|
* completion function, this implies that all data payload in the
|
|
|
|
* mca_btl_base_descriptor_t must be copied out within this callback or
|
|
|
|
* forfeited back to the BTL.
|
2005-09-13 01:38:31 +04:00
|
|
|
*
|
2007-07-25 21:26:23 +04:00
|
|
|
* @param[IN] btl BTL module
|
|
|
|
* @param[IN] tag The active message receive callback tag value
|
|
|
|
* @param[IN] descriptor The BTL descriptor (contains the receive payload)
|
|
|
|
* @param[IN] cbdata Opaque callback data
|
2005-06-30 09:50:55 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
typedef void (*mca_btl_base_module_recv_cb_fn_t)(
|
|
|
|
struct mca_btl_base_module_t* btl,
|
|
|
|
mca_btl_base_tag_t tag,
|
|
|
|
mca_btl_base_descriptor_t* descriptor,
|
|
|
|
void* cbdata
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Register a callback function that is called on receipt
|
|
|
|
* of a fragment.
|
|
|
|
*
|
2007-07-25 21:26:23 +04:00
|
|
|
* @param[IN] btl BTL module
|
|
|
|
* @param[IN] tag tag value of this callback
|
|
|
|
* (specified on subsequent send operations)
|
|
|
|
* @param[IN] cbfunc The callback function
|
|
|
|
* @param[IN] cbdata Opaque callback data
|
|
|
|
*
|
|
|
|
* @return OMPI_SUCCESS The callback was registered successfully
|
|
|
|
* @return OMPI_ERROR The callback was NOT registered successfully
|
2005-06-30 09:50:55 +04:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
typedef int (*mca_btl_base_module_register_fn_t)(
|
|
|
|
struct mca_btl_base_module_t* btl,
|
|
|
|
mca_btl_base_tag_t tag,
|
|
|
|
mca_btl_base_module_recv_cb_fn_t cbfunc,
|
|
|
|
void* cbdata
|
|
|
|
);
|
|
|
|
|
|
|
|
|
2006-08-17 00:21:38 +04:00
|
|
|
/**
|
|
|
|
* Callback function that is called asynchronously on receipt
|
|
|
|
* of an error from the transport layer
|
2007-07-25 21:26:23 +04:00
|
|
|
*
|
|
|
|
* @param[IN] btl BTL module
|
|
|
|
* @param[IN] flags type of error
|
2006-08-17 00:21:38 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
typedef void (*mca_btl_base_module_error_cb_fn_t)(
|
|
|
|
struct mca_btl_base_module_t* btl,
|
|
|
|
int32_t flags
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Register a callback function that is called on receipt
|
|
|
|
* of an error.
|
|
|
|
*
|
2007-07-25 21:26:23 +04:00
|
|
|
* @param[IN] btl BTL module
|
|
|
|
* @param[IN] cbfunc The callback function
|
|
|
|
*
|
|
|
|
* @return OMPI_SUCCESS The callback was registered successfully
|
|
|
|
* @return OMPI_ERROR The callback was NOT registered successfully
|
2006-08-17 00:21:38 +04:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
typedef int (*mca_btl_base_module_register_error_fn_t)(
|
|
|
|
struct mca_btl_base_module_t* btl,
|
|
|
|
mca_btl_base_module_error_cb_fn_t cbfunc
|
|
|
|
);
|
|
|
|
|
|
|
|
|
2005-06-30 09:50:55 +04:00
|
|
|
/**
|
|
|
|
* Allocate a descriptor with a segment of the requested size.
|
|
|
|
* Note that the BTL layer may choose to return a smaller size
|
2007-07-25 21:26:23 +04:00
|
|
|
* if it cannot support the request. The order tag value ensures that
|
|
|
|
* operations on the descriptor that is allocated will be
|
|
|
|
* ordered w.r.t. a previous operation on a particular descriptor.
|
|
|
|
* Ordering is only guaranteed if the previous descriptor had its
|
|
|
|
* local completion callback function called and the order tag of
|
|
|
|
* that descriptor is only valid upon the local completion callback function.
|
|
|
|
*
|
2005-06-30 09:50:55 +04:00
|
|
|
*
|
|
|
|
* @param btl (IN) BTL module
|
|
|
|
* @param size (IN) Request segment size.
|
2007-05-24 23:51:26 +04:00
|
|
|
* @param order (IN) The ordering tag (may be MCA_BTL_NO_ORDER)
|
2005-06-30 09:50:55 +04:00
|
|
|
*/
|
2007-05-24 23:51:26 +04:00
|
|
|
|
2005-06-30 09:50:55 +04:00
|
|
|
typedef mca_btl_base_descriptor_t* (*mca_btl_base_module_alloc_fn_t)(
|
|
|
|
struct mca_btl_base_module_t* btl,
|
2007-05-24 23:51:26 +04:00
|
|
|
uint8_t order,
|
2005-06-30 09:50:55 +04:00
|
|
|
size_t size
|
|
|
|
);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Return a descriptor allocated from this BTL via alloc/prepare.
|
2007-07-25 21:26:23 +04:00
|
|
|
* A descriptor can only be deallocated after its local completion
|
|
|
|
* callback function has called for all send/put/get operations.
|
|
|
|
*
|
2005-06-30 09:50:55 +04:00
|
|
|
* @param btl (IN) BTL module
|
|
|
|
* @param segment (IN) Descriptor allocated from the BTL
|
|
|
|
*/
|
|
|
|
typedef int (*mca_btl_base_module_free_fn_t)(
|
|
|
|
struct mca_btl_base_module_t* btl,
|
|
|
|
mca_btl_base_descriptor_t* descriptor
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
2007-07-25 21:26:23 +04:00
|
|
|
* Prepare a descriptor for send/put/get using the supplied
|
2007-04-27 01:03:38 +04:00
|
|
|
* convertor. If the convertor references data that is contiguous,
|
2005-06-30 09:50:55 +04:00
|
|
|
* the descriptor may simply point to the user buffer. Otherwise,
|
|
|
|
* this routine is responsible for allocating buffer space and
|
|
|
|
* packing if required.
|
|
|
|
*
|
2007-07-25 21:26:23 +04:00
|
|
|
* The descriptor returned can be used in multiple concurrent operations
|
|
|
|
* (send/put/get) unless the BTL has the MCA_BTL_FLAGS_RDMA_MATCHED flag set
|
|
|
|
* in which case a corresponding prepare call must accompany the put/get call
|
|
|
|
* in addition, the address and length that is put/get must match the address
|
|
|
|
* and length which is prepared.
|
|
|
|
*
|
|
|
|
* The order tag value ensures that operations on the
|
|
|
|
* descriptor that is prepared will be ordered w.r.t. a previous
|
|
|
|
* operation on a particular descriptor. Ordering is only guaranteed if
|
|
|
|
* the previous descriptor had its local completion callback function
|
|
|
|
* called and the order tag of that descriptor is only valid upon the local
|
|
|
|
* completion callback function.
|
|
|
|
*
|
2005-06-30 09:50:55 +04:00
|
|
|
* @param btl (IN) BTL module
|
|
|
|
* @param endpoint (IN) BTL peer addressing
|
2007-04-27 01:03:38 +04:00
|
|
|
* @param registration (IN) Memory registration
|
2005-06-30 09:50:55 +04:00
|
|
|
* @param convertor (IN) Data type convertor
|
2007-07-25 21:26:23 +04:00
|
|
|
* @param order (IN) The ordering tag (may be MCA_BTL_NO_ORDER)
|
2005-06-30 09:50:55 +04:00
|
|
|
* @param reserve (IN) Additional bytes requested by upper layer to precede user data
|
2007-07-25 21:26:23 +04:00
|
|
|
* @param size (IN/OUT) Number of bytes to prepare (IN),
|
|
|
|
* number of bytes actually prepared (OUT)
|
|
|
|
*
|
2005-06-30 09:50:55 +04:00
|
|
|
*/
|
|
|
|
typedef struct mca_btl_base_descriptor_t* (*mca_btl_base_module_prepare_fn_t)(
|
|
|
|
struct mca_btl_base_module_t* btl,
|
|
|
|
struct mca_btl_base_endpoint_t* endpoint,
|
|
|
|
mca_mpool_base_registration_t* registration,
|
|
|
|
struct ompi_convertor_t* convertor,
|
2007-05-24 23:51:26 +04:00
|
|
|
uint8_t order,
|
2005-06-30 09:50:55 +04:00
|
|
|
size_t reserve,
|
|
|
|
size_t* size
|
|
|
|
);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Initiate an asynchronous send.
|
2007-07-25 21:26:23 +04:00
|
|
|
* Completion Semantics: the descriptor has been queued for a send operation
|
|
|
|
* the BTL now controls the descriptor until local
|
|
|
|
* completion callback is made on the descriptor
|
|
|
|
*
|
|
|
|
* All BTLs allow multiple concurrent asynchronous send operations on a descriptor
|
2005-06-30 09:50:55 +04:00
|
|
|
*
|
|
|
|
* @param btl (IN) BTL module
|
|
|
|
* @param endpoint (IN) BTL addressing information
|
|
|
|
* @param descriptor (IN) Description of the data to be transfered
|
|
|
|
* @param tag (IN) The tag value used to notify the peer.
|
2007-07-25 21:26:23 +04:00
|
|
|
*
|
|
|
|
* @retval OMPI_SUCCESS The descriptor was successfully queued for a send
|
|
|
|
* @retval OMPI_ERROR The descriptor was NOT successfully queued for a send
|
|
|
|
* @retval OMPI_ERR_UNREACH The endpoint is not reachable
|
2005-06-30 09:50:55 +04:00
|
|
|
*/
|
|
|
|
typedef int (*mca_btl_base_module_send_fn_t)(
|
|
|
|
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 an asynchronous put.
|
2007-07-25 21:26:23 +04:00
|
|
|
* Completion Semantics: the descriptor has been queued for a put operation
|
|
|
|
* the BTL now controls the descriptor until local
|
|
|
|
* completion callback is made on the descriptor
|
|
|
|
*
|
|
|
|
* BTLs that do not have the MCA_BTL_FLAGS_RDMA_MATCHED flag set
|
|
|
|
* allow multiple concurrent put operations on the same descriptor.
|
|
|
|
* BTLs that do have the MCA_BTL_FLAGS_RDMA_MATCHED flag set require
|
|
|
|
* a corresponding prepare_src/dst call for each put operation and
|
|
|
|
* therefore prohibit multiple concurrent put operations.
|
|
|
|
*
|
2005-06-30 09:50:55 +04:00
|
|
|
* @param btl (IN) BTL module
|
|
|
|
* @param endpoint (IN) BTL addressing information
|
|
|
|
* @param descriptor (IN) Description of the data to be transferred
|
2007-07-25 21:26:23 +04:00
|
|
|
*
|
|
|
|
* @retval OMPI_SUCCESS The descriptor was successfully queued for a put
|
|
|
|
* @retval OMPI_ERROR The descriptor was NOT successfully queued for a put
|
2005-06-30 09:50:55 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
typedef int (*mca_btl_base_module_put_fn_t)(
|
|
|
|
struct mca_btl_base_module_t* btl,
|
|
|
|
struct mca_btl_base_endpoint_t* endpoint,
|
|
|
|
struct mca_btl_base_descriptor_t* descriptor
|
|
|
|
);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Initiate an asynchronous get.
|
|
|
|
*
|
2007-07-25 21:26:23 +04:00
|
|
|
* Completion Semantics: the descriptor has been queued for a get operation
|
|
|
|
* the BTL now controls the descriptor until local
|
|
|
|
* completion callback is made on the descriptor
|
|
|
|
*
|
|
|
|
* BTLs that do not have the MCA_BTL_FLAGS_RDMA_MATCHED flag set
|
|
|
|
* allow multiple concurrent get operations on the same descriptor.
|
|
|
|
* BTLs that do have the MCA_BTL_FLAGS_RDMA_MATCHED flag set require
|
|
|
|
* a corresponding prepare_src/dst call for each get operation and
|
|
|
|
* therefore prohibit multiple concurrent get operations.
|
|
|
|
*
|
2005-06-30 09:50:55 +04:00
|
|
|
* @param btl (IN) BTL module
|
|
|
|
* @param endpoint (IN) BTL addressing information
|
|
|
|
* @param descriptor (IN) Description of the data to be transferred
|
2007-07-25 21:26:23 +04:00
|
|
|
*
|
|
|
|
* @retval OMPI_SUCCESS The descriptor was successfully queued for a get
|
|
|
|
* @retval OMPI_ERROR The descriptor was NOT successfully queued for a get
|
2005-06-30 09:50:55 +04:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
typedef int (*mca_btl_base_module_get_fn_t)(
|
|
|
|
struct mca_btl_base_module_t* btl,
|
|
|
|
struct mca_btl_base_endpoint_t* endpoint,
|
|
|
|
struct mca_btl_base_descriptor_t* descriptor
|
|
|
|
);
|
|
|
|
|
|
|
|
|
2006-03-17 20:39:41 +03:00
|
|
|
/**
|
|
|
|
* Diagnostic dump of btl state.
|
|
|
|
*
|
|
|
|
* @param btl (IN) BTL module
|
2007-07-25 21:26:23 +04:00
|
|
|
* @param endpoint (IN) BTL endpoint
|
|
|
|
* @param verbose (IN) Verbosity level
|
2006-03-17 20:39:41 +03:00
|
|
|
*/
|
|
|
|
|
|
|
|
typedef void (*mca_btl_base_module_dump_fn_t)(
|
2006-03-17 21:46:48 +03:00
|
|
|
struct mca_btl_base_module_t* btl,
|
|
|
|
struct mca_btl_base_endpoint_t* endpoint,
|
|
|
|
int verbose
|
2006-03-17 20:39:41 +03:00
|
|
|
);
|
|
|
|
|
2007-03-17 02:11:45 +03:00
|
|
|
/**
|
|
|
|
* Fault Tolerance Event Notification Function
|
|
|
|
* @param state Checkpoint Status
|
|
|
|
* @return OMPI_SUCCESS or failure status
|
|
|
|
*/
|
|
|
|
typedef int (*mca_btl_base_module_ft_event_fn_t)(int state);
|
2006-03-17 20:39:41 +03:00
|
|
|
|
2005-06-30 09:50:55 +04:00
|
|
|
/**
|
|
|
|
* BTL module interface functions and attributes.
|
|
|
|
*/
|
|
|
|
struct mca_btl_base_module_t {
|
|
|
|
|
|
|
|
/* BTL common attributes */
|
|
|
|
mca_btl_base_component_t* btl_component; /**< pointer back to the BTL component structure */
|
|
|
|
size_t btl_eager_limit; /**< maximum size of first fragment -- eager send */
|
|
|
|
size_t btl_min_send_size; /**< threshold below which the BTL should not fragment */
|
|
|
|
size_t btl_max_send_size; /**< maximum send fragment size supported by the BTL */
|
2007-06-21 11:12:40 +04:00
|
|
|
size_t btl_rdma_pipeline_send_length; /**< amount of bytes that should be send by pipeline protocol */
|
2007-05-17 11:54:27 +04:00
|
|
|
size_t btl_rdma_pipeline_frag_size; /**< maximum rdma fragment size supported by the BTL */
|
|
|
|
size_t btl_min_rdma_pipeline_size; /**< minimum packet size for pipeline protocol */
|
2005-06-30 09:50:55 +04:00
|
|
|
uint32_t btl_exclusivity; /**< indicates this BTL should be used exclusively */
|
|
|
|
uint32_t btl_latency; /**< relative ranking of latency used to prioritize btls */
|
|
|
|
uint32_t btl_bandwidth; /**< bandwidth (Mbytes/sec) supported by each endpoint */
|
|
|
|
uint32_t btl_flags; /**< flags (put/get...) */
|
|
|
|
|
|
|
|
/* BTL function table */
|
2006-08-17 00:21:38 +04:00
|
|
|
mca_btl_base_module_add_procs_fn_t btl_add_procs;
|
|
|
|
mca_btl_base_module_del_procs_fn_t btl_del_procs;
|
|
|
|
mca_btl_base_module_register_fn_t btl_register;
|
|
|
|
mca_btl_base_module_finalize_fn_t btl_finalize;
|
2005-06-30 09:50:55 +04:00
|
|
|
|
|
|
|
mca_btl_base_module_alloc_fn_t btl_alloc;
|
|
|
|
mca_btl_base_module_free_fn_t btl_free;
|
|
|
|
mca_btl_base_module_prepare_fn_t btl_prepare_src;
|
|
|
|
mca_btl_base_module_prepare_fn_t btl_prepare_dst;
|
|
|
|
mca_btl_base_module_send_fn_t btl_send;
|
|
|
|
mca_btl_base_module_put_fn_t btl_put;
|
|
|
|
mca_btl_base_module_get_fn_t btl_get;
|
2007-07-25 21:26:23 +04:00
|
|
|
mca_btl_base_module_dump_fn_t btl_dump;
|
2006-08-18 02:02:01 +04:00
|
|
|
|
2007-07-25 21:26:23 +04:00
|
|
|
/** the mpool associated with this btl (optional) */
|
2005-09-13 02:28:23 +04:00
|
|
|
mca_mpool_base_module_t* btl_mpool;
|
2007-07-25 21:26:23 +04:00
|
|
|
/** register a default error handler */
|
2006-08-18 02:02:01 +04:00
|
|
|
mca_btl_base_module_register_error_fn_t btl_register_error;
|
2007-07-25 21:26:23 +04:00
|
|
|
/** fault tolerant even notification */
|
2007-03-17 02:11:45 +03:00
|
|
|
mca_btl_base_module_ft_event_fn_t btl_ft_event;
|
2005-06-30 09:50:55 +04:00
|
|
|
};
|
|
|
|
typedef struct mca_btl_base_module_t mca_btl_base_module_t;
|
|
|
|
|
|
|
|
/*
|
2006-08-22 20:25:36 +04:00
|
|
|
* Macro for use in modules that are of type btl v1.0.1
|
2005-06-30 09:50:55 +04:00
|
|
|
*/
|
2006-08-18 02:02:01 +04:00
|
|
|
#define MCA_BTL_BASE_VERSION_1_0_1 \
|
2005-06-30 09:50:55 +04:00
|
|
|
/* coll v1.0 is chained to MCA v1.0 */ \
|
|
|
|
MCA_BASE_VERSION_1_0_0, \
|
|
|
|
/* btl v1.0 */ \
|
2006-08-18 02:02:01 +04:00
|
|
|
"btl", 1, 0, 1
|
2005-06-30 09:50:55 +04:00
|
|
|
|
2006-08-22 20:25:36 +04:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Macro for use in modules that are of type btl v1.0.0
|
|
|
|
* alows older btl sources to compile..
|
|
|
|
*/
|
|
|
|
#define MCA_BTL_BASE_VERSION_1_0_0 \
|
|
|
|
/* coll v1.0 is chained to MCA v1.0 */ \
|
|
|
|
MCA_BASE_VERSION_1_0_0, \
|
|
|
|
/* btl v1.0 */ \
|
|
|
|
"btl", 1, 0, 0
|
|
|
|
|
2006-08-24 20:38:08 +04:00
|
|
|
#if defined(c_plusplus) || defined(__cplusplus)
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2005-06-30 09:50:55 +04:00
|
|
|
#endif /* OMPI_MCA_BTL_H */
|