Skip to content

Commit 3ad0bdb

Browse files
authored
Merge pull request #5 from NU-CUCIS/remove_mem_profile
Remove use of H5get_alloc_stats
2 parents f46a99d + 3a75971 commit 3ad0bdb

File tree

3 files changed

+2
-65
lines changed

3 files changed

+2
-65
lines changed

RELEASE_NOTES.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ Bug fix:
5151
+ Fix compression threshold calculation. See a9ea841
5252

5353
Other changes
54+
+ Remove the HDF5 metadata memory footprint profiling, as H5get_alloc_stats
55+
has been removed from HDF5 since 1.14.0. See PR #5.
5456
+ Remove the requirement of group `/spill`. See d4e0852
5557
+ Change chunk setting for small datasets. Set the chunk size to 256K
5658
element, no matter if the dataset dim[0] is smaller than 256K element or

configure.ac

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -354,9 +354,6 @@ AC_CHECK_DECL(H5Ovisit3,
354354
AC_CHECK_DECL(H5Treclaim,
355355
[AC_DEFINE(HAS_H5TRECLAIM, 1, [Define if API H5Treclaim is defined])],
356356
[], [[#include <hdf5.h>]])
357-
AC_CHECK_DECL(H5get_alloc_stats,
358-
[AC_DEFINE(HAS_H5GET_ALLOC_STATS, 1, [Define if API H5get_alloc_stats is defined])],
359-
[], [[#include <hdf5.h>]])
360357

361358
AC_ARG_VAR(TESTMPIRUN, [MPI run command for "make check", @<:@default: mpiexec@:>@])
362359
if test "x${TESTMPIRUN}" = x ; then

main.cpp

Lines changed: 0 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -361,10 +361,6 @@ int main(int argc, char **argv)
361361

362362
GET_MEM(step_vmrss[0], step_vmsize[0])
363363

364-
#if defined HAS_H5GET_ALLOC_STATS && HAS_H5GET_ALLOC_STATS
365-
size_t cur_bytes, md_malloc;
366-
H5get_alloc_stats(NULL, &cur_bytes, NULL, NULL, NULL, NULL, NULL);
367-
#endif
368364
SET_TIMER(ts)
369365
/* Each process reads assigned input files to collect all group and dataset
370366
* metadata and stores them in the object concat. The input datasets are
@@ -379,10 +375,6 @@ int main(int argc, char **argv)
379375
GET_TIMER(ts, step_time[0])
380376
PRN_TIMER(step_time[0], "Read metadata from input files")
381377
GET_MEM(step_vmrss[1], step_vmsize[1])
382-
#if defined HAS_H5GET_ALLOC_STATS && HAS_H5GET_ALLOC_STATS
383-
H5get_alloc_stats(NULL, &md_malloc, NULL, NULL, NULL, NULL, NULL);
384-
md_malloc -= cur_bytes;
385-
#endif
386378

387379
SET_TIMER(ts)
388380
if (opt.append_mode)
@@ -641,60 +633,6 @@ int main(int argc, char **argv)
641633
printf(" VmSize: %9s %9s %9ld\n", "","", total_vmsize[8]);
642634
printf("\n");
643635
}
644-
645-
#if defined HAS_H5GET_ALLOC_STATS && HAS_H5GET_ALLOC_STATS
646-
unsigned long long total_alloc_bytes, max_ull, min_ull, avg_ull;
647-
size_t curr_alloc_bytes, peak_alloc_bytes, max_block_size;
648-
size_t total_alloc_blocks_count, curr_alloc_blocks_count;
649-
size_t peak_alloc_blocks_count, zd[7], max_zd[7], min_zd[7], avg_zd[7];
650-
651-
err = H5get_alloc_stats(&total_alloc_bytes, &curr_alloc_bytes,
652-
&peak_alloc_bytes, &max_block_size,
653-
&total_alloc_blocks_count,
654-
&curr_alloc_blocks_count,
655-
&peak_alloc_blocks_count);
656-
657-
MPI_Reduce(&total_alloc_bytes, &min_ull, 1, MPI_UNSIGNED_LONG_LONG, MPI_MIN, 0, MPI_COMM_WORLD);
658-
MPI_Reduce(&total_alloc_bytes, &max_ull, 1, MPI_UNSIGNED_LONG_LONG, MPI_MAX, 0, MPI_COMM_WORLD);
659-
MPI_Reduce(&total_alloc_bytes, &avg_ull, 1, MPI_UNSIGNED_LONG_LONG, MPI_SUM, 0, MPI_COMM_WORLD);
660-
min_ull /= 1048576;
661-
max_ull /= 1048576;
662-
avg_ull /= nprocs * 1048576;
663-
zd[0] = md_malloc;
664-
zd[1] = curr_alloc_bytes;
665-
zd[2] = peak_alloc_bytes;
666-
zd[3] = max_block_size;
667-
zd[4] = total_alloc_blocks_count;
668-
zd[5] = curr_alloc_blocks_count;
669-
zd[6] = peak_alloc_blocks_count;
670-
MPI_Reduce(zd, &min_zd, 7, MPI_UNSIGNED_LONG, MPI_MIN, 0, MPI_COMM_WORLD);
671-
MPI_Reduce(zd, &max_zd, 7, MPI_UNSIGNED_LONG, MPI_MAX, 0, MPI_COMM_WORLD);
672-
MPI_Reduce(zd, &avg_zd, 7, MPI_UNSIGNED_LONG, MPI_SUM, 0, MPI_COMM_WORLD);
673-
for (int i=0; i<4; i++) {
674-
min_zd[i] /= 1048576;
675-
max_zd[i] /= 1048576;
676-
avg_zd[i] /= nprocs * 1048576;
677-
}
678-
for (int i=4; i<7; i++) {
679-
min_zd[i] /= 1024;
680-
max_zd[i] /= 1024;
681-
avg_zd[i] /= nprocs * 1024;
682-
}
683-
684-
if (!opt.quiet && rank == 0) { /* only rank 0 reports timings */
685-
printf("-------------------------------------------------------------\n");
686-
printf("Memory footprints (min, max, avg among all processes):\n");
687-
printf("construct metadata (MiB) min=%8zd max=%8zd avg=%8zd\n",min_zd[0],max_zd[0],avg_zd[0]);
688-
printf("total_alloc_bytes (MiB) min=%8llu max=%8llu avg=%8llu\n",min_ull,max_ull,avg_ull);
689-
// printf("curr_alloc_bytes (MiB) min=%8zd max=%8zd avg=%8zd\n",min_zd[1],max_zd[1],avg_zd[1]);
690-
printf("peak_alloc_bytes (MiB) min=%8zd max=%8zd avg=%8zd\n",min_zd[2],max_zd[2],avg_zd[2]);
691-
printf("max_block_size (MiB) min=%8zd max=%8zd avg=%8zd\n",min_zd[3],max_zd[3],avg_zd[3]);
692-
printf("total_alloc_blocks_count (K) min=%8zd max=%8zd avg=%8zd\n",min_zd[4],max_zd[4],avg_zd[4]);
693-
// printf("curr_alloc_blocks_count (K) min=%8zd max=%8zd avg=%8zd\n",min_zd[5],max_zd[5],avg_zd[5]);
694-
printf("peak_alloc_blocks_count (K) min=%8zd max=%8zd avg=%8zd\n",min_zd[6],max_zd[6],avg_zd[6]);
695-
printf("-------------------------------------------------------------\n");
696-
}
697-
#endif
698636
#endif
699637

700638
prog_exit:

0 commit comments

Comments
 (0)