Problem about running yade in parallel

Asked by Huang peilun on 2020-01-29

Hi everyone!
I'm learning to run yadedaily in parallel.

I use 'yadedaily --threads=2 test.py' to run my code.
First few steps works fine but then comes an error which says:

python3.5: /builds/yade-dev/trunk/deb/yadedaily/pkg/common/InsertionSortCollider.hpp:127: yade::InsertionSortCollider::Bounds& yade::InsertionSortCollider::VecBounds::operator[](long int): Assertion `idx < long(size()) && idx >= 0' failed.
Aborted (core dumped)

Here's my code:

############################
############################
############################

from yade import pack

SoilMat=FrictMat(young=25e6,poisson=0.2,density=2650,frictionAngle=0.28)
O.materials.append((SoilMat))

O.bodies.append(geom.facetCylinder(center=(0,0,.5),radius=.38,height=1,wallMask=6))

sp=pack.SpherePack()
sp.makeCloud((-.38,-.38,0),(.38,.38,1),rMean=.025,rRelFuzz=.3)
cyl=pack.inCylinder((0,0,0),(0,0,1),.355)
sp=pack.filterSpherePack(cyl,sp,True)
sp.toSimulation(material=SoilMat)

O.engines=[
 ForceResetter(),
 InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Facet_Aabb()]),
 InteractionLoop(
  [Ig2_Sphere_Sphere_ScGeom(),Ig2_Facet_Sphere_ScGeom(),Ig2_Wall_Sphere_ScGeom()],
  [Ip2_FrictMat_FrictMat_FrictPhys()],
  [Law2_ScGeom_FrictPhys_CundallStrack()]
 ),
 # update position using Newton's equations
 NewtonIntegrator(gravity=(0,0,-9.81),damping=0.05),
 # call the checkUnbalanced function (defined below) every 2 seconds
]
O.dt=.2*PWaveTimeStep()

O.saveTmp()

############################
############################
############################

And when I change the rMean of the spherepack, it works.
But I need to simulate a lot of spheres, can anyone help me solve the problem when rMean is small?

Thanks in advance!

Question information

Language:
English Edit question
Status:
Solved
For:
Yade Edit question
Assignee:
No assignee Edit question
Solved by:
Jérôme Duriez
Solved:
2020-02-03
Last query:
2020-02-03
Last reply:
2020-02-03
Jan Stránský (honzik) said : #1

Hello,

I could not reproduce the problem..
what version of Yade and what operating system do you use?

thanks
Jan

Huang peilun (hpl16) said : #2

Thanks for your reply!

it's
"
Yade 20200119-3121~146d6de~xenial1.
Ubuntu 16.04 LTS xenial.
"

I can run the first few steps and then this problem occurs.

Jan Stránský (honzik) said : #3

I am using Ubuntu 18.04 LTS.
I have tried with yade 2018-02b without any problem
Then I used relatively new source version (2020-01-06.git-f6677ba) and got segmentation fault :-D
Please open a bug (referencing this question).
cheers
Jan

Best Jérôme Duriez (jduriez) said : #4

I think this issue is known and fixed / workarounded as of yadedaily 20200202-3270~7acb24d~bionic1:

https://gitlab.com/yade-dev/trunk/issues/138

Huang peilun (hpl16) said : #5

Thanks Jérôme Duriez, that solved my question.

Janek Kozicki (cosurgi) said : #6

And we will not have this bug ever again. Because a test for it was added to the pipeline ;)

Huang peilun (hpl16) said : #7

That's great. Thanks!