- moved src/mca/ptl/base/ptl_base_sendreq.h -> src/mca/pml/base/pml_base_sendreq.h
src/mca/ptl/base/ptl_base_recvreq.h -> src/mca/pml/base/pml_base_recvreq.h - rename mca_ptl_base_recv_request_t -> mca_pml_base_recv_request_t mca_ptl_base_send_request_t -> mca_pml_base_send_request_t This commit was SVN r1463.
Этот коммит содержится в:
родитель
13b025abb7
Коммит
ebd9c4d92f
@ -15,7 +15,9 @@ AM_CPPFLAGS = -I$(top_builddir)/src
|
||||
headers = \
|
||||
base.h \
|
||||
pml_base_bsend.h \
|
||||
pml_base_request.h
|
||||
pml_base_request.h \
|
||||
pml_base_recvreq.h \
|
||||
pml_base_sendreq.h
|
||||
|
||||
libmca_pml_base_la_SOURCES = \
|
||||
$(headers) \
|
||||
@ -23,7 +25,9 @@ libmca_pml_base_la_SOURCES = \
|
||||
pml_base_close.c \
|
||||
pml_base_request.c \
|
||||
pml_base_open.c \
|
||||
pml_base_select.c
|
||||
pml_base_select.c \
|
||||
pml_base_recvreq.c \
|
||||
pml_base_sendreq.c
|
||||
|
||||
# Conditionally install the header files
|
||||
|
||||
|
@ -1,9 +1,11 @@
|
||||
#include "threads/mutex.h"
|
||||
#include "threads/condition.h"
|
||||
#include "mca/allocator/base/base.h"
|
||||
#include "mca/allocator/allocator.h"
|
||||
#include "mca/base/mca_base_param.h"
|
||||
#include "mca/pml/pml.h"
|
||||
#include "mca/pml/base/pml_base_request.h"
|
||||
#include "mca/ptl/base/ptl_base_sendreq.h"
|
||||
#include "mca/pml/base/pml_base_sendreq.h"
|
||||
#include "pml_base_bsend.h"
|
||||
|
||||
static ompi_mutex_t mca_pml_bsend_mutex; /* lock for thread safety */
|
||||
@ -179,7 +181,7 @@ int mca_pml_base_bsend_detach(void* addr, int* size)
|
||||
*/
|
||||
int mca_pml_base_bsend_request_init(ompi_request_t* request, bool persistent)
|
||||
{
|
||||
mca_ptl_base_send_request_t* sendreq = (mca_ptl_base_send_request_t*)request;
|
||||
mca_pml_base_send_request_t* sendreq = (mca_pml_base_send_request_t*)request;
|
||||
struct iovec iov;
|
||||
void* buf;
|
||||
int rc;
|
||||
@ -229,7 +231,7 @@ int mca_pml_base_bsend_request_init(ompi_request_t* request, bool persistent)
|
||||
*/
|
||||
int mca_pml_base_bsend_request_fini(ompi_request_t* request)
|
||||
{
|
||||
mca_ptl_base_send_request_t* sendreq = (mca_ptl_base_send_request_t*)request;
|
||||
mca_pml_base_send_request_t* sendreq = (mca_pml_base_send_request_t*)request;
|
||||
|
||||
/* remove from list of pending requests */
|
||||
THREAD_LOCK(&mca_pml_bsend_mutex);
|
||||
|
32
src/mca/pml/base/pml_base_recvreq.c
Обычный файл
32
src/mca/pml/base/pml_base_recvreq.c
Обычный файл
@ -0,0 +1,32 @@
|
||||
/*
|
||||
* $HEADER$
|
||||
*/
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
|
||||
#include "include/types.h"
|
||||
#include "mca/pml/base/pml_base_recvreq.h"
|
||||
|
||||
|
||||
static void mca_pml_base_recv_request_construct(mca_pml_base_recv_request_t*);
|
||||
static void mca_pml_base_recv_request_destruct(mca_pml_base_recv_request_t*);
|
||||
|
||||
|
||||
ompi_class_t mca_pml_base_recv_request_t_class = {
|
||||
"mca_pml_base_recv_request_t",
|
||||
OBJ_CLASS(mca_pml_base_request_t),
|
||||
(ompi_construct_t) mca_pml_base_recv_request_construct,
|
||||
(ompi_destruct_t) mca_pml_base_recv_request_destruct
|
||||
};
|
||||
|
||||
|
||||
static void mca_pml_base_recv_request_construct(mca_pml_base_recv_request_t* request)
|
||||
{
|
||||
/* no need to reinit for every recv -- never changes */
|
||||
request->super.req_type = MCA_PML_REQUEST_RECV;
|
||||
}
|
||||
|
||||
|
||||
static void mca_pml_base_recv_request_destruct(mca_pml_base_recv_request_t* request)
|
||||
{
|
||||
}
|
||||
|
@ -7,22 +7,20 @@
|
||||
#ifndef MCA_PML_BASE_RECV_REQUEST_H
|
||||
#define MCA_PML_BASE_RECV_REQUEST_H
|
||||
|
||||
#include "mca/ptl/ptl.h"
|
||||
#include "mca/pml/base/pml_base_request.h"
|
||||
|
||||
extern ompi_class_t mca_ptl_base_recv_request_t_class;
|
||||
struct mca_ptl_base_recv_frag_t;
|
||||
extern ompi_class_t mca_pml_base_recv_request_t_class;
|
||||
|
||||
/**
|
||||
* Base type for receive requests.
|
||||
*/
|
||||
struct mca_ptl_base_recv_request_t {
|
||||
struct mca_pml_base_recv_request_t {
|
||||
mca_pml_base_request_t super; /**< base request */
|
||||
size_t req_bytes_packed; /**< size of message being received */
|
||||
size_t req_bytes_received; /**< number of bytes received from network */
|
||||
size_t req_bytes_delivered; /**< number of bytes delivered to user */
|
||||
};
|
||||
typedef struct mca_ptl_base_recv_request_t mca_ptl_base_recv_request_t;
|
||||
typedef struct mca_pml_base_recv_request_t mca_pml_base_recv_request_t;
|
||||
|
||||
|
||||
/**
|
||||
@ -37,7 +35,7 @@ typedef struct mca_ptl_base_recv_request_t mca_ptl_base_recv_request_t;
|
||||
* @param comm (IN) Communicator.
|
||||
* @param persistent (IN) Is this a ersistent request.
|
||||
*/
|
||||
#define MCA_PTL_BASE_RECV_REQUEST_INIT( \
|
||||
#define MCA_PML_BASE_RECV_REQUEST_INIT( \
|
||||
request, \
|
||||
addr, \
|
||||
count, \
|
||||
@ -65,21 +63,5 @@ typedef struct mca_ptl_base_recv_request_t mca_ptl_base_recv_request_t;
|
||||
(request)->super.req_free_called = false; \
|
||||
}
|
||||
|
||||
/**
|
||||
* Attempt to match the request against the unexpected fragment list
|
||||
* for all source ranks w/in the communicator.
|
||||
*
|
||||
* @param request (IN) Request to match.
|
||||
*/
|
||||
void mca_ptl_base_recv_request_match_wild(mca_ptl_base_recv_request_t* request);
|
||||
|
||||
/**
|
||||
* Attempt to match the request against the unexpected fragment list
|
||||
* for a specific source rank.
|
||||
*
|
||||
* @param request (IN) Request to match.
|
||||
*/
|
||||
void mca_ptl_base_recv_request_match_specific(mca_ptl_base_recv_request_t* request);
|
||||
|
||||
#endif
|
||||
|
29
src/mca/pml/base/pml_base_sendreq.c
Обычный файл
29
src/mca/pml/base/pml_base_sendreq.c
Обычный файл
@ -0,0 +1,29 @@
|
||||
/*
|
||||
* $HEADER$
|
||||
*/
|
||||
#include <string.h>
|
||||
#include "mca/pml/base/pml_base_sendreq.h"
|
||||
|
||||
static void mca_pml_base_send_request_construct(mca_pml_base_send_request_t* req);
|
||||
static void mca_pml_base_send_request_destruct(mca_pml_base_send_request_t* req);
|
||||
|
||||
|
||||
ompi_class_t mca_pml_base_send_request_t_class = {
|
||||
"mca_pml_base_send_request_t",
|
||||
OBJ_CLASS(mca_pml_base_request_t),
|
||||
(ompi_construct_t) mca_pml_base_send_request_construct,
|
||||
(ompi_destruct_t) mca_pml_base_send_request_destruct
|
||||
};
|
||||
|
||||
|
||||
static void mca_pml_base_send_request_construct(mca_pml_base_send_request_t* request)
|
||||
{
|
||||
/* no need to reinit for every send -- never changes */
|
||||
request->super.req_type = MCA_PML_REQUEST_SEND;
|
||||
OBJ_CONSTRUCT(&request->req_convertor, ompi_convertor_t);
|
||||
}
|
||||
|
||||
static void mca_pml_base_send_request_destruct(mca_pml_base_send_request_t* req)
|
||||
{
|
||||
}
|
||||
|
@ -9,19 +9,15 @@
|
||||
|
||||
#include "ompi_config.h"
|
||||
#include "datatype/datatype.h"
|
||||
#include "mca/ptl/ptl.h"
|
||||
#include "mca/pml/base/pml_base_request.h"
|
||||
#include "mca/ptl/base/ptl_base_comm.h"
|
||||
|
||||
|
||||
extern ompi_class_t mca_ptl_base_send_request_t_class;
|
||||
struct mca_ptl_base_send_frag_t;
|
||||
extern ompi_class_t mca_pml_base_send_request_t_class;
|
||||
|
||||
|
||||
/**
|
||||
* Base type for send requests
|
||||
*/
|
||||
struct mca_ptl_base_send_request_t {
|
||||
struct mca_pml_base_send_request_t {
|
||||
mca_pml_base_request_t super; /** base request type - common data structure for use by wait/test */
|
||||
size_t req_offset; /**< number of bytes that have already been assigned to a fragment */
|
||||
size_t req_bytes_packed; /**< packed size of a message given the datatype and count */
|
||||
@ -34,7 +30,7 @@ struct mca_ptl_base_send_request_t {
|
||||
size_t req_peer_size;
|
||||
ompi_convertor_t req_convertor; /**< convertor that describes this datatype */
|
||||
};
|
||||
typedef struct mca_ptl_base_send_request_t mca_ptl_base_send_request_t;
|
||||
typedef struct mca_pml_base_send_request_t mca_pml_base_send_request_t;
|
||||
|
||||
|
||||
|
||||
@ -51,7 +47,7 @@ typedef struct mca_ptl_base_send_request_t mca_ptl_base_send_request_t;
|
||||
* @param mode (IN) Send mode (STANDARD,BUFFERED,SYNCHRONOUS,READY)
|
||||
* @param persistent (IN) Is request persistent.
|
||||
*/
|
||||
#define MCA_PTL_BASE_SEND_REQUEST_INIT( \
|
||||
#define MCA_PML_BASE_SEND_REQUEST_INIT( \
|
||||
request, \
|
||||
addr, \
|
||||
count, \
|
||||
@ -106,8 +102,8 @@ typedef struct mca_ptl_base_send_request_t mca_ptl_base_send_request_t;
|
||||
* @param request (IN) Send request.
|
||||
* return TRUE if an ack/match has been received from peer.
|
||||
*/
|
||||
static inline bool mca_ptl_base_send_request_matched(
|
||||
mca_ptl_base_send_request_t* request)
|
||||
static inline bool mca_pml_base_send_request_matched(
|
||||
mca_pml_base_send_request_t* request)
|
||||
{
|
||||
return (NULL != request->req_peer_match.pval);
|
||||
}
|
@ -16,7 +16,7 @@
|
||||
#include "mca/pml/pml.h"
|
||||
#include "mca/pml/base/pml_base_request.h"
|
||||
#include "mca/pml/base/pml_base_bsend.h"
|
||||
#include "mca/ptl/base/ptl_base_sendreq.h"
|
||||
#include "mca/pml/base/pml_base_sendreq.h"
|
||||
#include "mca/ptl/ptl.h"
|
||||
|
||||
#define MCA_PML_TEG_STATISTICS 0
|
||||
@ -276,7 +276,7 @@ extern int mca_pml_teg_free(
|
||||
switch(pml_request->req_type) { \
|
||||
case MCA_PML_REQUEST_SEND: \
|
||||
{ \
|
||||
mca_ptl_base_send_request_t* sendreq = (mca_ptl_base_send_request_t*)pml_request; \
|
||||
mca_pml_base_send_request_t* sendreq = (mca_pml_base_send_request_t*)pml_request; \
|
||||
mca_ptl_t* ptl = sendreq->req_owner; \
|
||||
if(sendreq->req_send_mode == MCA_PML_BASE_SEND_BUFFERED) { \
|
||||
mca_pml_base_bsend_request_fini((ompi_request_t*)sendreq); \
|
||||
|
@ -1,7 +1,5 @@
|
||||
#include "pml_teg.h"
|
||||
#include "mca/ptl/base/ptl_base_comm.h"
|
||||
#include "mca/pml/base/pml_base_request.h"
|
||||
#include "mca/ptl/base/ptl_base_sendreq.h"
|
||||
|
||||
|
||||
int mca_pml_teg_free(ompi_request_t** request)
|
||||
|
@ -10,10 +10,10 @@ int mca_pml_teg_iprobe(
|
||||
{
|
||||
int rc;
|
||||
|
||||
mca_ptl_base_recv_request_t recvreq;
|
||||
OBJ_CONSTRUCT(&recvreq, mca_ptl_base_recv_request_t);
|
||||
mca_pml_base_recv_request_t recvreq;
|
||||
recvreq.super.super.req_type = OMPI_REQUEST_PML;
|
||||
recvreq.super.req_type = MCA_PML_REQUEST_IPROBE;
|
||||
MCA_PTL_BASE_RECV_REQUEST_INIT(
|
||||
MCA_PML_BASE_RECV_REQUEST_INIT(
|
||||
&recvreq,
|
||||
NULL,
|
||||
0,
|
||||
@ -30,8 +30,6 @@ int mca_pml_teg_iprobe(
|
||||
if((*matched = recvreq.super.req_mpi_done) == true && (NULL != status)) {
|
||||
*status = recvreq.super.req_status;
|
||||
}
|
||||
|
||||
OBJ_DESTRUCT(&recvreq);
|
||||
return OMPI_SUCCESS;
|
||||
}
|
||||
|
||||
@ -43,10 +41,10 @@ int mca_pml_teg_probe(
|
||||
ompi_status_public_t* status)
|
||||
{
|
||||
int rc;
|
||||
mca_ptl_base_recv_request_t recvreq;
|
||||
OBJ_CONSTRUCT(&recvreq, mca_ptl_base_recv_request_t);
|
||||
mca_pml_base_recv_request_t recvreq;
|
||||
recvreq.super.super.req_type = OMPI_REQUEST_PML;
|
||||
recvreq.super.req_type = MCA_PML_REQUEST_PROBE;
|
||||
MCA_PTL_BASE_RECV_REQUEST_INIT(
|
||||
MCA_PML_BASE_RECV_REQUEST_INIT(
|
||||
&recvreq,
|
||||
NULL,
|
||||
0,
|
||||
@ -81,7 +79,6 @@ int mca_pml_teg_probe(
|
||||
if(NULL != status) {
|
||||
*status = recvreq.super.req_status;
|
||||
}
|
||||
OBJ_DESTRUCT(&recvreq);
|
||||
return OMPI_SUCCESS;
|
||||
}
|
||||
|
||||
|
@ -11,12 +11,12 @@ int mca_pml_teg_irecv_init(
|
||||
struct ompi_request_t **request)
|
||||
{
|
||||
int rc;
|
||||
mca_ptl_base_recv_request_t *recvreq;
|
||||
mca_pml_base_recv_request_t *recvreq;
|
||||
MCA_PML_TEG_RECV_REQUEST_ALLOC(recvreq, rc);
|
||||
if(NULL == recvreq)
|
||||
return rc;
|
||||
|
||||
MCA_PTL_BASE_RECV_REQUEST_INIT(
|
||||
MCA_PML_BASE_RECV_REQUEST_INIT(
|
||||
recvreq,
|
||||
addr,
|
||||
count,
|
||||
@ -41,7 +41,7 @@ int mca_pml_teg_irecv(
|
||||
{
|
||||
int rc;
|
||||
|
||||
mca_ptl_base_recv_request_t *recvreq;
|
||||
mca_pml_base_recv_request_t *recvreq;
|
||||
MCA_PML_TEG_RECV_REQUEST_ALLOC(recvreq, rc);
|
||||
#if MCA_PML_TEG_STATISTICS
|
||||
mca_pml_teg.teg_irecvs++;
|
||||
@ -49,7 +49,7 @@ int mca_pml_teg_irecv(
|
||||
if(NULL == recvreq)
|
||||
return rc;
|
||||
|
||||
MCA_PTL_BASE_RECV_REQUEST_INIT(
|
||||
MCA_PML_BASE_RECV_REQUEST_INIT(
|
||||
recvreq,
|
||||
addr,
|
||||
count,
|
||||
@ -78,7 +78,7 @@ int mca_pml_teg_recv(
|
||||
ompi_status_public_t* status)
|
||||
{
|
||||
int rc;
|
||||
mca_ptl_base_recv_request_t *recvreq;
|
||||
mca_pml_base_recv_request_t *recvreq;
|
||||
MCA_PML_TEG_RECV_REQUEST_ALLOC(recvreq, rc);
|
||||
#if MCA_PML_TEG_STATISTICS
|
||||
mca_pml_teg.teg_recvs++;
|
||||
@ -86,7 +86,7 @@ int mca_pml_teg_recv(
|
||||
if(NULL == recvreq)
|
||||
return rc;
|
||||
|
||||
MCA_PTL_BASE_RECV_REQUEST_INIT(
|
||||
MCA_PML_BASE_RECV_REQUEST_INIT(
|
||||
recvreq,
|
||||
addr,
|
||||
count,
|
||||
|
@ -19,12 +19,12 @@ int mca_pml_teg_isend_init(
|
||||
{
|
||||
int rc;
|
||||
|
||||
mca_ptl_base_send_request_t* sendreq;
|
||||
mca_pml_base_send_request_t* sendreq;
|
||||
MCA_PML_TEG_SEND_REQUEST_ALLOC(comm,dst,sendreq,rc);
|
||||
if(rc != OMPI_SUCCESS)
|
||||
return rc;
|
||||
|
||||
MCA_PTL_BASE_SEND_REQUEST_INIT(
|
||||
MCA_PML_BASE_SEND_REQUEST_INIT(
|
||||
sendreq,
|
||||
buf,
|
||||
count,
|
||||
@ -52,14 +52,14 @@ int mca_pml_teg_isend(
|
||||
ompi_request_t **request)
|
||||
{
|
||||
int rc;
|
||||
mca_ptl_base_send_request_t* sendreq;
|
||||
mca_pml_base_send_request_t* sendreq;
|
||||
MCA_PML_TEG_SEND_REQUEST_ALLOC(comm,dst,sendreq,rc);
|
||||
#if MCA_PML_TEG_STATISTICS
|
||||
mca_pml_teg.teg_isends++;
|
||||
#endif
|
||||
if(rc != OMPI_SUCCESS)
|
||||
return rc;
|
||||
MCA_PTL_BASE_SEND_REQUEST_INIT(
|
||||
MCA_PML_BASE_SEND_REQUEST_INIT(
|
||||
sendreq,
|
||||
buf,
|
||||
count,
|
||||
@ -88,7 +88,7 @@ int mca_pml_teg_send(
|
||||
ompi_communicator_t* comm)
|
||||
{
|
||||
int rc;
|
||||
mca_ptl_base_send_request_t* sendreq;
|
||||
mca_pml_base_send_request_t* sendreq;
|
||||
MCA_PML_TEG_SEND_REQUEST_ALLOC(comm,dst,sendreq,rc);
|
||||
#if MCA_PML_TEG_STATISTICS
|
||||
mca_pml_teg.teg_sends++;
|
||||
@ -96,7 +96,7 @@ int mca_pml_teg_send(
|
||||
if(rc != OMPI_SUCCESS)
|
||||
return rc;
|
||||
|
||||
MCA_PTL_BASE_SEND_REQUEST_INIT(
|
||||
MCA_PML_BASE_SEND_REQUEST_INIT(
|
||||
sendreq,
|
||||
buf,
|
||||
count,
|
||||
|
@ -8,8 +8,8 @@
|
||||
#include "mca/ptl/ptl.h"
|
||||
#include "mca/base/mca_base_param.h"
|
||||
#include "mca/pml/base/pml_base_bsend.h"
|
||||
#include "mca/ptl/base/ptl_base_sendreq.h"
|
||||
#include "mca/ptl/base/ptl_base_recvreq.h"
|
||||
#include "mca/pml/base/pml_base_sendreq.h"
|
||||
#include "mca/pml/base/pml_base_recvreq.h"
|
||||
#include "pml_teg.h"
|
||||
#include "pml_teg_proc.h"
|
||||
|
||||
@ -147,8 +147,8 @@ mca_pml_t* mca_pml_teg_module_init(int* priority,
|
||||
/* recv requests */
|
||||
ompi_free_list_init(
|
||||
&mca_pml_teg.teg_recv_requests,
|
||||
sizeof(mca_ptl_base_recv_request_t),
|
||||
OBJ_CLASS(mca_ptl_base_recv_request_t),
|
||||
sizeof(mca_pml_base_recv_request_t),
|
||||
OBJ_CLASS(mca_pml_base_recv_request_t),
|
||||
mca_pml_teg.teg_free_list_num,
|
||||
mca_pml_teg.teg_free_list_max,
|
||||
mca_pml_teg.teg_free_list_inc,
|
||||
|
@ -1,7 +1,11 @@
|
||||
#include "mca/ptl/ptl.h"
|
||||
#include "mca/ptl/base/ptl_base_comm.h"
|
||||
#include "pml_teg_recvreq.h"
|
||||
|
||||
|
||||
static mca_ptl_base_recv_frag_t* mca_pml_teg_recv_request_match_specific_proc(
|
||||
mca_pml_base_recv_request_t* request, int proc);
|
||||
|
||||
/*
|
||||
* Update the recv request status to reflect the number of bytes
|
||||
* received and actually delivered to the application.
|
||||
@ -9,7 +13,7 @@
|
||||
|
||||
void mca_pml_teg_recv_request_progress(
|
||||
struct mca_ptl_t* ptl,
|
||||
mca_ptl_base_recv_request_t* req,
|
||||
mca_pml_base_recv_request_t* req,
|
||||
mca_ptl_base_recv_frag_t* frag)
|
||||
{
|
||||
THREAD_LOCK(&mca_pml_teg.teg_request_lock);
|
||||
@ -33,3 +37,124 @@ void mca_pml_teg_recv_request_progress(
|
||||
THREAD_UNLOCK(&mca_pml_teg.teg_request_lock);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* This routine is used to match a posted receive when the source process
|
||||
* is specified.
|
||||
*/
|
||||
|
||||
void mca_pml_teg_recv_request_match_specific(mca_pml_base_recv_request_t* request)
|
||||
{
|
||||
ompi_communicator_t *comm = request->super.req_comm;
|
||||
mca_pml_ptl_comm_t* pml_comm = comm->c_pml_comm;
|
||||
int req_peer = request->super.req_peer;
|
||||
mca_ptl_base_recv_frag_t* frag;
|
||||
|
||||
/* check for a specific match */
|
||||
THREAD_LOCK(&pml_comm->c_matching_lock);
|
||||
|
||||
/* assign sequence number */
|
||||
request->super.req_sequence = pml_comm->c_recv_seq++;
|
||||
|
||||
if (ompi_list_get_size(&pml_comm->c_unexpected_frags[req_peer]) > 0 &&
|
||||
(frag = mca_pml_teg_recv_request_match_specific_proc(request, req_peer)) != NULL) {
|
||||
mca_ptl_t* ptl = frag->super.frag_owner;
|
||||
THREAD_UNLOCK(&pml_comm->c_matching_lock);
|
||||
ptl->ptl_matched(ptl, frag);
|
||||
return; /* match found */
|
||||
}
|
||||
|
||||
/* We didn't find any matches. Record this irecv so we can match
|
||||
* it when the message comes in.
|
||||
*/
|
||||
if(request->super.req_type != MCA_PML_REQUEST_IPROBE)
|
||||
ompi_list_append(pml_comm->c_specific_receives+req_peer, (ompi_list_item_t*)request);
|
||||
THREAD_UNLOCK(&pml_comm->c_matching_lock);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* this routine is used to try and match a wild posted receive - where
|
||||
* wild is determined by the value assigned to the source process
|
||||
*/
|
||||
|
||||
void mca_pml_teg_recv_request_match_wild(mca_pml_base_recv_request_t* request)
|
||||
{
|
||||
ompi_communicator_t *comm = request->super.req_comm;
|
||||
mca_pml_ptl_comm_t* pml_comm = comm->c_pml_comm;
|
||||
int proc_count = comm->c_remote_group->grp_proc_count;
|
||||
int proc;
|
||||
|
||||
/*
|
||||
* Loop over all the outstanding messages to find one that matches.
|
||||
* There is an outer loop over lists of messages from each
|
||||
* process, then an inner loop over the messages from the
|
||||
* process.
|
||||
*/
|
||||
THREAD_LOCK(&pml_comm->c_matching_lock);
|
||||
|
||||
/* assign sequence number */
|
||||
request->super.req_sequence = pml_comm->c_recv_seq++;
|
||||
|
||||
for (proc = 0; proc < proc_count; proc++) {
|
||||
mca_ptl_base_recv_frag_t* frag;
|
||||
|
||||
/* continue if no frags to match */
|
||||
if (ompi_list_get_size(&pml_comm->c_unexpected_frags[proc]) == 0)
|
||||
continue;
|
||||
|
||||
/* loop over messages from the current proc */
|
||||
if ((frag = mca_pml_teg_recv_request_match_specific_proc(request, proc)) != NULL) {
|
||||
mca_ptl_t* ptl = frag->super.frag_owner;
|
||||
THREAD_UNLOCK(&pml_comm->c_matching_lock);
|
||||
ptl->ptl_matched(ptl, frag);
|
||||
return; /* match found */
|
||||
}
|
||||
}
|
||||
|
||||
/* We didn't find any matches. Record this irecv so we can match to
|
||||
* it when the message comes in.
|
||||
*/
|
||||
|
||||
if(request->super.req_type != MCA_PML_REQUEST_IPROBE)
|
||||
ompi_list_append(&pml_comm->c_wild_receives, (ompi_list_item_t*)request);
|
||||
THREAD_UNLOCK(&pml_comm->c_matching_lock);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* this routine tries to match a posted receive. If a match is found,
|
||||
* it places the request in the appropriate matched receive list.
|
||||
*/
|
||||
|
||||
static mca_ptl_base_recv_frag_t* mca_pml_teg_recv_request_match_specific_proc(
|
||||
mca_pml_base_recv_request_t* request, int proc)
|
||||
{
|
||||
mca_pml_ptl_comm_t *pml_comm = request->super.req_comm->c_pml_comm;
|
||||
ompi_list_t* unexpected_frags = pml_comm->c_unexpected_frags+proc;
|
||||
mca_ptl_base_recv_frag_t* frag;
|
||||
int tag = request->super.req_tag;
|
||||
|
||||
for (frag = (mca_ptl_base_recv_frag_t*)ompi_list_get_first(unexpected_frags);
|
||||
frag != (mca_ptl_base_recv_frag_t*)ompi_list_get_end(unexpected_frags);
|
||||
frag = (mca_ptl_base_recv_frag_t*)ompi_list_get_next(frag)) {
|
||||
mca_ptl_base_match_header_t* header = &frag->super.frag_header.hdr_match;
|
||||
|
||||
/* check first frag - we assume that process matching has been done already */
|
||||
if (((tag == OMPI_ANY_TAG) || (tag == header->hdr_tag))) {
|
||||
|
||||
if (tag == OMPI_ANY_TAG && header->hdr_tag < 0) {
|
||||
continue;
|
||||
}
|
||||
ompi_list_remove_item(unexpected_frags, (ompi_list_item_t*)frag);
|
||||
request->req_bytes_packed = header->hdr_msg_length;
|
||||
request->super.req_tag = header->hdr_tag;
|
||||
request->super.req_peer = header->hdr_src;
|
||||
frag->frag_request = request;
|
||||
return frag;
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -9,7 +9,7 @@
|
||||
|
||||
#include "pml_teg.h"
|
||||
#include "pml_teg_proc.h"
|
||||
#include "mca/ptl/base/ptl_base_recvreq.h"
|
||||
#include "mca/pml/base/pml_base_recvreq.h"
|
||||
#include "mca/ptl/base/ptl_base_recvfrag.h"
|
||||
|
||||
|
||||
@ -23,7 +23,7 @@
|
||||
{ \
|
||||
ompi_list_item_t* item; \
|
||||
OMPI_FREE_LIST_GET(&mca_pml_teg.teg_recv_requests, item, rc); \
|
||||
recvreq = (mca_ptl_base_recv_request_t*)item; \
|
||||
recvreq = (mca_pml_base_recv_request_t*)item; \
|
||||
}
|
||||
|
||||
/**
|
||||
@ -33,20 +33,36 @@
|
||||
*/
|
||||
#define MCA_PML_TEG_RECV_REQUEST_RETURN(request) \
|
||||
OMPI_FREE_LIST_RETURN(&mca_pml_teg.teg_recv_requests, (ompi_list_item_t*)request);
|
||||
|
||||
|
||||
/**
|
||||
* Attempt to match the request against the unexpected fragment list
|
||||
* for all source ranks w/in the communicator.
|
||||
*
|
||||
* @param request (IN) Request to match.
|
||||
*/
|
||||
void mca_pml_teg_recv_request_match_wild(mca_pml_base_recv_request_t* request);
|
||||
|
||||
/**
|
||||
* Attempt to match the request against the unexpected fragment list
|
||||
* for a specific source rank.
|
||||
*
|
||||
* @param request (IN) Request to match.
|
||||
*/
|
||||
void mca_pml_teg_recv_request_match_specific(mca_pml_base_recv_request_t* request);
|
||||
|
||||
/**
|
||||
* Start an initialized request.
|
||||
*
|
||||
* @param request Receive request.
|
||||
* @return OMPI_SUCESS or error status on failure.
|
||||
*/
|
||||
static inline int mca_pml_teg_recv_request_start(mca_ptl_base_recv_request_t* request)
|
||||
static inline int mca_pml_teg_recv_request_start(mca_pml_base_recv_request_t* request)
|
||||
{
|
||||
request->super.super.req_state = OMPI_REQUEST_ACTIVE;
|
||||
if(request->super.req_peer == OMPI_ANY_SOURCE) {
|
||||
mca_ptl_base_recv_request_match_wild(request);
|
||||
mca_pml_teg_recv_request_match_wild(request);
|
||||
} else {
|
||||
mca_ptl_base_recv_request_match_specific(request);
|
||||
mca_pml_teg_recv_request_match_specific(request);
|
||||
}
|
||||
return OMPI_SUCCESS;
|
||||
}
|
||||
@ -61,10 +77,9 @@ static inline int mca_pml_teg_recv_request_start(mca_ptl_base_recv_request_t* re
|
||||
*/
|
||||
void mca_pml_teg_recv_request_progress(
|
||||
struct mca_ptl_t* ptl,
|
||||
mca_ptl_base_recv_request_t* request,
|
||||
mca_pml_base_recv_request_t* request,
|
||||
mca_ptl_base_recv_frag_t* frag
|
||||
);
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -18,7 +18,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
void mca_pml_teg_send_request_schedule(mca_ptl_base_send_request_t* req)
|
||||
void mca_pml_teg_send_request_schedule(mca_pml_base_send_request_t* req)
|
||||
{
|
||||
ompi_proc_t *proc = ompi_comm_peer_lookup(req->super.req_comm, req->super.req_peer);
|
||||
mca_pml_proc_t* proc_pml = proc->proc_pml;
|
||||
@ -81,7 +81,7 @@ void mca_pml_teg_send_request_schedule(mca_ptl_base_send_request_t* req)
|
||||
|
||||
void mca_pml_teg_send_request_progress(
|
||||
struct mca_ptl_t* ptl,
|
||||
mca_ptl_base_send_request_t* req,
|
||||
mca_pml_base_send_request_t* req,
|
||||
mca_ptl_base_send_frag_t* frag)
|
||||
{
|
||||
bool first_frag;
|
||||
|
@ -9,8 +9,9 @@
|
||||
|
||||
#include "pml_teg_proc.h"
|
||||
#include "mca/ptl/ptl.h"
|
||||
#include "mca/ptl/base/ptl_base_sendreq.h"
|
||||
#include "mca/pml/base/pml_base_sendreq.h"
|
||||
#include "mca/ptl/base/ptl_base_sendfrag.h"
|
||||
#include "mca/ptl/base/ptl_base_comm.h"
|
||||
|
||||
|
||||
#define MCA_PML_TEG_SEND_REQUEST_ALLOC( \
|
||||
@ -36,7 +37,7 @@
|
||||
|
||||
|
||||
static inline int mca_pml_teg_send_request_start(
|
||||
mca_ptl_base_send_request_t* req)
|
||||
mca_pml_base_send_request_t* req)
|
||||
{
|
||||
mca_ptl_t* ptl = req->req_owner;
|
||||
size_t first_fragment_size = ptl->ptl_first_frag_size;
|
||||
@ -65,12 +66,12 @@ static inline int mca_pml_teg_send_request_start(
|
||||
}
|
||||
|
||||
|
||||
void mca_pml_teg_send_request_schedule(mca_ptl_base_send_request_t* req);
|
||||
void mca_pml_teg_send_request_schedule(mca_pml_base_send_request_t* req);
|
||||
|
||||
|
||||
void mca_pml_teg_send_request_progress(
|
||||
struct mca_ptl_t* ptl,
|
||||
mca_ptl_base_send_request_t* send_request,
|
||||
mca_pml_base_send_request_t* send_request,
|
||||
mca_ptl_base_send_frag_t* send_frag
|
||||
);
|
||||
|
||||
|
@ -9,7 +9,6 @@ int mca_pml_teg_start(size_t count, ompi_request_t** requests)
|
||||
size_t i;
|
||||
for(i=0; i<count; i++) {
|
||||
mca_pml_base_request_t *pml_request = (mca_pml_base_request_t*)requests[i];
|
||||
int state;
|
||||
if(NULL == pml_request)
|
||||
continue;
|
||||
|
||||
@ -42,7 +41,7 @@ int mca_pml_teg_start(size_t count, ompi_request_t** requests)
|
||||
switch(pml_request->req_type) {
|
||||
case MCA_PML_REQUEST_SEND: {
|
||||
mca_pml_base_send_mode_t sendmode =
|
||||
((mca_ptl_base_send_request_t*)pml_request)->req_send_mode;
|
||||
((mca_pml_base_send_request_t*)pml_request)->req_send_mode;
|
||||
rc = mca_pml_teg_isend_init(
|
||||
pml_request->req_addr,
|
||||
pml_request->req_count,
|
||||
@ -82,12 +81,12 @@ int mca_pml_teg_start(size_t count, ompi_request_t** requests)
|
||||
/* start the request */
|
||||
switch(pml_request->req_type) {
|
||||
case MCA_PML_REQUEST_SEND:
|
||||
if((rc = mca_pml_teg_send_request_start((mca_ptl_base_send_request_t*)pml_request))
|
||||
if((rc = mca_pml_teg_send_request_start((mca_pml_base_send_request_t*)pml_request))
|
||||
!= OMPI_SUCCESS)
|
||||
return rc;
|
||||
break;
|
||||
case MCA_PML_REQUEST_RECV:
|
||||
if((rc = mca_pml_teg_recv_request_start((mca_ptl_base_recv_request_t*)pml_request))
|
||||
if((rc = mca_pml_teg_recv_request_start((mca_pml_base_recv_request_t*)pml_request))
|
||||
!= OMPI_SUCCESS)
|
||||
return rc;
|
||||
break;
|
||||
|
@ -19,9 +19,7 @@ headers = \
|
||||
ptl_base_header.h \
|
||||
ptl_base_match.h \
|
||||
ptl_base_recvfrag.h \
|
||||
ptl_base_recvreq.h \
|
||||
ptl_base_sendfrag.h \
|
||||
ptl_base_sendreq.h
|
||||
ptl_base_sendfrag.h
|
||||
|
||||
libmca_ptl_base_la_SOURCES = \
|
||||
$(headers) \
|
||||
@ -31,10 +29,8 @@ libmca_ptl_base_la_SOURCES = \
|
||||
ptl_base_match.c \
|
||||
ptl_base_open.c \
|
||||
ptl_base_recvfrag.c \
|
||||
ptl_base_recvreq.c \
|
||||
ptl_base_select.c \
|
||||
ptl_base_sendfrag.c \
|
||||
ptl_base_sendreq.c
|
||||
ptl_base_sendfrag.c
|
||||
|
||||
# Conditionally install the header files
|
||||
|
||||
|
@ -22,19 +22,19 @@
|
||||
* Specialized matching routines for internal use only.
|
||||
*/
|
||||
|
||||
static mca_ptl_base_recv_request_t *mca_ptl_base_check_receives_for_match(
|
||||
static mca_pml_base_recv_request_t *mca_ptl_base_check_receives_for_match(
|
||||
mca_ptl_base_match_header_t *frag_header,
|
||||
mca_pml_ptl_comm_t *ptl_comm);
|
||||
|
||||
static mca_ptl_base_recv_request_t *mca_ptl_base_check_wild_receives_for_match(
|
||||
static mca_pml_base_recv_request_t *mca_ptl_base_check_wild_receives_for_match(
|
||||
mca_ptl_base_match_header_t *frag_header,
|
||||
mca_pml_ptl_comm_t *ptl_comm);
|
||||
|
||||
static mca_ptl_base_recv_request_t *mca_ptl_base_check_specific_receives_for_match(
|
||||
static mca_pml_base_recv_request_t *mca_ptl_base_check_specific_receives_for_match(
|
||||
mca_ptl_base_match_header_t *frag_header,
|
||||
mca_pml_ptl_comm_t *ptl_comm);
|
||||
|
||||
static mca_ptl_base_recv_request_t *mca_ptl_base_check_specific_and_wild_receives_for_match(
|
||||
static mca_pml_base_recv_request_t *mca_ptl_base_check_specific_and_wild_receives_for_match(
|
||||
mca_ptl_base_match_header_t *frag_header,
|
||||
mca_pml_ptl_comm_t *ptl_comm);
|
||||
|
||||
@ -81,7 +81,7 @@ bool mca_ptl_base_match(
|
||||
/* local variables */
|
||||
mca_ptl_sequence_t frag_msg_seq,next_msg_seq_expected;
|
||||
ompi_communicator_t *comm_ptr;
|
||||
mca_ptl_base_recv_request_t *matched_receive;
|
||||
mca_pml_base_recv_request_t *matched_receive;
|
||||
mca_pml_ptl_comm_t *pml_comm;
|
||||
int frag_src;
|
||||
bool match_made=false;
|
||||
@ -185,15 +185,15 @@ bool mca_ptl_base_match(
|
||||
* This routine assumes that the appropriate matching locks are
|
||||
* set by the upper level routine.
|
||||
*/
|
||||
static mca_ptl_base_recv_request_t *mca_ptl_base_check_receives_for_match
|
||||
static mca_pml_base_recv_request_t *mca_ptl_base_check_receives_for_match
|
||||
(mca_ptl_base_match_header_t *frag_header, mca_pml_ptl_comm_t *pml_comm)
|
||||
{
|
||||
/* local parameters */
|
||||
mca_ptl_base_recv_request_t *return_match;
|
||||
mca_pml_base_recv_request_t *return_match;
|
||||
int frag_src;
|
||||
|
||||
/* initialization */
|
||||
return_match=(mca_ptl_base_recv_request_t *)NULL;
|
||||
return_match=(mca_pml_base_recv_request_t *)NULL;
|
||||
|
||||
/*
|
||||
* figure out what sort of matching logic to use, if need to
|
||||
@ -240,16 +240,16 @@ static mca_ptl_base_recv_request_t *mca_ptl_base_check_receives_for_match
|
||||
* This routine assumes that the appropriate matching locks are
|
||||
* set by the upper level routine.
|
||||
*/
|
||||
static mca_ptl_base_recv_request_t *mca_ptl_base_check_wild_receives_for_match(
|
||||
static mca_pml_base_recv_request_t *mca_ptl_base_check_wild_receives_for_match(
|
||||
mca_ptl_base_match_header_t *frag_header,
|
||||
mca_pml_ptl_comm_t *pml_comm)
|
||||
{
|
||||
/* local parameters */
|
||||
mca_ptl_base_recv_request_t *return_match, *wild_recv;
|
||||
mca_pml_base_recv_request_t *return_match, *wild_recv;
|
||||
int frag_tag,recv_tag;
|
||||
|
||||
/* initialization */
|
||||
return_match=(mca_ptl_base_recv_request_t *)NULL;
|
||||
return_match=(mca_pml_base_recv_request_t *)NULL;
|
||||
frag_tag=frag_header->hdr_tag;
|
||||
|
||||
/*
|
||||
@ -257,11 +257,11 @@ static mca_ptl_base_recv_request_t *mca_ptl_base_check_wild_receives_for_match(
|
||||
* locking is protecting from having other threads trying to
|
||||
* change this list.
|
||||
*/
|
||||
for(wild_recv = (mca_ptl_base_recv_request_t *)
|
||||
for(wild_recv = (mca_pml_base_recv_request_t *)
|
||||
ompi_list_get_first(&(pml_comm->c_wild_receives));
|
||||
wild_recv != (mca_ptl_base_recv_request_t *)
|
||||
wild_recv != (mca_pml_base_recv_request_t *)
|
||||
ompi_list_get_end(&(pml_comm->c_wild_receives));
|
||||
wild_recv = (mca_ptl_base_recv_request_t *)
|
||||
wild_recv = (mca_pml_base_recv_request_t *)
|
||||
((ompi_list_item_t *)wild_recv)->ompi_list_next) {
|
||||
|
||||
recv_tag = wild_recv->super.req_tag;
|
||||
@ -306,28 +306,28 @@ static mca_ptl_base_recv_request_t *mca_ptl_base_check_wild_receives_for_match(
|
||||
* This routine assumes that the appropriate matching locks are
|
||||
* set by the upper level routine.
|
||||
*/
|
||||
static mca_ptl_base_recv_request_t *mca_ptl_base_check_specific_receives_for_match(
|
||||
static mca_pml_base_recv_request_t *mca_ptl_base_check_specific_receives_for_match(
|
||||
mca_ptl_base_match_header_t *frag_header,
|
||||
mca_pml_ptl_comm_t *pml_comm)
|
||||
{
|
||||
/* local variables */
|
||||
mca_ptl_base_recv_request_t *specific_recv, *return_match;
|
||||
mca_pml_base_recv_request_t *specific_recv, *return_match;
|
||||
int frag_src,recv_tag,frag_tag;
|
||||
|
||||
|
||||
/* initialization */
|
||||
return_match=(mca_ptl_base_recv_request_t *)NULL;
|
||||
return_match=(mca_pml_base_recv_request_t *)NULL;
|
||||
frag_src = frag_header->hdr_src;
|
||||
frag_tag=frag_header->hdr_tag;
|
||||
|
||||
/*
|
||||
* Loop over the specific irecvs.
|
||||
*/
|
||||
for(specific_recv = (mca_ptl_base_recv_request_t *)
|
||||
for(specific_recv = (mca_pml_base_recv_request_t *)
|
||||
ompi_list_get_first((pml_comm->c_specific_receives)+frag_src);
|
||||
specific_recv != (mca_ptl_base_recv_request_t *)
|
||||
specific_recv != (mca_pml_base_recv_request_t *)
|
||||
ompi_list_get_end((pml_comm->c_specific_receives)+frag_src);
|
||||
specific_recv = (mca_ptl_base_recv_request_t *)
|
||||
specific_recv = (mca_pml_base_recv_request_t *)
|
||||
((ompi_list_item_t *)specific_recv)->ompi_list_next) {
|
||||
/*
|
||||
* Check for a match
|
||||
@ -368,17 +368,17 @@ static mca_ptl_base_recv_request_t *mca_ptl_base_check_specific_receives_for_mat
|
||||
* This routine assumes that the appropriate matching locks are
|
||||
* set by the upper level routine.
|
||||
*/
|
||||
static mca_ptl_base_recv_request_t *mca_ptl_base_check_specific_and_wild_receives_for_match(
|
||||
static mca_pml_base_recv_request_t *mca_ptl_base_check_specific_and_wild_receives_for_match(
|
||||
mca_ptl_base_match_header_t *frag_header,
|
||||
mca_pml_ptl_comm_t *pml_comm)
|
||||
{
|
||||
/* local variables */
|
||||
mca_ptl_base_recv_request_t *specific_recv, *wild_recv, *return_match;
|
||||
mca_pml_base_recv_request_t *specific_recv, *wild_recv, *return_match;
|
||||
mca_ptl_sequence_t wild_recv_seq, specific_recv_seq;
|
||||
int frag_src,frag_tag, wild_recv_tag, specific_recv_tag;
|
||||
|
||||
/* initialization */
|
||||
return_match=(mca_ptl_base_recv_request_t *)NULL;
|
||||
return_match=(mca_pml_base_recv_request_t *)NULL;
|
||||
frag_src = frag_header->hdr_src;
|
||||
frag_tag=frag_header->hdr_tag;
|
||||
|
||||
@ -386,9 +386,9 @@ static mca_ptl_base_recv_request_t *mca_ptl_base_check_specific_and_wild_receive
|
||||
* We know that when this is called, both specific and wild irecvs
|
||||
* have been posted.
|
||||
*/
|
||||
specific_recv = (mca_ptl_base_recv_request_t *)
|
||||
specific_recv = (mca_pml_base_recv_request_t *)
|
||||
ompi_list_get_first((pml_comm->c_specific_receives)+frag_src);
|
||||
wild_recv = (mca_ptl_base_recv_request_t *)
|
||||
wild_recv = (mca_pml_base_recv_request_t *)
|
||||
ompi_list_get_first(&(pml_comm->c_wild_receives));
|
||||
|
||||
specific_recv_seq = specific_recv->super.req_sequence;
|
||||
@ -421,14 +421,14 @@ static mca_ptl_base_recv_request_t *mca_ptl_base_check_specific_and_wild_receive
|
||||
/*
|
||||
* No match, go to the next.
|
||||
*/
|
||||
wild_recv=(mca_ptl_base_recv_request_t *)
|
||||
wild_recv=(mca_pml_base_recv_request_t *)
|
||||
((ompi_list_item_t *)wild_recv)->ompi_list_next;
|
||||
|
||||
/*
|
||||
* If that was the last wild one, just look at the
|
||||
* rest of the specific ones.
|
||||
*/
|
||||
if (wild_recv == (mca_ptl_base_recv_request_t *)
|
||||
if (wild_recv == (mca_pml_base_recv_request_t *)
|
||||
ompi_list_get_end(&(pml_comm->c_wild_receives)) )
|
||||
{
|
||||
return_match = mca_ptl_base_check_specific_receives_for_match(frag_header,
|
||||
@ -467,14 +467,14 @@ static mca_ptl_base_recv_request_t *mca_ptl_base_check_specific_and_wild_receive
|
||||
/*
|
||||
* No match, go on to the next specific irecv.
|
||||
*/
|
||||
specific_recv = (mca_ptl_base_recv_request_t *)
|
||||
specific_recv = (mca_pml_base_recv_request_t *)
|
||||
((ompi_list_item_t *)specific_recv)->ompi_list_next;
|
||||
|
||||
/*
|
||||
* If that was the last specific irecv, process the
|
||||
* rest of the wild ones.
|
||||
*/
|
||||
if (specific_recv == (mca_ptl_base_recv_request_t *)
|
||||
if (specific_recv == (mca_pml_base_recv_request_t *)
|
||||
ompi_list_get_end((pml_comm->c_specific_receives)+frag_src) )
|
||||
{
|
||||
return_match = mca_ptl_base_check_wild_receives_for_match(frag_header,
|
||||
@ -515,7 +515,7 @@ static void mca_ptl_base_check_cantmatch_for_match(ompi_list_t *additional_match
|
||||
int match_found;
|
||||
mca_ptl_sequence_t next_msg_seq_expected, frag_seq;
|
||||
mca_ptl_base_recv_frag_t *frag_desc;
|
||||
mca_ptl_base_recv_request_t *matched_receive;
|
||||
mca_pml_base_recv_request_t *matched_receive;
|
||||
|
||||
/*
|
||||
* Loop over all the out of sequence messages. No ordering is assumed
|
||||
|
@ -8,8 +8,8 @@
|
||||
#define MCA_PTL_BASE_RECVFRAG_H
|
||||
|
||||
#include "mca/ptl/ptl.h"
|
||||
#include "mca/pml/base/pml_base_recvreq.h"
|
||||
#include "mca/ptl/base/ptl_base_fragment.h"
|
||||
#include "mca/ptl/base/ptl_base_recvreq.h"
|
||||
#include "mca/ptl/base/ptl_base_match.h"
|
||||
|
||||
extern ompi_class_t mca_ptl_base_recv_frag_t_class;
|
||||
@ -19,7 +19,7 @@ extern ompi_class_t mca_ptl_base_recv_frag_t_class;
|
||||
*/
|
||||
struct mca_ptl_base_recv_frag_t {
|
||||
mca_ptl_base_frag_t super; /**< base fragment descriptor */
|
||||
mca_ptl_base_recv_request_t *frag_request; /**< matched posted receive */
|
||||
mca_pml_base_recv_request_t *frag_request; /**< matched posted receive */
|
||||
bool frag_is_buffered; /**< does fragment need to be unpacked into users buffer */
|
||||
};
|
||||
typedef struct mca_ptl_base_recv_frag_t mca_ptl_base_recv_frag_t;
|
||||
@ -46,7 +46,7 @@ static inline bool mca_ptl_base_recv_frag_match(
|
||||
|
||||
while(NULL != frag) {
|
||||
mca_ptl_t* ptl = frag->super.frag_owner;
|
||||
mca_ptl_base_recv_request_t *request = frag->frag_request;
|
||||
mca_pml_base_recv_request_t *request = frag->frag_request;
|
||||
mca_ptl_base_match_header_t *header = &frag->super.frag_header.hdr_match;
|
||||
|
||||
/*
|
||||
|
@ -1,155 +0,0 @@
|
||||
/*
|
||||
* $HEADER$
|
||||
*/
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
|
||||
#include "include/types.h"
|
||||
#include "mca/ptl/base/ptl_base_comm.h"
|
||||
#include "mca/ptl/base/ptl_base_recvreq.h"
|
||||
#include "mca/ptl/base/ptl_base_recvfrag.h"
|
||||
|
||||
|
||||
static void mca_ptl_base_recv_request_construct(mca_ptl_base_recv_request_t*);
|
||||
static void mca_ptl_base_recv_request_destruct(mca_ptl_base_recv_request_t*);
|
||||
static mca_ptl_base_recv_frag_t* mca_ptl_base_recv_request_match_specific_proc(mca_ptl_base_recv_request_t*, int);
|
||||
|
||||
|
||||
ompi_class_t mca_ptl_base_recv_request_t_class = {
|
||||
"mca_ptl_base_recv_request_t",
|
||||
OBJ_CLASS(mca_pml_base_request_t),
|
||||
(ompi_construct_t) mca_ptl_base_recv_request_construct,
|
||||
(ompi_destruct_t) mca_ptl_base_recv_request_destruct
|
||||
};
|
||||
|
||||
|
||||
static void mca_ptl_base_recv_request_construct(mca_ptl_base_recv_request_t* request)
|
||||
{
|
||||
/* no need to reinit for every recv -- never changes */
|
||||
request->super.req_type = MCA_PML_REQUEST_RECV;
|
||||
}
|
||||
|
||||
|
||||
static void mca_ptl_base_recv_request_destruct(mca_ptl_base_recv_request_t* request)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* This routine is used to match a posted receive when the source process
|
||||
* is specified.
|
||||
*/
|
||||
|
||||
void mca_ptl_base_recv_request_match_specific(mca_ptl_base_recv_request_t* request)
|
||||
{
|
||||
ompi_communicator_t *comm = request->super.req_comm;
|
||||
mca_pml_ptl_comm_t* pml_comm = comm->c_pml_comm;
|
||||
int req_peer = request->super.req_peer;
|
||||
mca_ptl_base_recv_frag_t* frag;
|
||||
|
||||
/* check for a specific match */
|
||||
THREAD_LOCK(&pml_comm->c_matching_lock);
|
||||
|
||||
/* assign sequence number */
|
||||
request->super.req_sequence = pml_comm->c_recv_seq++;
|
||||
|
||||
if (ompi_list_get_size(&pml_comm->c_unexpected_frags[req_peer]) > 0 &&
|
||||
(frag = mca_ptl_base_recv_request_match_specific_proc(request, req_peer)) != NULL) {
|
||||
mca_ptl_t* ptl = frag->super.frag_owner;
|
||||
THREAD_UNLOCK(&pml_comm->c_matching_lock);
|
||||
ptl->ptl_matched(ptl, frag);
|
||||
return; /* match found */
|
||||
}
|
||||
|
||||
/* We didn't find any matches. Record this irecv so we can match
|
||||
* it when the message comes in.
|
||||
*/
|
||||
if(request->super.req_type != MCA_PML_REQUEST_IPROBE)
|
||||
ompi_list_append(pml_comm->c_specific_receives+req_peer, (ompi_list_item_t*)request);
|
||||
THREAD_UNLOCK(&pml_comm->c_matching_lock);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* this routine is used to try and match a wild posted receive - where
|
||||
* wild is determined by the value assigned to the source process
|
||||
*/
|
||||
|
||||
void mca_ptl_base_recv_request_match_wild(mca_ptl_base_recv_request_t* request)
|
||||
{
|
||||
ompi_communicator_t *comm = request->super.req_comm;
|
||||
mca_pml_ptl_comm_t* pml_comm = comm->c_pml_comm;
|
||||
int proc_count = comm->c_remote_group->grp_proc_count;
|
||||
int proc;
|
||||
|
||||
/*
|
||||
* Loop over all the outstanding messages to find one that matches.
|
||||
* There is an outer loop over lists of messages from each
|
||||
* process, then an inner loop over the messages from the
|
||||
* process.
|
||||
*/
|
||||
THREAD_LOCK(&pml_comm->c_matching_lock);
|
||||
|
||||
/* assign sequence number */
|
||||
request->super.req_sequence = pml_comm->c_recv_seq++;
|
||||
|
||||
for (proc = 0; proc < proc_count; proc++) {
|
||||
mca_ptl_base_recv_frag_t* frag;
|
||||
|
||||
/* continue if no frags to match */
|
||||
if (ompi_list_get_size(&pml_comm->c_unexpected_frags[proc]) == 0)
|
||||
continue;
|
||||
|
||||
/* loop over messages from the current proc */
|
||||
if ((frag = mca_ptl_base_recv_request_match_specific_proc(request, proc)) != NULL) {
|
||||
mca_ptl_t* ptl = frag->super.frag_owner;
|
||||
THREAD_UNLOCK(&pml_comm->c_matching_lock);
|
||||
ptl->ptl_matched(ptl, frag);
|
||||
return; /* match found */
|
||||
}
|
||||
}
|
||||
|
||||
/* We didn't find any matches. Record this irecv so we can match to
|
||||
* it when the message comes in.
|
||||
*/
|
||||
|
||||
if(request->super.req_type != MCA_PML_REQUEST_IPROBE)
|
||||
ompi_list_append(&pml_comm->c_wild_receives, (ompi_list_item_t*)request);
|
||||
THREAD_UNLOCK(&pml_comm->c_matching_lock);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* this routine tries to match a posted receive. If a match is found,
|
||||
* it places the request in the appropriate matched receive list.
|
||||
*/
|
||||
|
||||
static mca_ptl_base_recv_frag_t* mca_ptl_base_recv_request_match_specific_proc(
|
||||
mca_ptl_base_recv_request_t* request, int proc)
|
||||
{
|
||||
mca_pml_ptl_comm_t *pml_comm = request->super.req_comm->c_pml_comm;
|
||||
ompi_list_t* unexpected_frags = pml_comm->c_unexpected_frags+proc;
|
||||
mca_ptl_base_recv_frag_t* frag;
|
||||
int tag = request->super.req_tag;
|
||||
|
||||
for (frag = (mca_ptl_base_recv_frag_t*)ompi_list_get_first(unexpected_frags);
|
||||
frag != (mca_ptl_base_recv_frag_t*)ompi_list_get_end(unexpected_frags);
|
||||
frag = (mca_ptl_base_recv_frag_t*)ompi_list_get_next(frag)) {
|
||||
mca_ptl_base_match_header_t* header = &frag->super.frag_header.hdr_match;
|
||||
|
||||
/* check first frag - we assume that process matching has been done already */
|
||||
if (((tag == OMPI_ANY_TAG) || (tag == header->hdr_tag))) {
|
||||
|
||||
if (tag == OMPI_ANY_TAG && header->hdr_tag < 0) {
|
||||
continue;
|
||||
}
|
||||
ompi_list_remove_item(unexpected_frags, (ompi_list_item_t*)frag);
|
||||
request->req_bytes_packed = header->hdr_msg_length;
|
||||
request->super.req_tag = header->hdr_tag;
|
||||
request->super.req_peer = header->hdr_src;
|
||||
frag->frag_request = request;
|
||||
return frag;
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
@ -17,7 +17,7 @@ extern ompi_class_t mca_ptl_base_send_frag_t_class;
|
||||
*/
|
||||
struct mca_ptl_base_send_frag_t {
|
||||
mca_ptl_base_frag_t super; /**< base fragment descriptor */
|
||||
struct mca_ptl_base_send_request_t *frag_request; /**< pointer to send request */
|
||||
struct mca_pml_base_send_request_t *frag_request; /**< pointer to send request */
|
||||
};
|
||||
typedef struct mca_ptl_base_send_frag_t mca_ptl_base_send_frag_t;
|
||||
|
||||
|
@ -1,30 +0,0 @@
|
||||
/*
|
||||
* $HEADER$
|
||||
*/
|
||||
#include <string.h>
|
||||
#include "mca/ptl/base/ptl_base_sendreq.h"
|
||||
#include "mca/ptl/base/ptl_base_sendfrag.h"
|
||||
|
||||
static void mca_ptl_base_send_request_construct(mca_ptl_base_send_request_t* req);
|
||||
static void mca_ptl_base_send_request_destruct(mca_ptl_base_send_request_t* req);
|
||||
|
||||
|
||||
ompi_class_t mca_ptl_base_send_request_t_class = {
|
||||
"mca_ptl_base_send_request_t",
|
||||
OBJ_CLASS(mca_pml_base_request_t),
|
||||
(ompi_construct_t) mca_ptl_base_send_request_construct,
|
||||
(ompi_destruct_t) mca_ptl_base_send_request_destruct
|
||||
};
|
||||
|
||||
|
||||
static void mca_ptl_base_send_request_construct(mca_ptl_base_send_request_t* request)
|
||||
{
|
||||
/* no need to reinit for every send -- never changes */
|
||||
request->super.req_type = MCA_PML_REQUEST_SEND;
|
||||
OBJ_CONSTRUCT(&request->req_convertor, ompi_convertor_t);
|
||||
}
|
||||
|
||||
static void mca_ptl_base_send_request_destruct(mca_ptl_base_send_request_t* req)
|
||||
{
|
||||
}
|
||||
|
@ -138,8 +138,8 @@
|
||||
struct mca_ptl_t;
|
||||
struct mca_ptl_base_peer_t;
|
||||
struct mca_ptl_base_fragment_t;
|
||||
struct mca_ptl_base_recv_request_t;
|
||||
struct mca_ptl_base_send_request_t;
|
||||
struct mca_pml_base_recv_request_t;
|
||||
struct mca_pml_base_send_request_t;
|
||||
struct mca_ptl_base_recv_frag_t;
|
||||
struct mca_ptl_base_send_frag_t;
|
||||
struct mca_ptl_base_match_header_t;
|
||||
@ -306,14 +306,14 @@ typedef int (*mca_ptl_base_del_procs_fn_t)(
|
||||
* @return Status indicating if allocation was successful.
|
||||
*
|
||||
* To reduce latency (number of required allocations), a derived
|
||||
* type of mca_ptl_base_send_request_t is obtained from the PTL that
|
||||
* type of mca_pml_base_send_request_t is obtained from the PTL that
|
||||
* is selected to send the first fragment. The derived type should contain
|
||||
* space for the base request structure, the PTL first fragment,
|
||||
* and any other required buffer space.
|
||||
*/
|
||||
typedef int (*mca_ptl_base_request_alloc_fn_t)(
|
||||
struct mca_ptl_t* ptl,
|
||||
struct mca_ptl_base_send_request_t** request
|
||||
struct mca_pml_base_send_request_t** request
|
||||
);
|
||||
|
||||
/**
|
||||
@ -327,7 +327,7 @@ typedef int (*mca_ptl_base_request_alloc_fn_t)(
|
||||
*/
|
||||
typedef void (*mca_ptl_base_request_return_fn_t)(
|
||||
struct mca_ptl_t* ptl,
|
||||
struct mca_ptl_base_send_request_t* request
|
||||
struct mca_pml_base_send_request_t* request
|
||||
);
|
||||
|
||||
/**
|
||||
@ -354,7 +354,7 @@ typedef void (*mca_ptl_base_request_return_fn_t)(
|
||||
typedef int (*mca_ptl_base_put_fn_t)(
|
||||
struct mca_ptl_t* ptl,
|
||||
struct mca_ptl_base_peer_t* ptl_base_peer,
|
||||
struct mca_ptl_base_send_request_t* request,
|
||||
struct mca_pml_base_send_request_t* request,
|
||||
size_t offset,
|
||||
size_t size,
|
||||
int flags
|
||||
@ -380,7 +380,7 @@ typedef int (*mca_ptl_base_put_fn_t)(
|
||||
typedef int (*mca_ptl_base_get_fn_t)(
|
||||
struct mca_ptl_t* ptl,
|
||||
struct mca_ptl_base_peer_t* ptl_base_peer,
|
||||
struct mca_ptl_base_recv_request_t* request,
|
||||
struct mca_pml_base_recv_request_t* request,
|
||||
size_t offset,
|
||||
size_t size,
|
||||
int flags
|
||||
@ -435,7 +435,7 @@ typedef void (*mca_ptl_base_matched_fn_t)(
|
||||
*/
|
||||
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_pml_base_recv_request_t* recv_request,
|
||||
struct mca_ptl_base_recv_frag_t* recv_frag
|
||||
);
|
||||
|
||||
@ -449,7 +449,7 @@ typedef void (*mca_ptl_base_recv_progress_fn_t)(
|
||||
*/
|
||||
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_pml_base_send_request_t* send_request,
|
||||
struct mca_ptl_base_send_frag_t* send_frag
|
||||
);
|
||||
|
||||
|
@ -17,10 +17,10 @@
|
||||
#include "util/output.h"
|
||||
#include "mca/pml/pml.h"
|
||||
#include "mca/ptl/ptl.h"
|
||||
#include "mca/ptl/base/ptl_base_sendreq.h"
|
||||
#include "mca/pml/base/pml_base_sendreq.h"
|
||||
#include "mca/ptl/base/ptl_base_sendfrag.h"
|
||||
#include "mca/ptl/base/ptl_base_recvfrag.h"
|
||||
#include "mca/base/mca_base_param.h"
|
||||
#include "mca/pml/teg/src/pml_teg_sendreq.h"
|
||||
#include "ptl_self.h"
|
||||
|
||||
mca_ptl_t mca_ptl_self = {
|
||||
@ -73,21 +73,21 @@ int mca_ptl_self_finalize(struct mca_ptl_t* ptl)
|
||||
return OMPI_SUCCESS;
|
||||
}
|
||||
|
||||
int mca_ptl_self_request_alloc(struct mca_ptl_t* ptl, struct mca_ptl_base_send_request_t** request)
|
||||
int mca_ptl_self_request_alloc(struct mca_ptl_t* ptl, struct mca_pml_base_send_request_t** request)
|
||||
{
|
||||
int rc;
|
||||
mca_ptl_base_send_request_t* sendreq;
|
||||
mca_pml_base_send_request_t* sendreq;
|
||||
ompi_list_item_t* send_item;
|
||||
|
||||
OMPI_FREE_LIST_GET( &mca_ptl_self_module.self_send_requests, send_item, rc );
|
||||
|
||||
sendreq = (mca_ptl_base_send_request_t*)send_item;
|
||||
sendreq = (mca_pml_base_send_request_t*)send_item;
|
||||
sendreq->req_owner = ptl;
|
||||
*request = sendreq;
|
||||
return rc;
|
||||
}
|
||||
|
||||
void mca_ptl_self_request_return(struct mca_ptl_t* ptl, struct mca_ptl_base_send_request_t* request)
|
||||
void mca_ptl_self_request_return(struct mca_ptl_t* ptl, struct mca_pml_base_send_request_t* request)
|
||||
{
|
||||
OMPI_FREE_LIST_RETURN( &mca_ptl_self_module.self_send_requests, (ompi_list_item_t*)request);
|
||||
}
|
||||
@ -102,7 +102,7 @@ void mca_ptl_self_request_return(struct mca_ptl_t* ptl, struct mca_ptl_base_send
|
||||
int mca_ptl_self_send(
|
||||
struct mca_ptl_t* ptl,
|
||||
struct mca_ptl_base_peer_t* ptl_base_peer,
|
||||
struct mca_ptl_base_send_request_t* request,
|
||||
struct mca_pml_base_send_request_t* request,
|
||||
size_t offset,
|
||||
size_t size,
|
||||
int flags )
|
||||
@ -142,7 +142,7 @@ void mca_ptl_self_matched( mca_ptl_t* ptl,
|
||||
mca_ptl_base_recv_frag_t* frag)
|
||||
{
|
||||
mca_ptl_self_send_request_t* sendreq = (mca_ptl_self_send_request_t*)(frag->super.frag_header.hdr_frag.hdr_src_ptr.pval);
|
||||
mca_ptl_base_recv_request_t* recvreq = frag->frag_request;
|
||||
mca_pml_base_recv_request_t* recvreq = frag->frag_request;
|
||||
mca_ptl_base_send_frag_t sendfrag;
|
||||
|
||||
/* Did you have the same datatype or not ? If yes we can use an optimized version
|
||||
|
@ -12,7 +12,8 @@
|
||||
#include "event/event.h"
|
||||
#include "mca/pml/pml.h"
|
||||
#include "mca/ptl/ptl.h"
|
||||
#include "mca/ptl/base/ptl_base_recvreq.h"
|
||||
#include "mca/pml/base/pml_base_sendreq.h"
|
||||
#include "mca/pml/base/pml_base_recvreq.h"
|
||||
#include "mca/ptl/base/ptl_base_recvfrag.h"
|
||||
|
||||
/**
|
||||
@ -39,7 +40,7 @@ typedef struct mca_ptl_self_module_1_0_0_t mca_ptl_self_module_t;
|
||||
* base send request, and the base receive fragment which will be used to do the match.
|
||||
*/
|
||||
struct mca_ptl_self_send_request_t {
|
||||
mca_ptl_base_send_request_t super;
|
||||
mca_pml_base_send_request_t super;
|
||||
mca_ptl_base_recv_frag_t req_frag; /* first fragment */
|
||||
};
|
||||
typedef struct mca_ptl_self_send_request_t mca_ptl_self_send_request_t;
|
||||
@ -76,9 +77,9 @@ extern mca_ptl_t** mca_ptl_self_module_init(
|
||||
int mca_ptl_self_add_proc(struct mca_ptl_t* ptl, size_t nprocs, struct ompi_proc_t **ompi_proc, struct mca_ptl_base_peer_t** peer_ret, ompi_bitmap_t* reachable);
|
||||
int mca_ptl_self_del_proc(struct mca_ptl_t* ptl, size_t nprocs, struct ompi_proc_t **proc, struct mca_ptl_base_peer_t** ptl_peer);
|
||||
int mca_ptl_self_finalize(struct mca_ptl_t* ptl);
|
||||
int mca_ptl_self_request_alloc(struct mca_ptl_t* ptl, struct mca_ptl_base_send_request_t** request);
|
||||
void mca_ptl_self_request_return(struct mca_ptl_t* ptl, struct mca_ptl_base_send_request_t* request);
|
||||
int mca_ptl_self_send( struct mca_ptl_t* ptl, struct mca_ptl_base_peer_t* ptl_base_peer, struct mca_ptl_base_send_request_t* request,
|
||||
int mca_ptl_self_request_alloc(struct mca_ptl_t* ptl, struct mca_pml_base_send_request_t** request);
|
||||
void mca_ptl_self_request_return(struct mca_ptl_t* ptl, struct mca_pml_base_send_request_t* request);
|
||||
int mca_ptl_self_send( struct mca_ptl_t* ptl, 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 );
|
||||
void mca_ptl_self_matched( mca_ptl_t* ptl, mca_ptl_base_recv_frag_t* frag );
|
||||
|
||||
|
@ -18,7 +18,7 @@
|
||||
#include "util/output.h"
|
||||
#include "mca/pml/pml.h"
|
||||
#include "mca/ptl/ptl.h"
|
||||
#include "mca/ptl/base/ptl_base_sendreq.h"
|
||||
#include "mca/pml/base/pml_base_sendreq.h"
|
||||
#include "mca/ptl/base/ptl_base_recvfrag.h"
|
||||
#include "mca/base/mca_base_param.h"
|
||||
#include "mca/base/mca_base_module_exchange.h"
|
||||
@ -66,7 +66,8 @@ static void mca_ptl_self_send_request_destruct(mca_ptl_self_send_request_t* requ
|
||||
OBJ_DESTRUCT(&request->req_frag);
|
||||
}
|
||||
|
||||
OBJ_CLASS_INSTANCE( mca_ptl_self_send_request_t, mca_ptl_base_send_request_t,
|
||||
OBJ_CLASS_INSTANCE( mca_ptl_self_send_request_t,
|
||||
mca_pml_base_send_request_t,
|
||||
mca_ptl_self_send_request_construct,
|
||||
mca_ptl_self_send_request_destruct );
|
||||
|
||||
|
@ -7,10 +7,10 @@
|
||||
#include "util/if.h"
|
||||
#include "mca/pml/pml.h"
|
||||
#include "mca/ptl/ptl.h"
|
||||
#include "mca/pml/base/pml_base_sendreq.h"
|
||||
#include "mca/pml/base/pml_base_recvreq.h"
|
||||
#include "mca/ptl/base/ptl_base_header.h"
|
||||
#include "mca/ptl/base/ptl_base_sendreq.h"
|
||||
#include "mca/ptl/base/ptl_base_sendfrag.h"
|
||||
#include "mca/ptl/base/ptl_base_recvreq.h"
|
||||
#include "mca/ptl/base/ptl_base_recvfrag.h"
|
||||
#include "mca/base/mca_base_module_exchange.h"
|
||||
#include "ptl_sm.h"
|
||||
@ -142,13 +142,13 @@ int mca_ptl_sm_finalize(struct mca_ptl_t* ptl)
|
||||
}
|
||||
|
||||
|
||||
int mca_ptl_sm_request_alloc(struct mca_ptl_t* ptl, struct mca_ptl_base_send_request_t** request)
|
||||
int mca_ptl_sm_request_alloc(struct mca_ptl_t* ptl, struct mca_pml_base_send_request_t** request)
|
||||
{
|
||||
return OMPI_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
void mca_ptl_sm_request_return(struct mca_ptl_t* ptl, struct mca_ptl_base_send_request_t* request)
|
||||
void mca_ptl_sm_request_return(struct mca_ptl_t* ptl, struct mca_pml_base_send_request_t* request)
|
||||
{
|
||||
}
|
||||
|
||||
@ -163,9 +163,9 @@ void mca_ptl_sm_request_return(struct mca_ptl_t* ptl, struct mca_ptl_base_send_r
|
||||
int mca_ptl_sm_send(
|
||||
struct mca_ptl_t* ptl,
|
||||
struct mca_ptl_base_peer_t* ptl_peer,
|
||||
struct mca_ptl_base_send_request_t* sendreq,
|
||||
struct mca_pml_base_send_request_t* sendreq,
|
||||
size_t offset,
|
||||
size_t *size,
|
||||
size_t size,
|
||||
int flags)
|
||||
{
|
||||
return OMPI_SUCCESS;
|
||||
|
@ -145,7 +145,7 @@ extern int mca_ptl_sm_del_procs(
|
||||
*/
|
||||
extern int mca_ptl_sm_request_alloc(
|
||||
struct mca_ptl_t* ptl,
|
||||
struct mca_ptl_base_send_request_t**
|
||||
struct mca_pml_base_send_request_t**
|
||||
);
|
||||
|
||||
/**
|
||||
@ -157,7 +157,7 @@ extern int mca_ptl_sm_request_alloc(
|
||||
*/
|
||||
extern void mca_ptl_sm_request_return(
|
||||
struct mca_ptl_t* ptl,
|
||||
struct mca_ptl_base_send_request_t*
|
||||
struct mca_pml_base_send_request_t*
|
||||
);
|
||||
|
||||
/**
|
||||
@ -185,9 +185,9 @@ extern void mca_ptl_sm_matched(
|
||||
extern int mca_ptl_sm_send(
|
||||
struct mca_ptl_t* ptl,
|
||||
struct mca_ptl_base_peer_t* ptl_peer,
|
||||
struct mca_ptl_base_send_request_t*,
|
||||
struct mca_pml_base_send_request_t*,
|
||||
size_t offset,
|
||||
size_t *size,
|
||||
size_t size,
|
||||
int flags
|
||||
);
|
||||
|
||||
|
@ -16,7 +16,7 @@
|
||||
#include "util/sys_info.h"
|
||||
#include "mca/pml/pml.h"
|
||||
#include "mca/ptl/ptl.h"
|
||||
#include "mca/ptl/base/ptl_base_sendreq.h"
|
||||
#include "mca/pml/base/pml_base_sendreq.h"
|
||||
#include "mca/base/mca_base_param.h"
|
||||
#include "mca/base/mca_base_module_exchange.h"
|
||||
#include "mca/ptl/sm/src/ptl_sm.h"
|
||||
|
@ -4,7 +4,6 @@
|
||||
#include <unistd.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/errno.h>
|
||||
#include "mca/ptl/base/ptl_base_sendreq.h"
|
||||
#include "ptl_sm.h"
|
||||
#include "ptl_sm_recvfrag.h"
|
||||
|
||||
|
@ -6,7 +6,6 @@
|
||||
#include <sys/errno.h>
|
||||
#include "types.h"
|
||||
#include "datatype/datatype.h"
|
||||
#include "mca/ptl/base/ptl_base_sendreq.h"
|
||||
#include "ptl_sm.h"
|
||||
#include "ptl_sm_sendfrag.h"
|
||||
|
||||
|
@ -9,7 +9,7 @@
|
||||
|
||||
#include <sys/types.h>
|
||||
#include "ompi_config.h"
|
||||
#include "mca/ptl/base/ptl_base_sendreq.h"
|
||||
#include "mca/pml/base/pml_base_sendreq.h"
|
||||
#include "mca/ptl/base/ptl_base_sendfrag.h"
|
||||
#include "ptl_sm.h"
|
||||
|
||||
@ -44,7 +44,7 @@ typedef struct mca_ptl_sm_send_frag_t mca_ptl_sm_send_frag_t;
|
||||
int mca_ptl_sm_send_frag_init(
|
||||
mca_ptl_sm_send_frag_t*,
|
||||
struct mca_ptl_base_peer_t*,
|
||||
struct mca_ptl_base_send_request_t*,
|
||||
struct mca_pml_base_send_request_t*,
|
||||
size_t offset,
|
||||
size_t* size,
|
||||
int flags);
|
||||
|
@ -5,7 +5,7 @@
|
||||
#include <sys/types.h>
|
||||
#include <sys/errno.h>
|
||||
#include "types.h"
|
||||
#include "mca/ptl/base/ptl_base_sendreq.h"
|
||||
#include "mca/pml/base/pml_base_sendreq.h"
|
||||
#include "ptl_sm.h"
|
||||
#include "ptl_sm_sendreq.h"
|
||||
|
||||
@ -16,7 +16,7 @@ static void mca_ptl_sm_send_request_destruct(mca_ptl_sm_send_request_t*);
|
||||
|
||||
OBJ_CLASS_INSTANCE(
|
||||
mca_ptl_sm_send_request_t,
|
||||
mca_ptl_base_send_request_t,
|
||||
mca_pml_base_send_request_t,
|
||||
mca_ptl_sm_send_request_construct,
|
||||
mca_ptl_sm_send_request_destruct
|
||||
);
|
||||
|
@ -10,7 +10,7 @@
|
||||
|
||||
#include <sys/types.h>
|
||||
#include "ompi_config.h"
|
||||
#include "mca/ptl/base/ptl_base_sendreq.h"
|
||||
#include "mca/pml/base/pml_base_sendreq.h"
|
||||
#include "ptl_sm_sendfrag.h"
|
||||
|
||||
OBJ_CLASS_DECLARATION(mca_ptl_sm_send_request_t);
|
||||
@ -23,7 +23,7 @@ OBJ_CLASS_DECLARATION(mca_ptl_sm_send_request_t);
|
||||
* fragment on every send request.
|
||||
*/
|
||||
struct mca_ptl_sm_send_request_t {
|
||||
mca_ptl_base_send_request_t super;
|
||||
mca_pml_base_send_request_t super;
|
||||
mca_ptl_sm_send_frag_t req_frag; /* first fragment */
|
||||
};
|
||||
typedef struct mca_ptl_sm_send_request_t mca_ptl_sm_send_request_t;
|
||||
|
@ -8,9 +8,9 @@
|
||||
#include "mca/pml/pml.h"
|
||||
#include "mca/ptl/ptl.h"
|
||||
#include "mca/ptl/base/ptl_base_header.h"
|
||||
#include "mca/ptl/base/ptl_base_sendreq.h"
|
||||
#include "mca/pml/base/pml_base_sendreq.h"
|
||||
#include "mca/ptl/base/ptl_base_sendfrag.h"
|
||||
#include "mca/ptl/base/ptl_base_recvreq.h"
|
||||
#include "mca/pml/base/pml_base_recvreq.h"
|
||||
#include "mca/ptl/base/ptl_base_recvfrag.h"
|
||||
#include "mca/base/mca_base_module_exchange.h"
|
||||
#include "ptl_tcp.h"
|
||||
@ -108,20 +108,20 @@ int mca_ptl_tcp_finalize(struct mca_ptl_t* ptl)
|
||||
return OMPI_SUCCESS;
|
||||
}
|
||||
|
||||
int mca_ptl_tcp_request_alloc(struct mca_ptl_t* ptl, struct mca_ptl_base_send_request_t** request)
|
||||
int mca_ptl_tcp_request_alloc(struct mca_ptl_t* ptl, struct mca_pml_base_send_request_t** request)
|
||||
{
|
||||
int rc;
|
||||
mca_ptl_base_send_request_t* sendreq;
|
||||
mca_pml_base_send_request_t* sendreq;
|
||||
ompi_list_item_t* item;
|
||||
OMPI_FREE_LIST_GET(&mca_ptl_tcp_module.tcp_send_requests, item, rc);
|
||||
if(NULL != (sendreq = (mca_ptl_base_send_request_t*)item))
|
||||
if(NULL != (sendreq = (mca_pml_base_send_request_t*)item))
|
||||
sendreq->req_owner = ptl;
|
||||
*request = sendreq;
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
||||
void mca_ptl_tcp_request_return(struct mca_ptl_t* ptl, struct mca_ptl_base_send_request_t* request)
|
||||
void mca_ptl_tcp_request_return(struct mca_ptl_t* ptl, struct mca_pml_base_send_request_t* request)
|
||||
{
|
||||
/* OBJ_DESTRUCT(&request->req_convertor); */
|
||||
OMPI_FREE_LIST_RETURN(&mca_ptl_tcp_module.tcp_send_requests, (ompi_list_item_t*)request);
|
||||
@ -167,7 +167,7 @@ void mca_ptl_tcp_send_frag_return(struct mca_ptl_t* ptl, struct mca_ptl_tcp_send
|
||||
int mca_ptl_tcp_send(
|
||||
struct mca_ptl_t* ptl,
|
||||
struct mca_ptl_base_peer_t* ptl_peer,
|
||||
struct mca_ptl_base_send_request_t* sendreq,
|
||||
struct mca_pml_base_send_request_t* sendreq,
|
||||
size_t offset,
|
||||
size_t size,
|
||||
int flags)
|
||||
|
@ -175,7 +175,7 @@ extern int mca_ptl_tcp_del_procs(
|
||||
*/
|
||||
extern int mca_ptl_tcp_request_alloc(
|
||||
struct mca_ptl_t* ptl,
|
||||
struct mca_ptl_base_send_request_t**
|
||||
struct mca_pml_base_send_request_t**
|
||||
);
|
||||
|
||||
/**
|
||||
@ -187,7 +187,7 @@ extern int mca_ptl_tcp_request_alloc(
|
||||
*/
|
||||
extern void mca_ptl_tcp_request_return(
|
||||
struct mca_ptl_t* ptl,
|
||||
struct mca_ptl_base_send_request_t*
|
||||
struct mca_pml_base_send_request_t*
|
||||
);
|
||||
|
||||
/**
|
||||
@ -215,7 +215,7 @@ extern void mca_ptl_tcp_matched(
|
||||
extern int mca_ptl_tcp_send(
|
||||
struct mca_ptl_t* ptl,
|
||||
struct mca_ptl_base_peer_t* ptl_peer,
|
||||
struct mca_ptl_base_send_request_t*,
|
||||
struct mca_pml_base_send_request_t*,
|
||||
size_t offset,
|
||||
size_t size,
|
||||
int flags
|
||||
|
@ -17,7 +17,7 @@
|
||||
#include "util/output.h"
|
||||
#include "mca/pml/pml.h"
|
||||
#include "mca/ptl/ptl.h"
|
||||
#include "mca/ptl/base/ptl_base_sendreq.h"
|
||||
#include "mca/pml/base/pml_base_sendreq.h"
|
||||
#include "mca/base/mca_base_param.h"
|
||||
#include "mca/base/mca_base_module_exchange.h"
|
||||
#include "ptl_tcp.h"
|
||||
|
@ -11,7 +11,7 @@
|
||||
#include <netinet/in.h>
|
||||
#include <arpa/inet.h>
|
||||
#include "include/types.h"
|
||||
#include "mca/ptl/base/ptl_base_sendreq.h"
|
||||
#include "mca/pml/base/pml_base_sendreq.h"
|
||||
#include "ptl_tcp.h"
|
||||
#include "ptl_tcp_addr.h"
|
||||
#include "ptl_tcp_peer.h"
|
||||
|
@ -4,7 +4,7 @@
|
||||
#include <unistd.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/errno.h>
|
||||
#include "mca/ptl/base/ptl_base_sendreq.h"
|
||||
#include "mca/pml/base/pml_base_sendreq.h"
|
||||
#include "ptl_tcp.h"
|
||||
#include "ptl_tcp_peer.h"
|
||||
#include "ptl_tcp_recvfrag.h"
|
||||
@ -138,7 +138,7 @@ static bool mca_ptl_tcp_recv_frag_header(mca_ptl_tcp_recv_frag_t* frag, int sd,
|
||||
static bool mca_ptl_tcp_recv_frag_ack(mca_ptl_tcp_recv_frag_t* frag, int sd)
|
||||
{
|
||||
mca_ptl_tcp_send_frag_t* sendfrag;
|
||||
mca_ptl_base_send_request_t* sendreq;
|
||||
mca_pml_base_send_request_t* sendreq;
|
||||
sendfrag = (mca_ptl_tcp_send_frag_t*)frag->super.super.frag_header.hdr_ack.hdr_src_ptr.pval;
|
||||
sendreq = sendfrag->super.frag_request;
|
||||
sendreq->req_peer_match = frag->super.super.frag_header.hdr_ack.hdr_dst_match;
|
||||
|
@ -50,7 +50,7 @@ bool mca_ptl_tcp_recv_frag_send_ack(mca_ptl_tcp_recv_frag_t* frag);
|
||||
|
||||
static inline void mca_ptl_tcp_recv_frag_matched(mca_ptl_tcp_recv_frag_t* frag)
|
||||
{
|
||||
mca_ptl_base_recv_request_t* request = frag->super.frag_request;
|
||||
mca_pml_base_recv_request_t* request = frag->super.frag_request;
|
||||
mca_ptl_base_frag_header_t* header = &frag->super.super.frag_header.hdr_frag;
|
||||
|
||||
/* if there is data associated with the fragment -- setup to receive */
|
||||
@ -96,7 +96,7 @@ static inline void mca_ptl_tcp_recv_frag_progress(mca_ptl_tcp_recv_frag_t* frag)
|
||||
if((frag)->frag_msg_cnt >= (frag)->super.super.frag_header.hdr_frag.hdr_frag_length) {
|
||||
/* make sure this only happens once for threaded case */
|
||||
if(fetchNset(&frag->frag_progressed, 1) == 0) {
|
||||
mca_ptl_base_recv_request_t* request = (frag)->super.frag_request;
|
||||
mca_pml_base_recv_request_t* request = (frag)->super.frag_request;
|
||||
if((frag)->super.frag_is_buffered) {
|
||||
mca_ptl_base_match_header_t* header = &(frag)->super.super.frag_header.hdr_match;
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
#include <sys/errno.h>
|
||||
#include "include/types.h"
|
||||
#include "datatype/datatype.h"
|
||||
#include "mca/ptl/base/ptl_base_sendreq.h"
|
||||
#include "mca/pml/base/pml_base_sendreq.h"
|
||||
#include "ptl_tcp.h"
|
||||
#include "ptl_tcp_peer.h"
|
||||
#include "ptl_tcp_proc.h"
|
||||
@ -51,7 +51,7 @@ static void mca_ptl_tcp_send_frag_destruct(mca_ptl_tcp_send_frag_t* frag)
|
||||
int mca_ptl_tcp_send_frag_init(
|
||||
mca_ptl_tcp_send_frag_t* sendfrag,
|
||||
mca_ptl_base_peer_t* ptl_peer,
|
||||
mca_ptl_base_send_request_t* sendreq,
|
||||
mca_pml_base_send_request_t* sendreq,
|
||||
size_t offset,
|
||||
size_t* size,
|
||||
int flags)
|
||||
|
@ -12,7 +12,7 @@
|
||||
#include <netinet/in.h>
|
||||
#include "os/atomic.h"
|
||||
#include "ompi_config.h"
|
||||
#include "mca/ptl/base/ptl_base_sendreq.h"
|
||||
#include "mca/pml/base/pml_base_sendreq.h"
|
||||
#include "mca/ptl/base/ptl_base_sendfrag.h"
|
||||
#include "ptl_tcp.h"
|
||||
#include "ptl_tcp_recvfrag.h"
|
||||
@ -55,7 +55,7 @@ bool mca_ptl_tcp_send_frag_handler(mca_ptl_tcp_send_frag_t*, int sd);
|
||||
int mca_ptl_tcp_send_frag_init(
|
||||
mca_ptl_tcp_send_frag_t*,
|
||||
struct mca_ptl_base_peer_t*,
|
||||
struct mca_ptl_base_send_request_t*,
|
||||
struct mca_pml_base_send_request_t*,
|
||||
size_t offset,
|
||||
size_t* size,
|
||||
int flags);
|
||||
@ -70,7 +70,7 @@ int mca_ptl_tcp_send_frag_init(
|
||||
|
||||
static inline void mca_ptl_tcp_send_frag_progress(mca_ptl_tcp_send_frag_t* frag)
|
||||
{
|
||||
mca_ptl_base_send_request_t* request = frag->super.frag_request;
|
||||
mca_pml_base_send_request_t* request = frag->super.frag_request;
|
||||
|
||||
/* if this is an ack - simply return to pool */
|
||||
if(request == NULL) {
|
||||
@ -81,7 +81,7 @@ static inline void mca_ptl_tcp_send_frag_progress(mca_ptl_tcp_send_frag_t* frag)
|
||||
*/
|
||||
} else if (frag->frag_vec_cnt == 0 &&
|
||||
((frag->super.super.frag_header.hdr_common.hdr_flags & MCA_PTL_FLAGS_ACK_MATCHED) == 0 ||
|
||||
mca_ptl_base_send_request_matched(request))) {
|
||||
mca_pml_base_send_request_matched(request))) {
|
||||
|
||||
/* make sure this only happens once in threaded case */
|
||||
if(fetchNset(&frag->frag_progressed,1) == 0) {
|
||||
@ -106,7 +106,7 @@ static inline void mca_ptl_tcp_send_frag_init_ack(
|
||||
mca_ptl_tcp_recv_frag_t* frag)
|
||||
{
|
||||
mca_ptl_base_header_t* hdr = &ack->super.super.frag_header;
|
||||
mca_ptl_base_recv_request_t* request = frag->super.frag_request;
|
||||
mca_pml_base_recv_request_t* request = frag->super.frag_request;
|
||||
hdr->hdr_common.hdr_type = MCA_PTL_HDR_TYPE_ACK;
|
||||
hdr->hdr_common.hdr_flags = 0;
|
||||
hdr->hdr_common.hdr_size = sizeof(mca_ptl_base_ack_header_t);
|
||||
|
@ -5,7 +5,7 @@
|
||||
#include <sys/types.h>
|
||||
#include <sys/errno.h>
|
||||
#include "include/types.h"
|
||||
#include "mca/ptl/base/ptl_base_sendreq.h"
|
||||
#include "mca/pml/base/pml_base_sendreq.h"
|
||||
#include "ptl_tcp.h"
|
||||
#include "ptl_tcp_sendreq.h"
|
||||
|
||||
@ -16,7 +16,7 @@ static void mca_ptl_tcp_send_request_destruct(mca_ptl_tcp_send_request_t*);
|
||||
|
||||
ompi_class_t mca_ptl_tcp_send_request_t_class = {
|
||||
"mca_ptl_tcp_send_request_t",
|
||||
OBJ_CLASS(mca_ptl_base_send_request_t),
|
||||
OBJ_CLASS(mca_pml_base_send_request_t),
|
||||
(ompi_construct_t)mca_ptl_tcp_send_request_construct,
|
||||
(ompi_destruct_t)mca_ptl_tcp_send_request_destruct
|
||||
};
|
||||
|
@ -12,7 +12,7 @@
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
#include "ompi_config.h"
|
||||
#include "mca/ptl/base/ptl_base_sendreq.h"
|
||||
#include "mca/pml/base/pml_base_sendreq.h"
|
||||
#include "ptl_tcp_sendfrag.h"
|
||||
|
||||
extern ompi_class_t mca_ptl_tcp_send_request_t_class;
|
||||
@ -24,7 +24,7 @@ extern ompi_class_t mca_ptl_tcp_send_request_t_class;
|
||||
* fragment on every send request.
|
||||
*/
|
||||
struct mca_ptl_tcp_send_request_t {
|
||||
mca_ptl_base_send_request_t super;
|
||||
mca_pml_base_send_request_t super;
|
||||
mca_ptl_tcp_send_frag_t req_frag; /* first fragment */
|
||||
};
|
||||
typedef struct mca_ptl_tcp_send_request_t mca_ptl_tcp_send_request_t;
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user