Changes to support rcache in mpool
This commit was SVN r7176.
Этот коммит содержится в:
родитель
dc769e3560
Коммит
ba9342085e
@ -22,7 +22,10 @@
|
|||||||
#include "mca/mca.h"
|
#include "mca/mca.h"
|
||||||
#include "info/info.h"
|
#include "info/info.h"
|
||||||
#include "opal/class/opal_list.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;
|
struct mca_mpool_base_resources_t;
|
||||||
|
|
||||||
@ -33,7 +36,11 @@ struct mca_mpool_base_registration_t {
|
|||||||
unsigned char* base;
|
unsigned char* base;
|
||||||
unsigned char* bound;
|
unsigned char* bound;
|
||||||
unsigned char* alloc_base;
|
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;
|
typedef struct mca_mpool_base_registration_t mca_mpool_base_registration_t;
|
||||||
|
|
||||||
OMPI_DECLSPEC OBJ_CLASS_DECLARATION(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,
|
size_t size,
|
||||||
mca_mpool_base_registration_t* registration);
|
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
|
* 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_free_fn_t mpool_free; /**< free function */
|
||||||
mca_mpool_base_module_register_fn_t mpool_register; /**< register memory */
|
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_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 */
|
mca_mpool_base_module_finalize_fn_t mpool_finalize; /**< finalize */
|
||||||
};
|
};
|
||||||
/**
|
/**
|
||||||
|
@ -138,6 +138,20 @@ void mca_mpool_mvapi_free(mca_mpool_base_module_t* mpool,
|
|||||||
void * addr,
|
void * addr,
|
||||||
mca_mpool_base_registration_t* registration);
|
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)
|
#if defined(c_plusplus) || defined(__cplusplus)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
#include <vapi_types.h>
|
#include <vapi_types.h>
|
||||||
#include <vapi_common.h>
|
#include <vapi_common.h>
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Initializes the mpool module.
|
* Initializes the mpool module.
|
||||||
*/
|
*/
|
||||||
void mca_mpool_mvapi_module_init(mca_mpool_mvapi_module_t* mpool)
|
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_free = mca_mpool_mvapi_free;
|
||||||
mpool->super.mpool_register = mca_mpool_mvapi_register;
|
mpool->super.mpool_register = mca_mpool_mvapi_register;
|
||||||
mpool->super.mpool_deregister = mca_mpool_mvapi_deregister;
|
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;
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user