yade-dev team mailing list archive
-
yade-dev team
-
Mailing list archive
-
Message #07219
perfomance benchmark
Hi!
I did a perfomance test for parallel mode and results in no good.
Performance boost only about 40% from 1 thread to 4 thread for 200k
particles...
Cause is a non-parallelised InsertionSortCollider, who need about 80%
time with 4 threads.
Results attached.
--
Best regards,
Sergei Dorofeenko,
Cand. Phys.-Mat. Sci.
Institute of Problems of Chemical Physics,
Chernogolovka, Moscow region, Russia.
e-mail: dorofeenko@xxxxxxxxx
N timingEnabled
10 True
20 True
30 True
40 True
50 True
60 True
Attachment:
perfomance.ods
Description: application/vnd.oasis.opendocument.spreadsheet
# encoding: utf-8
import numpy,random,time
from yade import utils,geom,plot
utils.readParamsFromTable(
N=20,
timingEnabled=True,
noTableOk=True)
from yade.params import table
R=0.003 # spheres mean radius [m]
Gap=0.1*R # gap between particles
N=table.N
dirName=O.tags['d.id']
os.mkdir(dirName)
# material
density=2400
fricAngle=radians(35)
en=1
es=1
#en=0.3
#es=0.3
tc=0.001
params=utils.getViscoelasticFromSpheresInteraction(tc,en,es)
mat=O.materials.append(ViscElMat(density=density,frictionAngle=fricAngle,**params))
### box
W=N*R+(N+1)*Gap/2.
O.bodies.append(geom.facetBox((0,0,0),(W*1.1,W,W*1.1),material=mat,color=(1,0,0)))
# engines
O.engines=[
ForceResetter(),
InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Facet_Aabb()]),
InteractionLoop(
[Ig2_Sphere_Sphere_ScGeom(), Ig2_Facet_Sphere_ScGeom()],
[Ip2_ViscElMat_ViscElMat_ViscElPhys()],
[Law2_ScGeom_ViscElPhys_Basic()],
),
#GravityEngine(gravity=[0,-9.81,0]),
NewtonIntegrator(damping=0),
VTKRecorder(virtPeriod=0.01,fileName=dirName+'/',recorders=['spheres','facets','velocity','ids']),
]
O.dt=.1*tc
# particles
L=(N-1)*(2*R+Gap)/2.
for x in numpy.linspace(-L,L,N):
for y in numpy.linspace(-L,L,N):
for z in numpy.linspace(-L,L,N):
s=utils.sphere( (x,y,z), R, material=mat)
s.state.vel=Vector3(random.uniform(-0.4,0.4),random.uniform(-0.4,0.4),random.uniform(-0.4,0.4))
O.bodies.append(s)
print 'nbBodies=',len(O.bodies)
O.run(200,True)
O.timingEnabled=table.timingEnabled
tStart=time.time()
nbIter=2000
O.run(nbIter,True)
tEnd=time.time()
print 'Elapsed ', tEnd-tStart, ' sec'
print 'Perfomance ', (tEnd-tStart)/nbIter, ' sec/iter'
print 'Extrapolation on 1e5 iters ', (tEnd-tStart)/nbIter*1e5/3600., ' hours'
from yade import timing
timing.stats()
Follow ups