Skip to content

Commit

Permalink
Merge pull request #72 from IntelLabs/feature_pmgd_alloc_params
Browse files Browse the repository at this point in the history
Add PMGD num_allocators to config file
  • Loading branch information
luisremis authored Jan 16, 2019
2 parents 7ac412a + d3cc10a commit 017722a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/PMGDQueryHandler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
3 changes: 3 additions & 0 deletions src/VDMSConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 017722a

Please sign in to comment.