[asl] 42/177: Adding dumping of maps-parameters (prm_*)

Ghislain Vaillant ghisvail-guest at moszumanska.debian.org
Thu Aug 27 09:22:37 UTC 2015


This is an automated email from the git hooks/post-receive script.

ghisvail-guest pushed a commit to branch master
in repository asl.

commit 301f28b5986caeec436e57aee5a151b6c416cb99
Author: AvtechScientific <AvtechScientific at users.noreply.github.com>
Date:   Sun Jun 21 12:51:41 2015 +0300

    Adding dumping of maps-parameters (prm_*)
---
 src/utilities/aslParametersManager.cxx       | 20 +++++++++++++-------
 test/testPhysics/flow/multicomponent_flow.cc |  1 -
 2 files changed, 13 insertions(+), 8 deletions(-)

diff --git a/src/utilities/aslParametersManager.cxx b/src/utilities/aslParametersManager.cxx
index 1462cf6..e9e3145 100644
--- a/src/utilities/aslParametersManager.cxx
+++ b/src/utilities/aslParametersManager.cxx
@@ -288,8 +288,8 @@ namespace asl
 	{
 		configurationOptions.add_options()
 			(key.c_str(), value<T>()->required(), description.c_str());
-		// ToDo: maps - Add the option to the default parameters file
-//		parametersFileStr += "\n# " + description + "\n" + key + " = " + numToStr(defaultValue) + "\n";
+		// Add the option to the default parameters file
+		parametersFileStr += "\n# " + description + "\n" + key + " = \n";
 	}
 
 
@@ -299,10 +299,12 @@ namespace asl
 	                                                 string description)
 	{		
 		configurationOptions.add_options()
-			(key.c_str(), value<T>(&parameter.v())->default_value(defaultValue), description.c_str());
+			(key.c_str(), value<T>(&parameter.v())->default_value(defaultValue),
+			 description.c_str());
 
 		// Add the option to the default parameters file
-		parametersFileStr += "\n# " + description + "\n" + key + " = " + numToStr(defaultValue) + "\n";
+		parametersFileStr += "\n# " + description + "\n"
+							+ key + " = " + numToStr(defaultValue) + "\n";
 	}
 
 
@@ -423,7 +425,7 @@ namespace asl
 
 			populateMaps(vm);
 
-			// Set Hardware default queue as required through provided options
+			// Set hardware default queue as required through provided options
 			acl::hardware.setDefaultQueue(vm["platform"].as<string>(), vm["device"].as<string>());
 
 			// Place it after(!) notify(vm);
@@ -452,11 +454,15 @@ namespace asl
 			if (!ifs)
 				errorMessage("Can not open configuration file: " + configFile);
 
-			parsed_options parsed = parse_config_file(ifs, configurationOptions, true);
+			parsed_options parsed = parse_config_file(ifs, configurationOptions,
+			                                          true);
 			store(parsed, vm);
 			notify(vm);
 			populateMaps(vm);
-		}
+			// No need to set hardware default queue, because this
+			// member functions is not called on program launch and deals with
+			// parameters others than `platform` and `device`.
+	}
 		catch(exception& e)
 		{
 			errorMessage(string("ParametersManager::load() - ") + e.what());
diff --git a/test/testPhysics/flow/multicomponent_flow.cc b/test/testPhysics/flow/multicomponent_flow.cc
index 3bc45be..c676a95 100644
--- a/test/testPhysics/flow/multicomponent_flow.cc
+++ b/test/testPhysics/flow/multicomponent_flow.cc
@@ -58,7 +58,6 @@ class Parameters
 		string folder;
 
 		asl::Block::DV size;
-
 		asl::Parameter<double> dx;
 		asl::Parameter<double> dt;
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/asl.git



More information about the debian-science-commits mailing list