
WHAT: Open our low-level communication infrastructure by moving all necessary components (btl/rcache/allocator/mpool) down in OPAL All the components required for inter-process communications are currently deeply integrated in the OMPI layer. Several groups/institutions have express interest in having a more generic communication infrastructure, without all the OMPI layer dependencies. This communication layer should be made available at a different software level, available to all layers in the Open MPI software stack. As an example, our ORTE layer could replace the current OOB and instead use the BTL directly, gaining access to more reactive network interfaces than TCP. Similarly, external software libraries could take advantage of our highly optimized AM (active message) communication layer for their own purpose. UTK with support from Sandia, developped a version of Open MPI where the entire communication infrastucture has been moved down to OPAL (btl/rcache/allocator/mpool). Most of the moved components have been updated to match the new schema, with few exceptions (mainly BTLs where I have no way of compiling/testing them). Thus, the completion of this RFC is tied to being able to completing this move for all BTLs. For this we need help from the rest of the Open MPI community, especially those supporting some of the BTLs. A non-exhaustive list of BTLs that qualify here is: mx, portals4, scif, udapl, ugni, usnic. This commit was SVN r32317.
127 строки
4.2 KiB
C
127 строки
4.2 KiB
C
/*
|
|
* Copyright (c) 2013 Mellanox Technologies, Inc.
|
|
* All rights reserved.
|
|
* $COPYRIGHT$
|
|
*
|
|
* Additional copyrights may follow
|
|
*
|
|
* $HEADER$
|
|
*/
|
|
|
|
#include "oshmem_config.h"
|
|
#include "opal/prefetch.h"
|
|
#include "oshmem/constants.h"
|
|
#include "oshmem/mca/spml/spml.h"
|
|
#include "opal/mca/btl/btl.h"
|
|
#include "orte/mca/errmgr/errmgr.h"
|
|
#include "opal/mca/mpool/mpool.h"
|
|
#include "ompi/mca/bml/base/base.h"
|
|
#include "oshmem/mca/spml/yoda/spml_yoda.h"
|
|
#include "oshmem/mca/spml/yoda/spml_yoda_putreq.h"
|
|
#include "oshmem/mca/spml/yoda/spml_yoda_getreq.h"
|
|
#include "oshmem/mca/spml/yoda/spml_yoda_rdmafrag.h"
|
|
|
|
/*
|
|
* The free call mark the final stage in a request life-cycle. Starting from this
|
|
* point the request is completed at both SPML and user level, and can be used
|
|
* for others one sided communications. Therefore, in the case of the YODA SPML it should
|
|
* be added to the free request list.
|
|
*/
|
|
static int mca_spml_yoda_get_request_free(struct oshmem_request_t** request)
|
|
{
|
|
mca_spml_yoda_get_request_t* getreq =
|
|
*(mca_spml_yoda_get_request_t**) request;
|
|
|
|
assert( false == getreq->req_get.req_base.req_free_called);
|
|
|
|
OPAL_THREAD_LOCK(&oshmem_request_lock);
|
|
getreq->req_get.req_base.req_free_called = true;
|
|
|
|
OMPI_FREE_LIST_RETURN_MT( &mca_spml_base_get_requests,
|
|
(ompi_free_list_item_t*)getreq);
|
|
|
|
OPAL_THREAD_UNLOCK(&oshmem_request_lock);
|
|
|
|
*request = SHMEM_REQUEST_NULL; /*MPI_REQUEST_NULL;*/
|
|
return OSHMEM_SUCCESS;
|
|
}
|
|
|
|
static int mca_spml_yoda_get_request_cancel(struct oshmem_request_t* request,
|
|
int complete)
|
|
{
|
|
/* we dont cancel get requests by now */
|
|
return OSHMEM_SUCCESS;
|
|
}
|
|
|
|
static void mca_spml_yoda_get_request_construct(mca_spml_yoda_get_request_t* req)
|
|
{
|
|
req->req_get.req_base.req_type = MCA_SPML_REQUEST_GET;
|
|
req->req_get.req_base.req_oshmem.req_free = mca_spml_yoda_get_request_free;
|
|
req->req_get.req_base.req_oshmem.req_cancel =
|
|
mca_spml_yoda_get_request_cancel;
|
|
}
|
|
|
|
static void mca_spml_yoda_get_request_destruct(mca_spml_yoda_get_request_t* req)
|
|
{
|
|
}
|
|
|
|
OBJ_CLASS_INSTANCE( mca_spml_yoda_get_request_t,
|
|
mca_spml_base_get_request_t,
|
|
mca_spml_yoda_get_request_construct,
|
|
mca_spml_yoda_get_request_destruct);
|
|
|
|
void mca_spml_yoda_get_completion(mca_btl_base_module_t* btl,
|
|
struct mca_btl_base_endpoint_t* ep,
|
|
struct mca_btl_base_descriptor_t* des,
|
|
int status)
|
|
{
|
|
mca_spml_yoda_rdma_frag_t* frag =
|
|
(mca_spml_yoda_rdma_frag_t*) des->des_cbdata;
|
|
mca_spml_yoda_get_request_t* getreq =
|
|
(mca_spml_yoda_get_request_t*) frag->rdma_req;
|
|
mca_bml_base_btl_t* bml_btl = (mca_bml_base_btl_t*) des->des_context;
|
|
|
|
/* check completion status */
|
|
if (OPAL_UNLIKELY(OSHMEM_SUCCESS != status)) {
|
|
/* shmem has no way to propagate errors. cry&die */
|
|
SPML_ERROR("FATAL get completion error");
|
|
abort();
|
|
}
|
|
/* decide if we need to copy buffer */
|
|
if (getreq->p_dst) {
|
|
memcpy(getreq->p_dst,
|
|
des->des_remote->seg_addr.pval,
|
|
frag->size);
|
|
}
|
|
|
|
if (getreq->parent) {
|
|
OPAL_THREAD_ADD32(&getreq->parent->active_count, -1);
|
|
}
|
|
getreq->req_get.req_base.req_spml_complete = true;
|
|
oshmem_request_complete(&getreq->req_get.req_base.req_oshmem, 1);
|
|
oshmem_request_free((oshmem_request_t**) &getreq);
|
|
|
|
mca_bml_base_free(bml_btl, des);
|
|
|
|
OPAL_THREAD_ADD32(&mca_spml_yoda.n_active_gets, -1);
|
|
}
|
|
|
|
void mca_spml_yoda_get_response_completion(mca_btl_base_module_t* btl,
|
|
struct mca_btl_base_endpoint_t* ep,
|
|
struct mca_btl_base_descriptor_t* des,
|
|
int status)
|
|
{
|
|
mca_bml_base_btl_t* bml_btl = (mca_bml_base_btl_t*) des->des_context;
|
|
|
|
/* check completion status */
|
|
if (OPAL_UNLIKELY(OSHMEM_SUCCESS != status)) {
|
|
/* shmem has no way to propagate errors. cry&die */
|
|
SPML_ERROR("FATAL get completion error");
|
|
abort();
|
|
}
|
|
|
|
mca_bml_base_free(bml_btl, des);
|
|
|
|
OPAL_THREAD_ADD32(&mca_spml_yoda.n_active_gets, -1);
|
|
}
|