@@ -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
700638prog_exit:
0 commit comments