### mpi code for parallel resolution

149
views
0
6 months ago by
Dear all,
thank you in advance for the help.

I'm trying to run the following code in parallel on 200 k elements mesh, typing    "mpirun -n np python demo.py":

(uu0,pp0) = w0.split(True)
delta1.update(uu0, nu,dt, kappa1, u_in, diameter)
delta2.update(uu0, nu, dt, kappa2, u_in, diameter)

cell1.update(uu0, nu,dt, kappa1, u_in, diameter)
cell2.update(uu0, nu, dt, kappa2, u_in, diameter)
DELTA1= interpolate(delta1, DGeW)
DELTA2=interpolate(delta2, DGeW)
CELL1= interpolate(cell1, DGeW)
CELL2=interpolate(cell2, DGeW)
#Save deltas
Delta1_vtk<< (DELTA1,t)
Delta2_vtk<< (DELTA2,t)
Cell1_vtk<< (CELL1,t)
Cell2_vtk<< (CELL2,t)

#CFL number
h = CellSize(mesh)
CFL = project(sqrt(inner(uu0,uu0))*dt/h, DGeW)

CFL_vtk<< (CFL,t)

J = derivative (F,w,dw)

# Define variational problem
pde = NonlinearVariationalProblem(F,w,bc,J)
solver = NonlinearVariationalSolver(pde)
prm = solver.parameters
prm["newton_solver"]["absolute_tolerance"] = 1E-8
prm["newton_solver"]["relative_tolerance"] = 1E-7
solver.solve()

(u, p) = w.split()
p_vtk<< (p,t)
u_vtk<< (u,t)

Unfortunately we don't see any time advantage, actually we verify an increment for the resolution time when we increase the processor number. Is there something wrong?

Thank you very much again
Best Regards
M Pesarin
Community: FEniCS Project