Repository: systemml Updated Branches: refs/heads/master 815ca4f2a -> e1a762f65
[SYSTEMML-1829] Add setConfig, resetConfig to Python MLContext Added methods setConfig, resetConfig, isGPU, isForceGPU to Python MLContext for consistency with Java MLContext. Closes #608. Project: http://git-wip-us.apache.org/repos/asf/systemml/repo Commit: http://git-wip-us.apache.org/repos/asf/systemml/commit/e1a762f6 Tree: http://git-wip-us.apache.org/repos/asf/systemml/tree/e1a762f6 Diff: http://git-wip-us.apache.org/repos/asf/systemml/diff/e1a762f6 Branch: refs/heads/master Commit: e1a762f654a945a8cc36ffeb6ac665ac308a8204 Parents: 815ca4f Author: Glenn Weidner <gweid...@us.ibm.com> Authored: Tue Aug 8 13:44:58 2017 -0700 Committer: Glenn Weidner <gweid...@us.ibm.com> Committed: Tue Aug 8 13:44:58 2017 -0700 ---------------------------------------------------------------------- src/main/python/systemml/mlcontext.py | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/systemml/blob/e1a762f6/src/main/python/systemml/mlcontext.py ---------------------------------------------------------------------- diff --git a/src/main/python/systemml/mlcontext.py b/src/main/python/systemml/mlcontext.py index 8ab683a..5841ab5 100644 --- a/src/main/python/systemml/mlcontext.py +++ b/src/main/python/systemml/mlcontext.py @@ -798,7 +798,25 @@ class MLContext(object): """ self._ml.setConfigProperty(propertyName, propertyValue) return self - + + def setConfig(self, configFilePath): + """ + Set SystemML configuration based on a configuration file. + + Parameters + ---------- + configFilePath: String + """ + self._ml.setConfig(configFilePath) + return self + + def resetConfig(self): + """ + Reset configuration settings to default values. + """ + self._ml.resetConfig() + return self + def version(self): """Display the project version.""" return self._ml.version() @@ -819,6 +837,14 @@ class MLContext(object): """Returns True if program execution statistics should be output, False otherwise.""" return self._ml.isStatistics() + def isGPU(self): + """Returns True if GPU mode is enabled, False otherwise.""" + return self._ml.isGPU() + + def isForceGPU(self): + """Returns True if "force" GPU mode is enabled, False otherwise.""" + return self._ml.isForceGPU() + def close(self): """ Closes this MLContext instance to cleanup buffer pool, static/local state and scratch space.