Exemple #1
0
static void torus_configure() {
    anno_map = codes_mapping_get_lp_anno_map(LP_CONFIG_NM);
    assert(anno_map);
    num_params = anno_map->num_annos + (anno_map->has_unanno_lp > 0);
    all_params = malloc(num_params * sizeof(*all_params));

    for (uint64_t i = 0; i < anno_map->num_annos; i++) {
        const char * anno = anno_map->annotations[i];
        torus_read_config(anno, &all_params[i]);
    }
    if (anno_map->has_unanno_lp > 0) {
        torus_read_config(NULL, &all_params[anno_map->num_annos]);
    }
}
void lsm_configure(void)
{
    /* check and see if any lsm LPs are being used - otherwise,
     * skip the config */
    if (0 == codes_mapping_get_lp_count(NULL, 0, LSM_NAME, NULL, 1))
        return;

    anno_map = codes_mapping_get_lp_anno_map(LSM_NAME);
    assert(anno_map);
    models_anno = (disk_model_t*)malloc(anno_map->num_annos * sizeof(*models_anno));

    // read the configuration for unannotated entries
    if (anno_map->has_unanno_lp > 0){
        read_config(&config, NULL, &model_unanno);
    }

    for (int i = 0; i < anno_map->num_annos; i++){
        char const * anno = anno_map->annotations[i].ptr;
        read_config(&config, anno, &models_anno[i]);
    }
}