* convert the Portals PTL to use the new convertor code
This commit was SVN r6152.
Этот коммит содержится в:
родитель
e3b77373a3
Коммит
56777944b6
@ -68,9 +68,9 @@ static ompi_output_stream_t portals_output_stream = {
|
||||
0, /* syslog priority */
|
||||
NULL, /* syslog ident */
|
||||
NULL, /* prefix */
|
||||
false, /* want stdout */
|
||||
true, /* want stdout */
|
||||
false, /* want stderr */
|
||||
true, /* want file */
|
||||
false, /* want file */
|
||||
false, /* file append */
|
||||
"ptl-portals" /* file suffix */
|
||||
};
|
||||
|
@ -179,33 +179,22 @@ mca_ptl_portals_matched(struct mca_ptl_base_module_t *ptl_base,
|
||||
mca_ptl_base_recv_request_t* request = frag_base->frag_request;
|
||||
mca_ptl_portals_module_t* ptl = (mca_ptl_portals_module_t*) ptl_base;
|
||||
mca_ptl_portals_recv_frag_t* recvfrag = (mca_ptl_portals_recv_frag_t*) frag_base;
|
||||
unsigned int bytes_delivered = recvfrag->frag_size;
|
||||
size_t bytes_delivered = recvfrag->frag_size;
|
||||
|
||||
/* generate an acknowledgment if required */
|
||||
if(hdr->hdr_common.hdr_flags & MCA_PTL_FLAGS_ACK) {
|
||||
mca_ptl_portals_send_ack(ptl, recvfrag);
|
||||
}
|
||||
|
||||
/* can just use the convertor straight from the request - no need
|
||||
to initialize. Might want to personalize, if required */
|
||||
|
||||
/* copy data into users buffer */
|
||||
if(recvfrag->frag_size > 0) {
|
||||
struct iovec iov;
|
||||
unsigned int iov_count = 1;
|
||||
int free_after = 0;
|
||||
ompi_proc_t *proc = ompi_comm_peer_lookup(request->req_recv.req_base.req_comm,
|
||||
request->req_recv.req_base.req_ompi.req_status.MPI_SOURCE);
|
||||
ompi_convertor_t* convertor = &frag_base->frag_base.frag_convertor;
|
||||
|
||||
/* initialize receive convertor */
|
||||
ompi_convertor_copy(proc->proc_convertor, convertor);
|
||||
ompi_convertor_init_for_recv(
|
||||
convertor, /* convertor */
|
||||
0, /* flags */
|
||||
request->req_recv.req_base.req_datatype, /* datatype */
|
||||
request->req_recv.req_base.req_count, /* count elements */
|
||||
request->req_recv.req_base.req_addr, /* users buffer */
|
||||
0, /* offset in bytes into packed buffer */
|
||||
NULL ); /* not allocating memory */
|
||||
/*ompi_convertor_get_packed_size(convertor, &request->req_bytes_packed); */
|
||||
ompi_convertor_t *convertor = &(request->req_recv.req_convertor);
|
||||
|
||||
iov.iov_base = recvfrag->frag_data;
|
||||
iov.iov_len = recvfrag->frag_size;
|
||||
|
@ -107,7 +107,7 @@ mca_ptl_portals_process_frag_frag(struct mca_ptl_portals_module_t *ptl,
|
||||
mca_ptl_base_header_t *hdr,
|
||||
ptl_event_t *ev)
|
||||
{
|
||||
unsigned int bytes_delivered;
|
||||
size_t bytes_delivered;
|
||||
mca_ptl_base_recv_request_t* request;
|
||||
mca_ptl_portals_recv_frag_t *recvfrag;
|
||||
|
||||
@ -124,22 +124,13 @@ mca_ptl_portals_process_frag_frag(struct mca_ptl_portals_module_t *ptl,
|
||||
struct iovec iov;
|
||||
unsigned int iov_count = 1;
|
||||
int free_after = 0;
|
||||
ompi_proc_t *proc = ompi_comm_peer_lookup(
|
||||
request->req_recv.req_base.req_comm,
|
||||
request->req_recv.req_base.req_ompi.req_status.MPI_SOURCE);
|
||||
ompi_convertor_t* convertor =
|
||||
&(recvfrag->frag_recv.frag_base.frag_convertor);
|
||||
|
||||
/* initialize receive convertor */
|
||||
ompi_convertor_copy(proc->proc_convertor, convertor);
|
||||
ompi_convertor_init_for_recv(
|
||||
convertor, /* convertor */
|
||||
0, /* flags */
|
||||
request->req_recv.req_base.req_datatype, /* datatype */
|
||||
request->req_recv.req_base.req_count, /* count elements */
|
||||
request->req_recv.req_base.req_addr, /* users buffer */
|
||||
hdr->hdr_frag.hdr_frag_offset, /* offset in bytes into packed buffer */
|
||||
NULL ); /* not allocating memory */
|
||||
/* clone receive convertor and set to correct position */
|
||||
ompi_convertor_clone_with_position(&(request->req_recv.req_convertor),
|
||||
convertor, 1,
|
||||
&(hdr->hdr_frag.hdr_frag_offset));
|
||||
|
||||
iov.iov_base = recvfrag->frag_data;
|
||||
iov.iov_len = recvfrag->frag_size;
|
||||
|
@ -45,13 +45,6 @@ mca_ptl_portals_send_frag_destruct(mca_ptl_portals_send_frag_t* frag)
|
||||
}
|
||||
|
||||
|
||||
static void*
|
||||
mca_ptl_portals_alloc(size_t *size)
|
||||
{
|
||||
return malloc(*size);
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
mca_ptl_portals_send(struct mca_ptl_base_module_t *ptl_base,
|
||||
struct mca_ptl_base_peer_t *ptl_peer,
|
||||
@ -79,19 +72,23 @@ mca_ptl_portals_send(struct mca_ptl_base_module_t *ptl_base,
|
||||
ompi_convertor_t *convertor;
|
||||
struct iovec iov;
|
||||
unsigned int iov_count;
|
||||
unsigned int max_data;
|
||||
size_t max_data;
|
||||
int rc;
|
||||
|
||||
convertor = &sendfrag->frag_send.frag_base.frag_convertor;
|
||||
ompi_convertor_copy(&sendreq->req_send.req_convertor, convertor);
|
||||
ompi_convertor_init_for_send(
|
||||
convertor,
|
||||
0,
|
||||
sendreq->req_send.req_datatype,
|
||||
sendreq->req_send.req_count,
|
||||
sendreq->req_send.req_addr,
|
||||
offset,
|
||||
mca_ptl_portals_alloc );
|
||||
/* BWB - first frag, only need to call pack. Can call
|
||||
personalize if we want to change options. On second frag,
|
||||
need to clone with ompi_convertor_clone_with_position(),
|
||||
then repersonalize. In either case, no need to free the
|
||||
convertors or anything like that. Look in base_fragment -
|
||||
there's a convertor in there.*/
|
||||
|
||||
if (offset == 0) {
|
||||
convertor = &sendreq->req_send.req_convertor;
|
||||
} else {
|
||||
convertor = &sendfrag->frag_send.frag_base.frag_convertor;
|
||||
ompi_convertor_clone_with_position(&sendreq->req_send.req_convertor,
|
||||
convertor, 1, &offset);
|
||||
}
|
||||
|
||||
/* if data is contigous convertor will return an offset
|
||||
* into users buffer - otherwise will return an allocated buffer
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user