2012-08-16 23:11:35 +04:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2009-2012 Oak Ridge National Laboratory. All rights reserved.
|
|
|
|
* Copyright (c) 2009-2012 Mellanox Technologies. All rights reserved.
|
|
|
|
* $COPYRIGHT$
|
|
|
|
*
|
|
|
|
* Additional copyrights may follow
|
|
|
|
*
|
|
|
|
* $HEADER$
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef MCA_ML_ALLOC_H
|
|
|
|
#define MCA_ML_ALLOC_H
|
|
|
|
|
|
|
|
#include "ompi_config.h"
|
|
|
|
#include "ompi/include/ompi/constants.h"
|
|
|
|
#include "ompi/communicator/communicator.h"
|
|
|
|
#include "ompi/mca/coll/coll.h"
|
|
|
|
#include "ompi/mca/bcol/base/base.h"
|
|
|
|
#include "opal/sys/atomic.h"
|
George did the work and deserves all the credit for it. Ralph did the merge, and deserves whatever blame results from errors in it :-)
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.
2014-07-26 04:47:28 +04:00
|
|
|
#include "opal/mca/mpool/base/base.h"
|
2012-08-16 23:11:35 +04:00
|
|
|
#include "coll_ml_lmngr.h"
|
|
|
|
|
|
|
|
/*
|
|
|
|
Returns a block of memory from mpool
|
|
|
|
|
|
|
|
ARGS:
|
|
|
|
IN ml_component: component descriptor
|
|
|
|
OUT ml_memblock: block_addr - Starting address of the memory block
|
|
|
|
size - Size of the block
|
|
|
|
register_info - Register information passed from the mpool
|
|
|
|
|
|
|
|
Return
|
|
|
|
On Sucess : Returns size of memory block
|
|
|
|
On Failure: Returns -1
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
struct mca_coll_ml_component_t;
|
|
|
|
struct mca_coll_ml_module_t;
|
|
|
|
|
2014-02-07 23:15:45 +04:00
|
|
|
mca_bcol_base_memory_block_desc_t *mca_coll_ml_allocate_block(
|
2012-08-16 23:11:35 +04:00
|
|
|
struct mca_coll_ml_component_t *ml_component,
|
2014-02-07 23:15:45 +04:00
|
|
|
struct mca_bcol_base_memory_block_desc_t *ml_memblock
|
2012-08-16 23:11:35 +04:00
|
|
|
);
|
|
|
|
/* Allocate the memory from mpool */
|
|
|
|
/* Register the memory block with bcols */
|
|
|
|
|
|
|
|
void mca_coll_ml_free_block(
|
2014-02-07 23:15:45 +04:00
|
|
|
mca_bcol_base_memory_block_desc_t *ml_memblock
|
2012-08-16 23:11:35 +04:00
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
Initialize the memory block and map into buffers and memory banks, and
|
|
|
|
also buffer descriptors are initialized.
|
|
|
|
|
|
|
|
IN ml_memblock: Memory block descriptor
|
|
|
|
IN num_buffers: number of buffers
|
|
|
|
IN num_banks: number of banks
|
|
|
|
Return
|
|
|
|
On Sucess: OMPI_SUCCESS
|
|
|
|
On Failure: OMPI_ERROR
|
|
|
|
*/
|
|
|
|
int mca_coll_ml_initialize_block(
|
2014-02-07 23:15:45 +04:00
|
|
|
mca_bcol_base_memory_block_desc_t *ml_memblock,
|
2012-08-16 23:11:35 +04:00
|
|
|
uint32_t num_buffers,
|
|
|
|
uint32_t num_banks,
|
|
|
|
uint32_t buffer_size,
|
|
|
|
int32_t data_offset,
|
|
|
|
opal_list_t *bcols_in_use
|
|
|
|
);
|
|
|
|
/* Map blocks into buffers and banks */
|
|
|
|
/* Initialize the descriptors */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
Allocate a memory buffer from the block
|
|
|
|
IN ml_memblock: Memory block descriptor
|
|
|
|
OUT ml_membuffer: Buffer allocated for data from the block
|
|
|
|
|
|
|
|
Return
|
|
|
|
On Sucess: OMPI_SUCCESS
|
|
|
|
On Failure: OMPI_ERROR
|
|
|
|
*/
|
2014-02-07 23:15:45 +04:00
|
|
|
mca_bcol_base_payload_buffer_desc_t *mca_coll_ml_alloc_buffer(
|
2012-08-16 23:11:35 +04:00
|
|
|
struct mca_coll_ml_module_t *module);
|
|
|
|
|
|
|
|
int mca_coll_ml_free_buffer(
|
2014-02-07 23:15:45 +04:00
|
|
|
mca_bcol_base_memory_block_desc_t *ml_memblock,
|
|
|
|
struct mca_bcol_base_payload_buffer_desc_t *ml_membuffer
|
2012-08-16 23:11:35 +04:00
|
|
|
);
|
|
|
|
|
|
|
|
/*
|
|
|
|
Register the memory block with bcol component
|
|
|
|
|
|
|
|
IN ml_memblock: Memory block descriptor
|
|
|
|
OUT registerations (ml_memblock)
|
|
|
|
|
|
|
|
Return
|
|
|
|
On Sucess: OMPI_SUCCESS
|
|
|
|
On Failure: OMPI_ERROR
|
|
|
|
|
|
|
|
*/
|
|
|
|
int mca_coll_ml_register_block_bcol(
|
2014-02-07 23:15:45 +04:00
|
|
|
mca_bcol_base_memory_block_desc_t *ml_memblock
|
2012-08-16 23:11:35 +04:00
|
|
|
);
|
|
|
|
|
|
|
|
#endif /* MCA_ML_ALLOC_H */
|