2004-01-09 06:26:12 +03:00
|
|
|
/*
|
|
|
|
* $HEADER$
|
|
|
|
*/
|
2004-03-26 17:15:20 +03:00
|
|
|
/**
|
|
|
|
* @file
|
|
|
|
*
|
2004-01-14 06:42:02 +03:00
|
|
|
* P2P Transport Layer (PTL)
|
2004-03-26 17:15:20 +03:00
|
|
|
*
|
2004-08-02 04:24:22 +04:00
|
|
|
* An MCA component type that allows the PML (mca_pml_t) to support a
|
|
|
|
* variety of network transports concurrently. The PTL layer is
|
|
|
|
* responsible for the reliable delivery of message fragments, while
|
|
|
|
* the assignment and scheduling of fragments to PTLs is handled by
|
|
|
|
* the upper layer.
|
2004-03-26 17:15:20 +03:00
|
|
|
*
|
|
|
|
* PTL Initialization:
|
|
|
|
*
|
2004-08-02 04:24:22 +04:00
|
|
|
* During library initialization, all available PTL components are
|
|
|
|
* loaded and opened via their mca_base_open_component_fn_t
|
|
|
|
* function. If possible, the component should load and open
|
|
|
|
* regardless of wether the transport is available. This allows
|
|
|
|
* parameters used by the component to be reported on by tools such as
|
|
|
|
* ompi_info.
|
2004-03-26 17:15:20 +03:00
|
|
|
*
|
2004-08-02 04:24:22 +04:00
|
|
|
* The mca_ptl_base_component_init_fn_t() is then called for each of the
|
|
|
|
* components that are succesfully opened. The component init function may
|
|
|
|
* return either:
|
2004-03-26 17:15:20 +03:00
|
|
|
*
|
|
|
|
* (1) a NULL list of PTL instances if the transport is not available,
|
|
|
|
* (2) a list containing a single PTL instance, where the PTL provides
|
|
|
|
* a layer of abstraction over multiple physical devices (e.g. NICs),
|
|
|
|
* (3) a list containing multiple PTL instances where each PTL instance
|
|
|
|
* corresponds to a single physical device.
|
|
|
|
*
|
2004-08-02 04:24:22 +04:00
|
|
|
* If multiple network devices are available for a given transport,
|
|
|
|
* the preferred approach is (3) above. In this case, the PML layer
|
|
|
|
* will handle scheduling across the available resources, and
|
|
|
|
* fail-over in the event of a PTL failure. If the second approach is
|
|
|
|
* used, and a single PTL instance abstracts multiple physical
|
|
|
|
* devices, the PTL assumes all responsibility for scheduling/failover
|
2004-03-26 17:15:20 +03:00
|
|
|
* within those devices.
|
|
|
|
*
|
2004-08-02 04:24:22 +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
|
|
|
|
* mca_base_modex_send() interface. Note that peer information will
|
|
|
|
* not be available via mca_base_modex_recv() during the module's init
|
|
|
|
* function. However, it is guaranteed to be available during PTL
|
|
|
|
* selection.
|
2004-03-26 17:15:20 +03:00
|
|
|
*
|
|
|
|
* PTL Selection:
|
|
|
|
*
|
2004-08-02 04:24:22 +04:00
|
|
|
* The PML maintains a list of available PTL instances, sorted by
|
|
|
|
* their exclusivity ranking. This is a relative ranking that is used
|
|
|
|
* to select the set of PTLs that may be used to reach a given
|
|
|
|
* destination. The PTL modules are queried via their
|
|
|
|
* mca_ptl_base_add_proc_fn_t() to determine if they are able to reach
|
|
|
|
* a given destination. The first PTL module that returns success is
|
|
|
|
* selected. Subsequent PTL modules are queried only if they are at
|
|
|
|
* the same exclusivity ranking.
|
2004-03-26 17:15:20 +03:00
|
|
|
*
|
|
|
|
* An example of how this might be used:
|
|
|
|
*
|
|
|
|
* PTL 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
|
|
|
|
*
|
2004-08-02 04:24:22 +04:00
|
|
|
* When a PTL module is selected, it may choose to optionally return a
|
|
|
|
* pointer to an an mca_ptl_base_peer_t data structure to the
|
|
|
|
* PML. This pointer is cached by the PML and returned to the PTL on
|
|
|
|
* subsequent data transfer calls to this specific process. The
|
|
|
|
* actual contents of the data structure are defined on a per PTL
|
|
|
|
* basis, and are typically used to cache addressing or connection
|
|
|
|
* information, such as the TCP socket used by the TCP PTL.
|
2004-03-26 17:15:20 +03:00
|
|
|
*
|
|
|
|
* Send Path:
|
|
|
|
*
|
2004-08-02 04:24:22 +04:00
|
|
|
* When multiple PTLs are available to reach a given destination, a
|
|
|
|
* single request (that is large enough) will be split across the
|
|
|
|
* available PTLs. The PML scheduler will determine the PTL to use for
|
|
|
|
* the first fragment based on the relative latency ranking exported
|
|
|
|
* by the PTLs.
|
|
|
|
*
|
|
|
|
* To minimize latency, and allow for derived types of the
|
|
|
|
* mca_pml_base_send_request_t, the PML will call the selected PTLs
|
|
|
|
* ptl_request_alloc() method to allocate the send request
|
|
|
|
* descriptor. The PTL should return a derived type of
|
|
|
|
* mca_pml_base_send_request_t, that contains space for both the base
|
|
|
|
* send request and initial fragment descriptor
|
|
|
|
* (mca_ptl_base_send_frag_t or derived type). This approach allows
|
|
|
|
* all of the descriptors required to initiate the send to be
|
|
|
|
* allocated from a free list in a single operation.
|
|
|
|
*
|
|
|
|
* When the request is started, the PML will call the selected PTL's
|
|
|
|
* ptl_send() method with up to ptl_first_frag_size bytes of the
|
|
|
|
* request. The PTL should attempt to deliver up to the requested
|
|
|
|
* number of bytes. The number of bytes actually fragmented and queued
|
|
|
|
* for delivery must be updated on the send request to reflect the
|
|
|
|
* current offset into the send buffer.
|
|
|
|
*
|
|
|
|
* If the request is larger than ptl_first_frag_size, the remainder of
|
|
|
|
* the request will be scheduled across potentially multiple PTLs,
|
|
|
|
* upon an acknowledgment from the peer that the request has been
|
|
|
|
* matched on the receive side. The PTL must defer calling
|
|
|
|
* ptl_send_progress() on the initial fragment until an acknowledment
|
|
|
|
* is received, as this signals to the PML that the remaining
|
|
|
|
* fragments may be scheduled. For further detail on the scheduling
|
|
|
|
* algorithm, refer to the PML (mca_pml_t) documentation.
|
|
|
|
*
|
|
|
|
* As subsequent fragments are completed by the PTLs, the
|
|
|
|
* ptl_send_progress() method should be called to update the status of
|
|
|
|
* the send request. Note that each PTL is responsible for managing
|
|
|
|
* the resources associated with send fragments and their allocation
|
|
|
|
* from and return to internal caches/free lists.
|
2004-03-26 17:15:20 +03:00
|
|
|
*
|
|
|
|
* Recv Path:
|
|
|
|
*
|
2004-08-02 04:24:22 +04:00
|
|
|
* The first fragment of a message is sent with a header type of
|
|
|
|
* mca_ptl_base_match_header_t. When a header of this type is
|
|
|
|
* received, to minimize latency the PTL should call the ptl_match()
|
|
|
|
* method as soon as entire header is available, potentially prior to
|
|
|
|
* receiving any data associated with the first fragment. If a match
|
|
|
|
* is made, the PML will call the ptl_matched() method of the
|
|
|
|
* fragments PTL.
|
|
|
|
*
|
|
|
|
* The ptl_matched() method should generate, if required, an ack to
|
|
|
|
* the source process. An ack is required if the
|
|
|
|
* MCA_PTL_FLAGS_ACK_MATCHED bit is set by the source in the initial
|
|
|
|
* message header. The ack should contain a pointer to the matched
|
|
|
|
* request, along with the pointer to the orignal send fragment
|
|
|
|
* contained in the initial message header.
|
|
|
|
*
|
|
|
|
* On receipt of the ack, the source will schedule any remaining
|
|
|
|
* fragments. The selected PTLs should generate the remaining
|
|
|
|
* fragments with an mca_ptl_base_frag_header_t, which contains a
|
|
|
|
* placeholder for a pointer to the matched receive request. This
|
|
|
|
* allows the receiver to avoid calling the matching logic for
|
|
|
|
* subsequent fragments. As fragments are completed, each PTL calls
|
|
|
|
* their ptl_recv_progress() method to update the PML with the request
|
2004-03-26 17:15:20 +03:00
|
|
|
* status.
|
2004-01-14 06:42:02 +03:00
|
|
|
*/
|
2004-03-26 17:15:20 +03:00
|
|
|
|
2004-01-29 05:49:32 +03:00
|
|
|
#ifndef MCA_PTL_H
|
|
|
|
#define MCA_PTL_H
|
2004-01-09 06:26:12 +03:00
|
|
|
|
|
|
|
#include "mca/mca.h"
|
2004-06-07 19:33:53 +04:00
|
|
|
#include "include/ompi.h"
|
|
|
|
#include "class/ompi_list.h"
|
2004-03-17 21:45:16 +03:00
|
|
|
#include "proc/proc.h"
|
|
|
|
#include "mca/pml/pml.h"
|
2004-01-09 06:26:12 +03:00
|
|
|
|
2004-01-12 22:17:09 +03:00
|
|
|
/*
|
2004-01-14 06:42:02 +03:00
|
|
|
* PTL types
|
2004-01-12 22:17:09 +03:00
|
|
|
*/
|
|
|
|
|
2004-08-02 04:24:22 +04:00
|
|
|
struct mca_ptl_base_module_t;
|
2004-02-05 03:50:37 +03:00
|
|
|
struct mca_ptl_base_peer_t;
|
2004-01-14 06:42:02 +03:00
|
|
|
struct mca_ptl_base_fragment_t;
|
2004-06-24 23:28:30 +04:00
|
|
|
struct mca_pml_base_recv_request_t;
|
|
|
|
struct mca_pml_base_send_request_t;
|
2004-02-04 00:33:29 +03:00
|
|
|
struct mca_ptl_base_recv_frag_t;
|
2004-02-10 19:53:41 +03:00
|
|
|
struct mca_ptl_base_send_frag_t;
|
2004-02-12 23:55:10 +03:00
|
|
|
struct mca_ptl_base_match_header_t;
|
2004-01-14 06:42:02 +03:00
|
|
|
|
2004-04-12 19:39:15 +04:00
|
|
|
typedef uint64_t mca_ptl_sequence_t;
|
|
|
|
typedef uint64_t mca_ptl_tstamp_t;
|
2004-06-07 19:33:53 +04:00
|
|
|
typedef ompi_list_t mca_ptl_queue_t;
|
2004-04-12 19:39:15 +04:00
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
MCA_PTL_ENABLE
|
|
|
|
} mca_ptl_control_t;
|
2004-01-14 06:42:02 +03:00
|
|
|
|
2004-05-20 17:45:34 +04:00
|
|
|
/**
|
|
|
|
* PTL flags
|
|
|
|
*/
|
|
|
|
#define MCA_PTL_PUT 1
|
|
|
|
#define MCA_PTL_GET 2
|
|
|
|
|
2004-01-14 18:18:14 +03:00
|
|
|
/*
|
2004-08-02 04:24:22 +04:00
|
|
|
* PTL component interface functions and datatype.
|
2004-01-14 18:18:14 +03:00
|
|
|
*/
|
|
|
|
|
2004-01-14 06:42:02 +03:00
|
|
|
/**
|
2004-08-02 04:24:22 +04:00
|
|
|
* MCA->PTL Intializes the PTL component and creates specific PTL
|
|
|
|
* module(s).
|
2004-01-14 06:42:02 +03:00
|
|
|
*
|
2004-03-26 17:15:20 +03:00
|
|
|
* @param num_ptls (OUT) Returns the number of ptl instances created, or 0
|
|
|
|
* if the transport is not available.
|
2004-01-31 02:02:39 +03:00
|
|
|
*
|
2004-08-02 04:24:22 +04:00
|
|
|
* @param allow_multi_user_threads (OUT) Whether this component can
|
|
|
|
* run at MPI_THREAD_MULTIPLE or not.
|
2004-01-31 02:02:39 +03:00
|
|
|
*
|
2004-08-02 04:24:22 +04:00
|
|
|
* @param have_hidden_threads (OUT) Whether this component may use
|
2004-01-31 02:02:39 +03:00
|
|
|
* hidden threads (e.g., progress threads) or not.
|
|
|
|
*
|
2004-08-02 04:24:22 +04:00
|
|
|
* @return Array of pointers to PTL modules, or NULL if the transport
|
2004-03-26 17:15:20 +03:00
|
|
|
* is not available.
|
|
|
|
*
|
2004-08-02 04:24:22 +04:00
|
|
|
* During component initialization, the PTL component should discover
|
|
|
|
* the physical devices that are available for the given transport,
|
|
|
|
* and a PTL instance created to represent each available device. Any
|
|
|
|
* addressing information required by peers to reach the available
|
|
|
|
* devices should be published during the component init via the
|
|
|
|
* mca_base_modex_send() interface.
|
2004-01-09 06:26:12 +03:00
|
|
|
*/
|
2004-08-02 04:24:22 +04:00
|
|
|
typedef struct mca_ptl_base_module_t** (*mca_ptl_base_component_init_fn_t)(
|
2004-01-31 02:02:39 +03:00
|
|
|
int *num_ptls,
|
|
|
|
bool *allow_multi_user_threads,
|
|
|
|
bool *have_hidden_threads
|
2004-01-14 06:42:02 +03:00
|
|
|
);
|
|
|
|
|
2004-04-12 19:39:15 +04:00
|
|
|
|
|
|
|
/**
|
2004-08-02 04:24:22 +04:00
|
|
|
* MCA->PTL Called to dynamically change a component parameter.
|
2004-04-12 19:39:15 +04:00
|
|
|
*
|
|
|
|
* @param flag (IN) Parameter to change.
|
|
|
|
* @param value (IN) Optional parameter value.
|
|
|
|
*
|
2004-06-07 19:33:53 +04:00
|
|
|
* @return OMPI_SUCCESS or error code on failure.
|
2004-04-12 19:39:15 +04:00
|
|
|
*/
|
2004-08-02 04:24:22 +04:00
|
|
|
typedef int (*mca_ptl_base_component_control_fn_t)(
|
2004-04-12 19:39:15 +04:00
|
|
|
int param,
|
|
|
|
void* value,
|
|
|
|
size_t size
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* MCA->PTL Called to progress outstanding requests for
|
|
|
|
* non-threaded polling environments.
|
|
|
|
*
|
|
|
|
* @param tstamp Current time.
|
2004-06-07 19:33:53 +04:00
|
|
|
* @return OMPI_SUCCESS or error code on failure.
|
2004-04-12 19:39:15 +04:00
|
|
|
*/
|
2004-08-02 04:24:22 +04:00
|
|
|
typedef int (*mca_ptl_base_component_progress_fn_t)(
|
2004-04-12 19:39:15 +04:00
|
|
|
mca_ptl_tstamp_t tstamp
|
|
|
|
);
|
|
|
|
|
2004-08-02 04:24:22 +04:00
|
|
|
|
2004-01-14 18:18:14 +03:00
|
|
|
/**
|
2004-08-02 04:24:22 +04:00
|
|
|
* PTL component descriptor. Contains component version information
|
|
|
|
* and component open/close/init functions.
|
2004-01-14 18:18:14 +03:00
|
|
|
*/
|
|
|
|
|
2004-08-02 04:24:22 +04:00
|
|
|
struct mca_ptl_base_component_1_0_0_t {
|
|
|
|
mca_base_component_t ptlm_version;
|
|
|
|
mca_base_component_data_1_0_0_t ptlm_data;
|
|
|
|
|
|
|
|
mca_ptl_base_component_init_fn_t ptlm_init;
|
|
|
|
mca_ptl_base_component_control_fn_t ptlm_control;
|
|
|
|
mca_ptl_base_component_progress_fn_t ptlm_progress;
|
2004-01-14 18:18:14 +03:00
|
|
|
};
|
2004-08-02 04:24:22 +04:00
|
|
|
typedef struct mca_ptl_base_component_1_0_0_t mca_ptl_base_component_1_0_0_t;
|
|
|
|
typedef struct mca_ptl_base_component_1_0_0_t mca_ptl_base_component_t;
|
2004-01-14 18:18:14 +03:00
|
|
|
|
|
|
|
|
|
|
|
/*
|
2004-03-26 17:15:20 +03:00
|
|
|
* PTL instance interface functions and datatype.
|
2004-01-14 18:18:14 +03:00
|
|
|
*/
|
|
|
|
|
2004-03-26 17:15:20 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* MCA->PTL Clean up any resources held by PTL instance before the
|
|
|
|
* module is unloaded.
|
|
|
|
*
|
|
|
|
* @param ptl (IN) PTL instance.
|
|
|
|
*
|
|
|
|
* Prior to unloading a PTL module, the MCA framework will call the PTL
|
|
|
|
* finalize method for each PTL instance.
|
|
|
|
*
|
|
|
|
*/
|
2004-08-02 04:24:22 +04:00
|
|
|
typedef int (*mca_ptl_base_module_finalize_fn_t)(
|
|
|
|
struct mca_ptl_base_module_t* ptl
|
2004-03-26 17:15:20 +03:00
|
|
|
);
|
|
|
|
|
2004-01-14 06:42:02 +03:00
|
|
|
/**
|
2004-03-26 17:15:20 +03:00
|
|
|
* PML->PTL notification of change in the process list.
|
|
|
|
*
|
2004-06-04 02:13:01 +04:00
|
|
|
* @param ptl (IN) PTL instance
|
|
|
|
* @param nprocs (IN) Number of processes
|
|
|
|
* @param procs (IN) Set of processes
|
|
|
|
* @param peer (OUT) Set of (optional) mca_ptl_base_peer_t instances returned by PTL.
|
|
|
|
* @param reachable (IN/OUT) Bitmask indicating set of peer processes that are reachable by this PTL.
|
2004-06-07 19:33:53 +04:00
|
|
|
* @return OMPI_SUCCESS or error status on failure.
|
2004-06-04 02:13:01 +04:00
|
|
|
*
|
2004-08-02 04:24:22 +04:00
|
|
|
* The mca_ptl_base_module_add_procs_fn_t() is called by the PML to determine
|
2004-03-26 17:15:20 +03:00
|
|
|
* the set of PTLs that should be used to reach the specified process.
|
2004-06-07 19:33:53 +04:00
|
|
|
* A return value of OMPI_SUCCESS indicates the PTL should be added to the
|
2004-03-26 17:15:20 +03:00
|
|
|
* set used to reach the proc. The peers addressing information may be
|
|
|
|
* obtained by the PTL via the mca_base_modex_recv() function if required.
|
|
|
|
* The PTL may optionally return a pointer to a mca_ptl_base_peer_t data
|
|
|
|
* structure, to cache peer addressing or connection information.
|
2004-01-09 06:26:12 +03:00
|
|
|
*/
|
2004-08-02 04:24:22 +04:00
|
|
|
typedef int (*mca_ptl_base_module_add_procs_fn_t)(
|
|
|
|
struct mca_ptl_base_module_t* ptl,
|
2004-06-04 02:13:01 +04:00
|
|
|
size_t nprocs,
|
2004-06-07 19:33:53 +04:00
|
|
|
struct ompi_proc_t** procs,
|
2004-06-04 02:13:01 +04:00
|
|
|
struct mca_ptl_base_peer_t** peer,
|
2004-06-07 19:33:53 +04:00
|
|
|
ompi_bitmap_t* reachable
|
2004-01-14 06:42:02 +03:00
|
|
|
);
|
|
|
|
|
2004-01-15 22:51:06 +03:00
|
|
|
/**
|
2004-03-26 17:15:20 +03:00
|
|
|
* PML->PTL notification of change in the process list.
|
2004-01-15 22:51:06 +03:00
|
|
|
*
|
2004-03-26 17:15:20 +03:00
|
|
|
* @param ptl (IN) PTL instance
|
2004-06-04 02:13:01 +04:00
|
|
|
* @param nprocs (IN) Number of processes
|
|
|
|
* @param proc (IN) Set of processes
|
|
|
|
* @param peer (IN) Set of peer addressing information.
|
2004-03-26 17:15:20 +03:00
|
|
|
* @return Status indicating if cleanup was successful
|
|
|
|
*
|
|
|
|
* If the process list shrinks, the PML will notify the PTL of the
|
|
|
|
* change. Peer addressing information cached by the PML is provided
|
|
|
|
* for cleanup by the PTL.
|
2004-01-15 22:51:06 +03:00
|
|
|
*/
|
2004-08-02 04:24:22 +04:00
|
|
|
typedef int (*mca_ptl_base_module_del_procs_fn_t)(
|
|
|
|
struct mca_ptl_base_module_t* ptl,
|
2004-06-04 02:13:01 +04:00
|
|
|
size_t nprocs,
|
2004-06-07 19:33:53 +04:00
|
|
|
struct ompi_proc_t** procs,
|
2004-06-04 02:13:01 +04:00
|
|
|
struct mca_ptl_base_peer_t**
|
2004-01-15 22:51:06 +03:00
|
|
|
);
|
|
|
|
|
2004-01-14 06:42:02 +03:00
|
|
|
/**
|
2004-07-15 22:08:20 +04:00
|
|
|
* PML->PTL Initialize a send request for use by the PTL.
|
2004-03-26 17:15:20 +03:00
|
|
|
*
|
|
|
|
* @param ptl (IN) PTL instance
|
2004-08-03 01:24:00 +04:00
|
|
|
* @param request (IN) Pointer to allocated request.
|
2004-03-26 17:15:20 +03:00
|
|
|
*
|
2004-07-15 22:08:20 +04:00
|
|
|
* To reduce latency (number of required allocations), the PML allocates additional
|
|
|
|
* space along w/ each request - that may be used by the PTL for additional control
|
2004-08-03 01:24:00 +04:00
|
|
|
* information (e.g. first fragment descriptor). If the PTL intends to use this space
|
|
|
|
* the ptl_cache_bytes attributes should be set to reflect the number of bytes needed
|
|
|
|
* by the PTL on a per-request basis. This space is allocated contiguously along with
|
|
|
|
* the mca_pml_base_send_request_t, w/ the space available to the PTL immediately
|
|
|
|
* following the request.
|
2004-07-15 22:08:20 +04:00
|
|
|
*
|
|
|
|
* The init function is called the first time the request is ued by the PTL. On
|
|
|
|
* completion of the request - the PML will cache the request for later use by the
|
|
|
|
* same PTL. When the request is re-used from the cache, the init function is NOT
|
2004-08-03 01:24:00 +04:00
|
|
|
* called for subsequent sends.
|
2004-01-14 06:42:02 +03:00
|
|
|
*/
|
2004-08-02 04:24:22 +04:00
|
|
|
typedef int (*mca_ptl_base_module_request_init_fn_t)(
|
|
|
|
struct mca_ptl_base_module_t* ptl,
|
2004-07-15 22:08:20 +04:00
|
|
|
struct mca_pml_base_send_request_t* request
|
2004-01-29 22:27:39 +03:00
|
|
|
);
|
|
|
|
|
2004-07-15 22:08:20 +04:00
|
|
|
|
2004-03-26 17:15:20 +03:00
|
|
|
/**
|
2004-07-15 22:08:20 +04:00
|
|
|
* PML->PTL Cleanup any resources that may have been associated with the
|
|
|
|
* request by the PTL.
|
2004-03-26 17:15:20 +03:00
|
|
|
*
|
|
|
|
* @param ptl (IN) PTL instance
|
2004-08-03 01:24:00 +04:00
|
|
|
* @param request (IN) Pointer to allocated request.
|
2004-03-26 17:15:20 +03:00
|
|
|
*
|
2004-07-15 22:08:20 +04:00
|
|
|
* The fini function is called when the PML removes a request from the PTLs
|
2004-08-03 01:24:00 +04:00
|
|
|
* cache (due to resource constraints) or the cache limit has been reached, prior
|
|
|
|
* to re-using the request for another PTL. This provides the PTL the chance to
|
|
|
|
* cleanup/release any resources cached on the send descriptor by the PTL.
|
2004-03-26 17:15:20 +03:00
|
|
|
*/
|
2004-07-15 22:08:20 +04:00
|
|
|
|
2004-08-02 04:24:22 +04:00
|
|
|
typedef void (*mca_ptl_base_module_request_fini_fn_t)(
|
|
|
|
struct mca_ptl_base_module_t* ptl,
|
2004-06-24 23:28:30 +04:00
|
|
|
struct mca_pml_base_send_request_t* request
|
2004-01-14 06:42:02 +03:00
|
|
|
);
|
|
|
|
|
2004-03-26 17:15:20 +03:00
|
|
|
/**
|
2004-07-15 22:08:20 +04:00
|
|
|
* PML->PTL Initiate a send to the peer.
|
|
|
|
*
|
|
|
|
* @param ptl (IN) PTL instance
|
|
|
|
* @param ptl_base_peer (IN) PTL peer addressing
|
|
|
|
* @param request (IN) Send request
|
|
|
|
* @param offset Current offset into packed/contiguous buffer.
|
2004-09-15 11:26:03 +04:00
|
|
|
* @param size (IN) Number of bytes PML is requesting PTL to deliver,
|
2004-07-15 22:08:20 +04:00
|
|
|
* @param flags (IN) Flags that should be passed to the peer via the message header.
|
|
|
|
* @param request (OUT) OMPI_SUCCESS if the PTL was able to queue one or more fragments
|
|
|
|
*
|
|
|
|
* The PML implements a rendevouz protocol, with up to the PTL defined threshold
|
|
|
|
* bytes of the message sent in eager send mode.
|
|
|
|
*
|
2004-09-15 11:26:03 +04:00
|
|
|
* The PTL is responsible for updating the current data offset (req_offset) in the request
|
|
|
|
* with the actual number of bytes fragmented. This may be less than the requested size,
|
|
|
|
* due to resource constraints or datatype alighnment/offset.
|
2004-07-15 22:08:20 +04:00
|
|
|
*/
|
2004-08-02 04:24:22 +04:00
|
|
|
typedef int (*mca_ptl_base_module_send_fn_t)(
|
|
|
|
struct mca_ptl_base_module_t* ptl,
|
2004-07-15 22:08:20 +04:00
|
|
|
struct mca_ptl_base_peer_t* ptl_base_peer,
|
|
|
|
struct mca_pml_base_send_request_t* request,
|
|
|
|
size_t offset,
|
|
|
|
size_t size,
|
|
|
|
int flags
|
|
|
|
);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* PML->PTL Initiate a put to the peer.
|
2004-03-26 17:15:20 +03:00
|
|
|
*
|
|
|
|
* @param ptl (IN) PTL instance
|
|
|
|
* @param ptl_base_peer (IN) PTL peer addressing
|
2004-07-15 22:08:20 +04:00
|
|
|
* @param request (IN) Send request
|
2004-05-20 17:45:34 +04:00
|
|
|
* @param offset Current offset into packed/contiguous buffer.
|
2004-07-15 22:08:20 +04:00
|
|
|
* @param size (IN/OUT) Number of bytes PML is requesting PTL to deliver,
|
2004-05-20 17:45:34 +04:00
|
|
|
* PTL returns number of bytes sucessfully fragmented
|
2004-03-26 17:15:20 +03:00
|
|
|
* @param flags (IN) Flags that should be passed to the peer via the message header.
|
2004-06-07 19:33:53 +04:00
|
|
|
* @param request (OUT) OMPI_SUCCESS if the PTL was able to queue one or more fragments
|
2004-03-26 17:15:20 +03:00
|
|
|
*
|
2004-08-02 04:24:22 +04:00
|
|
|
* The PML implements a rendevouz protocol, with up to the PTL defined
|
|
|
|
* threshold bytes of the message sent in eager send mode (via
|
|
|
|
* mca_ptl_base_module_send_fn_t). On receipt of an acknowledgment
|
|
|
|
* from the peer, the PML will schedule the remaining fragments. If
|
|
|
|
* the PTL supports RDMA functionality, these subsequent transfers may
|
|
|
|
* use RDMA put semantics.
|
|
|
|
*
|
|
|
|
* If the PTL is unable to fragment the requested size, possibly due
|
|
|
|
* to resource constraints or datatype alighnment/offset, it should
|
|
|
|
* return the number of bytes actually fragmented in the size
|
|
|
|
* parameter.
|
2004-03-26 17:15:20 +03:00
|
|
|
*/
|
2004-08-02 04:24:22 +04:00
|
|
|
typedef int (*mca_ptl_base_module_put_fn_t)(
|
|
|
|
struct mca_ptl_base_module_t* ptl,
|
2004-07-15 22:08:20 +04:00
|
|
|
struct mca_ptl_base_peer_t* ptl_base_peer,
|
2004-06-24 23:28:30 +04:00
|
|
|
struct mca_pml_base_send_request_t* request,
|
2004-05-20 17:45:34 +04:00
|
|
|
size_t offset,
|
2004-06-04 02:13:01 +04:00
|
|
|
size_t size,
|
2004-03-16 18:12:11 +03:00
|
|
|
int flags
|
2004-01-14 06:42:02 +03:00
|
|
|
);
|
2004-01-09 06:26:12 +03:00
|
|
|
|
2004-07-15 22:08:20 +04:00
|
|
|
|
2004-03-26 17:15:20 +03:00
|
|
|
/**
|
2004-05-20 17:45:34 +04:00
|
|
|
* PML->PTL Initiate a get from a peer.
|
2004-03-26 17:15:20 +03:00
|
|
|
*
|
2004-05-20 17:45:34 +04:00
|
|
|
* @param ptl (IN) PTL instance
|
|
|
|
* @param ptl_base_peer (IN) PTL peer addressing
|
|
|
|
* @param request (IN) Recv request
|
|
|
|
* @param offset Current offset into packed/contiguous buffer.
|
|
|
|
* @param size (IN/OUT) Number of bytes PML is requesting PTL to pull from peer,
|
|
|
|
* PTL returns number of bytes sucessfully fragmented.
|
|
|
|
* @param flags (IN)
|
2004-06-07 19:33:53 +04:00
|
|
|
* @param request (OUT) OMPI_SUCCESS if the PTL was able to queue one or more fragments
|
2004-03-26 17:15:20 +03:00
|
|
|
*
|
2004-05-20 17:45:34 +04:00
|
|
|
* Initiate an RDMA get request to pull data from the peer. This is initiated
|
|
|
|
* at the receiver side when a request is matched if the PTL indicates that it
|
|
|
|
* supports RDMA get semantics.
|
2004-03-26 17:15:20 +03:00
|
|
|
*/
|
2004-05-20 17:45:34 +04:00
|
|
|
|
2004-08-02 04:24:22 +04:00
|
|
|
typedef int (*mca_ptl_base_module_get_fn_t)(
|
|
|
|
struct mca_ptl_base_module_t* ptl,
|
2004-05-20 17:45:34 +04:00
|
|
|
struct mca_ptl_base_peer_t* ptl_base_peer,
|
2004-06-24 23:28:30 +04:00
|
|
|
struct mca_pml_base_recv_request_t* request,
|
2004-05-20 17:45:34 +04:00
|
|
|
size_t offset,
|
2004-06-04 02:13:01 +04:00
|
|
|
size_t size,
|
2004-05-20 17:45:34 +04:00
|
|
|
int flags
|
2004-02-04 00:33:29 +03:00
|
|
|
);
|
|
|
|
|
2004-03-26 17:15:20 +03:00
|
|
|
/**
|
|
|
|
* PTL->PML Notification from the PTL to the PML that a new fragment
|
|
|
|
* has arrived and can be matched against posted receives.
|
|
|
|
*
|
|
|
|
* @param ptl (IN) PTL instance
|
|
|
|
* @param recv_frag Receive fragment
|
|
|
|
* @param header (IN) Message header
|
|
|
|
*
|
|
|
|
* A fragment may be matched either when a new receive is posted,
|
|
|
|
* or on receipt of a fragment from the network. In either case,
|
|
|
|
* the PML will downcall into the PTL to provide a notification
|
|
|
|
* that the match was made.
|
|
|
|
*
|
|
|
|
* The message header used for matching is not required to be
|
|
|
|
* contained within the receive fragment. However, if the match is
|
|
|
|
* not made, the matching code will copy the supplied header into the
|
|
|
|
* recv fragment so that the match can be made when the receive is posted.
|
|
|
|
*/
|
2004-08-02 04:24:22 +04:00
|
|
|
typedef bool (*mca_ptl_base_module_match_fn_t)(
|
|
|
|
struct mca_ptl_base_module_t* ptl,
|
2004-03-26 17:15:20 +03:00
|
|
|
struct mca_ptl_base_recv_frag_t* recv_frag,
|
2004-02-12 23:55:10 +03:00
|
|
|
struct mca_ptl_base_match_header_t* header
|
|
|
|
);
|
|
|
|
|
2004-05-20 17:45:34 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* PML->PTL Notification from the PML to the PTL that a receive has
|
|
|
|
* been posted and matched against the indicated fragment.
|
|
|
|
*
|
|
|
|
* @param ptl (IN) PTL instance
|
|
|
|
* @param recv_frag Matched fragment
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2004-08-02 04:24:22 +04:00
|
|
|
typedef void (*mca_ptl_base_module_matched_fn_t)(
|
|
|
|
struct mca_ptl_base_module_t* ptl,
|
2004-05-20 17:45:34 +04:00
|
|
|
struct mca_ptl_base_recv_frag_t* request
|
|
|
|
);
|
|
|
|
|
2004-03-26 17:15:20 +03:00
|
|
|
/**
|
|
|
|
* PTL->PML Notification from the PTL to the PML that a fragment
|
|
|
|
* has completed (e.g. been successfully delivered into users buffer)
|
|
|
|
*
|
2004-07-15 22:08:20 +04:00
|
|
|
* @param ptr(IN) PTL instance
|
|
|
|
* @param recv_request (IN) Receive Request
|
|
|
|
* @param bytes_received (IN) Number of bytes received from peer.
|
|
|
|
* @param bytes_delivered (IN) Number of bytes delivered to application.
|
2004-03-26 17:15:20 +03:00
|
|
|
*/
|
2004-08-02 04:24:22 +04:00
|
|
|
typedef void (*mca_ptl_base_module_recv_progress_fn_t)(
|
|
|
|
struct mca_ptl_base_module_t* ptl,
|
2004-06-24 23:28:30 +04:00
|
|
|
struct mca_pml_base_recv_request_t* recv_request,
|
2004-07-15 22:08:20 +04:00
|
|
|
size_t bytes_received,
|
|
|
|
size_t bytes_delivered
|
2004-02-10 19:53:41 +03:00
|
|
|
);
|
|
|
|
|
2004-03-26 17:15:20 +03:00
|
|
|
/**
|
|
|
|
* PTL->PML Notification from the PTL to the PML that a fragment
|
|
|
|
* has completed (e.g. been successfully delivered to peer)
|
|
|
|
*
|
2004-06-17 23:11:56 +04:00
|
|
|
* @param ptr(IN) PTL instance
|
2004-03-26 17:15:20 +03:00
|
|
|
* @param send_request (IN) Send Request
|
2004-07-15 22:08:20 +04:00
|
|
|
* @param bytes_sent (IN) Number of bytes sent to peer.
|
2004-03-26 17:15:20 +03:00
|
|
|
*/
|
2004-08-02 04:24:22 +04:00
|
|
|
typedef void (*mca_ptl_base_module_send_progress_fn_t)(
|
|
|
|
struct mca_ptl_base_module_t* ptl,
|
2004-06-24 23:28:30 +04:00
|
|
|
struct mca_pml_base_send_request_t* send_request,
|
2004-07-15 22:08:20 +04:00
|
|
|
size_t bytes_sent
|
2004-02-10 19:53:41 +03:00
|
|
|
);
|
|
|
|
|
2004-01-14 06:42:02 +03:00
|
|
|
/**
|
2004-03-26 17:15:20 +03:00
|
|
|
* PTL instance interface functions and attributes.
|
2004-01-09 08:11:33 +03:00
|
|
|
*/
|
2004-08-02 04:24:22 +04:00
|
|
|
struct mca_ptl_base_module_t {
|
2004-01-09 06:26:12 +03:00
|
|
|
|
2004-01-09 08:11:33 +03:00
|
|
|
/* PTL common attributes */
|
2004-08-02 04:24:22 +04:00
|
|
|
mca_ptl_base_component_t* ptl_component; /**< pointer back to the PTL component structure */
|
2004-07-15 22:08:20 +04:00
|
|
|
size_t ptl_cache_size; /**< maximum size of request cache for this PTL */
|
|
|
|
size_t ptl_cache_bytes; /**< number of bytes required by PTL for request cache */
|
2004-03-26 17:15:20 +03:00
|
|
|
size_t ptl_first_frag_size; /**< maximum size of first fragment -- eager send */
|
2004-01-15 03:58:54 +03:00
|
|
|
size_t ptl_min_frag_size; /**< threshold below which the PTL will not fragment */
|
|
|
|
size_t ptl_max_frag_size; /**< maximum fragment size supported by the PTL */
|
2004-01-15 22:51:06 +03:00
|
|
|
uint32_t ptl_exclusivity; /**< indicates this PTL should be used exclusively */
|
|
|
|
uint32_t ptl_latency; /**< relative ranking of latency used to prioritize ptls */
|
|
|
|
uint32_t ptl_bandwidth; /**< bandwidth (Mbytes/sec) supported by each endpoint */
|
2004-05-20 17:45:34 +04:00
|
|
|
uint32_t ptl_flags; /**< flags (put/get...) */
|
2004-01-09 06:26:12 +03:00
|
|
|
|
2004-02-10 19:53:41 +03:00
|
|
|
/* PML->PTL function table */
|
2004-08-02 04:24:22 +04:00
|
|
|
mca_ptl_base_module_add_procs_fn_t ptl_add_procs;
|
|
|
|
mca_ptl_base_module_del_procs_fn_t ptl_del_procs;
|
|
|
|
mca_ptl_base_module_finalize_fn_t ptl_finalize;
|
|
|
|
mca_ptl_base_module_send_fn_t ptl_send;
|
|
|
|
mca_ptl_base_module_put_fn_t ptl_put;
|
|
|
|
mca_ptl_base_module_get_fn_t ptl_get;
|
|
|
|
mca_ptl_base_module_matched_fn_t ptl_matched;
|
|
|
|
mca_ptl_base_module_request_init_fn_t ptl_request_init;
|
|
|
|
mca_ptl_base_module_request_fini_fn_t ptl_request_fini;
|
2004-02-10 19:53:41 +03:00
|
|
|
|
|
|
|
/* PTL->PML function table - filled in by PML at init */
|
2004-08-02 04:24:22 +04:00
|
|
|
mca_ptl_base_module_match_fn_t ptl_match;
|
|
|
|
mca_ptl_base_module_send_progress_fn_t ptl_send_progress;
|
|
|
|
mca_ptl_base_module_recv_progress_fn_t ptl_recv_progress;
|
2004-06-17 23:11:56 +04:00
|
|
|
|
|
|
|
/* Allow the canibalization of the PTL */
|
2004-08-02 04:24:22 +04:00
|
|
|
struct mca_ptl_base_module_t* ptl_stack;
|
2004-07-15 22:08:20 +04:00
|
|
|
|
|
|
|
/* for use by PML only */
|
2004-08-02 04:24:22 +04:00
|
|
|
struct mca_pml_base_ptl_t* ptl_base;
|
2004-01-12 22:17:09 +03:00
|
|
|
};
|
2004-08-02 04:24:22 +04:00
|
|
|
typedef struct mca_ptl_base_module_t mca_ptl_base_module_t;
|
2004-01-09 06:26:12 +03:00
|
|
|
|
|
|
|
/*
|
2004-01-30 06:55:39 +03:00
|
|
|
* Macro for use in modules that are of type ptl v1.0.0
|
2004-01-09 06:26:12 +03:00
|
|
|
*/
|
2004-01-30 06:55:39 +03:00
|
|
|
#define MCA_PTL_BASE_VERSION_1_0_0 \
|
|
|
|
/* coll v1.0 is chained to MCA v1.0 */ \
|
|
|
|
MCA_BASE_VERSION_1_0_0, \
|
|
|
|
/* ptl v1.0 */ \
|
|
|
|
"ptl", 1, 0, 0
|
2004-01-09 06:26:12 +03:00
|
|
|
|
2004-06-07 19:33:53 +04:00
|
|
|
#endif /* OMPI_MCA_PTL_H */
|