mtl.h

来自「MPI stands for the Message Passing Inter」· C头文件 代码 · 共 414 行 · 第 1/2 页

H
414
字号
 * if a negative tag is used. */typedef int (*mca_mtl_base_module_send_fn_t)(                          struct mca_mtl_base_module_t* mtl,                           struct ompi_communicator_t *comm,                          int dest,                          int tag,                          struct ompi_convertor_t *convertor,                          mca_pml_base_send_mode_t mode);/** * Non-blocking send to peer * * Non-blocking send to peer.  Standard MPI semantics must be met by * this call, as mandated in the mode argument.  There is one special * mode argument, MCA_PML_BASE_SEND_COMPLETE, which requires local * completion before the request is marked as complete. * * The PML will handle creation of the request, leaving the number of * bytes requested in the module structure available for the MTL * directly after the ompi_request_t structure.  The PML will handle * proper destruction of the request once it can safely be destructed * (it has been completed and freeed by a call to REQUEST_FReE or * TEST/WAIT).  The MTL should remove all resources associated with * the request when it is marked as completed. * * @param comm (IN)      Communicator used for operation * @param dest (IN)      Destination rank for send (relative to comm) * @param tag (IN)       MPI tag used for sending.  See note below. * @param convertor (IN) Datatype convertor describing send datatype.   *                       Already prepared for send. * @param mode (IN)      Mode for send operation (see pml.h) * @param blocking (IN)  True if the call originated from a blocking  *                       call, but the PML decided to use a  *                       non-blocking operation.  This is either for *                       internal performance decisions or because the *                       blocking send function is NULL.  This is an *                       optimization flag and is not needed for *                       correctness. * @param mtl_request (IN) Pointer to mtl_request.  The ompi_req field *                       will be populated with an initialized *                       ompi_request_t before calling. * * @return               OMPI_SUCCESS or error value * * \note While MPI does not allow users to specify negative tags, they * are used internally in Open MPI to provide a unique channel for * collective operations.  Therefore, the MTL can *not* cause an error * if a negative tag is used. */typedef int (*mca_mtl_base_module_isend_fn_t)(                          struct mca_mtl_base_module_t* mtl,                           struct ompi_communicator_t *comm,                          int dest,                          int tag,                          struct ompi_convertor_t *convertor,                          mca_pml_base_send_mode_t mode,                          bool blocking,                          mca_mtl_request_t *mtl_request);/** * Non-blocking receive * * Non-blocking receive function.  Standard MPI semantics for * MPI_Irecv must be implemented by this call. * * The PML will handle creation of the request, leaving the number of * bytes requested in teh module structure available for the MTL, * directly after the ompi_request_t structure.  The PML will handle * proper destruction of the request once it can safely be destroyed * (it has been completed and free'ed by a call to REQUEST_FREE or * TEST/WAIT).  The MTL should remove all resources associated with * the request when it is marked as completed. * * @param comm (IN)      Communicator used for operation * @param src (IN)       Source rank for send (relative to comm) * @param tag (IN)       MPI tag used for sending.  See note below. * @param convertor (IN) Datatype convertor describing receive datatype.   *                       Already prepared for receive. * @param mtl_request (IN) Pointer to mtl_request.  The ompi_req field *                       will be populated with an initialized *                       ompi_request_t before calling. * * @return              OMPI_SUCCESS or error value * * \note While MPI does not allow users to specify negative tags, they * are used internally in Open MPI to provide a unique channel for * collective operations.  Therefore, the MTL can *not* cause an error * if a negative tag is used.  Further, MPI_ANY_TAG should *not* match * against negative tags. */typedef int (*mca_mtl_base_module_irecv_fn_t)(                          struct mca_mtl_base_module_t* mtl,                          struct ompi_communicator_t *comm,                          int src,                          int tag,                          struct ompi_convertor_t *convertor,                          struct mca_mtl_request_t *mtl_request);/** * Non-blocking probe * * Non-blocking probe function.  Standard MPI semantics for MPI_IPROBE * must be implemented by this call. * * @param comm (IN)      Communicator used for operation * @param src (IN)       Source rank for send (relative to comm) * @param tag (IN)       MPI tag used for sending.  See note below. * @param flag (OUT)     true if message available, false otherwise * @param status (OUT)   Status structure for information on  *                       available message * * \note While MPI does not allow users to specify negative tags, they * are used internally in Open MPI to provide a unique channel for * collective operations.  Therefore, the MTL can *not* cause an error * if a negative tag is used.  Further, MPI_ANY_TAG should *not* match * against negative tags. */typedef int (*mca_mtl_base_module_iprobe_fn_t)(                          struct mca_mtl_base_module_t* mtl,                           struct ompi_communicator_t *comm,                          int src,                          int tag,                          int *flag,                          struct ompi_status_public_t *status);/** * Cancel an existing request * * Attempt to cancel an existing request.  The (poorly defined) * semantics for MPI_CANCEL must be implemented by this call.  This, * of course, allows the MTL module to do nothing at all. * Implementations of the MTL should make a good faith effort to * cancel receive requests that have not been started, as the "post a * receive for control messages" paradigm is a common one in loosely * coupled MPI applications. * * @param request(IN)     Request that should be cancelled * @param flag            Unknown exactly what this does. * */typedef int (*mca_mtl_base_module_cancel_fn_t)(                          struct mca_mtl_base_module_t* mtl,                           mca_mtl_request_t *mtl_request,                          int flag);/** * MTL module interface functions and attributes. */struct mca_mtl_base_module_t {    int      mtl_max_contextid;   /**< maximum allowable contextid */    int      mtl_max_tag;         /**< maximum tag value.  note that negative tags must be allowed */    size_t   mtl_request_size;    /**< number of bytes to reserve with request structure */    uint32_t mtl_flags;           /**< flags (put/get...) */    /* MTL function table */    mca_mtl_base_module_add_procs_fn_t   mtl_add_procs;    mca_mtl_base_module_del_procs_fn_t   mtl_del_procs;    mca_mtl_base_module_finalize_fn_t    mtl_finalize;    mca_mtl_base_module_send_fn_t        mtl_send;    mca_mtl_base_module_isend_fn_t       mtl_isend;    mca_mtl_base_module_irecv_fn_t       mtl_irecv;    mca_mtl_base_module_iprobe_fn_t      mtl_iprobe;    /* Optional MTL functions */    mca_mtl_base_module_cancel_fn_t      mtl_cancel;};typedef struct mca_mtl_base_module_t mca_mtl_base_module_t;/* * Macro for use in modules that are of type mtl v1.0.0 */#define MCA_MTL_BASE_VERSION_1_0_0 \  /* coll v1.0 is chained to MCA v1.0 */ \  MCA_BASE_VERSION_1_0_0, \  /* mtl v1.0 */ \  "mtl", 1, 0, 0/* * macro for doing direct call / call through struct */#if MCA_mtl_DIRECT_CALL#include MCA_mtl_DIRECT_CALL_HEADER#define OMPI_MTL_CALL_STAMP(a, b) ompi_mtl_ ## a ## _ ## b#define OMPI_MTL_CALL_EXPANDER(a, b) OMPI_MTL_CALL_STAMP(a,b)#define OMPI_MTL_CALL(a) OMPI_MTL_CALL_EXPANDER(MCA_mtl_DIRECT_CALL_COMPONENT, a)#else#define OMPI_MTL_CALL(a) ompi_mtl->mtl_ ## a#endifOMPI_DECLSPEC extern mca_mtl_base_module_t *ompi_mtl;#if defined(c_plusplus) || defined(__cplusplus)}#endif#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?