📄 mpidpost.h
字号:
Return value: An MPI error codeE*/int MPIDI_CH3_Connection_terminate(MPIDI_VC_t * vc);/* MPIDI_CH3_Connect_to_root (really connect to peer) - channel routine for connecting to a process through a port, used in implementing MPID_Comm_connect and accept */int MPIDI_CH3_Connect_to_root(const char *, MPIDI_VC_t **);/*E MPIDI_CH3_Abort - Abort this process. Input Parameters:+ exit_code - exit code to be returned by the process- error_msg - error message to print Return value: This function should not return.E*/int MPIDI_CH3_Abort(int exit_code, char * error_msg);/* * Channel upcall prototypes *//*E MPIDI_CH3U_Handle_recv_pkt- Handle a freshly received CH3 packet. Input Parameters:+ vc - virtual connection over which the packet was received- pkt - pointer to the CH3 packet Output Parameter:. rreqp - receive request defining data to be received; may be NULL NOTE: Multiple threads may not simultaneously call this routine with the same virtual connection. This constraint eliminates the need to lock the VC and thus improves performance. If simultaneous upcalls for a single VC are a possible, then the calling routine must serialize the calls (perhaps by locking the VC). Special consideration may need to be given to packet ordering if the channel has made guarantees about ordering.E*/int MPIDI_CH3U_Handle_recv_pkt(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt, MPID_Request ** rreqp);/*E MPIDI_CH3U_Handle_recv_req - Process a receive request for which all of the data has been received (and copied) into the buffers described by the request's IOV. Input Parameters:+ vc - virtual connection over which the data was received- rreq - pointer to the receive request object Output Parameter:. complete - data transfer for the request has completedE*/int MPIDI_CH3U_Handle_recv_req(MPIDI_VC_t * vc, MPID_Request * rreq, int * complete);/*E MPIDI_CH3U_Handle_send_req - Process a send request for which all of the data described the request's IOV has been completely buffered and/or sent. Input Parameters:+ vc - virtual connection over which the data was sent- sreq - pointer to the send request object Output Parameter:. complete - data transfer for the request has completedE*/int MPIDI_CH3U_Handle_send_req(MPIDI_VC_t * vc, MPID_Request * sreq, int * complete);/*E MPIDI_CH3U_Handle_connection - handle connection event Input Parameters:+ vc - virtual connection. event - connection event NOTE: At present this function is only used for connection terminationE*/int MPIDI_CH3U_Handle_connection(MPIDI_VC_t * vc, MPIDI_VC_Event_t event);/*E MPIDI_CH3U_Request_create - Initialize the channel device (ch3) component of a request. Input Parameters:. req - pointer to the request object IMPLEMENTORS: This routine must be called by MPIDI_CH3_Request_create().E*/void MPIDI_CH3U_Request_create(MPID_Request * req);/*E MPIDI_CH3U_Request_destroy - Free resources associated with the channel device (ch3) component of a request. Input Parameters:. req - pointer to the request object IMPLEMENTORS: This routine must be called by MPIDI_CH3_Request_destroy().E*/void MPIDI_CH3U_Request_destroy(MPID_Request * req);/* BEGIN EXPERIMENTAL BLOCK *//* The following functions enable RDMA capabilities in the CH3 device. * These functions may change in future releases. * There usage is protected in the code by #ifdef MPIDI_CH3_CHANNEL_RNDV *//*E MPIDI_CH3U_Handle_recv_rndv_pkt - This function is used by RDMA enabled channels to handle a rts packet. Input Parameters:+ vc - virtual connection over which the packet was received- pkt - pointer to the CH3 packet Output Parameters:+ rreqp - request pointer- foundp - found Return value: An mpi error code. Notes: This is the handler function to be called when the channel receives a rndv rts packet. After this function is called the channel is returned a request and a found flag. The channel may set any channel specific fields in the request at this time. Then the channel should call MPIDI_CH3U_Post_data_receive() and MPIDI_CH3_iStartRndvTransfer() if the found flag is set.E*/int MPIDI_CH3U_Handle_recv_rndv_pkt(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt, MPID_Request ** rreqp, int *foundp);/*E MPIDI_CH3_iStartRndvMsg - This function is used to initiate a rendezvous send. NOTE: An "rts packet" is provided which must be passed to handle_recv_rndv_pkt on the remote side. The first iov is also provided so the channel can register buffers, etc., if neccessary. Input Parameters:+ vc - virtual connection over which the rendezvous will be performed. sreq - pointer to the send request object- rts_pkt - CH3 packet to be delivered to CH3 on remote side Return value: An mpi error code. IMPLEMENTORS:E*/int MPIDI_CH3_iStartRndvMsg (MPIDI_VC_t * vc, MPID_Request * sreq, MPIDI_CH3_Pkt_t * rts_pkt);/*E MPIDI_CH3_iStartRndvTransfer - This function is used to indicate that a previous rendezvous rts has been matched and data transfer can commence. Input Parameters:+ vc - virtual connection over which the rendezvous will be performed- rreq - pointer to the receive request object Return value: An mpi error code. IMPLEMENTORS:E*/int MPIDI_CH3_iStartRndvTransfer (MPIDI_VC_t * vc, MPID_Request * rreq);/* END EXPERIMENTAL BLOCK *//* * Channel utility prototypes */int MPIDI_CH3U_Recvq_FU(int, int, int, MPI_Status * );MPID_Request * MPIDI_CH3U_Recvq_FDU(MPI_Request, MPIDI_Message_match *);MPID_Request * MPIDI_CH3U_Recvq_FDU_or_AEP(int, int, int, int * found);int MPIDI_CH3U_Recvq_DP(MPID_Request * rreq);MPID_Request * MPIDI_CH3U_Recvq_FDP(MPIDI_Message_match * match);MPID_Request * MPIDI_CH3U_Recvq_FDP_or_AEU(MPIDI_Message_match * match, int * found);void MPIDI_CH3U_Request_complete(MPID_Request * req);void MPIDI_CH3U_Request_increment_cc(MPID_Request * req, int * was_incomplete);void MPIDI_CH3U_Request_decrement_cc(MPID_Request * req, int * incomplete);int MPIDI_CH3U_Request_load_send_iov(MPID_Request * const sreq, MPID_IOV * const iov, int * const iov_n);int MPIDI_CH3U_Request_load_recv_iov(MPID_Request * const rreq);int MPIDI_CH3U_Request_unpack_uebuf(MPID_Request * rreq);int MPIDI_CH3U_Request_unpack_srbuf(MPID_Request * rreq);void MPIDI_CH3U_Buffer_copy(const void * const sbuf, int scount, MPI_Datatype sdt, int * smpi_errno, void * const rbuf, int rcount, MPI_Datatype rdt, MPIDI_msg_sz_t * rdata_sz, int * rmpi_errno);int MPIDI_CH3U_Post_data_receive(int found, MPID_Request ** rreqp);/* FIXME: Move these prototypes into header files in the appropriate util directories *//* added by brad. upcalls for MPIDI_CH3_Init that contain code which could be executed by two or more channels */int MPIDI_CH3U_Init_sock(int has_parent, MPIDI_PG_t * pg_p, int pg_rank, char **publish_bc_p, char **bc_key_p, char **bc_val_p, int *val_max_sz_p); int MPIDI_CH3U_Init_sshm(int has_parent, MPIDI_PG_t * pg_p, int pg_rank, char **publish_bc_p, char **bc_key_p, char **bc_val_p, int *val_max_sz_p);/* added by brad. business card related global and functions */#define MAX_HOST_DESCRIPTION_LEN 256/* FIXME: keep the listener port in one file and provide a method to set/retrieve it as needed */extern int MPIDI_CH3I_listener_port;int MPIDI_CH3U_Get_business_card_sock(char **bc_val_p, int *val_max_sz_p);int MPIDI_CH3U_Get_business_card_sshm(char **bc_val_p, int *val_max_sz_p);int MPIDI_CH3I_Get_business_card(char *value, int length);/* added by brad. finalization related upcalls */int MPIDI_CH3U_Finalize_sshm(void);/* Include definitions from the channel which require items defined by this file (mpidimpl.h) or the file it includes (mpiimpl.h). */#include "mpidi_ch3_post.h"#include "mpid_datatype.h"/* * Request utility macros (public - can be used in MPID macros) * * MT: The inc/dec of the completion counter must be atomic since the progress engine could be completing the request in one * thread and the application could be cancelling the request in another thread. */#if (USE_THREAD_IMPL != MPICH_THREAD_IMPL_NOT_IMPLEMENTED)/* SHMEM: In the case of a single-threaded shmem channel sharing requests between processes, a write barrier must be performed before decrementing the completion counter. This insures that other fields in the req structure are updated before the completion is signalled. How should that be incorporated into this code from the channel level? */#define MPIDI_CH3U_Request_decrement_cc(req_, incomplete_) \{ \ *(incomplete_) = --(*(req_)->cc_ptr); \}#elif defined(USE_ATOMIC_UPDATES)/* If locks are not used, a write barrier must be performed if *before* the completion counter reaches zero. This insures that other fields in the req structure are updated before the completion is signalled. */#define MPIDI_CH3U_Request_decrement_cc(req_, incomplete_) \{ \ int new_cc__; \ \ MPID_Atomic_write_barrier(); \ MPID_Atomic_decr_flag((req_)->cc_ptr, new_cc__); \ *(incomplete_) = new_cc__; \}#else#define MPIDI_CH3U_Request_decrement_cc(req_, incomplete_) \{ \ MPID_Request_thread_lock(req_); \ { \ *(incomplete_) = --(*(req_)->cc_ptr); \ } \ MPID_Request_thread_unlock(req_); \}#endif#if (USE_THREAD_IMPL != MPICH_THREAD_IMPL_NOT_IMPLEMENTED)#define MPIDI_CH3U_Request_increment_cc(req_, was_incomplete_) \{ \ *(was_incomplete_) = (*(req_)->cc_ptr)++; \}#elif defined(USE_ATOMIC_UPDATES)#define MPIDI_CH3U_Request_increment_cc(req_, was_incomplete_) \{ \ int old_cc__; \ \ MPID_Atomic_fetch_and_incr((req_)->cc_ptr, old_cc__); \ *(was_incomplete_) = old_cc__; \}#else#define MPIDI_CH3U_Request_increment_cc(req_, was_incomplete_) \{ \ MPID_Request_thread_lock(req_); \ { \ *(was_incomplete_) = (*(req_)->cc_ptr)++; \ } \ MPID_Request_thread_unlock(req_); \}#endif/* * Device level request management macros */#define MPID_Request_create() (MPIDI_CH3_Request_create())#define MPID_Request_add_ref(req_) MPIDI_CH3_Request_add_ref(req_)#define MPID_Request_release(req_) \{ \ int ref_count; \ \ MPIDI_CH3_Request_release_ref((req_), &ref_count); \ if (ref_count == 0) \ { \ MPIDI_CH3_Request_destroy(req_); \ } \}#if (USE_THREAD_IMPL != MPICH_THREAD_IMPL_NOT_IMPLEMENTED)#define MPID_Request_set_completed(req_) \{ \ *(req_)->cc_ptr = 0; \ MPIDI_CH3_Progress_signal_completion(); \}#else/* MT - If locks are not used, a write barrier must be performed before zeroing the completion counter. This insures that other fields in the req structure are updated before the completion is signaled. */#define MPID_Request_set_completed(req_) \{ \ MPID_Request_thread_lock(req_); \ { \ *(req_)->cc_ptr = 0; \ } \ MPID_Request_thread_unlock(req_); \ \ MPIDI_CH3_Progress_signal_completion(); \}#endif/* * Device level progress engine macros */#define MPID_Progress_start(progress_state_) MPIDI_CH3_Progress_start(progress_state_)#define MPID_Progress_wait(progress_state_) MPIDI_CH3_Progress_wait(progress_state_)#define MPID_Progress_end(progress_state_) MPIDI_CH3_Progress_end(progress_state_)#define MPID_Progress_test() MPIDI_CH3_Progress_test()#define MPID_Progress_poke() MPIDI_CH3_Progress_poke()/* Dynamic process support */int MPID_GPID_GetAllInComm( MPID_Comm *comm_ptr, int local_size, int local_gpids[], int *singlePG );int MPID_GPID_ToLpidArray( int size, int gpid[], int lpid[] );int MPID_VCR_CommFromLpids( MPID_Comm *newcomm_ptr, int size, const int lpids[] );int MPID_PG_ForwardPGInfo( MPID_Comm *peer_ptr, MPID_Comm *comm_ptr, int nPGids, int gpids[], int root );#endif /* !defined(MPICH_MPIDPOST_H_INCLUDED) */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -