Per request from Nathan, add a "commit" API to the opal db framework. This allows him to aggregate keys to work around the Cray's severe PMI limitations
This commit was SVN r28917.
Этот коммит содержится в:
родитель
0d5b6a73a4
Коммит
6c1a140e99
@ -69,6 +69,7 @@ OPAL_DECLSPEC int opal_db_base_remove_data(const opal_identifier_t *proc,
|
||||
OPAL_DECLSPEC int opal_db_base_add_log(const char *table,
|
||||
const opal_value_t *kvs, int nkvs);
|
||||
|
||||
OPAL_DECLSPEC void opal_db_base_commit(void);
|
||||
|
||||
END_C_DECLS
|
||||
|
||||
|
@ -65,7 +65,7 @@ int opal_db_base_store_pointer(const opal_identifier_t *proc,
|
||||
opal_db_active_module_t *mod;
|
||||
int rc;
|
||||
|
||||
/* cycle thru the actiove modules until one agrees to perform the op */
|
||||
/* cycle thru the active modules until one agrees to perform the op */
|
||||
did_op = false;
|
||||
OPAL_LIST_FOREACH(mod, &opal_db_base.store_order, opal_db_active_module_t) {
|
||||
if (NULL == mod->module->store_pointer) {
|
||||
@ -92,6 +92,20 @@ int opal_db_base_store_pointer(const opal_identifier_t *proc,
|
||||
return OPAL_SUCCESS;
|
||||
}
|
||||
|
||||
void opal_db_base_commit(void)
|
||||
{
|
||||
opal_db_active_module_t *mod;
|
||||
|
||||
/* cycle thru the active modules giving each a chance to perform the op */
|
||||
OPAL_LIST_FOREACH(mod, &opal_db_base.store_order, opal_db_active_module_t) {
|
||||
if (NULL == mod->module->commit) {
|
||||
continue;
|
||||
}
|
||||
mod->module->commit();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int opal_db_base_fetch(const opal_identifier_t *proc,
|
||||
const char *key, void **data,
|
||||
opal_data_type_t type)
|
||||
|
@ -33,6 +33,7 @@ opal_db_base_module_t opal_db = {
|
||||
NULL,
|
||||
opal_db_base_store,
|
||||
opal_db_base_store_pointer,
|
||||
opal_db_base_commit,
|
||||
opal_db_base_fetch,
|
||||
opal_db_base_fetch_pointer,
|
||||
opal_db_base_fetch_multiple,
|
||||
|
@ -79,6 +79,11 @@ typedef int (*opal_db_base_module_store_pointer_fn_t)(const opal_identifier_t *p
|
||||
opal_db_locality_t locality,
|
||||
opal_value_t *kv);
|
||||
|
||||
/*
|
||||
* Commit data to the database
|
||||
*/
|
||||
typedef void (*opal_db_base_module_commit_fn_t)(void);
|
||||
|
||||
/*
|
||||
* Retrieve data
|
||||
*
|
||||
@ -138,6 +143,7 @@ struct opal_db_base_module_1_0_0_t {
|
||||
opal_db_base_module_finalize_fn_t finalize;
|
||||
opal_db_base_module_store_fn_t store;
|
||||
opal_db_base_module_store_pointer_fn_t store_pointer;
|
||||
opal_db_base_module_commit_fn_t commit;
|
||||
opal_db_base_module_fetch_fn_t fetch;
|
||||
opal_db_base_module_fetch_pointer_fn_t fetch_pointer;
|
||||
opal_db_base_module_fetch_multiple_fn_t fetch_multiple;
|
||||
|
@ -54,6 +54,7 @@ opal_db_base_module_t opal_db_hash_module = {
|
||||
finalize,
|
||||
store,
|
||||
store_pointer,
|
||||
NULL,
|
||||
fetch,
|
||||
fetch_pointer,
|
||||
fetch_multiple,
|
||||
|
@ -42,6 +42,7 @@ static int store(const opal_identifier_t *id,
|
||||
static int store_pointer(const opal_identifier_t *proc,
|
||||
opal_db_locality_t locality,
|
||||
opal_value_t *kv);
|
||||
static void commit(void);
|
||||
static int fetch(const opal_identifier_t *proc,
|
||||
const char *key, void **data, opal_data_type_t type);
|
||||
static int fetch_pointer(const opal_identifier_t *proc,
|
||||
@ -57,6 +58,7 @@ opal_db_base_module_t opal_db_pmi_module = {
|
||||
finalize,
|
||||
store,
|
||||
store_pointer,
|
||||
commit,
|
||||
fetch,
|
||||
fetch_pointer,
|
||||
fetch_multiple,
|
||||
@ -334,6 +336,25 @@ static int store_pointer(const opal_identifier_t *proc,
|
||||
return rc;
|
||||
}
|
||||
|
||||
static void commit(void)
|
||||
{
|
||||
#if WANT_PMI2_SUPPORT
|
||||
PMI2_KVS_Fence();
|
||||
#else
|
||||
{
|
||||
int rc;
|
||||
|
||||
if (PMI_SUCCESS != (rc = PMI_KVS_Commit(pmi_kvs_name))) {
|
||||
OPAL_PMI_ERROR(rc, "PMI_KVS_Commit");
|
||||
return;
|
||||
}
|
||||
/* Barrier here to ensure all other procs have committed */
|
||||
PMI_Barrier();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
static char* fetch_string(const char *key)
|
||||
{
|
||||
char *tmp_val, *ptr, *tmpkey;
|
||||
|
@ -46,6 +46,7 @@ opal_db_base_module_t opal_db_print_module = {
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
add_log
|
||||
};
|
||||
|
||||
|
@ -55,6 +55,7 @@ opal_db_base_module_t opal_db_sqlite_module = {
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
add_log
|
||||
};
|
||||
|
||||
|
@ -187,20 +187,7 @@ static int modex(orte_grpcomm_collective_t *coll)
|
||||
/* our RTE data was constructed and pushed in the ESS pmi component */
|
||||
|
||||
/* commit our modex info */
|
||||
#if WANT_PMI2_SUPPORT
|
||||
PMI2_KVS_Fence();
|
||||
#else
|
||||
{
|
||||
int rc;
|
||||
|
||||
if (PMI_SUCCESS != (rc = PMI_KVS_Commit(pmi_kvs_name))) {
|
||||
OPAL_PMI_ERROR(rc, "PMI_KVS_Commit");
|
||||
return ORTE_ERR_FATAL;
|
||||
}
|
||||
/* Barrier here to ensure all other procs have committed */
|
||||
PMI_Barrier();
|
||||
}
|
||||
#endif
|
||||
opal_db.commit();
|
||||
|
||||
/* cycle thru all my peers and collect their RTE info */
|
||||
name.jobid = ORTE_PROC_MY_NAME->jobid;
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user