← Back to team overview

yade-users team mailing list archive

Re: [Question #683238]: Memory usage is too high

 

Question #683238 on Yade changed:
https://answers.launchpad.net/yade/+question/683238

Robert Caulk proposed the following answer:
I think you can help me solve the problem :-) but I need you to
carefully answer the following questions:

Just to clarify, you are saying that you observe a memory usage increase
when you set:

flow.defTolerance=-1
flow.meshUpdateInterval=-1

??

>If memory usage doesn't increase during the initial period of the
simulation,it will never increase.Similarly,if it increase,it will
continuously increase,even if I pause the simulation.

Please elaborate on this behavior. What is the "initial period"? Memory
continues to increase when you pause the simulation?

Will you please run the following script and tell me what you observe in
the mem plot with and without meshUpdateInterval=200? (dont forget to
run pip3 install psutil --user, to get the library for tracking memory):

from yade import pack, ymport,export
from yade import timing
import numpy as np
import shutil
import psutil

young=10e7 #250e7
finalFricDegree = 30 
density = 2600
rate = 0.01
iterper=400
intRadius=1.0

packingName = '30000.spheres'

sp = O.bodies.append(ymport.textExt(packingName, 'x_y_z_r'))

# get packing dimensions 
dim=utils.aabbExtrema()
xinf=dim[0][0]
xsup=dim[1][0]
X=xsup-xinf
yinf=dim[0][1]
ysup=dim[1][1]
Y=ysup-yinf
zinf=dim[0][2]
zsup=dim[1][2]
Z=zsup-zinf

mn,mx=Vector3(xinf, yinf,zinf),Vector3(xsup, ysup, zsup)

O.reset()

O.materials.append(FrictMat(density=density,young=young,poisson=.3,frictionAngle=radians(18.),label='spheres'))
O.materials.append(FrictMat(density=0,young=8.8e10,poisson=.8,frictionAngle=0.,label='walls'))

walls=aabbWalls([mn,mx],thickness=0,material='walls')
wallIds=O.bodies.append(walls)

sp = O.bodies.append(ymport.textExt(packingName,
'x_y_z_r',color=(0,0.2,0.7), material='spheres'))

O.engines=[
	ForceResetter(),
	InsertionSortCollider([Bo1_Sphere_Aabb(aabbEnlargeFactor=intRadius, label='Saabb'),Bo1_Box_Aabb()]),
	InteractionLoop(
		[Ig2_Sphere_Sphere_ScGeom6D(interactionDetectionFactor=intRadius, label='SSgeom'),Ig2_Box_Sphere_ScGeom6D()],
		[Ip2_FrictMat_FrictMat_MindlinPhys(label="hertzIp")],
		[Law2_ScGeom_MindlinPhys_Mindlin(includeAdhesion=True,label='hertzLaw')],label="iloop"
	),
	FlowEngine(dead=1,label="flow",multithread=False),	GlobalStiffnessTimeStepper(active=1,timeStepUpdateInterval=100,timestepSafetyCoefficient=0.8),
	TriaxialStressController(thickness=0,stressMask=7,internalCompaction=False,label='triax'),
	NewtonIntegrator(gravity=(0,0,0), damping=0.4,label='newton')
]
setContactFriction(radians(finalFricDegree))
SSgeom.interactionDetectionFactor=1.
Saabb.aabbEnlargeFactor=1.
flow.dead=0
flow.debug=0
#flow.fluidBulkModulus=2.2e9
flow.defTolerance=-1
flow.meshUpdateInterval=200
flow.useSolver=3
flow.permeabilityFactor=1
flow.viscosity=0.001

O.dynDt=False

newton.damping=0

triax.internalCompaction=False
triax.wall_bottom_activated=False
triax.stressMask=2
triax.goal1=triax.goal3=0
triax.goal2=-11000

flow.bndCondIsPressure=[0,0,0,1,0,0]
flow.bndCondValue=[0,0,0,0,0,0]
flow.boundaryUseMaxMin=[0,0,0,0,0,0]
O.dt=0.1e-3
O.dynDt=False

from yade import plot

def history():
	plot.addData(t=O.time,p=flow.getPorePressure((xsup/2,ysup/2,zsup/2)),
	unbal = unbalancedForce(),
	displacement=triax.depth0-triax.depth,
	P = abs(O.forces.f(4)[2]),
	mem = psutil.Process(os.getpid()).memory_info().rss/1e6	,
	speed = O.speed
	)

O.engines=O.engines+[PyRunner(dead=0,iterPeriod=iterper,command='history()',label='recorder')]

plot.plots={'t':(('speed')),'t ':(('unbal')),' t':(('mem'))}
plot.plot()

O.run()

-- 
You received this question notification because your team yade-users is
an answer contact for Yade.