Skip to content

Commit

Permalink
Add memory logging to ethier ci mode 2. (#190)
Browse files Browse the repository at this point in the history
  • Loading branch information
MalachiTimothyPhillips authored Sep 14, 2021
1 parent 5b2f238 commit 6215393
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions examples/ethier/ci.inc
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,22 @@ void ciTestErrors(nrs_t *nrs, dfloat time, int tstep)
break;

}

if (ciMode == 2){
dfloat memoryUsage = platform->device.memoryAllocated()/1e9;
MPI_Allreduce(MPI_IN_PLACE, &memoryUsage, 1, MPI_DFLOAT, MPI_SUM, platform->comm.mpiComm);

const dfloat expectedMemoryUsage = 0.0715437;
if(memoryUsage > 1.02 * expectedMemoryUsage && platform->mpiComm.mpiCommSize == 1)
{
printf("Expected memory usage exceeded!\n"
"Expected : %g GB\n"
"Actual : %g GB\n",
expectedMemoryUsage, memoryUsage);
fflush(stdout);
FAIL;
}
}
if (ciMode == 8){
const int expectedSteps = 56;
const int errSteps = abs(expectedSteps - tstep);
Expand Down

0 comments on commit 6215393

Please sign in to comment.