Skip to content

Commit

Permalink
Move profiler stop earlier to exclude cleanup from traces
Browse files Browse the repository at this point in the history
  • Loading branch information
pszi1ard authored and al42and committed Nov 6, 2023
1 parent e40e518 commit d663540
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/gromacs/mdrun/runner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2280,6 +2280,13 @@ int Mdrunner::mdrunner()
deviceStreamManager.get());
}

if (!hwinfo_->deviceInfoList.empty())
{
/* stop the GPU profiler (only CUDA);
* Doing so here avoids including a lot of cleanup/freeing API calls in the trace. */
stopGpuProfiler();
}

wallcycle_stop(wcycle.get(), WallCycleCounter::Run);

/* Finish up, write some stuff
Expand Down Expand Up @@ -2319,12 +2326,6 @@ int Mdrunner::mdrunner()
// Destroy streams after all the structures using them
deviceStreamManager.reset(nullptr);

if (!hwinfo_->deviceInfoList.empty())
{
/* stop the GPU profiler (only CUDA) */
stopGpuProfiler();
}

/* With tMPI we need to wait for all ranks to finish deallocation before
* destroying the CUDA context as some tMPI ranks may be sharing
* GPU and context.
Expand Down

0 comments on commit d663540

Please sign in to comment.