From 2db53681d1b135f01af6d7ed130cceeb7edc0f24 Mon Sep 17 00:00:00 2001 From: vincent Date: Sat, 28 Nov 2020 12:55:19 +0300 Subject: [PATCH] update output perf logging --- src/testCase_Grid.cpp | 98 +++++++++++++++++++++++++---------------- src/testCase_Memory.cpp | 62 +++++++++++++++++--------- src/version_hpcscan.h | 6 +-- 3 files changed, 103 insertions(+), 63 deletions(-) diff --git a/src/testCase_Grid.cpp b/src/testCase_Grid.cpp index 151170a..7cf3043 100644 --- a/src/testCase_Grid.cpp +++ b/src/testCase_Grid.cpp @@ -21,10 +21,10 @@ namespace hpcscan { TestCase_Grid::TestCase_Grid(void) -{ + { testCaseName = "Grid" ; testCaseVersion = "Standard implementation" ; -} + } //------------------------------------------------------------------------------------------------------- @@ -61,6 +61,12 @@ Rtn_code TestCase_Grid::run(void) Myint ntry = Config::Instance()->ntry ; + // for perf log + Myfloat FillGB=0, FillGpoint=0, MaxErrGB=0, MaxErrGpoint=0, L1ErrGB=0, L1ErrGpoint=0 ; + Myfloat GetSumAbsGB=0, GetSumAbsGpoint=0, GetSumAbsDiffGB=0, GetSumAbsDiffGpoint=0 ; + Myfloat GetMaxGB=0, GetMaxGpoint=0, GetMinGB=0, GetMinGpoint=0 ; + Myfloat UpdatePressureGB=0, UpdatePressureGpoint=0, ApplyBoundaryConditionGB=0, ApplyBoundaryConditionGpoint=0 ; + { //============================================ // Fill grid @@ -98,10 +104,10 @@ Rtn_code TestCase_Grid::run(void) } - printInfo(MASTER, " Best achieved GByte/s", - Myfloat(nGridPointGlob*sizeof(Myfloat)/testCase_time_best/1.e9)) ; - printInfo(MASTER, " Best achieved GPoint/s", - Myfloat(nGridPointGlob/testCase_time_best/1.e9)) ; + FillGB = Myfloat(nGridPointGlob*sizeof(Myfloat)/testCase_time_best/1.e9) ; + FillGpoint = Myfloat(nGridPointGlob/testCase_time_best/1.e9) ; + printInfo(MASTER, " Best achieved GByte/s", FillGB) ; + printInfo(MASTER, " Best achieved GPoint/s", FillGpoint) ; } // initialize grids @@ -145,10 +151,10 @@ Rtn_code TestCase_Grid::run(void) } - printInfo(MASTER, " Best achieved GByte/s", - Myfloat(2*nGridPointGlob*sizeof(Myfloat)/testCase_time_best/1.e9)) ; - printInfo(MASTER, " Best achieved GPoint/s", - Myfloat(nGridPointGlob/testCase_time_best/1.e9)) ; + MaxErrGB = Myfloat(2*nGridPointGlob*sizeof(Myfloat)/testCase_time_best/1.e9) ; + MaxErrGpoint = Myfloat(nGridPointGlob/testCase_time_best/1.e9) ; + printInfo(MASTER, " Best achieved GByte/s", MaxErrGB) ; + printInfo(MASTER, " Best achieved GPoint/s", MaxErrGpoint) ; } { @@ -185,10 +191,10 @@ Rtn_code TestCase_Grid::run(void) } - printInfo(MASTER, " Best achieved GByte/s", - Myfloat(2*nGridPointGlob*sizeof(Myfloat)/testCase_time_best/1.e9)) ; - printInfo(MASTER, " Best achieved GPoint/s", - Myfloat(nGridPointGlob/testCase_time_best/1.e9)) ; + L1ErrGB = Myfloat(2*nGridPointGlob*sizeof(Myfloat)/testCase_time_best/1.e9) ; + L1ErrGpoint = Myfloat(nGridPointGlob/testCase_time_best/1.e9) ; + printInfo(MASTER, " Best achieved GByte/s", L1ErrGB) ; + printInfo(MASTER, " Best achieved GPoint/s", L1ErrGpoint) ; } { @@ -222,10 +228,10 @@ Rtn_code TestCase_Grid::run(void) } } - printInfo(MASTER, " Best achieved GByte/s", - Myfloat(1*nGridPointGlob*sizeof(Myfloat)/testCase_time_best/1.e9)) ; - printInfo(MASTER, " Best achieved GPoint/s", - Myfloat(nGridPointGlob/testCase_time_best/1.e9)) ; + GetSumAbsGB = Myfloat(1*nGridPointGlob*sizeof(Myfloat)/testCase_time_best/1.e9) ; + GetSumAbsGpoint = Myfloat(nGridPointGlob/testCase_time_best/1.e9) ; + printInfo(MASTER, " Best achieved GByte/s", GetSumAbsGB) ; + printInfo(MASTER, " Best achieved GPoint/s", GetSumAbsGpoint) ; } { @@ -259,10 +265,10 @@ Rtn_code TestCase_Grid::run(void) } } - printInfo(MASTER, " Best achieved GByte/s", - Myfloat(2*nGridPointGlob*sizeof(Myfloat)/testCase_time_best/1.e9)) ; - printInfo(MASTER, " Best achieved GPoint/s", - Myfloat(nGridPointGlob/testCase_time_best/1.e9)) ; + GetSumAbsDiffGB = Myfloat(2*nGridPointGlob*sizeof(Myfloat)/testCase_time_best/1.e9) ; + GetSumAbsDiffGpoint = Myfloat(nGridPointGlob/testCase_time_best/1.e9) ; + printInfo(MASTER, " Best achieved GByte/s", GetSumAbsDiffGB) ; + printInfo(MASTER, " Best achieved GPoint/s", GetSumAbsDiffGpoint) ; } { @@ -297,10 +303,10 @@ Rtn_code TestCase_Grid::run(void) } - printInfo(MASTER, " Best achieved GByte/s", - Myfloat(nGridPointGlob*sizeof(Myfloat)/testCase_time_best/1.e9)) ; - printInfo(MASTER, " Best achieved GPoint/s", - Myfloat(nGridPointGlob/testCase_time_best/1.e9)) ; + GetMaxGB = Myfloat(nGridPointGlob*sizeof(Myfloat)/testCase_time_best/1.e9) ; + GetMaxGpoint = Myfloat(nGridPointGlob/testCase_time_best/1.e9) ; + printInfo(MASTER, " Best achieved GByte/s", GetMaxGB) ; + printInfo(MASTER, " Best achieved GPoint/s", GetMaxGpoint) ; } { @@ -335,10 +341,10 @@ Rtn_code TestCase_Grid::run(void) } - printInfo(MASTER, " Best achieved GByte/s", - Myfloat(nGridPointGlob*sizeof(Myfloat)/testCase_time_best/1.e9)) ; - printInfo(MASTER, " Best achieved GPoint/s", - Myfloat(nGridPointGlob/testCase_time_best/1.e9)) ; + GetMinGB = Myfloat(nGridPointGlob*sizeof(Myfloat)/testCase_time_best/1.e9) ; + GetMinGpoint = Myfloat(nGridPointGlob/testCase_time_best/1.e9) ; + printInfo(MASTER, " Best achieved GByte/s", GetMinGB) ; + printInfo(MASTER, " Best achieved GPoint/s", GetMinGpoint) ; } { @@ -395,10 +401,10 @@ Rtn_code TestCase_Grid::run(void) } - printInfo(MASTER, " Best achieved GByte/s", - Myfloat(5 * nGridPointGlob*sizeof(Myfloat)/testCase_time_best/1.e9)) ; - printInfo(MASTER, " Best achieved GPoint/s", - Myfloat(nGridPointGlob/testCase_time_best/1.e9)) ; + UpdatePressureGB = Myfloat(5 * nGridPointGlob*sizeof(Myfloat)/testCase_time_best/1.e9) ; + UpdatePressureGpoint = Myfloat(nGridPointGlob/testCase_time_best/1.e9) ; + printInfo(MASTER, " Best achieved GByte/s", UpdatePressureGB) ; + printInfo(MASTER, " Best achieved GPoint/s", UpdatePressureGpoint) ; } { @@ -476,14 +482,30 @@ Rtn_code TestCase_Grid::run(void) // we multiply by 2 the number of point to get an approximate of the bytes // this number is not exact - printInfo(MASTER, " Best achieved GByte/s", - Myfloat(2 * nGridPointGlob*sizeof(Myfloat)/testCase_time_best/1.e9)) ; + ApplyBoundaryConditionGB = Myfloat(2 * nGridPointGlob*sizeof(Myfloat)/testCase_time_best/1.e9) ; + printInfo(MASTER, " Best achieved GByte/s", ApplyBoundaryConditionGB) ; // Number of point is exact - printInfo(MASTER, " Best achieved GPoint/s", - Myfloat(nGridPointGlob/testCase_time_best/1.e9)) ; + ApplyBoundaryConditionGpoint = Myfloat(nGridPointGlob/testCase_time_best/1.e9) ; + printInfo(MASTER, " Best achieved GPoint/s", ApplyBoundaryConditionGpoint) ; } + // log perf + if (myid_world == 0) + { + perfLogFile + // 10, 11, 12, 13 + << FillGB << " " << FillGpoint << " " << MaxErrGB << " " << MaxErrGpoint << " " + // 14, 15, 16, 17 + << L1ErrGB << " " << L1ErrGpoint << " " << GetSumAbsGB << " " << GetSumAbsGpoint << " " + // 18, 19, 20, 21 + << GetSumAbsDiffGB << " " << GetSumAbsDiffGpoint << " " << GetMaxGB << " " << GetMaxGpoint << " " + // 22, 23, 24, 25 + << GetMinGB << " " << GetMinGpoint << " " << UpdatePressureGB << " " << UpdatePressureGpoint << " " + // 26, 27 + << ApplyBoundaryConditionGB << " " << ApplyBoundaryConditionGpoint << " " + << "\n" ; + } this->finalize() ; diff --git a/src/testCase_Memory.cpp b/src/testCase_Memory.cpp index af48471..cf09562 100644 --- a/src/testCase_Memory.cpp +++ b/src/testCase_Memory.cpp @@ -21,10 +21,10 @@ namespace hpcscan { TestCase_Memory::TestCase_Memory(void) -{ + { testCaseName = "Memory" ; testCaseVersion = "Standard implementation" ; -} + } //------------------------------------------------------------------------------------------------------- @@ -60,6 +60,11 @@ Rtn_code TestCase_Memory::run(void) Myfloat * const v = Vgrid.grid_3d ; Myfloat * const w = Wgrid.grid_3d ; + // for perf log + Myfloat FillGridGB=0, FillGridGpoint=0, CopyGridGB=0, CopyGridGpoint=0 ; + Myfloat AddGridGB=0, AddGridGpoint=0, MultiplyGridGB=0, MultiplyGridGpoint=0 ; + Myfloat AddUpdateGridGB=0, AddUpdateGridGpoint=0 ; + // one block per case { //============================================ @@ -104,10 +109,10 @@ Rtn_code TestCase_Memory::run(void) } - printInfo(MASTER, " Best achieved GByte/s", - Myfloat(nGridPoint*sizeof(Myfloat)/testCase_time_best/1.e9)) ; - printInfo(MASTER, " Best achieved GPoint/s", - Myfloat(nGridPoint/testCase_time_best/1.e9)) ; + FillGridGB = Myfloat(nGridPoint*sizeof(Myfloat)/testCase_time_best/1.e9) ; + FillGridGpoint = Myfloat(nGridPoint/testCase_time_best/1.e9) ; + printInfo(MASTER, " Best achieved GByte/s", FillGridGB) ; + printInfo(MASTER, " Best achieved GPoint/s", FillGridGpoint) ; } { @@ -152,10 +157,10 @@ Rtn_code TestCase_Memory::run(void) } - printInfo(MASTER, " Best achieved GByte/s", - Myfloat(nGridPoint*2*sizeof(Myfloat)/testCase_time_best/1.e9)) ; - printInfo(MASTER, " Best achieved GPoint/s", - Myfloat(nGridPoint/testCase_time_best/1.e9)) ; + CopyGridGB = Myfloat(nGridPoint*2*sizeof(Myfloat)/testCase_time_best/1.e9) ; + CopyGridGpoint = Myfloat(nGridPoint/testCase_time_best/1.e9) ; + printInfo(MASTER, " Best achieved GByte/s", CopyGridGB) ; + printInfo(MASTER, " Best achieved GPoint/s", CopyGridGpoint) ; } { @@ -202,10 +207,10 @@ Rtn_code TestCase_Memory::run(void) } - printInfo(MASTER, " Best achieved GByte/s", - Myfloat(nGridPoint*3*sizeof(Myfloat)/testCase_time_best/1.e9)) ; - printInfo(MASTER, " Best achieved GPoint/s", - Myfloat(nGridPoint/testCase_time_best/1.e9)) ; + AddGridGB = Myfloat(nGridPoint*3*sizeof(Myfloat)/testCase_time_best/1.e9) ; + AddGridGpoint = Myfloat(nGridPoint/testCase_time_best/1.e9) ; + printInfo(MASTER, " Best achieved GByte/s", AddGridGB) ; + printInfo(MASTER, " Best achieved GPoint/s", AddGridGpoint) ; } { @@ -252,10 +257,10 @@ Rtn_code TestCase_Memory::run(void) } - printInfo(MASTER, " Best achieved GByte/s", - Myfloat(nGridPoint*3*sizeof(Myfloat)/testCase_time_best/1.e9)) ; - printInfo(MASTER, " Best achieved GPoint/s", - Myfloat(nGridPoint/testCase_time_best/1.e9)) ; + MultiplyGridGB = Myfloat(nGridPoint*3*sizeof(Myfloat)/testCase_time_best/1.e9) ; + MultiplyGridGpoint = Myfloat(nGridPoint/testCase_time_best/1.e9) ; + printInfo(MASTER, " Best achieved GByte/s", MultiplyGridGB) ; + printInfo(MASTER, " Best achieved GPoint/s", MultiplyGridGpoint) ; } { @@ -301,10 +306,23 @@ Rtn_code TestCase_Memory::run(void) } - printInfo(MASTER, " Best achieved GByte/s", - Myfloat(nGridPoint*3*sizeof(Myfloat)/testCase_time_best/1.e9)) ; - printInfo(MASTER, " Best achieved GPoint/s", - Myfloat(nGridPoint/testCase_time_best/1.e9)) ; + AddUpdateGridGB = Myfloat(nGridPoint*3*sizeof(Myfloat)/testCase_time_best/1.e9) ; + AddUpdateGridGpoint = Myfloat(nGridPoint/testCase_time_best/1.e9) ; + printInfo(MASTER, " Best achieved GByte/s", AddUpdateGridGB) ; + printInfo(MASTER, " Best achieved GPoint/s", AddUpdateGridGpoint) ; + } + + // log perf + if (myid_world == 0) + { + perfLogFile + // 10, 11, 12, 13 + << FillGridGB << " " << FillGridGpoint << " " << CopyGridGB << " " << CopyGridGpoint << " " + // 14, 15, 16, 17 + << AddGridGB << " " << AddGridGpoint << " " << MultiplyGridGB << " " << MultiplyGridGpoint << " " + // 18, 19 + << AddUpdateGridGB << " " << AddUpdateGridGpoint << " " + << "\n" ; } this->finalize() ; diff --git a/src/version_hpcscan.h b/src/version_hpcscan.h index f7a07a9..b2af5f3 100755 --- a/src/version_hpcscan.h +++ b/src/version_hpcscan.h @@ -1,4 +1,4 @@ -const char HPCSCAN_GIT_COMMIT[] = "commit 7d33084153ce5101c19200ccb98682e1b5273664" ; +const char HPCSCAN_GIT_COMMIT[] = "commit a774e7ad052abfbff059b190a4b6eb560d230a02" ; const char HPCSCAN_GIT_AUTHOR[] = "Author: vincent " ; -const char HPCSCAN_GIT_DATE[] = "Date: Tue Nov 24 13:09:45 2020 +0300" ; -const time_t HPCSCAN_COMPILE_DATE = 1606212737 ; +const char HPCSCAN_GIT_DATE[] = "Date: Thu Nov 26 07:02:06 2020 +0300" ; +const time_t HPCSCAN_COMPILE_DATE = 1606554776 ;