Skip to content

Commit

Permalink
Updating GPTL timers in ADIOS conversion tool
Browse files Browse the repository at this point in the history
* Add a new timer to measure the runtime of main().

* Adjust the existing timer for ConvertBPFile() to better
  capture its runtime.
  • Loading branch information
dqwu committed Oct 4, 2024
1 parent 89cdee9 commit 7e360e3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tools/adios2pio-nm/adios2pio-nm-lib.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -2282,6 +2282,8 @@ int ConvertBPFile(const string &infilepath, const string &outfilename,
int w_mpirank, mpirank;
int w_nproc, nproc;

GPTLstart("adios2pio:ConvertBPFile");

w_comm = comm_in;
MPI_Comm_set_errhandler(w_comm, MPI_ERRORS_RETURN);
MPI_Comm_rank(w_comm, &w_mpirank);
Expand Down Expand Up @@ -2314,7 +2316,6 @@ int ConvertBPFile(const string &infilepath, const string &outfilename,

try
{
GPTLstart("adios2pio:ConvertBPFile");
t1 = MPI_Wtime();

/* Allocate IO and Engine and open BP4 file */
Expand Down Expand Up @@ -2649,7 +2650,6 @@ int ConvertBPFile(const string &infilepath, const string &outfilename,
<< " at " << __func__ << ":" << __LINE__ << endl;
ierr = BP2PIO_ERROR;
}
GPTLstop("adios2pio:ConvertBPFile");

ret = PIOc_finalize(iosysid);
if (ret != PIO_NOERR)
Expand All @@ -2676,6 +2676,8 @@ int ConvertBPFile(const string &infilepath, const string &outfilename,

MPI_Barrier(w_comm);

GPTLstop("adios2pio:ConvertBPFile");

if (ierr != BP2PIO_NOERR)
return ierr;

Expand Down
4 changes: 4 additions & 0 deletions tools/adios2pio-nm/adios2pio-nm.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,8 @@ int main(int argc, char *argv[])
return ret;
#endif

GPTLstart("adios2pio:main");

SetDebugOutput(debug_lvl);
MPI_Barrier(comm_in);
if (idir.size() == 0)
Expand All @@ -171,6 +173,8 @@ int main(int argc, char *argv[])
}
MPI_Barrier(comm_in);

GPTLstop("adios2pio:main");

#ifdef SPIO_ENABLE_GPTL_TIMING
/* Write the GPTL summary/rank_0 output */
std::string summary_file("spioconvtoolrwgptlsummaryinfo0wrank.dat");
Expand Down

0 comments on commit 7e360e3

Please sign in to comment.