1
1

Add the ptl as the first argument to all functions embedded in the ptl struct. This will allow us to have stacked

PTL modules.

This commit was SVN r1375.
Этот коммит содержится в:
George Bosilca 2004-06-17 19:11:56 +00:00
родитель 62e46c1d7c
Коммит 54c18fb1f0
6 изменённых файлов: 39 добавлений и 8 удалений

Просмотреть файл

@ -28,11 +28,13 @@ typedef struct mca_ptl_base_recv_frag_t mca_ptl_base_recv_frag_t;
/**
* Called by the PTL to match attempt a match for new fragments.
*
* @param ptl (IN) The PTL pointer
* @param frag (IN) Receive fragment descriptor.
* @param header (IN) Header corresponding to the receive fragment.
* @return OMPI_SUCCESS or error status on failure.
*/
static inline bool mca_ptl_base_recv_frag_match(
struct mca_ptl_t* ptl,
mca_ptl_base_recv_frag_t* frag,
mca_ptl_base_match_header_t* header)
{
@ -59,8 +61,8 @@ static inline bool mca_ptl_base_recv_frag_match(
*/
if(request->super.req_type == MCA_PML_REQUEST_PROBE) {
ptl->ptl_recv_progress(request, frag);
matched = mca_ptl_base_recv_frag_match(frag, header);
ptl->ptl_recv_progress(ptl, request, frag);
matched = mca_ptl_base_recv_frag_match( ptl, frag, header );
} else {

Просмотреть файл

@ -405,6 +405,7 @@ typedef int (*mca_ptl_base_get_fn_t)(
* recv fragment so that the match can be made when the receive is posted.
*/
typedef bool (*mca_ptl_base_match_fn_t)(
struct mca_ptl_t* ptl,
struct mca_ptl_base_recv_frag_t* recv_frag,
struct mca_ptl_base_match_header_t* header
);
@ -428,10 +429,12 @@ typedef void (*mca_ptl_base_matched_fn_t)(
* PTL->PML Notification from the PTL to the PML that a fragment
* has completed (e.g. been successfully delivered into users buffer)
*
* @param ptr(IN) PTL instance
* @param recv_request (IN) Receive Request
* @param recv_frag (IN) Receive Fragment
*/
typedef void (*mca_ptl_base_recv_progress_fn_t)(
struct mca_ptl_t* ptl,
struct mca_ptl_base_recv_request_t* recv_request,
struct mca_ptl_base_recv_frag_t* recv_frag
);
@ -440,14 +443,37 @@ typedef void (*mca_ptl_base_recv_progress_fn_t)(
* PTL->PML Notification from the PTL to the PML that a fragment
* has completed (e.g. been successfully delivered to peer)
*
* @param ptr(IN) PTL instance
* @param send_request (IN) Send Request
* @param send_frag (IN) Send Fragment
*/
typedef void (*mca_ptl_base_send_progress_fn_t)(
struct mca_ptl_t* ptl,
struct mca_ptl_base_send_request_t* send_request,
struct mca_ptl_base_send_frag_t* send_frag
);
/**
* PTL function list. They are mainly used for the stack-based approach on the
* profilling PTL.
*/
struct mca_ptl_functions_t {
/* PML->PTL function table */
mca_ptl_base_add_procs_fn_t ptl_add_procs;
mca_ptl_base_del_procs_fn_t ptl_del_procs;
mca_ptl_base_finalize_fn_t ptl_finalize;
mca_ptl_base_put_fn_t ptl_put;
mca_ptl_base_get_fn_t ptl_get;
mca_ptl_base_matched_fn_t ptl_matched;
mca_ptl_base_request_alloc_fn_t ptl_request_alloc;
mca_ptl_base_request_return_fn_t ptl_request_return;
/* PTL->PML function table - filled in by PML at init */
mca_ptl_base_match_fn_t ptl_match;
mca_ptl_base_send_progress_fn_t ptl_send_progress;
mca_ptl_base_recv_progress_fn_t ptl_recv_progress;
};
typedef struct mca_ptl_functions_t mca_ptl_functions_t;
/**
* PTL instance interface functions and attributes.
*/
@ -477,6 +503,9 @@ struct mca_ptl_t {
mca_ptl_base_match_fn_t ptl_match;
mca_ptl_base_send_progress_fn_t ptl_send_progress;
mca_ptl_base_recv_progress_fn_t ptl_recv_progress;
/* Allow the canibalization of the PTL */
struct mca_ptl_t* ptl_stack;
};
typedef struct mca_ptl_t mca_ptl_t;

Просмотреть файл

@ -129,7 +129,7 @@ int mca_ptl_self_send(
req->req_frag.super.frag_owner = &mca_ptl_self;
req->req_frag.frag_request = NULL;
req->req_frag.frag_is_buffered = 0;
ptl->ptl_match( &(req->req_frag), &(hdr->hdr_match) );
ptl->ptl_match( ptl, &(req->req_frag), &(hdr->hdr_match) );
return OMPI_SUCCESS;
}
@ -184,6 +184,6 @@ void mca_ptl_self_matched( mca_ptl_t* ptl,
sendfrag.super.frag_peer = NULL;
sendfrag.super.frag_addr = NULL;
sendfrag.super.frag_size = sendreq->super.req_bytes_packed;
ptl->ptl_send_progress( &(sendreq->super), &(sendfrag) );
ptl->ptl_recv_progress( recvreq, frag );
ptl->ptl_send_progress( ptl, &(sendreq->super), &(sendfrag) );
ptl->ptl_recv_progress( ptl, recvreq, frag );
}

Просмотреть файл

@ -157,7 +157,7 @@ static bool mca_ptl_tcp_recv_frag_match(mca_ptl_tcp_recv_frag_t* frag, int sd)
/* first pass through - attempt a match */
if(NULL == frag->super.frag_request && 0 == frag->frag_msg_cnt) {
/* attempt to match a posted recv */
if(mca_ptl_base_recv_frag_match(&frag->super, &frag->super.super.frag_header.hdr_match)) {
if(mca_ptl_base_recv_frag_match( frag->super.super.frag_owner, &frag->super, &frag->super.super.frag_header.hdr_match)) {
mca_ptl_tcp_recv_frag_matched(frag);
} else {
/* match was not made - so allocate buffer for eager send */

Просмотреть файл

@ -121,7 +121,7 @@ static inline void mca_ptl_tcp_recv_frag_progress(mca_ptl_tcp_recv_frag_t* frag)
}
/* progress the request */
(frag)->super.super.frag_owner->ptl_recv_progress(request, &(frag)->super);
(frag)->super.super.frag_owner->ptl_recv_progress((frag)->super.super.frag_owner, request, &(frag)->super);
if((frag)->frag_ack_pending == false) {
mca_ptl_tcp_recv_frag_return((frag)->super.super.frag_owner, (frag));
}

Просмотреть файл

@ -87,7 +87,7 @@ static inline void mca_ptl_tcp_send_frag_progress(mca_ptl_tcp_send_frag_t* frag)
if(fetchNset(&frag->frag_progressed,1) == 0) {
/* update request status */
frag->super.super.frag_owner->ptl_send_progress(request, &frag->super);
frag->super.super.frag_owner->ptl_send_progress(frag->super.super.frag_owner, request, &frag->super);
/* the first fragment is allocated with the request,
* all others need to be returned to free list