forked from Unidata/netcdf-c
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
618518c
commit bb6869b
Showing
10 changed files
with
106 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1207,7 +1207,7 @@ A user may encounter an incompatibility if any of the following appears in user | |
|
||
For additional information, see [Appendix B](#filters_appendixb). | ||
|
||
## Point of Contact {#filters_poc} | ||
## History {#filters_history} | ||
|
||
*Author*: Dennis Heimbigner<br> | ||
*Email*: [email protected]<br> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -49,7 +49,7 @@ to set the global plugin path to control plugin discovery. | |
Since the global path and the HDF5 and NCZarr paths are kept in | ||
sync, this means that both HDF5 and NCZarr will look in the same | ||
directories in order to locate specified plugins. | ||
[Appendix A](#pluginpath_appendixa) defines the current API for | ||
[Appendix E.1](#pluginpath_appendixe1) defines the current API for | ||
managing the global plugin path. | ||
|
||
Note that it is best practice for a client program to use the API | ||
|
@@ -70,53 +70,6 @@ initial plugin path is either: | |
|
||
This initial global plugin path will be propagated to HDF5 and NCZarr. | ||
|
||
### A Note About HDF5\_PLUGIN\_PATH | ||
|
||
## Appendix A. Programmatic Plugin Pathh API{#pluginpath_appendixa} | ||
|
||
The API makes use of a counted vector of strings representing the sequence of directories in the path. The relevant type definition is as follows. | ||
```` | ||
typedef struct NCPluginList {size_t ndirs; char** dirs;} NCPluginList; | ||
```` | ||
|
||
The API proposed in this PR looks like this (from netcdf-c/include/netcdf_filter.h). | ||
|
||
* ````int nc_plugin_path_ndirs(size_t* ndirsp);```` | ||
|
||
This function returns the number of directories in the sequence if internal directories of the internal plugin path list. | ||
|
||
The argument is as follows: | ||
- *ndirsp* store the number of directories in this memory. | ||
|
||
* ````int nc_plugin_path_get(NCPluginList* dirs);```` | ||
|
||
This function returns the current sequence of directories from the internal plugin path list. Since this function does not modify the plugin path, it does not need to be locked; it is only when used to get the path to be modified that locking is required. | ||
|
||
The argument is as follows: | ||
- *dirs* counted vector for storing the sequence of directies in the internal path list. | ||
|
||
If the value of *dirs.dirs is NULL (the normal case), then memory is allocated to hold the vector of directories. Otherwise, use the memory of *dirs.dirs* to hold the vector of directories. | ||
|
||
* ````int nc_plugin_path_set(const NCPluginList* dirs);```` | ||
|
||
This function empties the current internal path sequence and replaces it with the sequence of directories argument. Using an *ndirs* argument of 0 will clear the set of plugin paths. | ||
|
||
The argument are as follows: | ||
- *dirs* counted vector for storing the sequence of directies in the internal path list. | ||
|
||
*HDF5\_PLUGIN\_PATH* is a typical Windows or Unix style | ||
path-list. That is it is a sequence of absolute directory paths | ||
separated by a specific separator character. For Windows, the | ||
separator character is a semicolon (';') and for Unix, it is a | ||
colon (':'). | ||
|
||
At the moment, NetCDF optionally (i.e. not overridden) uses the | ||
existing HDF5 environment variable *HDF5\_PLUGIN\_PATH* to | ||
locate the directories in which plugin libraries are located. It | ||
also optionally uses the last directory in the path as the | ||
installation directory. This is used both for the HDF5 filter | ||
wrappers but also the NCZarr codec wrappers. | ||
|
||
## Installing Plugins at Build-Time | ||
|
||
At build-time, the target location directory into which libraries implementing plugins are installed is specified using a special *./configure* option | ||
|
@@ -147,7 +100,7 @@ or (cmake) | |
-DNETCDF_PLUGIN_INSTALL_DIR=NO | ||
```` | ||
|
||
### Multi-Threaded Access to the Plugin Path. | ||
## Multi-Threaded Access to the Plugin Path. | ||
Specifically, note that modifying the plugin path must be done "atomically". | ||
That is, in a multi-threaded environment, it is important that the sequence of actions involved in setting up the plugin path must be done by a single processor or in some other way as to guarantee that two or more processors are not simultaneously accessing the plugin path get/set operations. | ||
|
||
|
@@ -180,7 +133,52 @@ There is a complication with respect to the *nc_plugin_path_get* function. | |
It is possible for users to bypass the netcdf API and modify the HDF5 plugin paths directly. This can result in an inconsistent plugin path between the value | ||
used by HDF5 and the global value used by netcdf-c. Since there is no obvious fix for this, we warn the user of this possibility and otherwise ignore it. | ||
|
||
## Point of Contact {#pluginpath_poc} | ||
## Appendix E.1. Programmatic Plugin Path API{#pluginpath_appendixe1} | ||
|
||
The API makes use of a counted vector of strings representing the sequence of directories in the path. The relevant type definition is as follows. | ||
```` | ||
typedef struct NCPluginList {size_t ndirs; char** dirs;} NCPluginList; | ||
```` | ||
|
||
The API proposed in this PR looks like this (from netcdf-c/include/netcdf_filter.h). | ||
|
||
* ````int nc_plugin_path_ndirs(size_t* ndirsp);```` | ||
|
||
This function returns the number of directories in the sequence if internal directories of the internal plugin path list. | ||
|
||
The argument is as follows: | ||
- *ndirsp* store the number of directories in this memory. | ||
|
||
* ````int nc_plugin_path_get(NCPluginList* dirs);```` | ||
|
||
This function returns the current sequence of directories from the internal plugin path list. Since this function does not modify the plugin path, it does not need to be locked; it is only when used to get the path to be modified that locking is required. | ||
|
||
The argument is as follows: | ||
- *dirs* counted vector for storing the sequence of directies in the internal path list. | ||
|
||
If the value of *dirs.dirs is NULL (the normal case), then memory is allocated to hold the vector of directories. Otherwise, use the memory of *dirs.dirs* to hold the vector of directories. | ||
|
||
* ````int nc_plugin_path_set(const NCPluginList* dirs);```` | ||
|
||
This function empties the current internal path sequence and replaces it with the sequence of directories argument. Using an *ndirs* argument of 0 will clear the set of plugin paths. | ||
|
||
The argument are as follows: | ||
- *dirs* counted vector for storing the sequence of directies in the internal path list. | ||
|
||
*HDF5\_PLUGIN\_PATH* is a typical Windows or Unix style | ||
path-list. That is it is a sequence of absolute directory paths | ||
separated by a specific separator character. For Windows, the | ||
separator character is a semicolon (';') and for Unix, it is a | ||
colon (':'). | ||
|
||
At the moment, NetCDF optionally (i.e. not overridden) uses the | ||
existing HDF5 environment variable *HDF5\_PLUGIN\_PATH* to | ||
locate the directories in which plugin libraries are located. It | ||
also optionally uses the last directory in the path as the | ||
installation directory. This is used both for the HDF5 filter | ||
wrappers but also the NCZarr codec wrappers. | ||
|
||
## History {#pluginpath_history} | ||
|
||
*Author*: Dennis Heimbigner<br> | ||
*Email*: [email protected]<br> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters