552c9ca5a0
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.
152 строки
4.3 KiB
C
152 строки
4.3 KiB
C
/*
|
|
* Copyright (c) 2006-2007 The Trustees of Indiana University and Indiana
|
|
* University Research and Technology
|
|
* Corporation. All rights reserved.
|
|
* Copyright (c) 2004-2007 The University of Tennessee and The University
|
|
* of Tennessee Research Foundation. All rights
|
|
* reserved.
|
|
* Copyright (c) 2004-2006 The Regents of the University of California.
|
|
* All rights reserved.
|
|
* Copyright (c) 2011 Sandia National Laboratories. All rights reserved.
|
|
* $COPYRIGHT$
|
|
*
|
|
* Additional copyrights may follow
|
|
*
|
|
* $HEADER$
|
|
*/
|
|
|
|
#include "ompi_config.h"
|
|
|
|
#include "ompi/communicator/communicator.h"
|
|
#include "ompi/mca/pml/base/pml_base_request.h"
|
|
#include "ompi/mca/pml/base/pml_base_bsend.h"
|
|
#include "ompi/mca/pml/base/base.h"
|
|
|
|
#include "pml_cm.h"
|
|
#include "pml_cm_sendreq.h"
|
|
#include "pml_cm_recvreq.h"
|
|
|
|
ompi_pml_cm_t ompi_pml_cm = {
|
|
{
|
|
mca_pml_cm_add_procs,
|
|
mca_pml_cm_del_procs,
|
|
mca_pml_cm_enable,
|
|
NULL, /* No progress function. The MTL register their own */
|
|
mca_pml_cm_add_comm,
|
|
mca_pml_cm_del_comm,
|
|
mca_pml_cm_irecv_init,
|
|
mca_pml_cm_irecv,
|
|
mca_pml_cm_recv,
|
|
mca_pml_cm_isend_init,
|
|
mca_pml_cm_isend,
|
|
mca_pml_cm_send,
|
|
mca_pml_cm_iprobe,
|
|
mca_pml_cm_probe,
|
|
mca_pml_cm_start,
|
|
mca_pml_cm_improbe,
|
|
mca_pml_cm_mprobe,
|
|
mca_pml_cm_imrecv,
|
|
mca_pml_cm_mrecv,
|
|
mca_pml_cm_dump,
|
|
NULL,
|
|
0,
|
|
0
|
|
}
|
|
};
|
|
|
|
|
|
int
|
|
mca_pml_cm_enable(bool enable)
|
|
{
|
|
/* BWB - FIX ME - need to have this actually do something,
|
|
maybe? */
|
|
ompi_free_list_init_new(&mca_pml_base_send_requests,
|
|
sizeof(mca_pml_cm_hvy_send_request_t) + ompi_mtl->mtl_request_size,
|
|
opal_cache_line_size,
|
|
OBJ_CLASS(mca_pml_cm_hvy_send_request_t),
|
|
0,opal_cache_line_size,
|
|
ompi_pml_cm.free_list_num,
|
|
ompi_pml_cm.free_list_max,
|
|
ompi_pml_cm.free_list_inc,
|
|
NULL);
|
|
|
|
ompi_free_list_init_new(&mca_pml_base_recv_requests,
|
|
sizeof(mca_pml_cm_hvy_recv_request_t) + ompi_mtl->mtl_request_size,
|
|
opal_cache_line_size,
|
|
OBJ_CLASS(mca_pml_cm_hvy_recv_request_t),
|
|
0,opal_cache_line_size,
|
|
ompi_pml_cm.free_list_num,
|
|
ompi_pml_cm.free_list_max,
|
|
ompi_pml_cm.free_list_inc,
|
|
NULL);
|
|
|
|
return OMPI_SUCCESS;
|
|
}
|
|
|
|
|
|
int
|
|
mca_pml_cm_add_comm(ompi_communicator_t* comm)
|
|
{
|
|
/* should never happen, but it was, so check */
|
|
if (comm->c_contextid > ompi_pml_cm.super.pml_max_contextid) {
|
|
return OMPI_ERR_OUT_OF_RESOURCE;
|
|
}
|
|
|
|
/* initialize per-communicator data. MTLs may override this. */
|
|
comm->c_pml_comm = NULL;
|
|
|
|
/* notify the MTL about the added communicator */
|
|
return OMPI_MTL_CALL(add_comm(ompi_mtl, comm));
|
|
}
|
|
|
|
|
|
int
|
|
mca_pml_cm_del_comm(ompi_communicator_t* comm)
|
|
{
|
|
/* notify the MTL about the deleted communicator */
|
|
return OMPI_MTL_CALL(del_comm(ompi_mtl, comm));
|
|
}
|
|
|
|
|
|
int
|
|
mca_pml_cm_add_procs(struct ompi_proc_t** procs, size_t nprocs)
|
|
{
|
|
int ret;
|
|
|
|
#if OPAL_ENABLE_HETEROGENEOUS_SUPPORT
|
|
for (size_t i = 0 ; i < nprocs ; ++i) {
|
|
if (procs[i]->super.proc_arch != ompi_proc_local()->super.proc_arch) {
|
|
return OMPI_ERR_NOT_SUPPORTED;
|
|
}
|
|
}
|
|
#endif
|
|
|
|
/* make sure remote procs are using the same PML as us */
|
|
if (OMPI_SUCCESS != (ret = mca_pml_base_pml_check_selected("cm",
|
|
procs,
|
|
nprocs))) {
|
|
return ret;
|
|
}
|
|
|
|
ret = OMPI_MTL_CALL(add_procs(ompi_mtl, nprocs, procs));
|
|
return ret;
|
|
}
|
|
|
|
|
|
int
|
|
mca_pml_cm_del_procs(struct ompi_proc_t** procs, size_t nprocs)
|
|
{
|
|
int ret;
|
|
|
|
ret = OMPI_MTL_CALL(del_procs(ompi_mtl, nprocs, procs));
|
|
return ret;
|
|
}
|
|
|
|
|
|
/* print any available useful information from this communicator */
|
|
int
|
|
mca_pml_cm_dump(struct ompi_communicator_t* comm, int verbose)
|
|
{
|
|
return OMPI_ERR_NOT_IMPLEMENTED;
|
|
}
|