[asl] 41/177: Fixing ParametersManager

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 fa691214f6ec31bf37925a52ae18ce53fb12f631
Author: AvtechScientific <AvtechScientific at users.noreply.github.com>
Date:   Sat Jun 20 23:59:05 2015 +0300

    Fixing ParametersManager
---
 src/acl/aclHardware.cxx                |  2 +-
 src/utilities/aslParametersManager.cxx | 18 ++++++++++--------
 src/utilities/aslParametersManager.h   |  2 ++
 3 files changed, 13 insertions(+), 9 deletions(-)

diff --git a/src/acl/aclHardware.cxx b/src/acl/aclHardware.cxx
index 2905eb8..36a6697 100644
--- a/src/acl/aclHardware.cxx
+++ b/src/acl/aclHardware.cxx
@@ -120,7 +120,7 @@ namespace acl
 
 	std::string Hardware::getDefaultDeviceInfo()
 	{
-		string defaultDeviceInfo("\nplatform = " + getPlatformVendor(defaultQueue)
+		string defaultDeviceInfo("platform = " + getPlatformVendor(defaultQueue)
 								+ "\ndevice = " + getDeviceName(defaultQueue));
 		return defaultDeviceInfo;
 	}
diff --git a/src/utilities/aslParametersManager.cxx b/src/utilities/aslParametersManager.cxx
index c17349a..1462cf6 100644
--- a/src/utilities/aslParametersManager.cxx
+++ b/src/utilities/aslParametersManager.cxx
@@ -210,6 +210,8 @@ namespace asl
 	ParametersManager::ParametersManager():
 		configurationOptions("Configuration options"),
 		parametersFileStr(""),
+		platform(""),
+		device(""),
 		folder(""),
 		folderWithSlash(""),
 		programName(""),
@@ -217,10 +219,10 @@ namespace asl
 	{
 		enable();
 		// Add platform and device parameters with default values
-		Parameter<string> platform(acl::getPlatformVendor(acl::hardware.defaultQueue),
-									"platform", "Default computation platform", "");
-		Parameter<string> device(acl::getDeviceName(acl::hardware.defaultQueue),
-									"device", "Default computation device", "");
+		add(platform, acl::getPlatformVendor(acl::hardware.defaultQueue),
+		    "platform", "Default computation platform");
+		add(device, acl::getDeviceName(acl::hardware.defaultQueue),
+		    "device", "Default computation device");
 	}
 
 
@@ -335,17 +337,17 @@ namespace asl
 		genericOptions.add_options()
 			("help,h", "display this help and exit")
 			("version,v", "display version and exit")
-			("devices,d", "display available devices and exit")
+			("devices,d", "display all available devices and exit")
 			("folder,f", value<string>()->default_value("Default"),
 			 "path to the working folder that contains configuration file - parameters.ini")
-			("parameters,p",
+			("parameters,p", value<string>(),
 			 "generate default configuration file parameters.ini, write it to the provided path and exit")
 			("check,c", "check configuration for consistency and exit");
 
 		positional_options_description positional;
-		positional.add("folder", 1);
 
 		options_description allOptions;
+		positional.add("folder", 1);
 
 		allOptions.add(genericOptions).add(configurationOptions);
 
@@ -371,7 +373,7 @@ namespace asl
 			if (vm.count("devices"))
 			{
 				cout << programName + " " + programVersion + "\n\n"
-					<< "Default computation device:"
+					<< "Default computation device:\n"
 					<< acl::hardware.getDefaultDeviceInfo() << "\n\n"
 					<< "List of all available platforms and their devices:\n"
 					<< acl::hardware.getDevicesInfo()
diff --git a/src/utilities/aslParametersManager.h b/src/utilities/aslParametersManager.h
index 32ebf18..36f1ad1 100644
--- a/src/utilities/aslParametersManager.h
+++ b/src/utilities/aslParametersManager.h
@@ -109,6 +109,8 @@ namespace asl
 
 		private:
 			boost::program_options::options_description configurationOptions;
+			UValue<std::string> platform;
+			UValue<std::string> device;
 			std::string folder;
 			std::string folderWithSlash;
 			std::string programName;

-- 
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