From: Jean-Philippe ARGAUD Date: Thu, 23 Aug 2012 08:31:11 +0000 (+0200) Subject: Simplification of naming for memory sizes X-Git-Tag: V6_6_0~36 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=d06cb9aea5413a8650fedfed8ef54533568c39dd;p=modules%2Fadao.git Simplification of naming for memory sizes --- diff --git a/src/daComposant/daAlgorithms/AdjointTest.py b/src/daComposant/daAlgorithms/AdjointTest.py index 2eeceab..e1c0fe3 100644 --- a/src/daComposant/daAlgorithms/AdjointTest.py +++ b/src/daComposant/daAlgorithms/AdjointTest.py @@ -18,6 +18,7 @@ # # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # +# Author: Jean-Philippe Argaud, jean-philippe.argaud@edf.fr, EDF R&D import logging from daCore import BasicObjects, PlatformInfo @@ -70,7 +71,7 @@ class ElementaryAlgorithm(BasicObjects.Algorithm): def run(self, Xb=None, Y=None, H=None, M=None, R=None, B=None, Q=None, Parameters=None): logging.debug("%s Lancement"%self._name) - logging.debug("%s Taille mémoire utilisée de %.1f Mo"%(self._name, m.getUsedMemory("Mo"))) + logging.debug("%s Taille mémoire utilisée de %.1f Mo"%(self._name, m.getUsedMemory("M"))) # # Paramètres de pilotage # ---------------------- @@ -168,7 +169,7 @@ class ElementaryAlgorithm(BasicObjects.Algorithm): print "Results of adjoint stability check:" print msgs # - logging.debug("%s Taille mémoire utilisée de %.1f Mo"%(self._name, m.getUsedMemory("Mo"))) + logging.debug("%s Taille mémoire utilisée de %.1f Mo"%(self._name, m.getUsedMemory("M"))) logging.debug("%s Terminé"%self._name) # return 0 diff --git a/src/daComposant/daAlgorithms/EnsembleBlue.py b/src/daComposant/daAlgorithms/EnsembleBlue.py index 8bb2341..084943f 100644 --- a/src/daComposant/daAlgorithms/EnsembleBlue.py +++ b/src/daComposant/daAlgorithms/EnsembleBlue.py @@ -18,6 +18,7 @@ # # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # +# Author: Jean-Philippe Argaud, jean-philippe.argaud@edf.fr, EDF R&D import logging from daCore import BasicObjects, PlatformInfo @@ -43,7 +44,7 @@ class ElementaryAlgorithm(BasicObjects.Algorithm): - calcul de l'estimateur BLUE pour chaque membre de l'ensemble """ logging.debug("%s Lancement"%self._name) - logging.debug("%s Taille mémoire utilisée de %.1f Mo"%(self._name, m.getUsedMemory("Mo"))) + logging.debug("%s Taille mémoire utilisée de %.1f Mo"%(self._name, m.getUsedMemory("M"))) # # Paramètres de pilotage # ---------------------- @@ -111,7 +112,7 @@ class ElementaryAlgorithm(BasicObjects.Algorithm): Xa = numpy.matrix( Members ).mean(axis=0) self.StoredVariables["Analysis"].store( Xa.A1 ) # - logging.debug("%s Taille mémoire utilisée de %.1f Mo"%(self._name, m.getUsedMemory("Mo"))) + logging.debug("%s Taille mémoire utilisée de %.1f Mo"%(self._name, m.getUsedMemory("M"))) logging.debug("%s Terminé"%self._name) return 0 diff --git a/src/daComposant/daAlgorithms/GradientTest.py b/src/daComposant/daAlgorithms/GradientTest.py index 00a22f6..bff28d1 100644 --- a/src/daComposant/daAlgorithms/GradientTest.py +++ b/src/daComposant/daAlgorithms/GradientTest.py @@ -18,6 +18,7 @@ # # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # +# Author: Jean-Philippe Argaud, jean-philippe.argaud@edf.fr, EDF R&D import logging from daCore import BasicObjects, PlatformInfo @@ -88,7 +89,7 @@ class ElementaryAlgorithm(BasicObjects.Algorithm): def run(self, Xb=None, Y=None, H=None, M=None, R=None, B=None, Q=None, Parameters=None): logging.debug("%s Lancement"%self._name) - logging.debug("%s Taille mémoire utilisée de %.1f Mo"%(self._name, m.getUsedMemory("Mo"))) + logging.debug("%s Taille mémoire utilisée de %.1f Mo"%(self._name, m.getUsedMemory("M"))) # # Paramètres de pilotage # ---------------------- @@ -259,7 +260,7 @@ class ElementaryAlgorithm(BasicObjects.Algorithm): filename = str(self._parameters["ResultFile"])+".ps", ) # - logging.debug("%s Taille mémoire utilisée de %.1f Mo"%(self._name, m.getUsedMemory("Mo"))) + logging.debug("%s Taille mémoire utilisée de %.1f Mo"%(self._name, m.getUsedMemory("M"))) logging.debug("%s Terminé"%self._name) # return 0 diff --git a/src/daComposant/daAlgorithms/KalmanFilter.py b/src/daComposant/daAlgorithms/KalmanFilter.py index 708d5fe..9bf49a0 100644 --- a/src/daComposant/daAlgorithms/KalmanFilter.py +++ b/src/daComposant/daAlgorithms/KalmanFilter.py @@ -18,6 +18,7 @@ # # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # +# Author: Jean-Philippe Argaud, jean-philippe.argaud@edf.fr, EDF R&D import logging from daCore import BasicObjects, PlatformInfo @@ -44,7 +45,7 @@ class ElementaryAlgorithm(BasicObjects.Algorithm): avec l'observation du pas 1. """ logging.debug("%s Lancement"%self._name) - logging.debug("%s Taille mémoire utilisée de %.1f Mo"%(self._name, m.getUsedMemory("Mo"))) + logging.debug("%s Taille mémoire utilisée de %.1f Mo"%(self._name, m.getUsedMemory("M"))) # # Paramètres de pilotage # ---------------------- @@ -97,7 +98,7 @@ class ElementaryAlgorithm(BasicObjects.Algorithm): if self._parameters["CalculateAPosterioriCovariance"]: self.StoredVariables["APosterioriCovariance"].store( Pn ) # - logging.debug("%s Taille mémoire utilisée de %.1f Mo"%(self._name, m.getUsedMemory("Mo"))) + logging.debug("%s Taille mémoire utilisée de %.1f Mo"%(self._name, m.getUsedMemory("M"))) logging.debug("%s Terminé"%self._name) # return 0 diff --git a/src/daComposant/daAlgorithms/ParticleSwarmOptimization.py b/src/daComposant/daAlgorithms/ParticleSwarmOptimization.py index 0f81857..5da1eec 100644 --- a/src/daComposant/daAlgorithms/ParticleSwarmOptimization.py +++ b/src/daComposant/daAlgorithms/ParticleSwarmOptimization.py @@ -18,6 +18,7 @@ # # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # +# Author: Jean-Philippe Argaud, jean-philippe.argaud@edf.fr, EDF R&D import logging from daCore import BasicObjects, PlatformInfo @@ -87,7 +88,7 @@ class ElementaryAlgorithm(BasicObjects.Algorithm): Calcul de l'estimateur """ logging.debug("%s Lancement"%self._name) - logging.debug("%s Taille mémoire utilisée de %.1f Mo"%(self._name, m.getUsedMemory("Mo"))) + logging.debug("%s Taille mémoire utilisée de %.1f Mo"%(self._name, m.getUsedMemory("M"))) # # Paramètres de pilotage # ---------------------- @@ -242,7 +243,7 @@ class ElementaryAlgorithm(BasicObjects.Algorithm): # self.StoredVariables["Analysis"].store( Xa.A1 ) # - logging.debug("%s Taille mémoire utilisée de %.1f Mo"%(self._name, m.getUsedMemory("MB"))) + logging.debug("%s Taille mémoire utilisée de %.1f Mo"%(self._name, m.getUsedMemory("M"))) logging.debug("%s Terminé"%self._name) # return 0 diff --git a/src/daComposant/daAlgorithms/QuantileRegression.py b/src/daComposant/daAlgorithms/QuantileRegression.py index 616b41a..3bea251 100644 --- a/src/daComposant/daAlgorithms/QuantileRegression.py +++ b/src/daComposant/daAlgorithms/QuantileRegression.py @@ -18,6 +18,7 @@ # # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # +# Author: Jean-Philippe Argaud, jean-philippe.argaud@edf.fr, EDF R&D import logging from daCore import BasicObjects, PlatformInfo @@ -69,7 +70,7 @@ class ElementaryAlgorithm(BasicObjects.Algorithm): Calcul des parametres definissant le quantile """ logging.debug("%s Lancement"%self._name) - logging.debug("%s Taille mémoire utilisée de %.1f Mo"%(self._name, m.getUsedMemory("Mo"))) + logging.debug("%s Taille mémoire utilisée de %.1f Mo"%(self._name, m.getUsedMemory("M"))) # # Paramètres de pilotage # ---------------------- @@ -164,7 +165,7 @@ class ElementaryAlgorithm(BasicObjects.Algorithm): self.StoredVariables["Analysis"].store( Xa.A1 ) self.StoredVariables["Innovation"].store( d.A1 ) # - logging.debug("%s Taille mémoire utilisée de %.1f Mo"%(self._name, m.getUsedMemory("MB"))) + logging.debug("%s Taille mémoire utilisée de %.1f Mo"%(self._name, m.getUsedMemory("M"))) logging.debug("%s Terminé"%self._name) # return 0 diff --git a/src/daComposant/daCore/PlatformInfo.py b/src/daComposant/daCore/PlatformInfo.py index 7e51265..8441766 100644 --- a/src/daComposant/daCore/PlatformInfo.py +++ b/src/daComposant/daCore/PlatformInfo.py @@ -130,12 +130,11 @@ class SystemUsage: _proc_status = '/proc/%d/status' % os.getpid() _memo_status = '/proc/meminfo' _scale = { - 'o': 1.0, - 'ko': 1024.0, 'mo': 1024.0*1024.0, - 'Ko': 1024.0, 'Mo': 1024.0*1024.0, - 'B': 1.0, - 'kB': 1024.0, 'mB': 1024.0*1024.0, - 'KB': 1024.0, 'MB': 1024.0*1024.0, + 'K' : 1024.0, 'M' : 1024.0*1024.0, + 'o': 1.0, 'ko': 1024.0, 'mo': 1024.0*1024.0, + 'Ko': 1024.0, 'Mo': 1024.0*1024.0, + 'B': 1.0, 'kB': 1024.0, 'mB': 1024.0*1024.0, + 'KB': 1024.0, 'MB': 1024.0*1024.0, } _max_mem = 0 _max_rss = 0