Skip to content

Commit

Permalink
Merge pull request #610 from E3SM-Project/dqwu/perf_opt_conv_tool
Browse files Browse the repository at this point in the history
This PR implements some key optimizations for the ADIOS
conversion tool in SCORPIO:

[Performance measurement]
Added GPTL timers for performance tracking and hotspot
identification.

[Decomposition cache size increase]
Expanded DECOMP_CACHE_MAX_SIZE from 5 to 64 to reduce
overhead in cache management.

[Default rearranger]
Changed the default rearranger to REARR_ANY for better
adaptability in rearranger selection.

[Optimize hotspot Get() calls]
Switched some hotspot Get() calls to Deferred mode to
utilize optimized batch reads and used rank 0 for reads
to reduce contention.
  • Loading branch information
dqwu authored Oct 16, 2024
2 parents c62c5ca + 7e360e3 commit 65af970
Show file tree
Hide file tree
Showing 5 changed files with 224 additions and 45 deletions.
1 change: 1 addition & 0 deletions src/clib/pio_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,7 @@ extern "C" {
void pio_finalize_logging(void );

/* Initialize and finalize GPTL timers. */
bool spio_gptl_was_init_in_lib(void );
void pio_init_gptl(void);
void pio_finalize_gptl(void );

Expand Down
24 changes: 13 additions & 11 deletions src/clib/pioc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1776,17 +1776,19 @@ int PIOc_finalize_impl(int iosysid)
GPTLstop("PIO:PIOc_finalize");
#ifdef TIMING
#ifdef TIMING_INTERNAL
if(ios->io_comm != MPI_COMM_NULL)
{
snprintf(gptl_iolog_fname, PIO_MAX_NAME, "piorwgptlioinfo%010dwrank.dat", ios->ioroot);
GPTLpr_summary_file(ios->io_comm, gptl_iolog_fname);
LOG((2, "Finished writing gptl io proc summary"));
}
snprintf(gptl_log_fname, PIO_MAX_NAME, "piorwgptlinfo%010dwrank.dat", ios->ioroot);
if(ios->io_rank == 0)
{
GPTLpr_file(gptl_log_fname);
LOG((2, "Finished writing gptl summary"));
if(spio_gptl_was_init_in_lib()){
if(ios->io_comm != MPI_COMM_NULL)
{
snprintf(gptl_iolog_fname, PIO_MAX_NAME, "piorwgptlioinfo%010dwrank.dat", ios->ioroot);
GPTLpr_summary_file(ios->io_comm, gptl_iolog_fname);
LOG((2, "Finished writing gptl io proc summary"));
}
snprintf(gptl_log_fname, PIO_MAX_NAME, "piorwgptlinfo%010dwrank.dat", ios->ioroot);
if(ios->io_rank == 0)
{
GPTLpr_file(gptl_log_fname);
LOG((2, "Finished writing gptl summary"));
}
}
pio_finalize_gptl();
#endif
Expand Down
7 changes: 6 additions & 1 deletion src/clib/pioc_support.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -707,6 +707,11 @@ void pio_finalize_logging(void)
*/
/* Indicate if GPTL was initialized inside the library */
static bool GPTL_was_init_in_lib = false;
bool spio_gptl_was_init_in_lib(void )
{
return GPTL_was_init_in_lib;
}

void pio_init_gptl(void )
{
#ifdef TIMING_INTERNAL
Expand All @@ -727,7 +732,7 @@ void pio_finalize_gptl(void)
{
#ifdef TIMING_INTERNAL
pio_timer_ref_cnt -= 1;
if((pio_timer_ref_cnt == 0) && (GPTL_was_init_in_lib))
if((pio_timer_ref_cnt == 0) && (spio_gptl_was_init_in_lib()))
{
GPTLfinalize();
}
Expand Down
Loading

0 comments on commit 65af970

Please sign in to comment.