Assertion on H5Dwrite


I get this assertion displayed on a call to H5Dwrite

Assertion failed: f->file_id > 0, file ..\..\src\H5F.c, line 2344

The size of the written file upto this point of time is 191 MB .

What could have caused this assertion to be triggered ?. I am using hdf5
1.6.5 .

Thanks and Regards