Hi, I am trying to use parallel computing method and write a XDMF file as a result.
from dolfin import *
import math
from mpi4py import MPI
comm = MPI.COMM_WORLD
height = 1.
width = 1.
t = Constant(0.0)
set_log_level(30)
parameters["form_compiler"]["cpp_optimize"] = True
parameters["form_compiler"]["representation"] = "uflacs"
parameters["form_compiler"]["cpp_optimize_flags"] = "-O3 -ffast-math -march=native"
parameters["form_compiler"]["quadrature_degree"] = 2
mesh = Mesh()
mesh = BoxMesh(comm, Point(0,0,0), Point(width,height,width), 10, 10, 10)
x = SpatialCoordinate(mesh)
ELEMENT = VectorElement("Lagrange", mesh.ufl_cell(), 1)
FS = FunctionSpace(mesh, ELEMENT)
wtest = TestFunction(FS)
w = Function(FS)
dw = TrialFunction(FS)
output_file = XDMFFile(comm, "output.xdmf")
output_file.parameters["flush_output"] = True
output_file.parameters["functions_share_mesh"] = True
u_v = project(w,FS)
u_v.rename("disp", "Displacement")
output_file.write(u_v, float(t))
output_file.close()
compiled it with: mpirun -n 4 python3 (filename).py
but an errors occur like this:
HDF5-DIAG: Error detected in HDF5 (1.10.7) MPI-process 0:
#000: ../../../src/H5F.c line 366 in H5Fcreate(): unable to create file
major: File accessibility
minor: Unable to open file
#001: ../../../src/H5Fint.c line 1713 in H5F_open(): unable to lock the file
major: File accessibility
minor: Unable to lock file
#002: ../../../src/H5FD.c line 1675 in H5FD_lock(): driver lock request failed
major: Virtual File Layer
minor: Unable to lock file
#003: ../../../src/H5FDsec2.c line 990 in H5FD__sec2_lock(): unable to lock file, errno = 11, error message = 'Resource temporarily unavailable'
major: Virtual File Layer
minor: Unable to lock file
HDF5-DIAG: Error detected in HDF5 (1.10.7) MPI-process 0:
#000: ../../../src/H5F.c line 366 in H5Fcreate(): unable to create file
major: File accessibility
minor: Unable to open file
#001: ../../../src/H5Fint.c line 1713 in H5F_open(): unable to lock the file
major: File accessibility
minor: Unable to lock file
#002: ../../../src/H5FD.c line 1675 in H5FD_lock(): driver lock request failed
major: Virtual File Layer
minor: Unable to lock file
#003: ../../../src/H5FDsec2.c line 990 in H5FD__sec2_lock(): unable to lock file, errno = 11, error message = 'Resource temporarily unavailable'
major: Virtual File Layer
minor: Unable to lock file
befor I ran the code, there is no file on the directory.
I think output.xdmf and output.h5 files were well generated because I could open the xdmf file in paraview, but I don’t know why the errors occur.
Thank you.