Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/H5LS.c
Original file line number Diff line number Diff line change
Expand Up @@ -481,6 +481,10 @@ herr_t H5LSremove_cache(cache_storage_t *LS, cache_t *cache) {
LOG_DEBUG(-1, "Cache storage space left: %lu bytes\n", LS->mspace_left);
#endif

if (cache->path != NULL) {
free(cache->path);
cache->path = NULL;
}
free(cache);
cache = NULL;
}
Expand Down Expand Up @@ -511,6 +515,10 @@ herr_t H5LSremove_cache_all(cache_storage_t *LS) {
while (head != NULL) {
if (LS->io_node) {
ret_value = LS->mmap_cls->removeCacheFolder(head->cache->path);
if (head->cache->path != NULL) {
free(head->cache->path);
head->cache->path = NULL;
}
free(head->cache);
head->cache = NULL;
head = head->next;
Expand Down
18 changes: 9 additions & 9 deletions src/H5LS.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ typedef struct cache_t {
hsize_t mspace_per_rank_total; // total space per process
hsize_t mspace_per_rank_left; // space left per process
hid_t fd; // the associate file
char path[255]; // path
char *path; // dynamically allocated path
AccessHistory access_history;
} cache_t;

Expand Down Expand Up @@ -115,14 +115,14 @@ typedef struct _IO_THREAD {
// Memory mapped files
typedef struct _MMAP {
// for write
int fd; // file handle for write
char fname[255]; // full path of the memory mapped file
void *obj; // this will be used for cache data on global storage layer
void *buf; // pointer that map the file to the memory
void *tmp_buf; // temporally buffer, used for parallel read: copy the read
// buffer, return the H5Dread_to_cache function, the back
// ground thread write the data to the SSD.
hsize_t offset; // the offset of the memory map
int fd; // file handle for write
char *fname; // dynamically allocated full path of the memory mapped file
void *obj; // this will be used for cache data on global storage layer
void *buf; // pointer that map the file to the memory
void *tmp_buf; // temporally buffer, used for parallel read: copy the read
// buffer, return the H5Dread_to_cache function, the back
// ground thread write the data to the SSD.
hsize_t offset; // the offset of the memory map
} MMAP;

// Dataset
Expand Down
Loading