yade-dev team mailing list archive
-
yade-dev team
-
Mailing list archive
-
Message #01095
[svn] r1713 - in trunk: examples/collider-perf gui/py pkg/dem/PreProcessor
Author: eudoxos
Date: 2009-03-08 22:15:35 +0100 (Sun, 08 Mar 2009)
New Revision: 1713
Modified:
trunk/examples/collider-perf/perf.py
trunk/gui/py/timing.py
trunk/gui/py/utils.py
trunk/pkg/dem/PreProcessor/TriaxialTest.cpp
Log:
1. Fix crashed in TriaxialTest introduced by me a few days ago (referencing engine before being created)
2. Add simple (working?) memory usage query to utils and collider perf test.
Modified: trunk/examples/collider-perf/perf.py
===================================================================
--- trunk/examples/collider-perf/perf.py 2009-03-07 09:16:36 UTC (rev 1712)
+++ trunk/examples/collider-perf/perf.py 2009-03-08 21:15:35 UTC (rev 1713)
@@ -1,5 +1,5 @@
-utils.readParamsFromTable(nSpheres=1000,collider='PersistentSAPCollider',noTableOk=True)
+utils.readParamsFromTable(nSpheres=8000,collider='PersistentSAPCollider',noTableOk=True)
# name of file containing sphere packing with given number of spheres
spheresFile="packing-%dk.spheres"%(nSpheres/1000)
@@ -20,8 +20,10 @@
O.dt=utils.PWaveTimeStep()
utils.replaceCollider(StandAloneEngine(collider))
+mem0=utils.vmData()
O.step()
timing.stats()
+print 'Extra memory:',utils.vmData()-mem0,'kB'
timing.reset()
O.run(100,True)
timing.stats()
Modified: trunk/gui/py/timing.py
===================================================================
--- trunk/gui/py/timing.py 2009-03-07 09:16:36 UTC (rev 1712)
+++ trunk/gui/py/timing.py 2009-03-08 21:15:35 UTC (rev 1713)
@@ -57,12 +57,6 @@
print _formatLine('TOTAL',totalTime,-1,totalTime,level); lines+=1
return lines
-#[label,absTime,relTime,[
-# [sub1label,sub1absTime,sub1RelTime],
-# …]],
-#label2,absTime2,relTime2,
-# ]
-
def stats():
print 'Name'.ljust(_statCols['label'])+' '+'Count'.rjust(_statCols['count'])+' '+'Time'.rjust(_statCols['time'])+' '+'Rel. time'.rjust(_statCols['relTime'])
print '-'*(sum([_statCols[k] for k in _statCols])+len(_statCols)-1)
Modified: trunk/gui/py/utils.py
===================================================================
--- trunk/gui/py/utils.py 2009-03-07 09:16:36 UTC (rev 1712)
+++ trunk/gui/py/utils.py 2009-03-08 21:15:35 UTC (rev 1713)
@@ -431,3 +431,13 @@
break
if colliderIdx<0: raise RuntimeError("No Collider found within O.engines.")
O.engines=O.engines[:colliderIdx]+[colliderEngine]+O.engines[colliderIdx+1:]
+
+
+def procStatus(name):
+ import os
+ for l in open('/proc/%d/status'%os.getpid()):
+ if l.split(':')[0]==name: return l
+ raise "No such line in /proc/[pid]/status: "+name
+def vmData():
+ l=procStatus('VmData'); ll=l.split(); assert(ll[2]=='kB')
+ return int(ll[1])
Modified: trunk/pkg/dem/PreProcessor/TriaxialTest.cpp
===================================================================
--- trunk/pkg/dem/PreProcessor/TriaxialTest.cpp 2009-03-07 09:16:36 UTC (rev 1712)
+++ trunk/pkg/dem/PreProcessor/TriaxialTest.cpp 2009-03-08 21:15:35 UTC (rev 1713)
@@ -62,7 +62,6 @@
#include<yade/pkg-common/BodyRedirectionVector.hpp>
#include<yade/pkg-common/InteractionVecSet.hpp>
-#include<yade/pkg-common/InteractionHashMap.hpp>
#include<yade/pkg-common/PhysicalActionVectorVector.hpp>
#include<yade/extra/Shop.hpp>
@@ -257,6 +256,8 @@
rootBody->physicalActions = shared_ptr<PhysicalActionContainer>(new PhysicalActionVectorVector);
rootBody->bodies = shared_ptr<BodyContainer>(new BodyRedirectionVector);
+ createActors(rootBody);
+
shared_ptr<Body> body;
@@ -402,7 +403,6 @@
}
if(defaultDt<0) defaultDt=Shop::PWaveTimeStep();
- createActors(rootBody);
return true;
}