Skip to content

Commit

Permalink
update output perf logging
Browse files Browse the repository at this point in the history
  • Loading branch information
vetienne74 committed Nov 28, 2020
1 parent a774e7a commit 2db5368
Show file tree
Hide file tree
Showing 3 changed files with 103 additions and 63 deletions.
98 changes: 60 additions & 38 deletions src/testCase_Grid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@
namespace hpcscan {

TestCase_Grid::TestCase_Grid(void)
{
{
testCaseName = "Grid" ;
testCaseVersion = "Standard implementation" ;
}
}

//-------------------------------------------------------------------------------------------------------

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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) ;
}

{
Expand Down Expand Up @@ -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) ;
}

{
Expand Down Expand Up @@ -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) ;
}

{
Expand Down Expand Up @@ -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) ;
}

{
Expand Down Expand Up @@ -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) ;
}

{
Expand Down Expand Up @@ -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) ;
}

{
Expand Down Expand Up @@ -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) ;
}

{
Expand Down Expand Up @@ -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() ;

Expand Down
62 changes: 40 additions & 22 deletions src/testCase_Memory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@
namespace hpcscan {

TestCase_Memory::TestCase_Memory(void)
{
{
testCaseName = "Memory" ;
testCaseVersion = "Standard implementation" ;
}
}

//-------------------------------------------------------------------------------------------------------

Expand Down Expand Up @@ -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
{
//============================================
Expand Down Expand Up @@ -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) ;
}

{
Expand Down Expand Up @@ -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) ;
}

{
Expand Down Expand Up @@ -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) ;
}

{
Expand Down Expand Up @@ -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) ;
}

{
Expand Down Expand Up @@ -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() ;
Expand Down
6 changes: 3 additions & 3 deletions src/version_hpcscan.h
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>" ;
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 ;

0 comments on commit 2db5368

Please sign in to comment.