yade-users team mailing list archive
-
yade-users team
-
Mailing list archive
-
Message #12271
[Question #288003]: How to run yade in parallel with load() function
New question #288003 on Yade:
https://answers.launchpad.net/yade/+question/288003
Hi,
I cannot run Yade in parallel with my script which has load() function,
so please tell me how to do it.
I use two scripts as bellow: mill8-save.py and mill9-load.py.
In the "mill8-save.py", 1000 particles are generated twice and stl file is read as facets.
After particles fall on facets, the simulation is saved.
In the "mill9-load.py", the saved data is loaded and then facets rotate.
I tried running mill9-load.py in parallel,
bun I got error as bellow.
If I ran it by single thread, it was fine.
Also, I could run "mill8-save.py" in parallel.
====command and error=====================================
$ yade -j6 mill9-load.py
Welcome to Yade 2015-10-09.git-b8083be
TCP python prompt on localhost:9000, auth cookie `syseak'
XMLRPC info provider on http://localhost:21000
Running script mill9-load.py
*** Error in `/usr/bin/python': double free or corruption (fasttop): 0x00007f90cc000930 ***
Aborted (core dumped)
====command and error=====================================
====mill8-save.py========================================
#!/usr/bin/python
# -*- coding: utf-8 -*-
from yade import ymport, pack, qt, timing
walls = O.bodies.append(ymport.stl(file='drum/drum00.stl',color=(0,1,0)))
sp1=pack.SpherePack()
sp1.makeCloud(minCorner=(-1.6,-0.35,-0.35),maxCorner=(1.6,0.35,0.35),rMean=0.005,rRelFuzz=0,num=1000)
sp1.toSimulation(color=(0,0,1))
O.dt=1.0e-4
O.engines=[
ForceResetter(),
InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Facet_Aabb()]),
InteractionLoop(
[Ig2_Sphere_Sphere_ScGeom(),Ig2_Facet_Sphere_ScGeom()],
[Ip2_FrictMat_FrictMat_FrictPhys()],
[Law2_ScGeom_FrictPhys_CundallStrack()],
),
NewtonIntegrator(gravity=(0,0,-100)),
RotationEngine(ids=walls,rotationAxis=[1,0,0],rotateAroundZero=True,angularVelocity=0),
VTKRecorder(iterPeriod=10,recorders=['facets','spheres'],fileName='/home/inba/myYade/timing/benchmark/01/post1/bench-'),
PyRunner(iterPeriod=1,command="insert()"),
PyRunner(iterPeriod=100,command="log()"),
]
O.run(10001)
qt.View()
def log():
print O.iter, len(O.bodies)
if O.iter == 10000:
O.save("generation.gz2")
def insert():
if O.iter == 5000:
sp2=pack.SpherePack()
sp2.makeCloud(minCorner=(-1.6,-0.35,-0.35),maxCorner=(1.6,0.35,0.35),rMean=0.005,rRelFuzz=0,num=1000)
sp2.toSimulation(color=(0,0,1))
====mill8-save.py========================================
====mill9-load.py========================================
#!/usr/bin/python
# -*- coding: utf-8 -*-
from yade import ymport, pack, qt, timing
O.load("generation.gz2")
O.resetTime()
walls = range(2981)
O.dt=1.0e-4
O.engines=[
ForceResetter(),
InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Facet_Aabb()]),
InteractionLoop(
[Ig2_Sphere_Sphere_ScGeom(),Ig2_Facet_Sphere_ScGeom()],
[Ip2_FrictMat_FrictMat_FrictPhys()],
[Law2_ScGeom_FrictPhys_CundallStrack()],
),
NewtonIntegrator(gravity=(0,0,-9.81)),
RotationEngine(ids=walls,rotationAxis=[1,0,0],rotateAroundZero=True,angularVelocity=6.283185),
VTKRecorder(iterPeriod=10,recorders=['facets','spheres'],fileName='/home/inba/myYade/timing/benchmark/01/post2/bench-'),
PyRunner(iterPeriod=100,command="log()"),
]
O.run(10001)
def log():
print O.iter, len(O.bodies)
if O.iter == 10000:
O.save("rotation.gz2")
O.timingEnabled=True
O.wait()
timing.stats()
====mill9-load.py========================================
By the way,
number of facets is 2981 used in "mill9-load.py".
I want to knew how to access to IDs of the facets after loading.
Thanks,
Masayuki
--
You received this question notification because your team yade-users is
an answer contact for Yade.