Skip to content

Commit

Permalink
debug5
Browse files Browse the repository at this point in the history
  • Loading branch information
brtnfld committed Dec 11, 2024
1 parent 84716a2 commit a3914ab
Showing 1 changed file with 31 additions and 10 deletions.
41 changes: 31 additions & 10 deletions src/H5VLcache_ext.c
Original file line number Diff line number Diff line change
Expand Up @@ -5661,15 +5661,30 @@ static herr_t create_dataset_cache_on_local_storage(void *obj, void *dset_args,

if (dset->H5LS->path != NULL) {
strcpy(dset->H5DRMM->cache->path, p->H5DRMM->cache->path); // create
strcat(dset->H5DRMM->cache->path, "/");
strcat(dset->H5DRMM->cache->path, name);
strcat(dset->H5DRMM->cache->path, "/");
strcpy(dset->H5DRMM->mmap->fname, dset->H5DRMM->cache->path);
strcat(dset->H5DRMM->mmap->fname, "/dset-mmap-");
strncat(dset->H5DRMM->cache->path, "/",
sizeof(dset->H5DRMM->cache->path) -
strlen(dset->H5DRMM->cache->path) - 1);
strncat(dset->H5DRMM->cache->path, name,
sizeof(dset->H5DRMM->cache->path) -
strlen(dset->H5DRMM->cache->path) - 1);
strncat(dset->H5DRMM->cache->path, "/",
sizeof(dset->H5DRMM->cache->path) -
strlen(dset->H5DRMM->cache->path) - 1);
strncpy(dset->H5DRMM->mmap->fname, dset->H5DRMM->cache->path,
sizeof(dset->H5DRMM->mmap->fname) - 1);
dset->H5DRMM->mmap->fname[sizeof(dset->H5DRMM->mmap->fname) - 1] =
'\0'; // Ensure null-termination
strncat(dset->H5DRMM->mmap->fname, "/dset-mmap-",
sizeof(dset->H5DRMM->mmap->fname) -
strlen(dset->H5DRMM->mmap->fname) - 1);
char cc[255];
int2char(dset->H5DRMM->mpi->rank, cc);
strcat(dset->H5DRMM->mmap->fname, cc);
strcat(dset->H5DRMM->mmap->fname, ".dat");
strncat(dset->H5DRMM->mmap->fname, cc,
sizeof(dset->H5DRMM->mmap->fname) -
strlen(dset->H5DRMM->mmap->fname) - 1);
strncat(dset->H5DRMM->mmap->fname, ".dat",
sizeof(dset->H5DRMM->mmap->fname) -
strlen(dset->H5DRMM->mmap->fname) - 1);
#ifndef NDEBUG

LOG_DEBUG(-1, "Dataset read cache created: %s",
Expand Down Expand Up @@ -5747,9 +5762,15 @@ static herr_t create_group_cache_on_local_storage(void *obj, void *group_args,
memcpy(group->H5DRMM->mpi, o->H5DRMM->mpi, sizeof(MPI_INFO));
if (group->H5LS->path != NULL) {
strcpy(group->H5DRMM->cache->path, o->H5DRMM->cache->path); // create
strcat(group->H5DRMM->cache->path, "/");
strcat(group->H5DRMM->cache->path, name);
strcat(group->H5DRMM->cache->path, "/");
size_t remaining_size = sizeof(group->H5DRMM->cache->path) -
strlen(group->H5DRMM->cache->path) - 1;
strncat(group->H5DRMM->cache->path, "/", remaining_size);
remaining_size = sizeof(group->H5DRMM->cache->path) -
strlen(group->H5DRMM->cache->path) - 1;
strncat(group->H5DRMM->cache->path, name, remaining_size);
remaining_size = sizeof(group->H5DRMM->cache->path) -
strlen(group->H5DRMM->cache->path) - 1;
strncat(group->H5DRMM->cache->path, "/", remaining_size);
#ifndef NDEBUG
LOG_DEBUG(-1, "group cache created: %s", group->H5DRMM->cache->path);
#endif
Expand Down

0 comments on commit a3914ab

Please sign in to comment.