Centos cluster running

Asked by procrastinator on 2019-04-12

Hi, all.
Now I'm trying to use the cluster to do some simulation work. But there seem some errors.

Actually, the cluster can run for one of my scripts, but when I add another two line codes, this cluster can't work. There will be an error pop up.

here is my script:

from yade import pack, plot
from yade import utils
compFricDegree = 30
targetPorosity = 0.98
stabilityThreshold=0.3
finalFricDegree=19.5
damp=0.8
young=4e8
O.materials.append(CohFrictMat(young=young,poisson=0.3,frictionAngle=radians(compFricDegree),isCohesive=False,alphaKr=0.2,alphaKtw=0,etaRoll=0.5,momentRotationLaw=True,density=2648,label='spheres'))
O.materials.append(FrictMat(young=young,poisson=0.3,frictionAngle=0,density=0,label='walls'))
mn,mx=Vector3(0,0,0),Vector3(400e-3,400e-3,300e-3)
psdSizes,psdCumm = [3e-3,3.48e-3,3.98e-3,4.41e-3,4.78e-3,5.12e-3,5.53e-3,6.09e-3,7.37e-3,9.47e-3],[0.,0.11,0.22,0.33,0.44,0.56,0.67,0.78,0.89,1.0]
sp = pack.SpherePack()
sp.makeCloud(mn,mx,psdSizes=psdSizes,psdCumm=psdCumm,num=50026,distributeMass=1,seed=1)
pred=pack.inCylinder((200e-3,200e-3,0),(200e-3,200e-3,300e-3),radius=200e-3)
sp2 = pack.filterSpherePack(pred,sp,returnSpherePack=True)
sp2.toSimulation(material='spheres')
facets = geom.facetCylinder((200e-3,200e-3,150e-3),200e-3,300e-3,wallMask=6,material='walls',segmentsNumber=100)
O.bodies.append(facets)
print "num_spheres= ", len(O.bodies)
O.engines=[
 ForceResetter(),
 InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Facet_Aabb()]),
 InteractionLoop(
   [Ig2_Sphere_Sphere_ScGeom6D(),Ig2_Facet_Sphere_ScGeom()],
   [Ip2_FrictMat_FrictMat_FrictPhys(),Ip2_CohFrictMat_CohFrictMat_CohFrictPhys()], [Law2_ScGeom_FrictPhys_CundallStrack(),Law2_ScGeom6D_CohFrictPhys_CohesionMoment(useIncrementalForm=True,always_use_moment_law=True,label='cohesiveLaw')]
 ),
 GlobalStiffnessTimeStepper(active=1,timeStepUpdateInterval=10,timestepSafetyCoefficient=0.8),
 NewtonIntegrator(gravity=(0,0,-9.81),damping=damp),

]
O.dt=.5*PWaveTimeStep()

while 1:
 O.run(3000,True)
 unb=unbalancedForce()
 print 'unbalanced force: ',unb
 if unb<stabilityThreshold:
  break
O.save('make_sample_1.yade.gz')
O.saveTmp()

#####################
if I didn't include these two lines:

#pred=pack.inCylinder((200e-3,200e-3,0),(200e-3,200e-3,300e-3),radius=200e-3)
#sp2 = pack.filterSpherePack(pred,sp,returnSpherePack=True)

and change :sp2.toSimulation(material='spheres') to sp.toSimulation(material='spheres')

the cluster can run this script.

if I run the script that I posted. Here is the error:

TCP python prompt on localhost:9000, auth cookie `cdseya'
Welcome to Yade 2018.02b
XMLRPC info provider on http://localhost:21000
Running script make-sample.py
Traceback (most recent call last):
  File "/packages/7x/yade/2018.02b/bin/yade-2018.02b", line 182, in runScript
    execfile(script,globals())
  File "make-sample.py", line 16, in <module>
    sp2 = pack.filterSpherePack(pred,sp,returnSpherePack=True)
  File "/packages/7x/yade/2018.02b/lib64/yade-2018.02b/py/yade/pack.py", line 373, in filterSpherePack
    if dimP[0]>dimS[0] or dimP[1]>dimS[1] or dimP[2]>dimS[2]: warnings.warn("Packing's dimension (%s) doesn't fully contain dimension of the predicate (%s)."%(dimS,dimP))
TypeError: No registered converter was able to produce a C++ rvalue of type std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > from this Python object of type str

=================== JOB SUMMARY ================
id : make-sample.py.default
status : 256 (FAILED)
duration: 00:00:04
command : YADE_BATCH= DISPLAY= /packages/7x/yade/2018.02b/bin/yade-2018.02b --threads=1 --nice=10 -x make-sample.py> make-sample.py.default.log 2>&1
started : Thu Apr 11 17:02:03 2019
finished: Thu Apr 11 17:02:08 2019

Is there anyone can help me to figure out the reason why I just add that two line codes, this script can't work.

Question information

Language:
English Edit question
Status:
Solved
For:
Yade Edit question
Assignee:
No assignee Edit question
Solved by:
procrastinator
Solved:
2019-04-15
Last query:
2019-04-15
Last reply:
2019-04-12
Bettina Suhr (bettina-suhr) said : #1

Hi,

it seems to me your problem is not related to the usage of a cluster.

Reading your error message, the problem is caused by the filterSpherePack() function.
In the docs of this function it says: “The packing will be recentered to match the predicate and warning is given if the predicate is larger than the packing.”
Your predicate is not larger than your packing, but has exactly the same dimensions (x,y,z coordinate), which might cause the trouble.
The error message is:
if dimP[0]>dimS[0] or dimP[1]>dimS[1] or dimP[2]>dimS[2]: warnings.warn("Packing's dimension (%s) doesn't fully contain dimension of the predicate (%s)."%(dimS,dimP))

Therefore, I would think that you can solve your problem in increasing the size of your sphere pack in all three dimensions.

Hope it helps,
Bettina

I used the same script on a Ubuntu virtual system, this script can run very well. So I don't know whether this is the reason or not, but I will try and tell you the result.

This question is also posted by me, but the reason is not related to the boost. I double check with the IT technician from my University. They told me that the boost version is 1.53.

Hi Bettina,

thank you very much, I tried what you said yesterday, it works.