From d3cc10afd435b3d21bb4c896f911a624541513aa Mon Sep 17 00:00:00 2001 From: Luis Remis Date: Tue, 15 Jan 2019 03:03:56 -0800 Subject: [PATCH] Add PMGD num_allocators to config file --- src/PMGDQueryHandler.cc | 11 ++++++++++- src/VDMSConfig.h | 3 +++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/PMGDQueryHandler.cc b/src/PMGDQueryHandler.cc index c86e650f..d38589b8 100644 --- a/src/PMGDQueryHandler.cc +++ b/src/PMGDQueryHandler.cc @@ -46,9 +46,18 @@ PMGD::Graph *PMGDQueryHandler::_db; void PMGDQueryHandler::init() { std::string dbname = VDMSConfig::instance()->get_path_pmgd(); + int nalloc = VDMSConfig::instance()-> + get_int_value(PARAM_PMGD_NUM_ALLOCATORS, DEFAULT_PMGD_NUM_ALLOCATORS); + + PMGD::Graph::Config config; + config.num_allocators = nalloc; + + // TODO: Include allocators timeouts params as parameters for VDMS. + // These parameters can be loaded everytime VDMS is run. + // We need PMGD to support these as config params before we can do it here. // Create a db - _db = new PMGD::Graph(dbname.c_str(), PMGD::Graph::Create); + _db = new PMGD::Graph(dbname.c_str(), PMGD::Graph::Create, &config); } void PMGDQueryHandler::destroy() diff --git a/src/VDMSConfig.h b/src/VDMSConfig.h index c1d3362c..3f4b4fbd 100644 --- a/src/VDMSConfig.h +++ b/src/VDMSConfig.h @@ -44,6 +44,9 @@ #define PARAM_DB_BLOBS "blobs_path" #define PARAM_DB_DESCRIPTORS "descriptors_path" +#define PARAM_PMGD_NUM_ALLOCATORS "pmgd_num_allocators" +#define DEFAULT_PMGD_NUM_ALLOCATORS 1 + namespace VDMS{ class VDMSConfig