parallel scenes
Hi:
Follow the question 225080. I created 2 yade files and tried to run their scenes independently. But the 2files seems to use 1 omega?
I use the following codes to control my 2 files:
import liboofem
import threading, multiprocessing
import time
def solve1(n):
for i in range(500):
omega1.
omega1.step()
def solve2(n):
for i in range(500):
omega2.
omega2.step()
filename1=
filename2=
m1 = __import_
m2 = __import_
omega1 = m1.O
omega2 = m2.O
omega1.dt = 0.0001
print(omega2.dt)
#omega2.dt = 0.0001
for i in range(500):
m1.GenScene(i)
m2.GenScene(i)
the 2 yade files are exactly the same, and the following codes are one of them(Box.Sphere can be replaced by any sphere pack):
from libyade import yade
from yade import *
from yade import pack, Vector3, Vector3
def readsphere():
filename = 'Box.Sphere'
sphere=[]
a=open(
for i in range(int(
s = ((float(
sphere.append(s)
return sphere
SP = readsphere()
cellsize = Vector3.Ones
def randomPeriPack(
O.switchScene(); O.resetThisScene()
O.periodic=True
O.cell.
O.engines=
O.materials.
sp=SP
for s in sp: O.bodies.
O.dt=utils.
O.timingEnable
O.run();
O.wait()
cellsize = O.cell.size
for b in O.bodies: b.state.pos = O.cell.
ret=pack.
ret.fromSimula
O.switchScene()
print(
return ret
spack = randomPeriPack(
def GenScene(i):
if i != 0:
newScene = O.addScene()
O.switchToSce
print(
O.switchScene(); O.resetThisScene()
O.periodic = True
O.cell.
O.materials.
spack.
O.engines = [
ForceResetter(),
InsertionSort
InteractionLoop(
[Ig2_
[Ip2_
[Law2_
useIncremen
always_
)]),
NewtonIntegra
]
O.dt = 0.
O.step()
is2aabb.
ss2d3dg.
if the 2 files run independently, the output should be:
scene 1 created
scene 1 created
scene 2 created
scene 2 created
...
but the output is:
scene 1 created
scene 2 created
scene 3 created
...
why the 2 omegas are not independent? how can I parallel them? using different versions of YADE?
Yours,
Joe
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- Yade Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- zhou qian
- Solved:
- Last query:
- Last reply: