[firedrake] Dumbcheckpointing

Floriane Gidel [RPG] mmfg at leeds.ac.uk
Sun Nov 12 09:33:11 GMT 2017


Problem solved by adding the functions' name:

h_n0 = Function(V, name="h")


Why is it not working without the name?

Thanks,

Floriane

________________________________
De : firedrake-bounces at imperial.ac.uk <firedrake-bounces at imperial.ac.uk> de la part de Floriane Gidel [RPG] <mmfg at leeds.ac.uk>
Envoyé : samedi 11 novembre 2017 10:34:55
À : firedrake
Objet : Re: [firedrake] Dumbcheckpointing



Update: after some tests, I found that the error only occur when I define another mesh in the same code. Do you know what's going wrong ?

For instance:

res = 0.1

Nx = int(Lx/res) + 1

Ny = int(Ly/res) + 1


hor_mesh = RectangleMesh(Nx,Ny,Lx,Ly,quadrilateral=True)

V = FunctionSpace(hor_mesh, "CG", 1)

h_n1 = Function(V)


i=0

while i<100:

    dumb_file = DumbCheckpoint("h_"+str(i), mode=FILE_READ)

    dumb_file.load(h_n1)

    i+=1

works, but


Nx_aux = int(Lx/0.2) + 1

Ny_aux = int(Ly/0.1) + 1


aux_mesh = RectangleMesh(Nx_aux,Ny_aux,Lx,Ly,quadrilateral=True)


res = 0.1

Nx = int(Lx/res) + 1

Ny = int(Ly/res) + 1


hor_mesh = RectangleMesh(Nx,Ny,Lx,Ly,quadrilateral=True)

V = FunctionSpace(hor_mesh, "CG", 1)

h_n1 = Function(V)


i=0

while i<100:

    dumb_file = DumbCheckpoint("h_"+str(i), mode=FILE_READ)

    dumb_file.load(h_n1)

    i+=1


does not work:


Traceback (most recent call last):

  File "main.py", line 115, in <module>

    dumb_file.load(h_n1)

  File "/Users/mmfg/firedrake/src/firedrake/firedrake/checkpointing.py", line 237, in load

    v.load(self.vwr)

  File "PETSc/Vec.pyx", line 447, in petsc4py.PETSc.Vec.load (src/petsc4py.PETSc.c:95805)

petsc4py.PETSc.Error: error code 76

[0] VecLoad() line 925 in /private/var/folders/7h/wbj8xp7n3g5cfbr32ctcmwzcy3jf53/T/pip-yGXqPh-build/src/vec/vec/interface/vector.c

[0] VecLoad_Default() line 397 in /private/var/folders/7h/wbj8xp7n3g5cfbr32ctcmwzcy3jf53/T/pip-yGXqPh-build/src/vec/vec/utils/vecio.c

[0] VecLoad_HDF5() line 257 in /private/var/folders/7h/wbj8xp7n3g5cfbr32ctcmwzcy3jf53/T/pip-yGXqPh-build/src/vec/vec/utils/vecio.c

[0] Error in external library

[0] Error in HDF5 call H5Dopen2() Status -1

Exception RuntimeError: RuntimeError("Can't decrement id ref count (Can't close file, there are objects still open)",) in 'h5py._objects.ObjectID.__dealloc__' ignored

________________________________
De : firedrake-bounces at imperial.ac.uk <firedrake-bounces at imperial.ac.uk> de la part de Floriane Gidel [RPG] <mmfg at leeds.ac.uk>
Envoyé : vendredi 10 novembre 2017 19:04:12
À : firedrake
Objet : [firedrake] Dumbcheckpointing

Dear all,

I saved a function h using DumbCheckpoint through:
res = 0.1

Nx = int(Lx/res) + 1

Ny = int(Ly/res) + 1


hor_mesh = RectangleMesh(Nx,Ny,Lx,Ly,quadrilateral=True)

V = FunctionSpace(hor_mesh, "CG", 1)

h_n0 = Function(V)


...

[assign value to h_n0]

...


h_data = DumbCheckpoint("h", mode=FILE_CREATE)

h_data.store(h_n0)


 When trying to load it in another code, with:

res = 0.1

Nx = int(Lx/res) + 1

Ny = int(Ly/res) + 1


hor_mesh = RectangleMesh(Nx,Ny,Lx,Ly,quadrilateral=True)

V = FunctionSpace(hor_mesh, "CG", 1)

h_n1 = Function(V)


dumb_file = DumbCheckpoint("h", mode=FILE_READ)

dumb_file.load(h_n1)


I get the following error:

  File "TOC.py", line 130, in <module>

    dumb_file.load(h_n1)

  File "/Users/mmfg/firedrake/src/firedrake/firedrake/checkpointing.py", line 237, in load

    v.load(self.vwr)

  File "PETSc/Vec.pyx", line 447, in petsc4py.PETSc.Vec.load (src/petsc4py.PETSc.c:95805)

petsc4py.PETSc.Error: error code 76

[0] VecLoad() line 925 in /private/var/folders/7h/wbj8xp7n3g5cfbr32ctcmwzcy3jf53/T/pip-yGXqPh-build/src/vec/vec/interface/vector.c

[0] VecLoad_Default() line 397 in /private/var/folders/7h/wbj8xp7n3g5cfbr32ctcmwzcy3jf53/T/pip-yGXqPh-build/src/vec/vec/utils/vecio.c

[0] VecLoad_HDF5() line 257 in /private/var/folders/7h/wbj8xp7n3g5cfbr32ctcmwzcy3jf53/T/pip-yGXqPh-build/src/vec/vec/utils/vecio.c

[0] Error in external library

[0] Error in HDF5 call H5Dopen2() Status -1

Exception RuntimeError: RuntimeError("Can't decrement id ref count (Can't close file, there are objects still open)",) in 'h5py._objects.ObjectID.__dealloc__' ignored



Do you know what this error mean ?


Thank you,

Floriane


-------------- next part --------------
HTML attachment scrubbed and removed


More information about the firedrake mailing list