Skip to content

Commit

Permalink
delay pmpi call in free_mem
Browse files Browse the repository at this point in the history
  • Loading branch information
tim0s committed Oct 22, 2023
1 parent 5da8660 commit d44aecd
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion build/mpi_c_wrapper.c
Original file line number Diff line number Diff line change
Expand Up @@ -3365,8 +3365,8 @@ int MPI_Free_mem (void * base) {
lap_check();
WRITE_TRACE("%s", "MPI_Free_mem:");
WRITE_TRACE("%0.2f:", lap_mpi_initialized ? PMPI_Wtime()*1e6 : 0.0);
pmpi_retval = PMPI_Free_mem(base);
WRITE_TRACE("%p:", base);
pmpi_retval = PMPI_Free_mem(base);
WRITE_TRACE("%0.2f", lap_mpi_initialized ? PMPI_Wtime()*1e6 : 0.0); if (lap_backtrace_enabled) {
lap_get_full_backtrace(lap_backtrace_buf, LAP2_BACKTRACE_BUF_SIZE);
WRITE_TRACE(" # backtrace [%s]", lap_backtrace_buf);
Expand Down
2 changes: 1 addition & 1 deletion build/mpi_f_wrapper.c
Original file line number Diff line number Diff line change
Expand Up @@ -3463,8 +3463,8 @@ void FortranCInterface_GLOBAL(mpi_free_mem,MPI_FREE_MEM) (int* base, int* ierr)
lap_check();
WRITE_TRACE("%s", "MPI_Free_mem:");
WRITE_TRACE("%0.2f:", lap_mpi_initialized ? PMPI_Wtime()*1e6 : 0.0);
FortranCInterface_GLOBAL(pmpi_free_mem,PMPI_FREE_MEM)(base, ierr);
WRITE_TRACE("%lli:", (long long int) *base);
FortranCInterface_GLOBAL(pmpi_free_mem,PMPI_FREE_MEM)(base, ierr);
WRITE_TRACE("%0.2f", lap_mpi_initialized ? PMPI_Wtime()*1e6 : 0.0); if (lap_backtrace_enabled) {
lap_get_full_backtrace(lap_backtrace_buf, LAP2_BACKTRACE_BUF_SIZE);
WRITE_TRACE(" # backtrace [%s]", lap_backtrace_buf);
Expand Down
2 changes: 1 addition & 1 deletion src/liballprof2/gencode.py
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ def produce_tracers(self, mode='c'):
return

delay_pmpi = False # usually we write the trace after the pmpi call, however, if the function frees some of its arguments we want to do it before
if func.endswith("_free") or ("_delete_" in func) or (func == "MPI_Finalize"):
if func.endswith("_free") or func.endswith("Free_mem") or ("_delete_" in func) or (func == "MPI_Finalize"):
delay_pmpi = True

param_signatures = []
Expand Down

0 comments on commit d44aecd

Please sign in to comment.