diff --git a/ompi/mca/mpool/mpool.h b/ompi/mca/mpool/mpool.h index 306c5cdffa..d73685a05f 100644 --- a/ompi/mca/mpool/mpool.h +++ b/ompi/mca/mpool/mpool.h @@ -22,7 +22,10 @@ #include "mca/mca.h" #include "info/info.h" #include "opal/class/opal_list.h" +#include "ompi/class/ompi_pointer_array.h" +#define MCA_MPOOL_FLAGS_CACHE 0x1 +#define MCA_MPOOL_FLAGS_PERSIST 0x2 struct mca_mpool_base_resources_t; @@ -33,7 +36,11 @@ struct mca_mpool_base_registration_t { unsigned char* base; unsigned char* bound; unsigned char* alloc_base; + void* user_data; + uint32_t ref_count; + uint32_t flags; }; + typedef struct mca_mpool_base_registration_t mca_mpool_base_registration_t; OMPI_DECLSPEC OBJ_CLASS_DECLARATION(mca_mpool_base_registration_t); @@ -88,6 +95,26 @@ typedef int (*mca_mpool_base_module_deregister_fn_t)( size_t size, mca_mpool_base_registration_t* registration); +/** + * find registrations in this memory pool + */ + +typedef int (*mca_mpool_base_module_find_fn_t) ( + struct mca_mpool_base_module_t* mpool, + void* addr, + size_t size, + ompi_pointer_array_t* regs + ); + +/** + * release registration + */ + +typedef int (*mca_mpool_base_module_release_fn_t) ( + struct mca_mpool_base_module_t* mpool, + mca_mpool_base_registration_t* registration); + + /** * if appropriate - returns base address of memory pool */ @@ -131,6 +158,8 @@ struct mca_mpool_base_module_t { mca_mpool_base_module_free_fn_t mpool_free; /**< free function */ mca_mpool_base_module_register_fn_t mpool_register; /**< register memory */ mca_mpool_base_module_deregister_fn_t mpool_deregister; /**< deregister memory */ + mca_mpool_base_module_find_fn_t mpool_find; /**< find regisrations in the cache */ + mca_mpool_base_module_release_fn_t mpool_release; /**< release a regisrtation from the cache */ mca_mpool_base_module_finalize_fn_t mpool_finalize; /**< finalize */ }; /** diff --git a/ompi/mca/mpool/mvapi/mpool_mvapi.h b/ompi/mca/mpool/mvapi/mpool_mvapi.h index 240c9475d5..331f8db688 100644 --- a/ompi/mca/mpool/mvapi/mpool_mvapi.h +++ b/ompi/mca/mpool/mvapi/mpool_mvapi.h @@ -138,6 +138,20 @@ void mca_mpool_mvapi_free(mca_mpool_base_module_t* mpool, void * addr, mca_mpool_base_registration_t* registration); + +int mca_mpool_mvapi_find( + struct mca_mpool_base_module_t* mpool, + void* addr, + size_t size, + ompi_pointer_array_t *regs + ); + +int mca_mpool_mvapi_release( + struct mca_mpool_base_module_t* mpool, + mca_mpool_base_registration_t* registraion + ); + + #if defined(c_plusplus) || defined(__cplusplus) } #endif diff --git a/ompi/mca/mpool/mvapi/mpool_mvapi_module.c b/ompi/mca/mpool/mvapi/mpool_mvapi_module.c index 8434718bbb..fa2cf8a8e8 100644 --- a/ompi/mca/mpool/mvapi/mpool_mvapi_module.c +++ b/ompi/mca/mpool/mvapi/mpool_mvapi_module.c @@ -22,7 +22,7 @@ #include #include -/* +/* * Initializes the mpool module. */ void mca_mpool_mvapi_module_init(mca_mpool_mvapi_module_t* mpool) @@ -34,6 +34,8 @@ void mca_mpool_mvapi_module_init(mca_mpool_mvapi_module_t* mpool) mpool->super.mpool_free = mca_mpool_mvapi_free; mpool->super.mpool_register = mca_mpool_mvapi_register; mpool->super.mpool_deregister = mca_mpool_mvapi_deregister; + mpool->super.mpool_find = mca_mpool_mvapi_find; + mpool->super.mpool_release = mca_mpool_mvapi_release; mpool->super.mpool_finalize = NULL; } @@ -167,6 +169,26 @@ void mca_mpool_mvapi_free(mca_mpool_base_module_t* mpool, void * addr, } +int mca_mpool_mvapi_find( + struct mca_mpool_base_module_t* mpool, + void* addr, + size_t size, + ompi_pointer_array_t *regs + ){ + + return OMPI_SUCCESS; +} + +int mca_mpool_mvapi_release( + struct mca_mpool_base_module_t* mpool, + mca_mpool_base_registration_t* registraion + ){ + return OMPI_SUCCESS; +} + + + +