Skip to content

Commit

Permalink
Finish adding thread object to H5TS package. Refactor Mercury threadpool
Browse files Browse the repository at this point in the history
and remaining subfiling code to use H5TS code.  Remove Mercury thread, mutex,
and condition objects.

Signed-off-by: Quincey Koziol <[email protected]>
  • Loading branch information
qkoziol committed Mar 20, 2024
1 parent aab302e commit 6d9e35d
Show file tree
Hide file tree
Showing 26 changed files with 199 additions and 597 deletions.
3 changes: 0 additions & 3 deletions src/H5FDsubfiling/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,7 @@ if (HDF5_ENABLE_SUBFILING_VFD)

# Add mercury util sources to Subfiling VFD sources
set (MERCURY_UTIL_SOURCES
${H5FD_SUBFILING_MERCURY_DIR}/mercury_thread.c
${H5FD_SUBFILING_MERCURY_DIR}/mercury_thread_condition.c
${H5FD_SUBFILING_MERCURY_DIR}/mercury_thread_pool.c
${H5FD_SUBFILING_MERCURY_DIR}/mercury_thread_mutex.c
)

set (HDF5_H5FD_SUBFILING_SOURCES
Expand Down
2 changes: 0 additions & 2 deletions src/H5FDsubfiling/H5FDioc_priv.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@
#include "H5subfiling_common.h"
#include "H5subfiling_err.h"

#include "mercury_thread.h"
#include "mercury_thread_mutex.h"
#include "mercury_thread_pool.h"

/*
Expand Down
6 changes: 3 additions & 3 deletions src/H5FDsubfiling/H5FDioc_threads.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
*/
typedef struct ioc_data_t {
ioc_io_queue_t io_queue;
hg_thread_t ioc_main_thread;
H5TS_thread_t ioc_main_thread;
hg_thread_pool_t *io_thread_pool;
int64_t sf_context_id;

Expand Down Expand Up @@ -179,7 +179,7 @@ initialize_ioc_threads(void *_sf_context)
H5_SUBFILING_GOTO_ERROR(H5E_RESOURCE, H5E_CANTINIT, (-1), "can't initialize IOC worker thread pool");

/* Create the main IOC thread that will receive and dispatch I/O requests */
if (hg_thread_create(&ioc_data->ioc_main_thread, ioc_thread_main, ioc_data) < 0)
if (H5TS_thread_create(&ioc_data->ioc_main_thread, ioc_thread_main, ioc_data) < 0)
H5_SUBFILING_GOTO_ERROR(H5E_RESOURCE, H5E_CANTINIT, (-1), "can't create IOC main thread");

/* Wait until ioc_main() reports that it is ready */
Expand Down Expand Up @@ -232,7 +232,7 @@ finalize_ioc_threads(void *_sf_context)
H5TS_mutex_destroy(&ioc_data->io_queue.q_mutex);

/* Wait for IOC main thread to exit */
hg_thread_join(ioc_data->ioc_main_thread);
H5TS_thread_join(ioc_data->ioc_main_thread);
}

if (ioc_data->io_queue.num_failed > 0)
Expand Down
2 changes: 2 additions & 0 deletions src/H5FDsubfiling/H5subfiling_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ static size_t sf_topology_cache_num_entries = 0;
static file_map_to_context_t *sf_open_file_map = NULL;
static int sf_file_map_size = 0;

#ifdef H5_SUBFILING_DEBUG
static H5TS_mutex_t subfiling_log_mutex = H5TS_MUTEX_INITIALIZER;
#endif

#define DEFAULT_CONTEXT_CACHE_SIZE 16
#define DEFAULT_TOPOLOGY_CACHE_SIZE 4
Expand Down
65 changes: 0 additions & 65 deletions src/H5FDsubfiling/mercury/src/util/mercury_thread.c

This file was deleted.

75 changes: 0 additions & 75 deletions src/H5FDsubfiling/mercury/src/util/mercury_thread.h

This file was deleted.

34 changes: 0 additions & 34 deletions src/H5FDsubfiling/mercury/src/util/mercury_thread_condition.c

This file was deleted.

116 changes: 0 additions & 116 deletions src/H5FDsubfiling/mercury/src/util/mercury_thread_condition.h

This file was deleted.

Loading

0 comments on commit 6d9e35d

Please sign in to comment.