2005-05-23 22:06:50 +00:00
|
|
|
/*
|
2005-11-05 19:57:48 +00:00
|
|
|
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
|
|
|
* University Research and Technology
|
|
|
|
* Corporation. All rights reserved.
|
2013-07-04 08:34:37 +00:00
|
|
|
* Copyright (c) 2004-2013 The University of Tennessee and The University
|
2005-11-05 19:57:48 +00:00
|
|
|
* of Tennessee Research Foundation. All rights
|
|
|
|
* reserved.
|
2007-08-23 07:09:43 +00:00
|
|
|
* Copyright (c) 2004-2007 High Performance Computing Center Stuttgart,
|
2005-05-23 22:06:50 +00:00
|
|
|
* University of Stuttgart. All rights reserved.
|
|
|
|
* Copyright (c) 2004-2005 The Regents of the University of California.
|
|
|
|
* All rights reserved.
|
2008-05-30 01:29:09 +00:00
|
|
|
* Copyright (c) 2008 UT-Battelle, LLC. All rights reserved.
|
2012-04-24 20:19:15 +00:00
|
|
|
* Copyright (c) 2011-2012 Los Alamos National Security, LLC. All rights
|
|
|
|
* reserved.
|
|
|
|
*
|
2005-05-23 22:06:50 +00:00
|
|
|
* $COPYRIGHT$
|
|
|
|
*
|
|
|
|
* Additional copyrights may follow
|
|
|
|
*
|
|
|
|
* $HEADER$
|
|
|
|
*/
|
|
|
|
/**
|
|
|
|
* @file
|
|
|
|
*/
|
2005-05-23 22:22:20 +00:00
|
|
|
#ifndef OMPI_PML_OB1_RECV_REQUEST_H
|
|
|
|
#define OMPI_PML_OB1_RECV_REQUEST_H
|
2005-05-23 22:06:50 +00:00
|
|
|
|
|
|
|
#include "pml_ob1.h"
|
2005-09-12 22:28:23 +00:00
|
|
|
#include "pml_ob1_rdma.h"
|
2006-07-20 14:44:35 +00:00
|
|
|
#include "pml_ob1_rdmafrag.h"
|
2006-05-07 21:03:12 +00:00
|
|
|
#include "ompi/proc/proc.h"
|
|
|
|
#include "ompi/mca/pml/ob1/pml_ob1_comm.h"
|
2006-02-12 01:33:29 +00:00
|
|
|
#include "ompi/mca/mpool/base/base.h"
|
|
|
|
#include "ompi/mca/pml/base/pml_base_recvreq.h"
|
2005-05-23 22:06:50 +00:00
|
|
|
|
2007-12-21 06:19:46 +00:00
|
|
|
BEGIN_C_DECLS
|
2005-06-17 18:25:44 +00:00
|
|
|
|
2006-01-26 11:55:00 +00:00
|
|
|
struct mca_pml_ob1_recv_request_t {
|
2005-05-23 22:06:50 +00:00
|
|
|
mca_pml_base_recv_request_t req_recv;
|
2008-07-17 04:50:39 +00:00
|
|
|
ompi_ptr_t remote_req_send;
|
2005-09-14 17:08:08 +00:00
|
|
|
int32_t req_lock;
|
2005-06-09 03:11:51 +00:00
|
|
|
size_t req_pipeline_depth;
|
2008-07-09 17:38:41 +00:00
|
|
|
size_t req_bytes_received; /**< amount of data transferred into the user buffer */
|
2009-04-10 16:36:20 +00:00
|
|
|
size_t req_bytes_expected; /**< local size of the data as suggested by the user */
|
2005-06-09 03:11:51 +00:00
|
|
|
size_t req_rdma_offset;
|
2007-06-03 08:30:07 +00:00
|
|
|
size_t req_send_offset;
|
2005-09-12 22:28:23 +00:00
|
|
|
uint32_t req_rdma_cnt;
|
|
|
|
uint32_t req_rdma_idx;
|
2006-07-20 14:44:35 +00:00
|
|
|
bool req_pending;
|
Fix hang in receiving into MPI_alloced area.
This code hangs with openib BTL:
int size = 4000000;
sbuf = malloc(size);
MPI_Alloc_mem(size, MPI_INFO_NULL, &rbuf);
if (rank == 0)
{
MPI_Recv(rbuf, size, MPI_CHAR, 1, 1, MPI_COMM_WORLD, &stat);
}else{
MPI_Send(sbuf, size, MPI_CHAR, 0, 1, MPI_COMM_WORLD);
}
This commit was SVN r11613.
2006-09-11 12:18:59 +00:00
|
|
|
bool req_ack_sent; /**< whether ack was sent to the sender */
|
2007-09-18 16:18:47 +00:00
|
|
|
bool req_match_received; /**< Prevent request to be completed prematurely */
|
2007-07-30 12:50:38 +00:00
|
|
|
opal_mutex_t lock;
|
2007-07-01 11:34:23 +00:00
|
|
|
mca_pml_ob1_com_btl_t req_rdma[1];
|
2005-05-23 22:06:50 +00:00
|
|
|
};
|
|
|
|
typedef struct mca_pml_ob1_recv_request_t mca_pml_ob1_recv_request_t;
|
|
|
|
|
|
|
|
OBJ_CLASS_DECLARATION(mca_pml_ob1_recv_request_t);
|
|
|
|
|
2007-09-18 16:18:47 +00:00
|
|
|
static inline bool lock_recv_request(mca_pml_ob1_recv_request_t *recvreq)
|
|
|
|
{
|
|
|
|
return OPAL_THREAD_ADD32(&recvreq->req_lock, 1) == 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline bool unlock_recv_request(mca_pml_ob1_recv_request_t *recvreq)
|
|
|
|
{
|
|
|
|
return OPAL_THREAD_ADD32(&recvreq->req_lock, -1) == 0;
|
|
|
|
}
|
2005-05-23 22:06:50 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Allocate a recv request from the modules free list.
|
|
|
|
*
|
|
|
|
* @param rc (OUT) OMPI_SUCCESS or error status on failure.
|
|
|
|
* @return Receive request.
|
|
|
|
*/
|
2013-07-04 08:34:37 +00:00
|
|
|
#define MCA_PML_OB1_RECV_REQUEST_ALLOC(recvreq) \
|
2005-06-07 14:12:47 +00:00
|
|
|
do { \
|
2006-06-12 16:44:00 +00:00
|
|
|
ompi_free_list_item_t* item; \
|
2013-07-04 08:34:37 +00:00
|
|
|
OMPI_FREE_LIST_GET(&mca_pml_base_recv_requests, item); \
|
2005-06-07 14:12:47 +00:00
|
|
|
recvreq = (mca_pml_ob1_recv_request_t*)item; \
|
|
|
|
} while(0)
|
2005-05-23 22:06:50 +00:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Initialize a receive request with call parameters.
|
|
|
|
*
|
|
|
|
* @param request (IN) Receive request.
|
|
|
|
* @param addr (IN) User buffer.
|
|
|
|
* @param count (IN) Number of elements of indicated datatype.
|
|
|
|
* @param datatype (IN) User defined datatype.
|
|
|
|
* @param src (IN) Source rank w/in the communicator.
|
|
|
|
* @param tag (IN) User defined tag.
|
|
|
|
* @param comm (IN) Communicator.
|
|
|
|
* @param persistent (IN) Is this a ersistent request.
|
|
|
|
*/
|
2006-03-15 22:53:41 +00:00
|
|
|
#define MCA_PML_OB1_RECV_REQUEST_INIT( request, \
|
|
|
|
addr, \
|
|
|
|
count, \
|
|
|
|
datatype, \
|
|
|
|
src, \
|
|
|
|
tag, \
|
|
|
|
comm, \
|
|
|
|
persistent) \
|
|
|
|
do { \
|
|
|
|
MCA_PML_BASE_RECV_REQUEST_INIT( &(request)->req_recv, \
|
|
|
|
addr, \
|
|
|
|
count, \
|
|
|
|
datatype, \
|
|
|
|
src, \
|
|
|
|
tag, \
|
|
|
|
comm, \
|
|
|
|
persistent); \
|
2005-06-07 14:12:47 +00:00
|
|
|
} while(0)
|
2005-05-23 22:06:50 +00:00
|
|
|
|
2006-03-31 17:09:09 +00:00
|
|
|
/**
|
|
|
|
* Mark the request as completed at MPI level for internal purposes.
|
|
|
|
*
|
|
|
|
* @param recvreq (IN) Receive request.
|
|
|
|
*/
|
|
|
|
#define MCA_PML_OB1_RECV_REQUEST_MPI_COMPLETE( recvreq ) \
|
|
|
|
do { \
|
|
|
|
PERUSE_TRACE_COMM_EVENT( PERUSE_COMM_REQ_COMPLETE, \
|
|
|
|
&(recvreq->req_recv.req_base), PERUSE_RECV ); \
|
2008-05-30 03:58:39 +00:00
|
|
|
ompi_request_complete( &(recvreq->req_recv.req_base.req_ompi), true ); \
|
2006-03-31 17:09:09 +00:00
|
|
|
} while (0)
|
|
|
|
|
2006-02-08 22:42:00 +00:00
|
|
|
/*
|
|
|
|
* Free the PML receive request
|
|
|
|
*/
|
2007-07-10 22:16:38 +00:00
|
|
|
#define MCA_PML_OB1_RECV_REQUEST_RETURN(recvreq) \
|
|
|
|
{ \
|
|
|
|
MCA_PML_BASE_RECV_REQUEST_FINI(&(recvreq)->req_recv); \
|
|
|
|
OMPI_FREE_LIST_RETURN( &mca_pml_base_recv_requests, \
|
|
|
|
(ompi_free_list_item_t*)(recvreq)); \
|
|
|
|
}
|
2006-02-08 22:42:00 +00:00
|
|
|
|
2007-09-18 16:18:47 +00:00
|
|
|
/**
|
|
|
|
* Complete receive request. Request structure cannot be accessed after calling
|
|
|
|
* this function any more.
|
|
|
|
*
|
|
|
|
* @param recvreq (IN) Receive request.
|
|
|
|
*/
|
2009-02-28 14:15:34 +00:00
|
|
|
static inline void
|
2007-09-18 16:18:47 +00:00
|
|
|
recv_request_pml_complete(mca_pml_ob1_recv_request_t *recvreq)
|
|
|
|
{
|
|
|
|
size_t i;
|
|
|
|
|
|
|
|
assert(false == recvreq->req_recv.req_base.req_pml_complete);
|
|
|
|
|
|
|
|
if(recvreq->req_recv.req_bytes_packed > 0) {
|
|
|
|
PERUSE_TRACE_COMM_EVENT( PERUSE_COMM_REQ_XFER_END,
|
|
|
|
&recvreq->req_recv.req_base, PERUSE_RECV );
|
|
|
|
}
|
|
|
|
|
|
|
|
for(i = 0; i < recvreq->req_rdma_cnt; i++) {
|
|
|
|
mca_mpool_base_registration_t* btl_reg = recvreq->req_rdma[i].btl_reg;
|
|
|
|
if( NULL != btl_reg && btl_reg->mpool != NULL) {
|
|
|
|
btl_reg->mpool->mpool_deregister( btl_reg->mpool, btl_reg );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
recvreq->req_rdma_cnt = 0;
|
|
|
|
|
|
|
|
OPAL_THREAD_LOCK(&ompi_request_lock);
|
|
|
|
if(true == recvreq->req_recv.req_base.req_free_called) {
|
|
|
|
MCA_PML_OB1_RECV_REQUEST_RETURN(recvreq);
|
|
|
|
} else {
|
|
|
|
/* initialize request status */
|
|
|
|
recvreq->req_recv.req_base.req_pml_complete = true;
|
2010-07-21 20:07:00 +00:00
|
|
|
recvreq->req_recv.req_base.req_ompi.req_status._ucount =
|
|
|
|
recvreq->req_bytes_received;
|
2009-04-10 16:36:20 +00:00
|
|
|
if (recvreq->req_recv.req_bytes_packed > recvreq->req_bytes_expected) {
|
2010-07-21 20:07:00 +00:00
|
|
|
recvreq->req_recv.req_base.req_ompi.req_status._ucount =
|
|
|
|
recvreq->req_recv.req_bytes_packed;
|
2007-09-18 16:18:47 +00:00
|
|
|
recvreq->req_recv.req_base.req_ompi.req_status.MPI_ERROR =
|
|
|
|
MPI_ERR_TRUNCATE;
|
|
|
|
}
|
|
|
|
MCA_PML_OB1_RECV_REQUEST_MPI_COMPLETE(recvreq);
|
|
|
|
}
|
|
|
|
OPAL_THREAD_UNLOCK(&ompi_request_lock);
|
|
|
|
}
|
|
|
|
|
2009-02-28 14:15:34 +00:00
|
|
|
static inline bool
|
2007-09-18 16:18:47 +00:00
|
|
|
recv_request_pml_complete_check(mca_pml_ob1_recv_request_t *recvreq)
|
|
|
|
{
|
2011-03-18 21:36:35 +00:00
|
|
|
#if OPAL_ENABLE_MULTI_THREADS
|
2007-09-18 16:18:47 +00:00
|
|
|
opal_atomic_rmb();
|
2009-05-27 16:12:18 +00:00
|
|
|
#endif
|
2007-09-18 16:18:47 +00:00
|
|
|
if(recvreq->req_match_received &&
|
|
|
|
recvreq->req_bytes_received >= recvreq->req_recv.req_bytes_packed &&
|
|
|
|
lock_recv_request(recvreq)) {
|
|
|
|
recv_request_pml_complete(recvreq);
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2007-12-19 09:16:20 +00:00
|
|
|
extern void mca_pml_ob1_recv_req_start(mca_pml_ob1_recv_request_t *req);
|
|
|
|
#define MCA_PML_OB1_RECV_REQUEST_START(r) mca_pml_ob1_recv_req_start(r)
|
2005-06-17 18:25:44 +00:00
|
|
|
|
2007-12-19 09:16:20 +00:00
|
|
|
static inline void prepare_recv_req_converter(mca_pml_ob1_recv_request_t *req)
|
|
|
|
{
|
- Split the datatype engine into two parts: an MPI specific part in
OMPI
and a language agnostic part in OPAL. The convertor is completely
moved into OPAL. This offers several benefits as described in RFC
http://www.open-mpi.org/community/lists/devel/2009/07/6387.php
namely:
- Fewer basic types (int* and float* types, boolean and wchar
- Fixing naming scheme to ompi-nomenclature.
- Usability outside of the ompi-layer.
- Due to the fixed nature of simple opal types, their information is
completely
known at compile time and therefore constified
- With fewer datatypes (22), the actual sizes of bit-field types may be
reduced
from 64 to 32 bits, allowing reorganizing the opal_datatype
structure, eliminating holes and keeping data required in convertor
(upon send/recv) in one cacheline...
This has implications to the convertor-datastructure and other parts
of the code.
- Several performance tests have been run, the netpipe latency does not
change with
this patch on Linux/x86-64 on the smoky cluster.
- Extensive tests have been done to verify correctness (no new
regressions) using:
1. mpi_test_suite on linux/x86-64 using clean ompi-trunk and
ompi-ddt:
a. running both trunk and ompi-ddt resulted in no differences
(except for MPI_SHORT_INT and MPI_TYPE_MIX_LB_UB do now run
correctly).
b. with --enable-memchecker and running under valgrind (one buglet
when run with static found in test-suite, commited)
2. ibm testsuite on linux/x86-64 using clean ompi-trunk and ompi-ddt:
all passed (except for the dynamic/ tests failed!! as trunk/MTT)
3. compilation and usage of HDF5 tests on Jaguar using PGI and
PathScale compilers.
4. compilation and usage on Scicortex.
- Please note, that for the heterogeneous case, (-m32 compiled
binaries/ompi), neither
ompi-trunk, nor ompi-ddt branch would successfully launch.
This commit was SVN r21641.
2009-07-13 04:56:31 +00:00
|
|
|
if( req->req_recv.req_base.req_datatype->super.size | req->req_recv.req_base.req_count ) {
|
|
|
|
opal_convertor_copy_and_prepare_for_recv(
|
2008-07-09 17:38:41 +00:00
|
|
|
req->req_recv.req_base.req_proc->proc_convertor,
|
- Split the datatype engine into two parts: an MPI specific part in
OMPI
and a language agnostic part in OPAL. The convertor is completely
moved into OPAL. This offers several benefits as described in RFC
http://www.open-mpi.org/community/lists/devel/2009/07/6387.php
namely:
- Fewer basic types (int* and float* types, boolean and wchar
- Fixing naming scheme to ompi-nomenclature.
- Usability outside of the ompi-layer.
- Due to the fixed nature of simple opal types, their information is
completely
known at compile time and therefore constified
- With fewer datatypes (22), the actual sizes of bit-field types may be
reduced
from 64 to 32 bits, allowing reorganizing the opal_datatype
structure, eliminating holes and keeping data required in convertor
(upon send/recv) in one cacheline...
This has implications to the convertor-datastructure and other parts
of the code.
- Several performance tests have been run, the netpipe latency does not
change with
this patch on Linux/x86-64 on the smoky cluster.
- Extensive tests have been done to verify correctness (no new
regressions) using:
1. mpi_test_suite on linux/x86-64 using clean ompi-trunk and
ompi-ddt:
a. running both trunk and ompi-ddt resulted in no differences
(except for MPI_SHORT_INT and MPI_TYPE_MIX_LB_UB do now run
correctly).
b. with --enable-memchecker and running under valgrind (one buglet
when run with static found in test-suite, commited)
2. ibm testsuite on linux/x86-64 using clean ompi-trunk and ompi-ddt:
all passed (except for the dynamic/ tests failed!! as trunk/MTT)
3. compilation and usage of HDF5 tests on Jaguar using PGI and
PathScale compilers.
4. compilation and usage on Scicortex.
- Please note, that for the heterogeneous case, (-m32 compiled
binaries/ompi), neither
ompi-trunk, nor ompi-ddt branch would successfully launch.
This commit was SVN r21641.
2009-07-13 04:56:31 +00:00
|
|
|
&(req->req_recv.req_base.req_datatype->super),
|
2008-07-09 17:38:41 +00:00
|
|
|
req->req_recv.req_base.req_count,
|
|
|
|
req->req_recv.req_base.req_addr,
|
|
|
|
0,
|
|
|
|
&req->req_recv.req_base.req_convertor);
|
- Split the datatype engine into two parts: an MPI specific part in
OMPI
and a language agnostic part in OPAL. The convertor is completely
moved into OPAL. This offers several benefits as described in RFC
http://www.open-mpi.org/community/lists/devel/2009/07/6387.php
namely:
- Fewer basic types (int* and float* types, boolean and wchar
- Fixing naming scheme to ompi-nomenclature.
- Usability outside of the ompi-layer.
- Due to the fixed nature of simple opal types, their information is
completely
known at compile time and therefore constified
- With fewer datatypes (22), the actual sizes of bit-field types may be
reduced
from 64 to 32 bits, allowing reorganizing the opal_datatype
structure, eliminating holes and keeping data required in convertor
(upon send/recv) in one cacheline...
This has implications to the convertor-datastructure and other parts
of the code.
- Several performance tests have been run, the netpipe latency does not
change with
this patch on Linux/x86-64 on the smoky cluster.
- Extensive tests have been done to verify correctness (no new
regressions) using:
1. mpi_test_suite on linux/x86-64 using clean ompi-trunk and
ompi-ddt:
a. running both trunk and ompi-ddt resulted in no differences
(except for MPI_SHORT_INT and MPI_TYPE_MIX_LB_UB do now run
correctly).
b. with --enable-memchecker and running under valgrind (one buglet
when run with static found in test-suite, commited)
2. ibm testsuite on linux/x86-64 using clean ompi-trunk and ompi-ddt:
all passed (except for the dynamic/ tests failed!! as trunk/MTT)
3. compilation and usage of HDF5 tests on Jaguar using PGI and
PathScale compilers.
4. compilation and usage on Scicortex.
- Please note, that for the heterogeneous case, (-m32 compiled
binaries/ompi), neither
ompi-trunk, nor ompi-ddt branch would successfully launch.
This commit was SVN r21641.
2009-07-13 04:56:31 +00:00
|
|
|
opal_convertor_get_unpacked_size(&req->req_recv.req_base.req_convertor,
|
2009-04-10 16:36:20 +00:00
|
|
|
&req->req_bytes_expected);
|
2008-07-09 17:38:41 +00:00
|
|
|
}
|
2008-07-17 04:50:39 +00:00
|
|
|
}
|
2007-12-19 09:16:20 +00:00
|
|
|
|
|
|
|
#define MCA_PML_OB1_RECV_REQUEST_MATCHED(request, hdr) \
|
|
|
|
recv_req_matched(request, hdr)
|
|
|
|
|
|
|
|
static inline void recv_req_matched(mca_pml_ob1_recv_request_t *req,
|
2008-07-17 04:50:39 +00:00
|
|
|
mca_pml_ob1_match_hdr_t *hdr)
|
2007-12-19 09:16:20 +00:00
|
|
|
{
|
|
|
|
req->req_recv.req_base.req_ompi.req_status.MPI_SOURCE = hdr->hdr_src;
|
|
|
|
req->req_recv.req_base.req_ompi.req_status.MPI_TAG = hdr->hdr_tag;
|
|
|
|
req->req_match_received = true;
|
2011-03-18 21:36:35 +00:00
|
|
|
#if OPAL_ENABLE_MULTI_THREADS
|
2007-12-19 09:16:20 +00:00
|
|
|
opal_atomic_wmb();
|
2009-05-27 16:12:18 +00:00
|
|
|
#endif
|
2007-12-19 09:16:20 +00:00
|
|
|
if(req->req_recv.req_bytes_packed > 0) {
|
2009-05-06 20:11:28 +00:00
|
|
|
#if OPAL_ENABLE_HETEROGENEOUS_SUPPORT
|
2007-12-19 09:16:20 +00:00
|
|
|
if(MPI_ANY_SOURCE == req->req_recv.req_base.req_peer) {
|
|
|
|
/* non wildcard prepared during post recv */
|
|
|
|
prepare_recv_req_converter(req);
|
|
|
|
}
|
2009-05-06 20:11:28 +00:00
|
|
|
#endif /* OPAL_ENABLE_HETEROGENEOUS_SUPPORT */
|
2007-12-19 09:16:20 +00:00
|
|
|
PERUSE_TRACE_COMM_EVENT(PERUSE_COMM_REQ_XFER_BEGIN,
|
2009-08-05 03:12:33 +00:00
|
|
|
&req->req_recv.req_base, PERUSE_RECV);
|
2007-12-19 09:16:20 +00:00
|
|
|
}
|
|
|
|
}
|
2005-06-06 16:17:43 +00:00
|
|
|
|
|
|
|
|
2005-06-01 14:34:22 +00:00
|
|
|
/**
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2008-07-17 04:50:39 +00:00
|
|
|
#define MCA_PML_OB1_RECV_REQUEST_UNPACK( request, \
|
|
|
|
segments, \
|
|
|
|
num_segments, \
|
|
|
|
seg_offset, \
|
|
|
|
data_offset, \
|
|
|
|
bytes_received, \
|
|
|
|
bytes_delivered) \
|
2005-06-07 14:12:47 +00:00
|
|
|
do { \
|
2006-07-13 16:52:40 +00:00
|
|
|
bytes_delivered = 0; \
|
2005-07-15 16:17:33 +00:00
|
|
|
if(request->req_recv.req_bytes_packed > 0) { \
|
2005-06-30 05:50:55 +00:00
|
|
|
struct iovec iov[MCA_BTL_DES_MAX_SEGMENTS]; \
|
2005-06-07 14:12:47 +00:00
|
|
|
uint32_t iov_count = 0; \
|
2005-06-08 19:10:15 +00:00
|
|
|
size_t max_data = bytes_received; \
|
2005-06-07 14:12:47 +00:00
|
|
|
size_t n, offset = seg_offset; \
|
2006-05-23 03:21:15 +00:00
|
|
|
mca_btl_base_segment_t* segment = segments; \
|
2005-06-07 14:12:47 +00:00
|
|
|
\
|
2006-05-23 03:21:15 +00:00
|
|
|
for( n = 0; n < num_segments; n++, segment++ ) { \
|
2005-06-07 14:12:47 +00:00
|
|
|
if(offset >= segment->seg_len) { \
|
|
|
|
offset -= segment->seg_len; \
|
|
|
|
} else { \
|
2007-02-13 09:34:04 +00:00
|
|
|
iov[iov_count].iov_len = segment->seg_len - offset; \
|
2008-07-17 04:50:39 +00:00
|
|
|
iov[iov_count].iov_base = (IOVBASE_TYPE*) \
|
|
|
|
((unsigned char*)segment->seg_addr.pval + offset); \
|
2005-06-07 14:12:47 +00:00
|
|
|
iov_count++; \
|
2009-05-27 16:12:18 +00:00
|
|
|
offset = 0; \
|
2005-06-06 21:52:20 +00:00
|
|
|
} \
|
2005-06-06 16:17:43 +00:00
|
|
|
} \
|
2012-07-08 12:57:00 +00:00
|
|
|
OPAL_THREAD_LOCK(&request->lock); \
|
2006-06-26 20:08:33 +00:00
|
|
|
PERUSE_TRACE_COMM_OMPI_EVENT (PERUSE_COMM_REQ_XFER_CONTINUE, \
|
|
|
|
&(recvreq->req_recv.req_base), max_data, \
|
|
|
|
PERUSE_RECV); \
|
- Split the datatype engine into two parts: an MPI specific part in
OMPI
and a language agnostic part in OPAL. The convertor is completely
moved into OPAL. This offers several benefits as described in RFC
http://www.open-mpi.org/community/lists/devel/2009/07/6387.php
namely:
- Fewer basic types (int* and float* types, boolean and wchar
- Fixing naming scheme to ompi-nomenclature.
- Usability outside of the ompi-layer.
- Due to the fixed nature of simple opal types, their information is
completely
known at compile time and therefore constified
- With fewer datatypes (22), the actual sizes of bit-field types may be
reduced
from 64 to 32 bits, allowing reorganizing the opal_datatype
structure, eliminating holes and keeping data required in convertor
(upon send/recv) in one cacheline...
This has implications to the convertor-datastructure and other parts
of the code.
- Several performance tests have been run, the netpipe latency does not
change with
this patch on Linux/x86-64 on the smoky cluster.
- Extensive tests have been done to verify correctness (no new
regressions) using:
1. mpi_test_suite on linux/x86-64 using clean ompi-trunk and
ompi-ddt:
a. running both trunk and ompi-ddt resulted in no differences
(except for MPI_SHORT_INT and MPI_TYPE_MIX_LB_UB do now run
correctly).
b. with --enable-memchecker and running under valgrind (one buglet
when run with static found in test-suite, commited)
2. ibm testsuite on linux/x86-64 using clean ompi-trunk and ompi-ddt:
all passed (except for the dynamic/ tests failed!! as trunk/MTT)
3. compilation and usage of HDF5 tests on Jaguar using PGI and
PathScale compilers.
4. compilation and usage on Scicortex.
- Please note, that for the heterogeneous case, (-m32 compiled
binaries/ompi), neither
ompi-trunk, nor ompi-ddt branch would successfully launch.
This commit was SVN r21641.
2009-07-13 04:56:31 +00:00
|
|
|
opal_convertor_set_position( &(request->req_recv.req_base.req_convertor), \
|
2006-07-05 19:45:00 +00:00
|
|
|
&data_offset ); \
|
- Split the datatype engine into two parts: an MPI specific part in
OMPI
and a language agnostic part in OPAL. The convertor is completely
moved into OPAL. This offers several benefits as described in RFC
http://www.open-mpi.org/community/lists/devel/2009/07/6387.php
namely:
- Fewer basic types (int* and float* types, boolean and wchar
- Fixing naming scheme to ompi-nomenclature.
- Usability outside of the ompi-layer.
- Due to the fixed nature of simple opal types, their information is
completely
known at compile time and therefore constified
- With fewer datatypes (22), the actual sizes of bit-field types may be
reduced
from 64 to 32 bits, allowing reorganizing the opal_datatype
structure, eliminating holes and keeping data required in convertor
(upon send/recv) in one cacheline...
This has implications to the convertor-datastructure and other parts
of the code.
- Several performance tests have been run, the netpipe latency does not
change with
this patch on Linux/x86-64 on the smoky cluster.
- Extensive tests have been done to verify correctness (no new
regressions) using:
1. mpi_test_suite on linux/x86-64 using clean ompi-trunk and
ompi-ddt:
a. running both trunk and ompi-ddt resulted in no differences
(except for MPI_SHORT_INT and MPI_TYPE_MIX_LB_UB do now run
correctly).
b. with --enable-memchecker and running under valgrind (one buglet
when run with static found in test-suite, commited)
2. ibm testsuite on linux/x86-64 using clean ompi-trunk and ompi-ddt:
all passed (except for the dynamic/ tests failed!! as trunk/MTT)
3. compilation and usage of HDF5 tests on Jaguar using PGI and
PathScale compilers.
4. compilation and usage on Scicortex.
- Please note, that for the heterogeneous case, (-m32 compiled
binaries/ompi), neither
ompi-trunk, nor ompi-ddt branch would successfully launch.
This commit was SVN r21641.
2009-07-13 04:56:31 +00:00
|
|
|
opal_convertor_unpack( &(request)->req_recv.req_base.req_convertor, \
|
2006-07-05 19:45:00 +00:00
|
|
|
iov, \
|
|
|
|
&iov_count, \
|
2006-10-26 23:11:26 +00:00
|
|
|
&max_data ); \
|
2006-07-05 19:45:00 +00:00
|
|
|
bytes_delivered = max_data; \
|
2007-07-30 12:50:38 +00:00
|
|
|
OPAL_THREAD_UNLOCK(&request->lock); \
|
2005-06-06 16:17:43 +00:00
|
|
|
} \
|
2005-06-07 14:12:47 +00:00
|
|
|
} while (0)
|
2005-06-01 14:34:22 +00:00
|
|
|
|
2008-05-30 01:29:09 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
void mca_pml_ob1_recv_request_progress_match(
|
|
|
|
mca_pml_ob1_recv_request_t* req,
|
|
|
|
struct mca_btl_base_module_t* btl,
|
|
|
|
mca_btl_base_segment_t* segments,
|
|
|
|
size_t num_segments);
|
|
|
|
|
|
|
|
/**
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
void mca_pml_ob1_recv_request_progress_frag(
|
|
|
|
mca_pml_ob1_recv_request_t* req,
|
|
|
|
struct mca_btl_base_module_t* btl,
|
|
|
|
mca_btl_base_segment_t* segments,
|
|
|
|
size_t num_segments);
|
|
|
|
|
2013-01-17 22:34:43 +00:00
|
|
|
#if OMPI_CUDA_SUPPORT
|
|
|
|
void mca_pml_ob1_recv_request_frag_copy_start(
|
|
|
|
mca_pml_ob1_recv_request_t* req,
|
|
|
|
struct mca_btl_base_module_t* btl,
|
|
|
|
mca_btl_base_segment_t* segments,
|
|
|
|
size_t num_segments,
|
|
|
|
mca_btl_base_descriptor_t* des);
|
|
|
|
|
|
|
|
void mca_pml_ob1_recv_request_frag_copy_finished(struct mca_btl_base_module_t* btl,
|
|
|
|
struct mca_btl_base_endpoint_t* ep,
|
|
|
|
struct mca_btl_base_descriptor_t* des,
|
|
|
|
int status );
|
|
|
|
#endif /* OMPI_CUDA_SUPPORT */
|
2008-05-30 01:29:09 +00:00
|
|
|
/**
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
void mca_pml_ob1_recv_request_progress_rndv(
|
|
|
|
mca_pml_ob1_recv_request_t* req,
|
|
|
|
struct mca_btl_base_module_t* btl,
|
|
|
|
mca_btl_base_segment_t* segments,
|
|
|
|
size_t num_segments);
|
|
|
|
|
2005-05-23 22:06:50 +00:00
|
|
|
/**
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2008-05-30 01:29:09 +00:00
|
|
|
void mca_pml_ob1_recv_request_progress_rget(
|
2005-05-23 22:06:50 +00:00
|
|
|
mca_pml_ob1_recv_request_t* req,
|
2005-08-17 18:23:38 +00:00
|
|
|
struct mca_btl_base_module_t* btl,
|
2005-06-30 05:50:55 +00:00
|
|
|
mca_btl_base_segment_t* segments,
|
2005-05-23 22:06:50 +00:00
|
|
|
size_t num_segments);
|
|
|
|
|
2005-06-09 03:11:51 +00:00
|
|
|
/**
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2005-09-13 16:45:41 +00:00
|
|
|
void mca_pml_ob1_recv_request_matched_probe(
|
|
|
|
mca_pml_ob1_recv_request_t* req,
|
|
|
|
struct mca_btl_base_module_t* btl,
|
|
|
|
mca_btl_base_segment_t* segments,
|
|
|
|
size_t num_segments);
|
|
|
|
|
|
|
|
/**
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2007-09-18 16:18:47 +00:00
|
|
|
int mca_pml_ob1_recv_request_schedule_once(
|
2007-07-01 11:35:55 +00:00
|
|
|
mca_pml_ob1_recv_request_t* req, mca_bml_base_btl_t* start_bml_btl);
|
2005-06-09 03:11:51 +00:00
|
|
|
|
2007-09-18 16:18:47 +00:00
|
|
|
static inline int mca_pml_ob1_recv_request_schedule_exclusive(
|
|
|
|
mca_pml_ob1_recv_request_t* req,
|
|
|
|
mca_bml_base_btl_t* start_bml_btl)
|
|
|
|
{
|
|
|
|
int rc;
|
|
|
|
|
|
|
|
do {
|
|
|
|
rc = mca_pml_ob1_recv_request_schedule_once(req, start_bml_btl);
|
2012-04-06 14:23:13 +00:00
|
|
|
if(rc == OMPI_ERR_OUT_OF_RESOURCE)
|
2007-09-18 16:18:47 +00:00
|
|
|
break;
|
|
|
|
} while(!unlock_recv_request(req));
|
|
|
|
|
|
|
|
if(OMPI_SUCCESS == rc)
|
|
|
|
recv_request_pml_complete_check(req);
|
|
|
|
|
|
|
|
return rc;
|
|
|
|
}
|
|
|
|
|
2006-07-20 14:44:35 +00:00
|
|
|
static inline void mca_pml_ob1_recv_request_schedule(
|
2007-07-01 11:35:55 +00:00
|
|
|
mca_pml_ob1_recv_request_t* req,
|
|
|
|
mca_bml_base_btl_t* start_bml_btl)
|
2006-07-20 14:44:35 +00:00
|
|
|
{
|
2007-09-18 16:18:47 +00:00
|
|
|
if(!lock_recv_request(req))
|
|
|
|
return;
|
|
|
|
|
|
|
|
(void)mca_pml_ob1_recv_request_schedule_exclusive(req, start_bml_btl);
|
2006-07-20 14:44:35 +00:00
|
|
|
}
|
|
|
|
|
2006-12-29 07:38:24 +00:00
|
|
|
#define MCA_PML_OB1_ADD_ACK_TO_PENDING(P, S, D, O) \
|
|
|
|
do { \
|
|
|
|
mca_pml_ob1_pckt_pending_t *_pckt; \
|
|
|
|
\
|
2013-07-04 08:34:37 +00:00
|
|
|
MCA_PML_OB1_PCKT_PENDING_ALLOC(_pckt); \
|
2006-12-29 07:38:24 +00:00
|
|
|
_pckt->hdr.hdr_common.hdr_type = MCA_PML_OB1_HDR_TYPE_ACK; \
|
2007-01-04 22:07:37 +00:00
|
|
|
_pckt->hdr.hdr_ack.hdr_src_req.lval = (S); \
|
|
|
|
_pckt->hdr.hdr_ack.hdr_dst_req.pval = (D); \
|
2007-06-03 08:30:07 +00:00
|
|
|
_pckt->hdr.hdr_ack.hdr_send_offset = (O); \
|
2006-12-29 07:38:24 +00:00
|
|
|
_pckt->proc = (P); \
|
|
|
|
_pckt->bml_btl = NULL; \
|
|
|
|
OPAL_THREAD_LOCK(&mca_pml_ob1.lock); \
|
|
|
|
opal_list_append(&mca_pml_ob1.pckt_pending, \
|
|
|
|
(opal_list_item_t*)_pckt); \
|
|
|
|
OPAL_THREAD_UNLOCK(&mca_pml_ob1.lock); \
|
2006-07-20 14:44:35 +00:00
|
|
|
} while(0)
|
|
|
|
|
|
|
|
int mca_pml_ob1_recv_request_ack_send_btl(ompi_proc_t* proc,
|
2006-12-04 20:11:42 +00:00
|
|
|
mca_bml_base_btl_t* bml_btl, uint64_t hdr_src_req, void *hdr_dst_req,
|
2008-03-27 08:56:43 +00:00
|
|
|
uint64_t hdr_rdma_offset, bool nordma);
|
2006-07-20 14:44:35 +00:00
|
|
|
|
|
|
|
static inline int mca_pml_ob1_recv_request_ack_send(ompi_proc_t* proc,
|
2008-03-27 08:56:43 +00:00
|
|
|
uint64_t hdr_src_req, void *hdr_dst_req, uint64_t hdr_send_offset,
|
|
|
|
bool nordma)
|
2006-07-20 14:44:35 +00:00
|
|
|
{
|
|
|
|
size_t i;
|
|
|
|
mca_bml_base_btl_t* bml_btl;
|
|
|
|
mca_bml_base_endpoint_t* endpoint =
|
|
|
|
(mca_bml_base_endpoint_t*)proc->proc_bml;
|
|
|
|
|
|
|
|
for(i = 0; i < mca_bml_base_btl_array_get_size(&endpoint->btl_eager); i++) {
|
|
|
|
bml_btl = mca_bml_base_btl_array_get_next(&endpoint->btl_eager);
|
|
|
|
if(mca_pml_ob1_recv_request_ack_send_btl(proc, bml_btl, hdr_src_req,
|
2008-03-27 08:56:43 +00:00
|
|
|
hdr_dst_req, hdr_send_offset, nordma) == OMPI_SUCCESS)
|
2006-07-20 14:44:35 +00:00
|
|
|
return OMPI_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
MCA_PML_OB1_ADD_ACK_TO_PENDING(proc, hdr_src_req, hdr_dst_req,
|
2008-05-30 01:29:09 +00:00
|
|
|
hdr_send_offset);
|
2006-07-20 14:44:35 +00:00
|
|
|
|
|
|
|
return OMPI_ERR_OUT_OF_RESOURCE;
|
|
|
|
}
|
|
|
|
|
2006-10-29 09:12:24 +00:00
|
|
|
int mca_pml_ob1_recv_request_get_frag(mca_pml_ob1_rdma_frag_t* frag);
|
2006-07-20 14:44:35 +00:00
|
|
|
|
2006-10-29 09:12:24 +00:00
|
|
|
/* This function tries to continue recvreq that stuck due to resource
|
|
|
|
* unavailability. Recvreq is added to recv_pending list if scheduling of put
|
|
|
|
* operation cannot be accomplished for some reason. */
|
2006-07-20 14:44:35 +00:00
|
|
|
void mca_pml_ob1_recv_request_process_pending(void);
|
2006-10-29 09:12:24 +00:00
|
|
|
|
2007-12-21 06:19:46 +00:00
|
|
|
END_C_DECLS
|
|
|
|
|
2005-05-23 22:06:50 +00:00
|
|
|
#endif
|
|
|
|
|