Skip to content

Commit

Permalink
adding tests
Browse files Browse the repository at this point in the history
  • Loading branch information
zhenghh04 committed Sep 20, 2023
1 parent 95c75b3 commit 68bf631
Show file tree
Hide file tree
Showing 11 changed files with 119 additions and 14 deletions.
2 changes: 0 additions & 2 deletions src/H5LS.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
13 changes: 5 additions & 8 deletions src/H5VLcache_ext.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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);
}
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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
Expand Down
16 changes: 16 additions & 0 deletions tests/test_global_merge.sh
Original file line number Diff line number Diff line change
@@ -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



14 changes: 14 additions & 0 deletions tests/test_global_ssd.sh
Original file line number Diff line number Diff line change
@@ -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


12 changes: 12 additions & 0 deletions tests/test_global_ssd_async.sh
Original file line number Diff line number Diff line change
@@ -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


14 changes: 14 additions & 0 deletions tests/test_local_mem.sh
Original file line number Diff line number Diff line change
@@ -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


14 changes: 14 additions & 0 deletions tests/test_local_mem_async.sh
Original file line number Diff line number Diff line change
@@ -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


16 changes: 16 additions & 0 deletions tests/test_local_merge.sh
Original file line number Diff line number Diff line change
@@ -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



14 changes: 14 additions & 0 deletions tests/test_local_ssd.sh
Original file line number Diff line number Diff line change
@@ -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


14 changes: 14 additions & 0 deletions tests/test_local_ssd_async.sh
Original file line number Diff line number Diff line change
@@ -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


4 changes: 0 additions & 4 deletions utils/debug.h
Original file line number Diff line number Diff line change
Expand Up @@ -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__)
Expand Down

0 comments on commit 68bf631

Please sign in to comment.