Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add PMGD num_allocators to config file #72

Merged
merged 1 commit into from
Jan 16, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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