[Hdf-forum] MPI Virtual File Driver
Biddiscombe, John A.
biddisco at cscs.ch
Wed Jan 20 03:23:04 EST 2010
Quincey
>> so what I've done is added the following to H5I.c inside the
>> H5I_clear_type(...) function.
> Hmm, I'd rather not mangle the H5I_clear_type() routine that way.
> Can you modify the H5FD_free_cls() routine to call the new terminate
> callback that you've added? That would fit perfectly with the library's
> design.
No problem. I see now that inside H5I_clear_type, where I added the following line
if (cls && cls->terminate) cls->terminate();
The very next line is the free class call. By moving the line above into the free class, we remove pollution of H5I and it works exactly as before. It's good. All is done.
Only one thing remains. Inside H5FD_term_interface, there used to be a large number of class terminate calls, which are no longer needed, but once removed, we are left with the small remnant below. This is ok, but you'll see that there's an outer check for 'if nmembers>0 then clear type(VFL)', and once they're cleared, there used to be 'if nmembers>0 terminate each class (= reset VFL drivers)' - this check is still there, but there's no code inside it. Question is : Does there need to be some error check or can we just delete the second if nmembers>0 call. Since H5I_clear_type should call free_cls which in turn calls terminate, the only possibility is a potential check of 'did the class terminate correctly (is nmembers>0 still?) if not show an error' but a) is it possible to check, b) do we really care, by now the class structure should have been freed anyway, so next time anyone attempts to use it an error would occur anyway. I assume we just delete the second check. Yes?
JB
int H5FD_term_interface(void)
{
int n = 0;
FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5FD_term_interface)
if(H5_interface_initialize_g) {
if((n=H5I_nmembers(H5I_VFL))!=0) {
H5I_clear_type(H5I_VFL, FALSE, FALSE);
/* Reset the VFL drivers, if they've been closed */
if(H5I_nmembers(H5I_VFL)==0) {
} /* end if */
} else {
H5I_dec_type_ref(H5I_VFL);
H5_interface_initialize_g = 0;
n = 1; /*H5I*/
}
}
FUNC_LEAVE_NOAPI(n)
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.hdfgroup.org/pipermail/hdf-forum_hdfgroup.org/attachments/20100120/b9e54529/attachment.html>
More information about the Hdf-forum
mailing list