Problems about the flow.multithread
I've been using the "flow.multithread" to accelerate the calculation speed of problems about saturated soil recently. I've encounter several problems about the "flow.multithread".
1. When I write "multithread=True" before the simulation begins, just like the following, it reports that Segmentation fault (core dumped).
########
O.engines=[
...
FlowEngine(
...
]
########
However, if I don't set multithread=True at the first time I define the flow engine, set flow.multithrea
2. When I set flow.multithrea
I'm using the
Linux version 5.4.0-47-generic (buildd@
Yade 20201007-
Here's a MWE to produce the error. Through the VTK file can get the period error.
#######
from yade import pack,export
SoilMat=
O.materials.
mn,mx=Vector3(
walls=aabbWalls
wallIds=
snum=1000
sp=pack.
sp.makeCloud(
sp.toSimulation
Target_
triax=TriaxialS
stressMask = 7,
thickness = 0,
internalCompac
)
Pressure=10000
flow=FlowEngine(
dead=1,
defTolerance=
meshUpdateInte
useSolver=3,
#multithread=True,
permeabilityFa
bndCondIsPress
bndCondValue=
boundaryUseMax
viscosity=0.00089 #The dynamic viscosity of water is 8.90*10-4 Pa`s at about 25 degree.
)
newton=
#Engine of the simulation
O.engines=[
ForceResetter(),
InsertionSortC
InteractionLoop(
[Ig2_
[Ip2_
[Law2_
),
GlobalStiffnes
flow,
triax,
PyRunner(
newton,
PyRunner(
]
triax.goal1=
while 1:
O.run(1000,True)
if unbalancedForce
break
Monitor.dead=1
vtksaver2.dead=0
flow.dead=0
triax.internalC
triax.stressMask=0
triax.goal1=
O.run(1,1)
flow.multithrea
#######
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- Yade Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- Robert Caulk
- Solved:
- 2020-10-09
- Last query:
- 2020-10-09
- Last reply:
- 2020-10-09
|
#1 |
Looks like you bumped into 2 bugs in FlowEngine. But neither bug is catastrophic. You'll see below that I do not have time to debug these for you - but you are more than welcome to chase them down yourself if for some reason you find it worth while (probably only worth your time if you want to learn how FlowEngine actually works, otherwise these two bug fixes don't really improve much besides "quality of life").
>1. When I write "multithread=True" before the simulation begins, just like the following, it reports that Segmentation fault (core dumped).
I just spent some time looking into this bug, it is not immediately clear to me why this is happening. It is clearly a first run initiation bug - but at the moment I do not have a lot of extra time to debug the feature, especially since it works by activating multithread after 1 step. I would say, if it is working after running a single step then activating multithread - just keep using it like that. There is no computational gain from running multithread for a single extra step.
>After certain steps, all pore pressure turn to zero and the next step everything is back to normal again. This error occurs at a fixed interval.
It is a benign bug with saveVTK, if you ask for it to print too frequently in addition to flow.multithread, there may be a period where it hasn't updated itself to print from the correct triangulation despite Yade still using the correct triangulation for pressure force computations internally. In other words: I verify that the pore pressure inside Yade is not actually 0, that is simply an artifact of carrying around multiple solvers. it is simply That is a low priority bug at the moment. Again if you want to spend time learning the inner workings of yade I will point you to the noCache flag - I believe that is the reason saveVTK is incorrectly grabbing the triangulation periodically in such case.
Cheers,
Robert
Huang peilun (hpl16) said : | #2 |
Thanks Robert Caulk, that solved my question.