Add an attributes parameter to the dstore.open function so we can pass directives to the active storage component. This can, for example, include the backing file info for a new shared memory segment.
Этот коммит содержится в:
родитель
63f619f871
Коммит
1ae34da5e5
@ -79,7 +79,7 @@ typedef struct {
|
||||
} opal_dstore_proc_data_t;
|
||||
OBJ_CLASS_DECLARATION(opal_dstore_proc_data_t);
|
||||
|
||||
OPAL_DECLSPEC int opal_dstore_base_open(const char *name);
|
||||
OPAL_DECLSPEC int opal_dstore_base_open(const char *name, opal_list_t *attrs);
|
||||
OPAL_DECLSPEC int opal_dstore_base_close(int dstorehandle);
|
||||
OPAL_DECLSPEC int opal_dstore_base_store(int dstorehandle,
|
||||
const opal_identifier_t *id,
|
||||
|
@ -22,14 +22,14 @@
|
||||
#include "opal/mca/dstore/base/base.h"
|
||||
|
||||
|
||||
int opal_dstore_base_open(const char *name)
|
||||
int opal_dstore_base_open(const char *name, opal_list_t *attrs)
|
||||
{
|
||||
opal_dstore_handle_t *hdl;
|
||||
int index;
|
||||
opal_dstore_base_module_t *mod;
|
||||
|
||||
/* ask the storage component for a module */
|
||||
if (NULL != (mod = opal_dstore_base.storage_component->create_handle())) {
|
||||
if (NULL != (mod = opal_dstore_base.storage_component->create_handle(attrs))) {
|
||||
/* have our module, so create a new dstore_handle */
|
||||
hdl = OBJ_NEW(opal_dstore_handle_t);
|
||||
if (NULL != name) {
|
||||
|
@ -56,10 +56,15 @@ OPAL_DECLSPEC extern int opal_dstore_nonpeer;
|
||||
* a unique "handle" that must be provided with any subsequent
|
||||
* call to store or fetch data from this database.
|
||||
*
|
||||
* The attributes parameter can be used to pass any desired
|
||||
* optional directives to the active storage component. These
|
||||
* are passed as a list of opal_value_t's.
|
||||
*
|
||||
* NOTE: calls to these APIs must be thread-protected as there
|
||||
* is NO internal thread safety.
|
||||
*/
|
||||
typedef int (*opal_dstore_base_API_open_fn_t)(const char *name);
|
||||
typedef int (*opal_dstore_base_API_open_fn_t)(const char *name,
|
||||
opal_list_t *attributes);
|
||||
|
||||
/*
|
||||
* Close a database handle
|
||||
@ -167,7 +172,7 @@ typedef struct {
|
||||
*/
|
||||
|
||||
/* create and return a datastore module */
|
||||
typedef opal_dstore_base_module_t* (*mca_dstore_base_component_create_hdl_fn_t)(void);
|
||||
typedef opal_dstore_base_module_t* (*mca_dstore_base_component_create_hdl_fn_t)(opal_list_t *attributes);
|
||||
|
||||
/* provide a chance for the component to finalize */
|
||||
typedef void (*mca_dstore_base_component_finalize_fn_t)(void);
|
||||
|
@ -25,7 +25,7 @@
|
||||
#include "opal/mca/dstore/base/base.h"
|
||||
#include "dstore_hash.h"
|
||||
|
||||
static opal_dstore_base_module_t *component_create(void);
|
||||
static opal_dstore_base_module_t *component_create(opal_list_t *attrs);
|
||||
static int dstore_hash_query(mca_base_module_t **module, int *priority);
|
||||
|
||||
/*
|
||||
@ -64,7 +64,8 @@ static int dstore_hash_query(mca_base_module_t **module, int *priority)
|
||||
return OPAL_SUCCESS;
|
||||
}
|
||||
|
||||
static opal_dstore_base_module_t *component_create(void)
|
||||
/* this component ignores any input attributes */
|
||||
static opal_dstore_base_module_t *component_create(opal_list_t *attrs)
|
||||
{
|
||||
mca_dstore_hash_module_t *mod;
|
||||
|
||||
|
@ -198,15 +198,15 @@ int pmix_server_init(void)
|
||||
opal_setenv("PMIX_SERVER_URI", pmix_server_uri, true, &orte_launch_environ);
|
||||
|
||||
/* setup the datastore handles */
|
||||
if (0 > (pmix_server_local_handle = opal_dstore.open("pmix-local"))) {
|
||||
if (0 > (pmix_server_local_handle = opal_dstore.open("pmix-local", NULL))) {
|
||||
ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE);
|
||||
return ORTE_ERR_OUT_OF_RESOURCE;
|
||||
}
|
||||
if (0 > (pmix_server_remote_handle = opal_dstore.open("pmix-remote"))) {
|
||||
if (0 > (pmix_server_remote_handle = opal_dstore.open("pmix-remote", NULL))) {
|
||||
ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE);
|
||||
return ORTE_ERR_OUT_OF_RESOURCE;
|
||||
}
|
||||
if (0 > (pmix_server_global_handle = opal_dstore.open("pmix-global"))) {
|
||||
if (0 > (pmix_server_global_handle = opal_dstore.open("pmix-global", NULL))) {
|
||||
ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE);
|
||||
return ORTE_ERR_OUT_OF_RESOURCE;
|
||||
}
|
||||
|
@ -191,7 +191,7 @@ int orte_init(int* pargc, char*** pargv, orte_proc_type_t flags)
|
||||
goto error;
|
||||
}
|
||||
/* create the handle */
|
||||
if (0 > (opal_dstore_internal = opal_dstore.open("INTERNAL"))) {
|
||||
if (0 > (opal_dstore_internal = opal_dstore.open("INTERNAL", NULL))) {
|
||||
error = "opal dstore internal";
|
||||
ret = ORTE_ERR_FATAL;
|
||||
goto error;
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user