hdf5/src/H5FDmulti_private.h

46 lines
1.6 KiB
C
Raw Normal View History

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
* terms governing use, modification, and redistribution, is contained in *
* the LICENSE file, which can be found at the root of the source code *
* distribution tree, or in https://www.hdfgroup.org/licenses. *
* If you do not have access to either file, you may request a copy from *
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
Refactor H5FD and package initialization (#4934) - Reverts PR#1024, which (unnecessarily) switched from deferred package initialization to centralized initialization of all packages and introduced H5FDperform_init() to wrap an internal routine to initialize VFD plugins. - Went back to deferred package initialization (primarily), to eliminate unnecessary resource use. (Performance has been verified to be the same either way) - Switched VFD plugins to use “#define (H5OPEN, )” pattern, with registration of internal VFD plugins at library initialization time. Eliminates calling API routine (H5FDperform_init) from within the library, which was deadlocking threadsafe concurrency. And also eliminates exposing internal library routines in a public header file. - Removed copy-and-paste replicas of the H5OPEN macro and put a (better) single definition in H5public.h - Separated API and internal routine calls in stdio and multi VFD plugins into separate source files, so that the library doesn’t invoke API routines internally (also a deadlock problem for threadsafe concurrency). Also needed a “private” header for these plugins. - Separated registering/unregistering a VFD plugin from initializing /finalizing the plugin, instead of blurring those ideas together. Defers the VFD plugin init to when it’s actually used, which reduces resource usage, especially for the MPI-based plugins like the subfiling, etc. - Refactored the copy-and-pasted check for locking into a central location in the H5FD.c code. - Fixed a bunch of compiler warnings, especially ones that trigger CI failures with -Werror
2024-10-24 21:28:40 +08:00
* Purpose: The private header file for the multi VFD
*/
Refactor H5FD and package initialization (#4934) - Reverts PR#1024, which (unnecessarily) switched from deferred package initialization to centralized initialization of all packages and introduced H5FDperform_init() to wrap an internal routine to initialize VFD plugins. - Went back to deferred package initialization (primarily), to eliminate unnecessary resource use. (Performance has been verified to be the same either way) - Switched VFD plugins to use “#define (H5OPEN, )” pattern, with registration of internal VFD plugins at library initialization time. Eliminates calling API routine (H5FDperform_init) from within the library, which was deadlocking threadsafe concurrency. And also eliminates exposing internal library routines in a public header file. - Removed copy-and-paste replicas of the H5OPEN macro and put a (better) single definition in H5public.h - Separated API and internal routine calls in stdio and multi VFD plugins into separate source files, so that the library doesn’t invoke API routines internally (also a deadlock problem for threadsafe concurrency). Also needed a “private” header for these plugins. - Separated registering/unregistering a VFD plugin from initializing /finalizing the plugin, instead of blurring those ideas together. Defers the VFD plugin init to when it’s actually used, which reduces resource usage, especially for the MPI-based plugins like the subfiling, etc. - Refactored the copy-and-pasted check for locking into a central location in the H5FD.c code. - Fixed a bunch of compiler warnings, especially ones that trigger CI failures with -Werror
2024-10-24 21:28:40 +08:00
#ifndef H5FDmulti_private_H
#define H5FDmulti_private_H
/* Include VFD's public header */
#include "H5FDmulti.h" /* multi VFD */
/* Private headers needed by this file */
#include "H5FDprivate.h" /* File drivers */
/**************************/
/* Library Private Macros */
/**************************/
/****************************/
/* Library Private Typedefs */
/****************************/
/*****************************/
/* Library Private Variables */
/*****************************/
/* multi VFD's class struct */
H5_DLLVAR const H5FD_class_t H5FD_multi_g;
/******************************/
/* Library Private Prototypes */
/******************************/
Refactor H5FD and package initialization (#4934) - Reverts PR#1024, which (unnecessarily) switched from deferred package initialization to centralized initialization of all packages and introduced H5FDperform_init() to wrap an internal routine to initialize VFD plugins. - Went back to deferred package initialization (primarily), to eliminate unnecessary resource use. (Performance has been verified to be the same either way) - Switched VFD plugins to use “#define (H5OPEN, )” pattern, with registration of internal VFD plugins at library initialization time. Eliminates calling API routine (H5FDperform_init) from within the library, which was deadlocking threadsafe concurrency. And also eliminates exposing internal library routines in a public header file. - Removed copy-and-paste replicas of the H5OPEN macro and put a (better) single definition in H5public.h - Separated API and internal routine calls in stdio and multi VFD plugins into separate source files, so that the library doesn’t invoke API routines internally (also a deadlock problem for threadsafe concurrency). Also needed a “private” header for these plugins. - Separated registering/unregistering a VFD plugin from initializing /finalizing the plugin, instead of blurring those ideas together. Defers the VFD plugin init to when it’s actually used, which reduces resource usage, especially for the MPI-based plugins like the subfiling, etc. - Refactored the copy-and-pasted check for locking into a central location in the H5FD.c code. - Fixed a bunch of compiler warnings, especially ones that trigger CI failures with -Werror
2024-10-24 21:28:40 +08:00
#endif /* H5FDmulti_private_H */