From 2dc76ceae3dfbe333b6b404e5b1298be99b211c9 Mon Sep 17 00:00:00 2001 From: bothameister Date: Tue, 13 Jul 2010 03:33:36 +0000 Subject: added queue mechanism to parallelization of hyperparam resampling; new program argument 'num_jobs' to control granularity. git-svn-id: https://ws10smt.googlecode.com/svn/trunk@232 ec762483-ff6d-05da-a07a-a48fb63a330f --- gi/pyp-topics/src/train-contexts.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'gi/pyp-topics/src/train-contexts.cc') diff --git a/gi/pyp-topics/src/train-contexts.cc b/gi/pyp-topics/src/train-contexts.cc index 455e7b1e..a673bf4e 100644 --- a/gi/pyp-topics/src/train-contexts.cc +++ b/gi/pyp-topics/src/train-contexts.cc @@ -54,6 +54,7 @@ int main(int argc, char **argv) ("freq-cutoff-end", value()->default_value(0), "final frequency cutoff.") ("freq-cutoff-interval", value()->default_value(0), "number of iterations between frequency decrement.") ("max-threads", value()->default_value(1), "maximum number of simultaneous threads allowed") + ("num-jobs", value()->default_value(1), "allows finer control over parallelization") ; cmdline_specific.add(config_options); @@ -77,10 +78,11 @@ int main(int argc, char **argv) cerr << "Please specify a file containing the data." << endl; return 1; } - + assert(vm["max-threads"].as() > 0); + assert(vm["num-jobs"].as() > -1); // seed the random number generator: 0 = automatic, specify value otherwise unsigned long seed = 0; - PYPTopics model(vm["topics"].as(), vm.count("hierarchical-topics"), seed, vm["max-threads"].as()); + PYPTopics model(vm["topics"].as(), vm.count("hierarchical-topics"), seed, vm["max-threads"].as(), vm["num-jobs"].as()); // read the data BackoffGenerator* backoff_gen=0; -- cgit v1.2.3