I found that pvd is not well suited for my code. I want to use h5 format to save the solution at each time step in parallel. I want to know the hdf5 equivalent of
# solve for u and save at every time step
f = File("output.pvd")
while t < T:
u.vector() = u0.vector()
solve.solve() # solve for u
f << u, t
that paraview can read easily.