From 68bf6313701f800bdf140ecf7abd14ba450f1113 Mon Sep 17 00:00:00 2001 From: Huihuo Zheng Date: Wed, 20 Sep 2023 17:29:06 -0500 Subject: [PATCH] adding tests --- src/H5LS.c | 2 -- src/H5VLcache_ext.c | 13 +++++-------- tests/test_global_merge.sh | 16 ++++++++++++++++ tests/test_global_ssd.sh | 14 ++++++++++++++ tests/test_global_ssd_async.sh | 12 ++++++++++++ tests/test_local_mem.sh | 14 ++++++++++++++ tests/test_local_mem_async.sh | 14 ++++++++++++++ tests/test_local_merge.sh | 16 ++++++++++++++++ tests/test_local_ssd.sh | 14 ++++++++++++++ tests/test_local_ssd_async.sh | 14 ++++++++++++++ utils/debug.h | 4 ---- 11 files changed, 119 insertions(+), 14 deletions(-) create mode 100755 tests/test_global_merge.sh create mode 100755 tests/test_global_ssd.sh create mode 100755 tests/test_global_ssd_async.sh create mode 100755 tests/test_local_mem.sh create mode 100755 tests/test_local_mem_async.sh create mode 100755 tests/test_local_merge.sh create mode 100755 tests/test_local_ssd.sh create mode 100755 tests/test_local_ssd_async.sh diff --git a/src/H5LS.c b/src/H5LS.c index 61d292a..6f30cd3 100644 --- a/src/H5LS.c +++ b/src/H5LS.c @@ -449,8 +449,6 @@ herr_t H5LSremove_cache(cache_storage_t *LS, cache_t *cache) { LS->mmap_cls->removeCacheFolder(cache->path); CacheList *head = LS->cache_head; - assert(head != NULL); - assert(head->cache != NULL); while (head != NULL && head->cache != NULL && head->cache != cache) { head = head->next; } diff --git a/src/H5VLcache_ext.c b/src/H5VLcache_ext.c index f16c13a..95c91e6 100644 --- a/src/H5VLcache_ext.c +++ b/src/H5VLcache_ext.c @@ -1008,7 +1008,7 @@ static herr_t H5VL_cache_ext_init(hid_t vipl_id) { H5LS_stack->next = NULL; if (!getenv("ABT_THREAD_STACKSIZE")) setenv("ABT_THREAD_STACKSIZE", "100000", 1); - setenv("HDF5_ASYNC_DISABLE_IMPLICIT_NON_DSET_RW", "1", 1); + //setenv("HDF5_ASYNC_DISABLE_IMPLICIT_NON_DSET_RW", "1", 1); // async_close_task_list = (object_close_task_t *) // malloc(sizeof(object_close_task_t)); async_close_task_list->next = NULL; // async_close_task_current = async_close_task_list; @@ -1080,6 +1080,7 @@ static herr_t H5VL_cache_ext_term(void) { H5LS_stack_t *p; while (H5LS_stack != NULL) { p = H5LS_stack; + free(p->H5LS); free(p); H5LS_stack = H5LS_stack->next; } @@ -4460,13 +4461,12 @@ static herr_t H5VL_cache_ext_file_close(void *file, hid_t dxpl_id, void **req) { if (o->async_close && o->write_cache && o->async_under) { while (o->async_close_task_current != NULL) { async_close_task_wait(o->async_close_task_current); - o->async_close_task_current = o->async_close_task_current->next; #ifndef NDEBUG - LOG_DEBUG(-1, "delay close object: %d", o->async_close_task_current->type); +#endif + o->async_close_task_current = o->async_close_task_current->next; -#endif } free_async_close_list(o->async_close_task_head); } @@ -5827,9 +5827,6 @@ static herr_t create_file_cache_on_local_storage(void *obj, void *file_args, H5LSregister_cache(file->H5LS, file->H5DWMM->cache, (void *)file)); file->H5LS->cache_head = file->H5LS->cache_list; file->H5LS->cache_list = file->H5LS->cache_list->next; - LOG_DEBUG(-1, "cache %ld\n", file->H5DWMM->cache); - // assert(file->H5LS->cache_list->cache==file->H5DWMM->cache); - LOG_DEBUG(-1, "cache_head->cache %ld\n", file->H5LS->cache_head->cache); file->H5DWMM->io->offset_current = 0; file->H5DWMM->mmap->offset = 0; } @@ -6034,7 +6031,6 @@ static herr_t create_dataset_cache_on_local_storage(void *obj, void *dset_args, } H5LSregister_cache(dset->H5LS, dset->H5DRMM->cache, obj); - dset->H5LS->cache_head = dset->H5LS->cache_list; dset->H5LS->cache_list = dset->H5LS->cache_list->next; // create mmap window hsize_t ss = round_page(dset->H5DRMM->dset.size); @@ -6680,6 +6676,7 @@ static herr_t create_dataset_cache_on_global_storage(void *obj, void *dset_args, LOG_DEBUG(-1, "Create dataset in parent group done"); #endif H5LSregister_cache(dset->H5LS, dset->H5DWMM->cache, obj); +// dset->H5LS->cache_head = dset->H5LS->cache_list; dset->H5LS->cache_list = dset->H5LS->cache_list->next; // create mmap window #ifndef NDEBUG diff --git a/tests/test_global_merge.sh b/tests/test_global_merge.sh new file mode 100755 index 0000000..516e97c --- /dev/null +++ b/tests/test_global_merge.sh @@ -0,0 +1,16 @@ +export HDF5_PLUGIN_PATH=/home/huihuo.zheng/workspace/exahdf5/soft//hdf5/vol/lib +export HDF5_VOL_CONNECTOR="cache_ext config=cache_1.cfg;under_vol=512;under_info={under_vol=0;under_info={}}" +export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HDF5_PLUGIN_PATH +mkdir -p SSD +echo " +HDF5_CACHE_STORAGE_TYPE: SSD +HDF5_CACHE_STORAGE_PATH: SSD +HDF5_CACHE_STORAGE_SCOPE: GLOBAL +HDF5_CACHE_STORAGE_SIZE: 1287558138880 +HDF5_CACHE_FUSION_THRESHOLD: 16777216 +HDF5_CACHE_WRITE_BUFFER_SIZE: 10485760000 +" > cache_1.cfg +HDF5_CACHE_WR=yes mpirun -np 2 write_cache.exe --dim 1024 1 --collective + + + diff --git a/tests/test_global_ssd.sh b/tests/test_global_ssd.sh new file mode 100755 index 0000000..31a2880 --- /dev/null +++ b/tests/test_global_ssd.sh @@ -0,0 +1,14 @@ +export HDF5_PLUGIN_PATH=/home/huihuo.zheng/workspace/exahdf5/soft//hdf5/vol/lib +export HDF5_VOL_CONNECTOR="cache_ext config=cache_1.cfg;under_vol=512;under_info={under_vol=0;under_info={}}" +export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HDF5_PLUGIN_PATH +mkdir -p SSD +echo " +HDF5_CACHE_STORAGE_TYPE: SSD +HDF5_CACHE_STORAGE_PATH: SSD +HDF5_CACHE_STORAGE_SCOPE: GLOBAL +HDF5_CACHE_STORAGE_SIZE: 1287558138880 +HDF5_CACHE_WRITE_BUFFER_SIZE: 10485760000 +" > cache_1.cfg +HDF5_CACHE_WR=yes mpirun -np 2 write_cache.exe + + diff --git a/tests/test_global_ssd_async.sh b/tests/test_global_ssd_async.sh new file mode 100755 index 0000000..83403f7 --- /dev/null +++ b/tests/test_global_ssd_async.sh @@ -0,0 +1,12 @@ +export HDF5_PLUGIN_PATH=/home/huihuo.zheng/workspace/exahdf5/soft//hdf5/vol/lib +export HDF5_VOL_CONNECTOR="cache_ext config=cache_1.cfg;under_vol=512;under_info={under_vol=0;under_info={}}" +export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HDF5_PLUGIN_PATH +mkdir -p SSD +echo "HDF5_CACHE_STORAGE_TYPE: SSD +HDF5_CACHE_STORAGE_PATH: SSD +HDF5_CACHE_STORAGE_SCOPE: GLOBAL +HDF5_CACHE_STORAGE_SIZE: 1287558138880 +HDF5_CACHE_WRITE_BUFFER_SIZE: 10485760000" > cache_1.cfg +HDF5_CACHE_WR=yes mpirun -np 2 write_cache.exe --async_close + + diff --git a/tests/test_local_mem.sh b/tests/test_local_mem.sh new file mode 100755 index 0000000..7c8959e --- /dev/null +++ b/tests/test_local_mem.sh @@ -0,0 +1,14 @@ +export HDF5_PLUGIN_PATH=/home/huihuo.zheng/workspace/exahdf5/soft//hdf5/vol/lib +export HDF5_VOL_CONNECTOR="cache_ext config=cache_1.cfg;under_vol=512;under_info={under_vol=0;under_info={}}" +export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HDF5_PLUGIN_PATH +mkdir -p SSD +echo " +HDF5_CACHE_STORAGE_TYPE: MEMORY +HDF5_CACHE_STORAGE_PATH: SSD +HDF5_CACHE_STORAGE_SCOPE: LOCAL +HDF5_CACHE_STORAGE_SIZE: 1287558138880 +HDF5_CACHE_WRITE_BUFFER_SIZE: 10485760000 +" > cache_1.cfg +HDF5_CACHE_WR=yes mpirun -np 2 write_cache.exe + + diff --git a/tests/test_local_mem_async.sh b/tests/test_local_mem_async.sh new file mode 100755 index 0000000..8abb077 --- /dev/null +++ b/tests/test_local_mem_async.sh @@ -0,0 +1,14 @@ +export HDF5_PLUGIN_PATH=/home/huihuo.zheng/workspace/exahdf5/soft//hdf5/vol/lib +export HDF5_VOL_CONNECTOR="cache_ext config=cache_1.cfg;under_vol=512;under_info={under_vol=0;under_info={}}" +export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HDF5_PLUGIN_PATH +mkdir -p SSD +echo " +HDF5_CACHE_STORAGE_TYPE: MEMORY +HDF5_CACHE_STORAGE_PATH: SSD +HDF5_CACHE_STORAGE_SCOPE: LOCAL +HDF5_CACHE_STORAGE_SIZE: 1287558138880 +HDF5_CACHE_WRITE_BUFFER_SIZE: 10485760000 +" > cache_1.cfg +HDF5_CACHE_WR=yes mpirun -np 2 write_cache.exe --async_close + + diff --git a/tests/test_local_merge.sh b/tests/test_local_merge.sh new file mode 100755 index 0000000..edbdbae --- /dev/null +++ b/tests/test_local_merge.sh @@ -0,0 +1,16 @@ +export HDF5_PLUGIN_PATH=/home/huihuo.zheng/workspace/exahdf5/soft//hdf5/vol/lib +export HDF5_VOL_CONNECTOR="cache_ext config=cache_1.cfg;under_vol=512;under_info={under_vol=0;under_info={}}" +export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HDF5_PLUGIN_PATH +mkdir -p SSD +echo " +HDF5_CACHE_STORAGE_TYPE: MEMORY +HDF5_CACHE_STORAGE_PATH: SSD +HDF5_CACHE_STORAGE_SCOPE: LOCAL +HDF5_CACHE_STORAGE_SIZE: 1287558138880 +HDF5_CACHE_FUSION_THRESHOLD: 16777216 +HDF5_CACHE_WRITE_BUFFER_SIZE: 10485760000 +" > cache_1.cfg +HDF5_CACHE_WR=yes mpirun -np 2 write_cache.exe --dim 1024 1 --collective + + + diff --git a/tests/test_local_ssd.sh b/tests/test_local_ssd.sh new file mode 100755 index 0000000..6ce8553 --- /dev/null +++ b/tests/test_local_ssd.sh @@ -0,0 +1,14 @@ +export HDF5_PLUGIN_PATH=/home/huihuo.zheng/workspace/exahdf5/soft//hdf5/vol/lib +export HDF5_VOL_CONNECTOR="cache_ext config=cache_1.cfg;under_vol=512;under_info={under_vol=0;under_info={}}" +export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HDF5_PLUGIN_PATH +mkdir -p SSD +echo " +HDF5_CACHE_STORAGE_TYPE: SSD +HDF5_CACHE_STORAGE_PATH: SSD +HDF5_CACHE_STORAGE_SCOPE: LOCAL +HDF5_CACHE_STORAGE_SIZE: 1287558138880 +HDF5_CACHE_WRITE_BUFFER_SIZE: 10485760000 +" > cache_1.cfg +HDF5_CACHE_WR=yes mpirun -np 2 write_cache.exe + + diff --git a/tests/test_local_ssd_async.sh b/tests/test_local_ssd_async.sh new file mode 100755 index 0000000..7877db2 --- /dev/null +++ b/tests/test_local_ssd_async.sh @@ -0,0 +1,14 @@ +export HDF5_PLUGIN_PATH=/home/huihuo.zheng/workspace/exahdf5/soft//hdf5/vol/lib +export HDF5_VOL_CONNECTOR="cache_ext config=cache_1.cfg;under_vol=512;under_info={under_vol=0;under_info={}}" +export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HDF5_PLUGIN_PATH +mkdir -p SSD +echo " +HDF5_CACHE_STORAGE_TYPE: SSD +HDF5_CACHE_STORAGE_PATH: SSD +HDF5_CACHE_STORAGE_SCOPE: LOCAL +HDF5_CACHE_STORAGE_SIZE: 1287558138880 +HDF5_CACHE_WRITE_BUFFER_SIZE: 10485760000 +" > cache_1.cfg +HDF5_CACHE_WR=yes mpirun -np 2 write_cache.exe --async_close + + diff --git a/utils/debug.h b/utils/debug.h index 18177a6..d8ea24a 100644 --- a/utils/debug.h +++ b/utils/debug.h @@ -69,10 +69,6 @@ void log_init(int rank); sprintf(msg_debug, __VA_ARGS__); \ log_trace(__FILE__, __func__, __LINE__, X, msg_debug); \ } -//#define LOG_DEBUG(...) log_debug(__FILE__, __func__, __LINE__, __VA_ARGS__) -//#define LOG_ERROR(...) log_error(__FILE__, __func__, __LINE__, __VA_ARGS__) -//#define LOG_WARN(...) log_warn(__FILE__, __func__, __LINE__, __VA_ARGS__) -//#define LOG_INFO(...) log_info(__FILE__, __func__, __LINE__, __VA_ARGS__) #define malloc(...) my_malloc(__FILE__, __LINE__, __FUNCTION__, __VA_ARGS__) #define free(...) my_free(__FILE__, __LINE__, __FUNCTION__, __VA_ARGS__) #define calloc(...) my_calloc(__FILE__, __LINE__, __FUNCTION__, __VA_ARGS__)