Parallel Processing_error

Hello
I am using Fenics on Docker Windows

when i run a code with simple command python3 it runs properly, but issue is my system use only 1 or 2 logical processors and simulation is very slow but code run properly

when i try to use multi processor it produce errors
mpirun -n <no. of processors > python3

My Question is when code is running properly on single processor, than how i can run a code by using multiprocessors .???

Regards

You would need to provide a minimal code example that produces this error for anyone to give you any guidance.

‘’’
def g(v,n):
return (1.0 - (1.0 - exp(-Re)) * n ) / (1.0 - exp(-Re)) *
conditional(ge(v,vn),1.0,0.0)
- (1.0 - conditional(ge(v,vn),1.0,0.0))*n

def f(v,n):
return (-v+(vstar-pow(n,M))*(1.0-ufl.tanh(v-vh))*pow(v,2)*0.5)

def hr(xi,n):
return K1 * xi*xi / (1 + n) - K2 * n

Magnetic field

def mg(v,mf):
return Km1*v - Km2 * mf +mfe

def In(v,mf):
return Km0pow(alp,mfbet)lamln(alp)* v

def varAngle(s):
return ((thetaEpi - thetaEndo) * s + thetaEndo)/ 180.0 * pi

def normalizeAndProj_vec(u):
return project(u/sqrt(dot(u,u)),FiberSpace)

def normalize_vec(u):
return u/sqrt(dot(u,u))

def comptauv(T,Ta,beta,tauv):
return tauv/(1+beta*(T-Ta))

def comptaun(T,Q10,Ta,taun):
return taun*pow(Q10,(Ta-T)/10.0)

def comptauxi(T,Q10,Ta,tauxi):
return tauxi*pow(Q10,(Ta-T)/10.0)

def comptaumf(T,Q10,Ta,taumf):
return taumf*pow(Q10,(Ta-T)/10.0)

t = 0.0; dt = 0.1; Tfinal=750;

freqSave = 1; inc = 0

stim_t0 = dt; stim_t2 = 350; stim_dur = 2.0; stim_amp = 2.0

******* Create mesh and define function spaces **********

mesh = Mesh(“square.xml”)
bdry = MeshFunction(“size_t”, mesh, “square_facet_region.xml”)
ds = Measure(“ds”, subdomain_data=bdry)
nn = FacetNormal(mesh)
‘’’


its the error

First of all, you need to make sure the code is reproducable for others, i.e. avoid having external meshes as import.
Secondly, make sure you format the code in markdown syntax, i.e.

```python

def f(x):
    return x[0]
```

Thirdly, it is not adviced to use xml files when running in parallel. You should use xdmf files.

1 Like

thank you, i try with xdmf, and i will take care next time regarding your instructions