btl.h
来自「MPI stands for the Message Passing Inter」· C头文件 代码 · 共 613 行 · 第 1/2 页
H
613 行
/* * 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. * * 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); /** * PML->BTL notification of change in the process list. * * @param btl (IN) BTL module * @param nprocs (IN) Number of processes * @param procs (IN) Set of processes * @param endpoint (OUT) Set of (optional) mca_btl_base_endpoint_t structures by BTL. * @param reachable (OUT) Bitmask indicating set of peer processes that are reachable by this BTL. * @return OMPI_SUCCESS or error status on failure. * * The mca_btl_base_module_add_procs_fn_t() is called by the PML to * determine the set of BTLs that should be used to reach each process. * Any addressing information exported by the peer via the mca_pml_base_modex_send() * function should be available during this call via the corresponding * mca_pml_base_modex_recv() function. The BTL may utilize this information to * determine reachability of each peer process. * * For each process that is reachable by the BTL, the bit corresponding to the index * into the proc array (nprocs) should be set in the reachable bitmask. The PML * provides the BTL the option to return a pointer to a data structure defined * by the BTL that is returned to the BTL on subsequent calls to the BTL data * transfer functions (e.g btl_send). This may be used by the BTL to cache any addressing * or connection information (e.g. TCP socket, IP queue pair). */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 * * When the process list changes, the PML notifies the BTL of the * 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, struct mca_btl_base_endpoint_t**);/** * Callback function that is called asynchronously on receipt * of data by the transport layer. * */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. * * @param btl (IN) BTL module * @return Status indicating if cleanup was successful * * When the process list changes, the PML notifies the BTL of the * change, to provide the opportunity to cleanup or release any * resources associated with the peer. */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);/** * Callback function that is called asynchronously on receipt * of an error from the transport layer * */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. * * @param btl (IN) BTL module * @return Status indicating if cleanup was successful * */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);/** * Allocate a descriptor with a segment of the requested size. * Note that the BTL layer may choose to return a smaller size * if it cannot support the request. * * @param btl (IN) BTL module * @param size (IN) Request segment size. */typedef mca_btl_base_descriptor_t* (*mca_btl_base_module_alloc_fn_t)( struct mca_btl_base_module_t* btl, size_t size);/** * Return a descriptor allocated from this BTL via alloc/prepare. * * @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);/** * Prepare a descriptor for send/rdma using the supplied * convertor. If the convertor references data that is contigous, * the descriptor may simply point to the user buffer. Otherwise, * this routine is responsible for allocating buffer space and * packing if required. * * @param btl (IN) BTL module * @param endpoint (IN) BTL peer addressing * @param convertor (IN) Data type convertor * @param reserve (IN) Additional bytes requested by upper layer to precede user data * @param size (IN/OUT) Number of bytes to prepare (IN), number of bytes actually prepared (OUT) */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, size_t reserve, size_t* size);/** * Initiate an asynchronous send. * * @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. */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. * * @param btl (IN) BTL module * @param endpoint (IN) BTL addressing information * @param descriptor (IN) Description of the data to be transferred */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. * * @param btl (IN) BTL module * @param endpoint (IN) BTL addressing information * @param descriptor (IN) Description of the data to be transferred * */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);/** * Diagnostic dump of btl state. * * @param btl (IN) BTL module */typedef void (*mca_btl_base_module_dump_fn_t)( struct mca_btl_base_module_t* btl, struct mca_btl_base_endpoint_t* endpoint, int verbose);/** * 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 */ size_t btl_min_rdma_size; /**< threshold below which the BTL should not fragment */ size_t btl_max_rdma_size; /**< maximum rdma fragment size supported by the BTL */ 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 */ 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; 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; mca_btl_base_module_dump_fn_t btl_dump; /* diagnostics */ /* the mpool associated with this btl (optional) */ mca_mpool_base_module_t* btl_mpool; /* register a default error handler */ mca_btl_base_module_register_error_fn_t btl_register_error; };typedef struct mca_btl_base_module_t mca_btl_base_module_t;/* * Macro for use in modules that are of type btl v1.0.1 */#define MCA_BTL_BASE_VERSION_1_0_1 \ /* coll v1.0 is chained to MCA v1.0 */ \ MCA_BASE_VERSION_1_0_0, \ /* btl v1.0 */ \ "btl", 1, 0, 1/* * 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#if defined(c_plusplus) || defined(__cplusplus)}#endif#endif /* OMPI_MCA_BTL_H */
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?