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.
155 строки
4.7 KiB
C
155 строки
4.7 KiB
C
/*
|
|
* Copyright (c) 2009-2012 Oak Ridge National Laboratory. All rights reserved.
|
|
* Copyright (c) 2009-2012 Mellanox Technologies. All rights reserved.
|
|
* Copyright (c) 2013 The University of Tennessee and The University
|
|
* of Tennessee Research Foundation. All rights
|
|
* reserved.
|
|
* $COPYRIGHT$
|
|
*
|
|
* Additional copyrights may follow
|
|
*
|
|
* $HEADER$
|
|
*/
|
|
|
|
#ifndef MCA_BCOL_IBOFFLOAD_FRAG_H
|
|
#define MCA_BCOL_IBOFFLOAD_FRAG_H
|
|
|
|
#include "ompi_config.h"
|
|
|
|
#include <infiniband/verbs.h>
|
|
|
|
#include "opal/datatype/opal_convertor.h"
|
|
|
|
#include "opal/mca/mpool/mpool.h"
|
|
#include "opal/class/ompi_free_list.h"
|
|
|
|
#include "bcol_iboffload.h"
|
|
|
|
BEGIN_C_DECLS
|
|
|
|
/* forward declarations */
|
|
struct mca_bcol_iboffload_collreq_t;
|
|
|
|
struct mca_bcol_iboffload_reg_t {
|
|
mca_mpool_base_registration_t base;
|
|
struct ibv_mr *mr;
|
|
};
|
|
typedef struct mca_bcol_iboffload_reg_t mca_bcol_iboffload_reg_t;
|
|
|
|
typedef enum {
|
|
MCA_BCOL_IBOFFLOAD_NONE_OWNER = -1,
|
|
MCA_BCOL_IBOFFLOAD_DUMMY_OWNER,
|
|
MCA_BCOL_IBOFFLOAD_BCOL_OWNER,
|
|
MCA_BCOL_IBOFFLOAD_ML_OWNER
|
|
} frag_type;
|
|
|
|
typedef enum {
|
|
MCA_BCOL_IBOFFLOAD_SEND_FRAG,
|
|
MCA_BCOL_IBOFFLOAD_SEND_FRAG_ML,
|
|
MCA_BCOL_IBOFFLOAD_SEND_FRAG_ML_CALC,
|
|
MCA_BCOL_IBOFFLOAD_SEND_FRAG_CONVERT,
|
|
MCA_BCOL_IBOFFLOAD_SEND_FRAG_CALC,
|
|
MCA_BCOL_IBOFFLOAD_SEND_FRAG_DUMMY
|
|
} send_frag_type;
|
|
|
|
struct mca_bcol_iboffload_frag_t {
|
|
ompi_free_list_item_t super;
|
|
|
|
struct mca_bcol_iboffload_frag_t *next;
|
|
struct mca_bcol_iboffload_reg_t *registration;
|
|
|
|
struct ibv_sge sg_entry;
|
|
|
|
frag_type type;
|
|
|
|
int ref_counter;
|
|
int qp_index;
|
|
};
|
|
typedef struct mca_bcol_iboffload_frag_t mca_bcol_iboffload_frag_t;
|
|
OBJ_CLASS_DECLARATION(mca_bcol_iboffload_frag_t);
|
|
|
|
/* The same fragment maybe shared by multiple task.
|
|
* In order to manage right release and allocation flow
|
|
* we use reference counter on each fragment and the follow
|
|
* wrapper allocation and release function that hides
|
|
* the counter */
|
|
|
|
#define IBOFFLOAD_SET_SINGLE_FRAG_ON_TASK(fragment, task) \
|
|
do { \
|
|
++((fragment)->ref_counter); \
|
|
(task)->frag = (fragment); \
|
|
} while(0)
|
|
|
|
#define IBOFFLOAD_SET_FRAGS_ON_TASK(fragment, task) \
|
|
do { \
|
|
struct mca_bcol_iboffload_frag_t *temp_frag = fragment; \
|
|
while (NULL != temp_frag) { \
|
|
++(temp_frag->ref_counter); \
|
|
temp_frag = temp_frag->next; \
|
|
} \
|
|
(task)->frag = fragment; \
|
|
} while(0)
|
|
|
|
/* function declarations */
|
|
mca_bcol_iboffload_frag_t *
|
|
mca_bcol_iboffload_get_send_frag(struct mca_bcol_iboffload_collreq_t *coll_request,
|
|
uint32_t destination, int qp_index, size_t len,
|
|
size_t src_offset, int buff_index, int send_frag_type);
|
|
|
|
void
|
|
mca_bcol_iboffload_frag_init(ompi_free_list_item_t* item, void* ctx);
|
|
void
|
|
mca_bcol_iboffload_ml_frag_init(ompi_free_list_item_t* item, void* ctx);
|
|
|
|
static inline __opal_attribute_always_inline__
|
|
mca_bcol_iboffload_frag_t* mca_bcol_iboffload_get_ml_empty_frag(
|
|
mca_bcol_iboffload_module_t *iboffload,
|
|
int qp_index)
|
|
{
|
|
ompi_free_list_item_t *item;
|
|
mca_bcol_iboffload_frag_t *frag;
|
|
|
|
mca_bcol_iboffload_component_t *cm = &mca_bcol_iboffload_component;
|
|
|
|
/* Get frag from free list */
|
|
OMPI_FREE_LIST_GET_MT(&cm->ml_frags_free, item);
|
|
if (OPAL_UNLIKELY(NULL == item)) {
|
|
return NULL;
|
|
}
|
|
|
|
frag = (mca_bcol_iboffload_frag_t *) item;
|
|
|
|
frag->qp_index = qp_index;
|
|
frag->next = NULL;
|
|
|
|
return frag;
|
|
}
|
|
|
|
static inline __opal_attribute_always_inline__
|
|
mca_bcol_iboffload_frag_t* mca_bcol_iboffload_get_ml_frag(
|
|
mca_bcol_iboffload_module_t *iboffload,
|
|
int qp_index, size_t len, uint32_t lkey, uint64_t addr)
|
|
{
|
|
/* local variables */
|
|
mca_bcol_iboffload_frag_t *frag;
|
|
|
|
IBOFFLOAD_VERBOSE(10, ("Call for get ML frag - addr 0x%x", addr));
|
|
|
|
frag = mca_bcol_iboffload_get_ml_empty_frag(iboffload, qp_index);
|
|
|
|
frag->sg_entry.addr = addr;
|
|
frag->sg_entry.lkey = lkey;
|
|
frag->sg_entry.length = len;
|
|
|
|
IBOFFLOAD_VERBOSE(10, ("Setting ml frag lkey %u, "
|
|
"addr %p, qp_index %d, send value - %lf",
|
|
frag->sg_entry.lkey, frag->sg_entry.addr,
|
|
qp_index, *(double *) frag->sg_entry.addr));
|
|
|
|
return frag;
|
|
}
|
|
|
|
END_C_DECLS
|
|
|
|
#endif
|