From cb61a02f27792e00fdb0e53897bed6a2eba2807a Mon Sep 17 00:00:00 2001 From: Matthew Larson Date: Thu, 5 Dec 2024 13:59:38 -0600 Subject: [PATCH] Add new connector stacks to CI --- .github/workflows/multithread_test.yml | 72 ++++++++++++++++++++++++ test/mt_passthru_wrapper_vol_connector.c | 35 +++++++++++- 2 files changed, 105 insertions(+), 2 deletions(-) diff --git a/.github/workflows/multithread_test.yml b/.github/workflows/multithread_test.yml index a4c296412b9..bc9451d9dec 100644 --- a/.github/workflows/multithread_test.yml +++ b/.github/workflows/multithread_test.yml @@ -111,6 +111,78 @@ jobs: run: | valgrind ./test/API/h5_api_test -maxthreads ${{ env.num_threads }} + - name: API Tests - ST to Native (Multi-threaded) + if: matrix.api_tests == '--enable-api-tests' && matrix.multi_thread == '--enable-multithread --disable-hl' + working-directory: ${{github.workspace}} + env: + HDF5_PLUGIN_PATH: ${{github.workspace}}/test/.libs + HDF5_VOL_CONNECTOR: "pass_through under_vol=0\\;under_info={}" + run: | + valgrind ./test/API/h5_api_test -maxthreads ${{ env.num_threads }} + + - name: API Tests - MT to Native (Multi-threaded) + if: matrix.api_tests == '--enable-api-tests' && matrix.multi_thread == '--enable-multithread --disable-hl' + working-directory: ${{github.workspace}} + env: + HDF5_PLUGIN_PATH: ${{github.workspace}}/test/.libs + HDF5_VOL_CONNECTOR: "mt_passthru_wrapper_vol_connector under_vol=0\\;under_info={}" + run: | + valgrind ./test/API/h5_api_test -maxthreads ${{ env.num_threads }} + + - name: API Tests - MT to MT Native Wrapper (Multi-threaded) + if: matrix.api_tests == '--enable-api-tests' && matrix.multi_thread == '--enable-multithread --disable-hl' + working-directory: ${{github.workspace}} + env: + HDF5_PLUGIN_PATH: ${{github.workspace}}/test/.libs + HDF5_VOL_CONNECTOR: "mt_passthru_wrapper_vol_connector under_vol=162\\;under_info={}" + run: | + valgrind ./test/API/h5_api_test -maxthreads ${{ env.num_threads }} + + - name: API Tests - ST to MT Native Wrapper (Multi-threaded) + if: matrix.api_tests == '--enable-api-tests' && matrix.multi_thread == '--enable-multithread --disable-hl' + working-directory: ${{github.workspace}} + env: + HDF5_PLUGIN_PATH: ${{github.workspace}}/test/.libs + HDF5_VOL_CONNECTOR: "pass_through under_vol=162\\;under_info={}" + run: | + valgrind ./test/API/h5_api_test -maxthreads ${{ env.num_threads }} + + - name: API Tests - MT to ST to Native (Multi-threaded) + if: matrix.api_tests == '--enable-api-tests' && matrix.multi_thread == '--enable-multithread --disable-hl' + working-directory: ${{github.workspace}} + env: + HDF5_PLUGIN_PATH: ${{github.workspace}}/test/.libs + HDF5_VOL_CONNECTOR: "mt_passthru_wrapper_vol_connector under_vol=1\\;under_info={under_vol=0\\;under_info={}}" + run: | + valgrind ./test/API/h5_api_test -maxthreads ${{ env.num_threads }} + + - name: API Tests - ST to MT to Native (Multi-threaded) + if: matrix.api_tests == '--enable-api-tests' && matrix.multi_thread == '--enable-multithread --disable-hl' + working-directory: ${{github.workspace}} + env: + HDF5_PLUGIN_PATH: ${{github.workspace}}/test/.libs + HDF5_VOL_CONNECTOR: "pass_through under_vol=163\\;under_info={under_vol=0\\;under_info={}}" + run: | + valgrind ./test/API/h5_api_test -maxthreads ${{ env.num_threads }} + + - name: API Tests - MT to ST to MT Native Wrapper (Multi-threaded) + if: matrix.api_tests == '--enable-api-tests' && matrix.multi_thread == '--enable-multithread --disable-hl' + working-directory: ${{github.workspace}} + env: + HDF5_PLUGIN_PATH: ${{github.workspace}}/test/.libs + HDF5_VOL_CONNECTOR: "mt_passthru_wrapper_vol_connector under_vol=1\\;under_info={under_vol=162\\;under_info={}}" + run: | + valgrind ./test/API/h5_api_test -maxthreads ${{ env.num_threads }} + + - name: API Tests - ST to MT to MT Native Wrapper (Multi-threaded) + if: matrix.api_tests == '--enable-api-tests' && matrix.multi_thread == '--enable-multithread --disable-hl' + working-directory: ${{github.workspace}} + env: + HDF5_PLUGIN_PATH: ${{github.workspace}}/test/.libs + HDF5_VOL_CONNECTOR: "pass_through under_vol=163\\;under_info={under_vol=162\\;under_info={}}" + run: | + valgrind ./test/API/h5_api_test -maxthreads ${{ env.num_threads }} + - name: MT VL Tests (Non-threaded) working-directory: ${{github.workspace}}/test/ run: | diff --git a/test/mt_passthru_wrapper_vol_connector.c b/test/mt_passthru_wrapper_vol_connector.c index b87ebc87ff5..0fb8fcbd177 100644 --- a/test/mt_passthru_wrapper_vol_connector.c +++ b/test/mt_passthru_wrapper_vol_connector.c @@ -81,6 +81,9 @@ static herr_t mt_pass_through_wrapper_free_obj(mt_pass_through_wra H5PL_type_t H5PLget_plugin_type(void); const void *H5PLget_plugin_info(void); +static herr_t mt_pass_through_wrapper_initialize(hid_t vipl_id); +static herr_t mt_pass_through_wrapper_terminate(void); + /* VOL info callbacks */ static void *mt_pass_through_wrapper_info_copy(const void *info); static herr_t mt_pass_through_wrapper_info_cmp(int *cmp_value, const void *info1, const void *info2); @@ -245,8 +248,8 @@ static const H5VL_class_t mt_pass_through_wrapper_g = { MT_PASSTHRU_WRAPPER_NAME, /* name */ 0, /* connector version */ 0, /* capability flags */ - NULL, /* initialize */ - NULL, /* terminate */ + mt_pass_through_wrapper_initialize, /* initialize */ + mt_pass_through_wrapper_terminate, /* terminate */ { /* info_cls */ sizeof(mt_pass_through_wrapper_info_t), /* size */ @@ -414,6 +417,34 @@ mt_pass_through_wrapper_free_obj(mt_pass_through_wrapper_t *obj) return 0; } /* end H5VL__pass_through_free_obj() */ + +static herr_t +mt_pass_through_wrapper_initialize(hid_t vipl_id) { + /* Initialize the Internal Passthrough VOL + * to support testing with multiple passthrough connectors + */ + hid_t passthru_id = H5I_INVALID_HID; + herr_t ret_value = 0; + + (void) vipl_id; + + if ((passthru_id = H5VL_PASSTHRU) < 0) + ret_value = -1; + + return ret_value; +} + +static herr_t +mt_pass_through_wrapper_terminate(void) { + /* Terminate the Internal Passthrough VOL */ + herr_t ret_value = 0; + + if (H5Idec_ref(H5VL_PASSTHRU) < 0) + ret_value = -1; + + return ret_value; +} + /*--------------------------------------------------------------------------- * Function: mt_pass_through_wrapper_info_copy *