Can not run the old code in the new version even if changed something following the instruction

Asked by Liqing Jiao on 2011-04-11

Dear All,

I can run my code well in 0.5 version. But if I decrease the strain rate applying the triaxial load, the "segmentation fault" will be appeared and stop the modeling. I see the new version that is 0.6.2, have already solved the problem looks like that the same message stop the modeling. I think maybe my problem can also be solved through changed the version of Yade. Then I installed the new version 0.60.2 instead of the old version 0.50. And I modified my python code following the error reminder. But the "segmentation fault" also appear even through I run the code that can run well in the old version. The process is listed as follow:

jiaoliqing@ubuntu:~/YADE/bin$ yade-cleanComp060 16-09-re-3d.py
Welcome to Yade 0.60
TCP python prompt on localhost:9000, auth cookie `yeascu'
XMLRPC info provider on http://localhost:21000
Running script 16-09-re-3d.py
Traceback (most recent call last):
  File "/home/jiaoliqing/YADE/bin/yade-cleanComp060", line 152, in runScript
    execfile(script,globals())
  File "16-09-re-3d.py", line 48, in <module>
    spheres=regularHexa_J(pack.inAlignedBox((-.25*specimenLength,-.05*specimenLength,-.25*specimenLength),(.25*specimenLength,.05*specimenLength,0.25*specimenLength)),radius=sphereRadius,gap=0.0,material=concreteId)
NameError: name 'specimenLength' is not defined
[[ ^L clears screen, ^U kills line. F12 controller, F11 3d view, F10 both, F9 generator, F8 plot. ]]
Yade [1]:
Do you really want to exit ([y]/n)?
Yade: normal exit.
Terminated
jiaoliqing@ubuntu:~/YADE/bin$ yade-cleanComp060 16-09-re-3d.py
Welcome to Yade 0.60
TCP python prompt on localhost:9000, auth cookie `esacks'
XMLRPC info provider on http://localhost:21000
Running script 16-09-re-3d.py
Traceback (most recent call last):
  File "/home/jiaoliqing/YADE/bin/yade-cleanComp060", line 152, in runScript
    execfile(script,globals())
  File "16-09-re-3d.py", line 50, in <module>
    spheres=regularHexa_J(pack.inAlignedBox((-.25*specimenLength,-.05*specimenLength,-.25*specimenLength),(.25*specimenLength,.05*specimenLength,0.25*specimenLength)),radius=sphereRadius,gap=0.0,material=concreteId)
TypeError: can't multiply sequence by non-int of type 'float'
[[ ^L clears screen, ^U kills line. F12 controller, F11 3d view, F10 both, F9 generator, F8 plot. ]]
Yade [1]:
Do you really want to exit ([y]/n)?
Yade: normal exit.
Terminated
jiaoliqing@ubuntu:~/YADE/bin$
jiaoliqing@ubuntu:~/YADE/bin$ yade-cleanComp060 16-09-re-3d.py
Welcome to Yade 0.60
TCP python prompt on localhost:9000, auth cookie `ucssye'
XMLRPC info provider on http://localhost:21000
Running script 16-09-re-3d.py
Traceback (most recent call last):
  File "/home/jiaoliqing/YADE/bin/yade-cleanComp060", line 152, in runScript
    execfile(script,globals())
  File "16-09-re-3d.py", line 50, in <module>
    spheres=regularHexa_J(pack.inAlignedBox((-.25*0.1,-.05*0.1,-.25*0.1),(.25*0.1,.05*0.1,0.25*0.1)),radius=sphereRadius,gap=0.0,material=concreteId)
  File "16-09-re-3d.py", line 33, in regularHexa_J
    a=2*radius+gap
TypeError: can only concatenate tuple (not "float") to tuple
[[ ^L clears screen, ^U kills line. F12 controller, F11 3d view, F10 both, F9 generator, F8 plot. ]]
Yade [1]:
Do you really want to exit ([y]/n)?
Yade: normal exit.
Terminated
jiaoliqing@ubuntu:~/YADE/bin$ yade-cleanComp060 16-09-re-3d.py
Welcome to Yade 0.60
TCP python prompt on localhost:9000, auth cookie `kcaesy'
XMLRPC info provider on http://localhost:21000
Running script 16-09-re-3d.py
Traceback (most recent call last):
  File "/home/jiaoliqing/YADE/bin/yade-cleanComp060", line 152, in runScript
    execfile(script,globals())
  File "16-09-re-3d.py", line 113, in <module>
    [Ip2_2xCohFrictMat_CohFrictPhys(setCohesionNow=False,setCohesionOnNewContacts=True,normalCohesion=40e3,shearCohesion=40e3)],
AttributeError: No such attribute: shearCohesion.
[[ ^L clears screen, ^U kills line. F12 controller, F11 3d view, F10 both, F9 generator, F8 plot. ]]
Yade [1]:
Do you really want to exit ([y]/n)?
Yade: normal exit.
Terminated
jiaoliqing@ubuntu:~/YADE/bin$ yade-cleanComp060 16-09-re-3d.py
Welcome to Yade 0.60
TCP python prompt on localhost:9000, auth cookie `aduksy'
XMLRPC info provider on http://localhost:21000
Running script 16-09-re-3d.py
Traceback (most recent call last):
  File "/home/jiaoliqing/YADE/bin/yade-cleanComp060", line 152, in runScript
    execfile(script,globals())
  File "16-09-re-3d.py", line 113, in <module>
    [Ip2_2xCohFrictMat_CohFrictPhys(setCohesionNow=False,setCohesionOnNewContacts=True,normalAdhesion=40e3,shearAdhesion=40e3)],
AttributeError: No such attribute: normalAdhesion.
[[ ^L clears screen, ^U kills line. F12 controller, F11 3d view, F10 both, F9 generator, F8 plot. ]]
Yade [1]:
Do you really want to exit ([y]/n)?
Yade: normal exit.
Terminated
jiaoliqing@ubuntu:~/YADE/bin$ yade-cleanComp060 16-09-re-3d.py
Welcome to Yade 0.60
TCP python prompt on localhost:9000, auth cookie `kecyas'
XMLRPC info provider on http://localhost:21000
Running script 16-09-re-3d.py
/home/jiaoliqing/YADE/lib/yade-cleanComp060/py/yade/__init__.py:114: DeprecationWarning: Class `Law2_ScGeom_CohFrictPhys_ElasticPlastic' was renamed to (or replaced by) `Law2_ScGeom_CohFrictPhys_CohesionMoment', update your code! (you can run 'yade --update script.py' to do that automatically)
/home/jiaoliqing/YADE/lib/yade-cleanComp060/py/yade/__init__.py:114: DeprecationWarning: Class `InteractionDispatchers' was renamed to (or replaced by) `InteractionLoop', update your code! (you can run 'yade --update script.py' to do that automatically)
Traceback (most recent call last):
  File "/home/jiaoliqing/YADE/bin/yade-cleanComp060", line 152, in runScript
    execfile(script,globals())
  File "16-09-re-3d.py", line 119, in <module>
    SnapshotEngine(iterPeriod=200,fileBase='/tmp/12_08_c-',viewNo=0),
NameError: name 'SnapshotEngine' is not defined
[[ ^L clears screen, ^U kills line. F12 controller, F11 3d view, F10 both, F9 generator, F8 plot. ]]
Yade [1]:
Do you really want to exit ([y]/n)?
Yade: normal exit.
Terminated
jiaoliqing@ubuntu:~/YADE/bin$ yade-cleanComp060 16-09-re-3d.py
Welcome to Yade 0.60
TCP python prompt on localhost:9000, auth cookie `csuaky'
XMLRPC info provider on http://localhost:21000
Running script 16-09-re-3d.py
/home/jiaoliqing/YADE/lib/yade-cleanComp060/py/yade/__init__.py:114: DeprecationWarning: Class `Law2_ScGeom_CohFrictPhys_ElasticPlastic' was renamed to (or replaced by) `Law2_ScGeom_CohFrictPhys_CohesionMoment', update your code! (you can run 'yade --update script.py' to do that automatically)
/home/jiaoliqing/YADE/lib/yade-cleanComp060/py/yade/__init__.py:114: DeprecationWarning: Class `InteractionDispatchers' was renamed to (or replaced by) `InteractionLoop', update your code! (you can run 'yade --update script.py' to do that automatically)
[[ ^L clears screen, ^U kills line. F12 controller, F11 3d view, F10 both, F9 generator, F8 plot. ]]
Yade [1]:
Do you really want to exit ([y]/n)?
Yade: normal exit.
Terminated
jiaoliqing@ubuntu:~/YADE/bin$ yade-cleanComp060 16-09-re-3d.py
Welcome to Yade 0.60
TCP python prompt on localhost:9000, auth cookie `caseuy'
XMLRPC info provider on http://localhost:21000
Running script 16-09-re-3d.py
Traceback (most recent call last):
  File "/home/jiaoliqing/YADE/bin/yade-cleanComp060", line 152, in runScript
    execfile(script,globals())
  File "16-09-re-3d.py", line 114, in <module>
    [LLaw2_ScGeom_CohFrictPhys_CohesionMoment()]
NameError: name 'LLaw2_ScGeom_CohFrictPhys_CohesionMoment' is not defined
[[ ^L clears screen, ^U kills line. F12 controller, F11 3d view, F10 both, F9 generator, F8 plot. ]]
Yade [1]:
Do you really want to exit ([y]/n)?
Yade: normal exit.
Terminated
jiaoliqing@ubuntu:~/YADE/bin$ yade-cleanComp060 16-09-re-3d.py
Welcome to Yade 0.60
TCP python prompt on localhost:9000, auth cookie `ykecsu'
XMLRPC info provider on http://localhost:21000
Running script 16-09-re-3d.py
/home/jiaoliqing/YADE/lib/yade-cleanComp060/py/yade/__init__.py:114: DeprecationWarning: Class `InteractionDispatchers' was renamed to (or replaced by) `InteractionLoop', update your code! (you can run 'yade --update script.py' to do that automatically)
[[ ^L clears screen, ^U kills line. F12 controller, F11 3d view, F10 both, F9 generator, F8 plot. ]]
Yade [1]: ---------------------------------------------------------------------------
KeyboardInterrupt Traceback (most recent call last)

/home/jiaoliqing/YADE/lib/yade-cleanComp060/py/yade/__init__.pyc in refreshEvent(self)
    187 def yzxSlot(self): self.setViewAxes((-1,0,0),(0,0,1))
    188 def zxySlot(self): self.setViewAxes((0,-1,0),(1,0,0))
--> 189 def refreshEvent(self):
    190 self.refreshValues()
    191 self.activateControls()

KeyboardInterrupt:

Do you really want to exit ([y]/n)?
Yade: normal exit.
Terminated
jiaoliqing@ubuntu:~/YADE/bin$ yade-cleanComp060 16-09-re-3d.py
Welcome to Yade 0.60
TCP python prompt on localhost:9000, auth cookie `ceuykd'
XMLRPC info provider on http://localhost:21000
Running script 16-09-re-3d.py
[[ ^L clears screen, ^U kills line. F12 controller, F11 3d view, F10 both, F9 generator, F8 plot. ]]
Yade [1]: 10567 WARN yade.Engine /home/jiaoliqing/yade-0.60.2/pkg/common/Collider.cpp:41 findBoundDispatcherInEnginesIfNoFunctorsAndWarn: Collider.boundDispatcher had no functors defined, while there was a BoundDispatcher found in O.engines. Since version 0.60 (r2396), Collider has boundDispatcher integrated in itself; separate BoundDispatcher should not be used anymore. For now, I will fix it for you, but change your script! Where it reads e.g.

 O.engines=[...,
  BoundDispatcher([Bo1_Sphere_Aabb(),Bo1_Facet_Aabb()]),
  InsertionSortCollider(),
  ...
 ]

it should become

 O.engines=[...,
  InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Facet_Aabb()]),
  ...
 ]

instead.
python: malloc.c:4628: _int_malloc: Assertion `(unsigned long)(size) >= (unsigned long)(nb)' failed.
Segmentation fault
jiaoliqing@ubuntu:~/YADE/bin$ yade-cleanComp060 16-09-re-3d.py
Welcome to Yade 0.60
TCP python prompt on localhost:9000, auth cookie `daeusy'
XMLRPC info provider on http://localhost:21000
Running script 16-09-re-3d.py
[[ ^L clears screen, ^U kills line. F12 controller, F11 3d view, F10 both, F9 generator, F8 plot. ]]
Yade [1]: Segmentation fault

May I have your help? Could you explain that why the segmentation fault will appear when I dwindle the loading rate? And how to solve this problem? Thank you!
Looking forward to your replay!

Best Regards
Liqing

Question information

Language:
English Edit question
Status:
Answered
For:
Yade Edit question
Assignee:
No assignee Edit question
Last query:
2011-04-14
Last reply:
2011-04-14
Anton Gladky (gladky-anton) said : #1

Hi,

please, file a bug, using bugtracker [1] and attach the crashing script (better simplify it, as you can).
It would be also good, if you test your script with the latest trunk version.

[1] https://bugs.launchpad.net/yade
[2] https://www.yade-dem.org/source/yade_latest_trunk.tgz

A.

Liqing Jiao (liqing) said : #2

Dear All,

Thanks for Anton's suggestion. I simplified the question as follows:
My phthon file is
from yade import pack,plot
import itertools

O.materials.append(CohFrictMat(young=150e10,poisson=.2,frictionAngle=0,density=7800,isCohesive=True,isBroken=True,normalCohesion=40e3,shearCohesion=40e3,label='frictionless'))
sphereRadius=1e-3,
concreteId=O.materials.append(CohFrictMat(young=2.514e6,poisson=.5,frictionAngle=0.5,density=1130,isCohesive=True,isBroken=True,))
spheres=pack.regularHexa(pack.inAlignedBox((-.25*0.1,-.05*0.1,-.25*0.1),(.25*0.1,.05*0.1,0.25*0.1)),radius=1e-3,gap=0.0,material=concreteId)
O.bodies.append(spheres)
## create walls around the packing
walls=utils.aabbWalls(thickness=.0001,material='frictionless')
wallIds=O.bodies.append(walls)
triax=ThreeDTriaxialEngine(
    wall_bottom_id=wallIds[2],
    wall_top_id=wallIds[3],
    wall_left_id=wallIds[0],
    wall_right_id=wallIds[1],
    wall_back_id=wallIds[4],
    wall_front_id=wallIds[5],
    internalCompaction=False,
        strainRate1=3.3e-4,
        stressControl_1=False,
        stressControl_2=False,
        stressControl_3=False,
    label='strainer',
)
O.engines=[
    ForceResetter(),
    #BoundDispatcher([Bo1_Sphere_Aabb(),Bo1_Box_Aabb()]),
    InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Box_Aabb()]),
    #InsertionSortCollider(nBins=5,binCoeff=5,sweepLength=.05*1e-3),
    InteractionLoop(
        [Ig2_Sphere_Sphere_ScGeom(),Ig2_Box_Sphere_ScGeom()],
        [Ip2_2xCohFrictMat_CohFrictPhys(setCohesionNow=False,setCohesionOnNewContacts=True)],
        [Law2_ScGeom_CohFrictPhys_CohesionMoment()]
    ),
    GlobalStiffnessTimeStepper(),
    triax,
    NewtonIntegrator(damping=.4),

]
O.run()

It is not complicated. But when I run it in the 0.60.2 version, the error appear as follow:
Welcome to Yade 0.60
TCP python prompt on localhost:9000, auth cookie `ksudys'
XMLRPC info provider on http://localhost:21000
Running script 16-09-re-3d.py
[[ ^L clears screen, ^U kills line. F12 controller, F11 3d view, F10 both, F9 generator, F8 plot. ]]
Yade [1]: Segmentation fault
No other information come out. If you know why it can not run well, could you tell me how to modify it? Thank you!

Cheers
Liqing

At 2011-04-11,"Anton Gladky" <email address hidden> wrote:

>Question #152385 on Yade changed:
>https://answers.launchpad.net/yade/+question/152385
>
> Status: Open => Answered
>
>Anton Gladky proposed the following answer:
>Hi,
>
>please, file a bug, using bugtracker [1] and attach the crashing script (better simplify it, as you can).
>It would be also good, if you test your script with the latest trunk version.
>
>[1] https://bugs.launchpad.net/yade
>[2] https://www.yade-dem.org/source/yade_latest_trunk.tgz
>
>A.
>
>--
>You received this question notification because you are a member of
>yade-users, which is an answer contact for Yade.
>
>_______________________________________________
>Mailing list: https://launchpad.net/~yade-users
>Post to : <email address hidden>
>Unsubscribe : https://launchpad.net/~yade-users
>More help : https://help.launchpad.net/ListHelp

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

Hello

To get more info about Segmentation fault, try to launch this script with a debug version of Yade (make a new compilation for that)

Liqing Jiao (liqing) said : #4

Dear All,

Thank Jduriez for the reply very quickly!
I think my yade version is newest that is yade-0.60.2. So I don't know how to solve this problem. Do you see this problem or error information when you run yade? Thank you!

Cheers
Liqing

At 2011-04-13,jduriez <email address hidden> wrote:

>Your question #152385 on Yade changed:
>https://answers.launchpad.net/yade/+question/152385
>
> Status: Open => Answered
>
>jduriez proposed the following answer:
>Hello
>
>To get more info about Segmentation fault, try to launch this script
>with a debug version of Yade (make a new compilation for that)
>
>--
>If this answers your question, please go to the following page to let us
>know that it is solved:
>https://answers.launchpad.net/yade/+question/152385/+confirm?answer_id=2
>
>If you still need help, you can reply to this email or go to the
>following page to enter your feedback:
>https://answers.launchpad.net/yade/+question/152385
>
>You received this question notification because you are a direct
>subscriber of the question.

Hi,

I tried your script with a recent version (not sure what would happen in 0.6). It gave me this:

DeprecationWarning: Class `Ip2_2xCohFrictMat_CohFrictPhys' was renamed to (or replaced by) `Ip2_CohFrictMat_CohFrictMat_CohFrictPhys', update your code! (you can run 'yade --update script.py' to do that automatically)
DeprecationWarning: Class `Law2_ScGeom_CohFrictPhys_CohesionMoment' was renamed to (or replaced by) `Law2_ScGeom6D_CohFrictPhys_CohesionMoment', update your code! (you can run 'yade --update script.py' to do that automatically)

So, I ran "yade --update yourScript.py", and then Interaction loop looked like this:

InteractionLoop(
        [Ig2_Sphere_Sphere_ScGeom(),Ig2_Box_Sphere_ScGeom()],
        [Ip2_CohFrictMat_CohFrictMat_CohFrictPhys(setCohesionNow=False,setCohesionOnNewContacts=True)],
        [Law2_ScGeom6D_CohFrictPhys_CohesionMoment()]
    ),

At that point the type mismatch is obvious: ScGeom are generated while the contact law needs ScGeom6D. Actually, using substepping in the qt window, there is a clear error message (not sure why we don't have this output when a full step is done...):

"None of given Law2 functors can handle interaction #3677+0, types geom:ScGeom=1 and phys:CohFrictPhys=6"

It is possible that yade0.6 is still using the old misleading names, I'd have to check. I recommend using the last bzr version, then with this loop, your script works:

InteractionLoop(
        [Ig2_Sphere_Sphere_ScGeom6D(),Ig2_Box_Sphere_ScGeom6D()],
        [Ip2_CohFrictMat_CohFrictMat_CohFrictPhys(setCohesionNow=False,setCohesionOnNewContacts=True)],
        [Law2_ScGeom6D_CohFrictPhys_CohesionMoment()]
    ),

Liqing Jiao (liqing) said : #6

Dear Chareyre,

Thank you for your reply and warm help.
I followed what you said to change my code. But it also can't run, and give me the error like this:

Welcome to Yade 0.60
TCP python prompt on localhost:9000, auth cookie `asudes'
XMLRPC info provider on http://localhost:21000
Running script 16-09-re-3d.py
Traceback (most recent call last):
  File "/home/jiaoliqing/YADE/bin/yade", line 152, in runScript
    execfile(script,globals())
  File "16-09-re-3d.py", line 35, in <module>
    [Ip2_CohFrictMat_CohFrictMat_CohFrictPhys(setCohesionNow=False,setCohesionOnNewContacts=True)],
NameError: name 'Ip2_CohFrictMat_CohFrictMat_CohFrictPhys' is not defined
[[ ^L clears screen, ^U kills line. F12 controller, F11 3d view, F10 both, F9 generator, F8 plot. ]]
Yade [1]:

It looks like the Ip2 file is not suitable. I also saw the Ip2_2xCohFrictMat_CohFrictPhys in the install files. I think maybe it is not the cause of that problem. Could you help me to check it again?

Cheers
Liqing

At 2011-04-13,Chareyre <email address hidden> wrote:

>Your question #152385 on Yade changed:
>https://answers.launchpad.net/yade/+question/152385
>
> Status: Open => Answered
>
>Chareyre proposed the following answer:
>Hi,
>
>I tried your script with a recent version (not sure what would happen in
>0.6). It gave me this:
>
>DeprecationWarning: Class `Ip2_2xCohFrictMat_CohFrictPhys' was renamed to (or replaced by) `Ip2_CohFrictMat_CohFrictMat_CohFrictPhys', update your code! (you can run 'yade --update script.py' to do that automatically)
>DeprecationWarning: Class `Law2_ScGeom_CohFrictPhys_CohesionMoment' was renamed to (or replaced by) `Law2_ScGeom6D_CohFrictPhys_CohesionMoment', update your code! (you can run 'yade --update script.py' to do that automatically)
>
>So, I ran "yade --update yourScript.py", and then Interaction loop
>looked like this:
>
>InteractionLoop(
> [Ig2_Sphere_Sphere_ScGeom(),Ig2_Box_Sphere_ScGeom()],
> [Ip2_CohFrictMat_CohFrictMat_CohFrictPhys(setCohesionNow=False,setCohesionOnNewContacts=True)],
> [Law2_ScGeom6D_CohFrictPhys_CohesionMoment()]
> ),
>
>At that point the type mismatch is obvious: ScGeom are generated while
>the contact law needs ScGeom6D. Actually, using substepping in the qt
>window, there is a clear error message (not sure why we don't have this
>output when a full step is done...):
>
>"None of given Law2 functors can handle interaction #3677+0, types
>geom:ScGeom=1 and phys:CohFrictPhys=6"
>
>It is possible that yade0.6 is still using the old misleading names, I'd
>have to check. I recommend using the last bzr version, then with this
>loop, your script works:
>
>InteractionLoop(
> [Ig2_Sphere_Sphere_ScGeom6D(),Ig2_Box_Sphere_ScGeom6D()],
> [Ip2_CohFrictMat_CohFrictMat_CohFrictPhys(setCohesionNow=False,setCohesionOnNewContacts=True)],
> [Law2_ScGeom6D_CohFrictPhys_CohesionMoment()]
> ),
>
>--
>If this answers your question, please go to the following page to let us
>know that it is solved:
>https://answers.launchpad.net/yade/+question/152385/+confirm?answer_id=4
>
>If you still need help, you can reply to this email or go to the
>following page to enter your feedback:
>https://answers.launchpad.net/yade/+question/152385
>
>You received this question notification because you are a direct
>subscriber of the question.

Then you are still using a version where Ip2_2xCohFrictMat_CohFrictPhys
is not yet renamed Ip2_CohFrictMat_CohFrictMat_CohFrictPhys.
Just replace new name by old name (or use the same "yade --update
yourOldScript.py" method that I showed in previous reply).
You should seriously consider installing last bzr revision to avoid this
sort of problems.

Can you help with this problem?

Provide an answer of your own, or ask Liqing Jiao for more information if necessary.

To post a message you must log in.