Skip to content
Snippets Groups Projects
Commit c8d3dc1a authored by Ali Mohammed's avatar Ali Mohammed
Browse files

distlayout is copied to cdo handle and request cdo handle in pm cdo registry

parent ad983f00
No related branches found
No related tags found
No related merge requests found
...@@ -2713,11 +2713,6 @@ mstro_attribute_dict_set_kventry(mstro_attribute_dict dict, ...@@ -2713,11 +2713,6 @@ mstro_attribute_dict_set_kventry(mstro_attribute_dict dict,
MSTRO_CDO_ATTR_VALUE_timestamp, &ts, true); MSTRO_CDO_ATTR_VALUE_timestamp, &ts, true);
} }
case MSTRO__POOL__AVAL__VAL_MMB_LAYOUT: { case MSTRO__POOL__AVAL__VAL_MMB_LAYOUT: {
/**FIXME support other mmbLayout types */
if(aval->mmblayout->type != MSTRO__POOL__MMBLAYOUT__MMB_LAYOUT_TYPE__MMB_IRREGULAR){
ERR("Unsupported mmbLayout type \n");
return MSTRO_UNIMPL;
}
mmbLayout *dist_layout; mmbLayout *dist_layout;
mstro_attribute_pool_aval_to_mmbLayout(aval->mmblayout, &dist_layout); mstro_attribute_pool_aval_to_mmbLayout(aval->mmblayout, &dist_layout);
... ...
......
...@@ -1700,56 +1700,20 @@ mstro_pm_cdo_registry_find(mstro_app_id app, const struct mstro_cdo_id *id) ...@@ -1700,56 +1700,20 @@ mstro_pm_cdo_registry_find(mstro_app_id app, const struct mstro_cdo_id *id)
} }
mstro_status mstro_status
mstro_pm_cdo_registry_store_dist_layout(struct cdo_handle_entry *e, mstro_pm_cdo_registry_attributes_to_dist_layout(Mstro__Pool__Attributes *attributes, mmbLayout **dist_layout)
Mstro__Pool__Attributes *attributes)
{ {
mstro_status status = MSTRO_OK; mstro_status status = MSTRO_OK;
size_t n = attributes->kv_map->n_map; size_t n = attributes->kv_map->n_map;
/*declare and init all dist layout variables */
bool dist = false;
size_t *offsets = NULL;
size_t *sizes = NULL;
size_t element_size_bytes = 0;
size_t index = -1;
size_t n_blocks = 0;
int n_req_attribs = 0;
mmbLayout *dist_layout;
DEBUG("looking for distributed layout among %d attributes \n", n); DEBUG("looking for distributed layout among %d attributes \n", n);
const char *key; const char *key;
for(size_t i=0; i<n; i++) { for(size_t i=0; i<n; i++) {
key = attributes->kv_map->map[i]->key; key = attributes->kv_map->map[i]->key;
ERR("key len: %d (%s)\n", strlen(key), key); if(strcmp(key,".maestro.core.cdo.dist-layout")==0) {
if(strcmp(key,".maestro.core.cdo.isdistributed")==0) { DEBUG("DIST Layout found ... \n\n\n");
dist = attributes->kv_map->map[i]->val->bool_; status = mstro_attribute_pool_aval_to_mmbLayout(attributes->kv_map->map[i]->val->mmblayout, dist_layout);
ERR("dist = %d \n", dist ); break;
} else if(strcmp(key,".maestro.core.cdo.dist-layout")==0) {
ERR("DIST Layout found ... \n\n\n");
size_t n = (size_t) attributes->kv_map->map[i]->val->mmblayout->irregular->n_blocks;
ERR("layout type %d \n ", attributes->kv_map->map[i]->val->mmblayout->type);
ERR("layout index %"PRIu64" \n ", attributes->kv_map->map[i]->val->mmblayout->index);
ERR("nblocks %zu \n", n);
for (size_t k = 0; k < n; k++) {
ERR("offsets[%zu] = %"PRIu64", lengths[%zu] = %"PRIu64" \n", k,
attributes->kv_map->map[i]->val->mmblayout->irregular->offsets[k],
k,
attributes->kv_map->map[i]->val->mmblayout->irregular->lengths[k]);
}
n_req_attribs++;
}
}
if(dist)
{
ERR("DIST CDO !!!!!! \n\n\n\n");
if (n_req_attribs != 2)
{
ERR("Found only %d out of 2 required dist attributes", n_req_attribs);
}
} }
else {
ERR("NOT DIST CDO !!!! \n\n\n");
} }
return status; return status;
... ...
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment