From f3943bf245e5ae2484e617b3d8b02e2ae28452c4 Mon Sep 17 00:00:00 2001 From: Rom Walton Date: Sat, 22 May 2004 01:36:36 +0000 Subject: [PATCH] *** empty log message *** svn path=/trunk/boinc/; revision=3415 --- checkin_notes | 11 ++ client/cs_benchmark.C | 31 ++-- client/dhrystone.C | 45 +++--- client/whetstone.C | 317 +++++++++++++++++++--------------------- clientgui/MainFrame.cpp | 9 ++ 5 files changed, 212 insertions(+), 201 deletions(-) diff --git a/checkin_notes b/checkin_notes index 693bcc582e..4949817aaf 100755 --- a/checkin_notes +++ b/checkin_notes @@ -12483,3 +12483,14 @@ David May 21 2004 cs_benchmark.C dhrystone.C whetstone.C + +Rom May 21 2004 + - A little fine tuning to the benchmark process. + Should be less than 1% difference between executions without any + other software runing + + client/ + cs_benchmark.C + dhrystone.C + whetstone.C + \ No newline at end of file diff --git a/client/cs_benchmark.C b/client/cs_benchmark.C index 2e65d0ea2b..b54785156e 100644 --- a/client/cs_benchmark.C +++ b/client/cs_benchmark.C @@ -74,16 +74,17 @@ #define DEFAULT_MEMBW 1e8 #define DEFAULT_CACHE 1e6 -#define FP_START 1 -#define FP_END 5 -#define INT_START 6 -#define INT_END 10 +#define FP_START 2 +#define FP_END 6 +#define INT_START 8 +#define INT_END 12 -#define BM_INIT 0 +#define BM_FP_INIT 0 #define BM_FP 1 -#define BM_FP_DONE 2 +#define BM_INT_INIT 2 #define BM_INT 3 -#define BM_DONE 4 +#define BM_SLEEP 4 +#define BM_DONE 5 static int bm_state; #define BENCHMARK_PERIOD (SECONDS_PER_DAY*30) @@ -190,10 +191,10 @@ void CLIENT_STATE::start_cpu_benchmarks() { return; } - cpu_benchmarks_start = dtime(); - bm_state = BM_INIT; + bm_state = BM_FP_INIT; remove_benchmark_file(BM_TYPE_FP); remove_benchmark_file(BM_TYPE_INT); + cpu_benchmarks_start = dtime(); msg_printf(NULL, MSG_INFO, "Running CPU benchmarks"); if (!benchmark_descs) { @@ -299,7 +300,7 @@ bool CLIENT_STATE::cpu_benchmarks_poll() { // do transitions through benchmark states // switch (bm_state) { - case BM_INIT: + case BM_FP_INIT: if (now - cpu_benchmarks_start > FP_START) { make_benchmark_file(BM_TYPE_FP); bm_state = BM_FP; @@ -308,10 +309,10 @@ bool CLIENT_STATE::cpu_benchmarks_poll() { case BM_FP: if (now - cpu_benchmarks_start > FP_END) { remove_benchmark_file(BM_TYPE_FP); - bm_state = BM_FP_DONE; + bm_state = BM_INT_INIT; } return false; - case BM_FP_DONE: + case BM_INT_INIT: if (now - cpu_benchmarks_start > INT_START) { make_benchmark_file(BM_TYPE_INT); bm_state = BM_INT; @@ -320,9 +321,13 @@ bool CLIENT_STATE::cpu_benchmarks_poll() { case BM_INT: if (now - cpu_benchmarks_start > INT_END) { remove_benchmark_file(BM_TYPE_INT); - bm_state = BM_DONE; + bm_state = BM_SLEEP; } return false; + case BM_SLEEP: + boinc_sleep(2.0); + bm_state = BM_DONE; + return false; } // check for timeout diff --git a/client/dhrystone.C b/client/dhrystone.C index 535697a6f3..521fc676c7 100644 --- a/client/dhrystone.C +++ b/client/dhrystone.C @@ -251,19 +251,19 @@ void dhrystone( Loops = 160000; // determines runtime - do - { - Array2Glob[8][7] = 10; + Array2Glob[8][7] = 10; - benchmark_wait_to_start(BM_TYPE_INT); + benchmark_wait_to_start(BM_TYPE_INT); - /***************** - -- Start Timer -- - *****************/ - - startclock = dtime(); - int bigloops = 0; -restart: + /***************** + -- Start Timer -- + *****************/ + + startclock = dtime(); + int bigloops = 0; + + do + { for (i = 0; i < Loops; ++i) { Proc5(); @@ -290,22 +290,19 @@ restart: Proc2(&IntLoc1); } bigloops++; - if (!benchmark_time_to_stop(BM_TYPE_INT)) { - goto restart; - } - Loops *= bigloops; + } + while (!benchmark_time_to_stop(BM_TYPE_INT)); - /***************** - -- Stop Timer -- - *****************/ + Loops *= bigloops; - benchtime = dtime() - startclock; - - //printf ("%12.0f runs %6.2f seconds \n",(double) Loops, benchtime); + /***************** + -- Stop Timer -- + *****************/ + + benchtime = dtime() - startclock; + + //printf ("%12.0f runs %6.2f seconds \n",(double) Loops, benchtime); - } - while (0); - Dhrystones_Per_Second = (double) Loops / benchtime; Vax_Mips = Dhrystones_Per_Second / 1757.0; #if 0 diff --git a/client/whetstone.C b/client/whetstone.C index a311ff9798..a2c3863c1c 100644 --- a/client/whetstone.C +++ b/client/whetstone.C @@ -56,14 +56,14 @@ C********************************************************************** #ifdef _WIN32 #include "stdafx.h" #endif -/* standard C library headers required */ + +#ifndef _WIN32 #include #include #include #include - -/* the following is optional depending on the timing function used */ #include +#endif #include "util.h" #include "cpu_benchmark.h" @@ -98,16 +98,13 @@ void whetstone(double& flops) { long N1, N2, N3, N4, N6, N7, N8, N9, N10, N11; double X1,X2,X3,X4,X,Y,Z; long LOOP; - int II, JJ; + int II; /* added for this version */ - long loopstart; double startsec, finisec; double KIPS; - II = 32; - - loopstart = 1000; /* see the note about LOOP below */ + II = 0; benchmark_wait_to_start(BM_TYPE_FP); @@ -134,189 +131,181 @@ C 'II' TIMES TO INCREASE WALL-CLOCK TIMING ACCURACY. C LOOP = 1000; */ - LOOP = loopstart; + LOOP = 100; - JJ = 0; + do + { + N1 = 0; + N2 = 12 * LOOP; + N3 = 14 * LOOP; + N4 = 345 * LOOP; + N6 = 210 * LOOP; + N7 = 32 * LOOP; + N8 = 899 * LOOP; + N9 = 616 * LOOP; + N10 = 0; + N11 = 93 * LOOP; + /* + C + C Module 1: Simple identifiers + C + */ + X1 = 1.0; + X2 = -1.0; + X3 = -1.0; + X4 = -1.0; -IILOOP: - N1 = 0; - N2 = 12 * LOOP; - N3 = 14 * LOOP; - N4 = 345 * LOOP; - N6 = 210 * LOOP; - N7 = 32 * LOOP; - N8 = 899 * LOOP; - N9 = 616 * LOOP; - N10 = 0; - N11 = 93 * LOOP; -/* -C -C Module 1: Simple identifiers -C -*/ - X1 = 1.0; - X2 = -1.0; - X3 = -1.0; - X4 = -1.0; + for (I = 1; I <= N1; I++) { + X1 = (X1 + X2 + X3 - X4) * T; + X2 = (X1 + X2 - X3 + X4) * T; + X3 = (X1 - X2 + X3 + X4) * T; + X4 = (-X1+ X2 + X3 + X4) * T; + } - for (I = 1; I <= N1; I++) { - X1 = (X1 + X2 + X3 - X4) * T; - X2 = (X1 + X2 - X3 + X4) * T; - X3 = (X1 - X2 + X3 + X4) * T; - X4 = (-X1+ X2 + X3 + X4) * T; - } + /* + C + C Module 2: Array elements + C + */ + E1[1] = 1.0; + E1[2] = -1.0; + E1[3] = -1.0; + E1[4] = -1.0; -/* -C -C Module 2: Array elements -C -*/ - E1[1] = 1.0; - E1[2] = -1.0; - E1[3] = -1.0; - E1[4] = -1.0; + for (I = 1; I <= N2; I++) { + E1[1] = ( E1[1] + E1[2] + E1[3] - E1[4]) * T; + E1[2] = ( E1[1] + E1[2] - E1[3] + E1[4]) * T; + E1[3] = ( E1[1] - E1[2] + E1[3] + E1[4]) * T; + E1[4] = (-E1[1] + E1[2] + E1[3] + E1[4]) * T; + } - for (I = 1; I <= N2; I++) { - E1[1] = ( E1[1] + E1[2] + E1[3] - E1[4]) * T; - E1[2] = ( E1[1] + E1[2] - E1[3] + E1[4]) * T; - E1[3] = ( E1[1] - E1[2] + E1[3] + E1[4]) * T; - E1[4] = (-E1[1] + E1[2] + E1[3] + E1[4]) * T; - } + /* + C + C Module 3: Array as parameter + C + */ + for (I = 1; I <= N3; I++) + PA(E1); -/* -C -C Module 3: Array as parameter -C -*/ - for (I = 1; I <= N3; I++) - PA(E1); + /* + C + C Module 4: Conditional jumps + C + */ + J = 1; + for (I = 1; I <= N4; I++) { + if (J == 1) + J = 2; + else + J = 3; -/* -C -C Module 4: Conditional jumps -C -*/ - J = 1; - for (I = 1; I <= N4; I++) { - if (J == 1) - J = 2; - else - J = 3; + if (J > 2) + J = 0; + else + J = 1; - if (J > 2) - J = 0; - else - J = 1; - - if (J < 1) - J = 1; - else - J = 0; - } + if (J < 1) + J = 1; + else + J = 0; + } -/* -C -C Module 5: Omitted -C Module 6: Integer arithmetic -C -*/ + /* + C + C Module 5: Omitted + C Module 6: Integer arithmetic + C + */ - J = 1; - K = 2; - L = 3; + J = 1; + K = 2; + L = 3; - for (I = 1; I <= N6; I++) { - J = J * (K-J) * (L-K); - K = L * K - (L-J) * K; - L = (L-K) * (K+J); - E1[L-1] = J + K + L; - E1[K-1] = J * K * L; - } + for (I = 1; I <= N6; I++) { + J = J * (K-J) * (L-K); + K = L * K - (L-J) * K; + L = (L-K) * (K+J); + E1[L-1] = J + K + L; + E1[K-1] = J * K * L; + } -/* -C -C Module 7: Trigonometric functions -C -*/ - X = 0.5; - Y = 0.5; + /* + C + C Module 7: Trigonometric functions + C + */ + X = 0.5; + Y = 0.5; - for (I = 1; I <= N7; I++) { - X = T * DATAN(T2*DSIN(X)*DCOS(X)/(DCOS(X+Y)+DCOS(X-Y)-1.0)); - Y = T * DATAN(T2*DSIN(Y)*DCOS(Y)/(DCOS(X+Y)+DCOS(X-Y)-1.0)); - } + for (I = 1; I <= N7; I++) { + X = T * DATAN(T2*DSIN(X)*DCOS(X)/(DCOS(X+Y)+DCOS(X-Y)-1.0)); + Y = T * DATAN(T2*DSIN(Y)*DCOS(Y)/(DCOS(X+Y)+DCOS(X-Y)-1.0)); + } -/* -C -C Module 8: Procedure calls -C -*/ - X = 1.0; - Y = 1.0; - Z = 1.0; + /* + C + C Module 8: Procedure calls + C + */ + X = 1.0; + Y = 1.0; + Z = 1.0; - for (I = 1; I <= N8; I++) - P3(X,Y,&Z); + for (I = 1; I <= N8; I++) + P3(X,Y,&Z); -/* -C -C Module 9: Array references -C -*/ - J = 1; - K = 2; - L = 3; - E1[1] = 1.0; - E1[2] = 2.0; - E1[3] = 3.0; + /* + C + C Module 9: Array references + C + */ + J = 1; + K = 2; + L = 3; + E1[1] = 1.0; + E1[2] = 2.0; + E1[3] = 3.0; - for (I = 1; I <= N9; I++) - P0(); + for (I = 1; I <= N9; I++) + P0(); -/* -C -C Module 10: Integer arithmetic -C -*/ - J = 2; - K = 3; + /* + C + C Module 10: Integer arithmetic + C + */ + J = 2; + K = 3; - for (I = 1; I <= N10; I++) { - J = J + K; - K = J + K; - J = K - J; - K = K - J - J; - } + for (I = 1; I <= N10; I++) { + J = J + K; + K = J + K; + J = K - J; + K = K - J - J; + } -/* -C -C Module 11: Standard functions -C -*/ - X = 0.75; + /* + C + C Module 11: Standard functions + C + */ + X = 0.75; - for (I = 1; I <= N11; I++) - X = DSQRT(DEXP(DLOG(X)/T1)); + for (I = 1; I <= N11; I++) + X = DSQRT(DEXP(DLOG(X)/T1)); -/* -C -C THIS IS THE END OF THE MAJOR LOOP. -C -*/ -#if 0 - if (++JJ <= II) - goto IILOOP; -#else - JJ++; - if (!benchmark_time_to_stop(BM_TYPE_FP)) { - goto IILOOP; + /* + C + C THIS IS THE END OF THE MAJOR LOOP. + C + */ + II++; } - II = JJ; -#endif + while (!benchmark_time_to_stop(BM_TYPE_FP)); /* C diff --git a/clientgui/MainFrame.cpp b/clientgui/MainFrame.cpp index a86f90f6bb..51beee6a58 100644 --- a/clientgui/MainFrame.cpp +++ b/clientgui/MainFrame.cpp @@ -21,6 +21,9 @@ // Revision History: // // $Log$ +// Revision 1.11 2004/05/22 01:36:36 rwalton +// *** empty log message *** +// // Revision 1.10 2004/05/21 06:27:15 rwalton // *** empty log message *** // @@ -97,6 +100,9 @@ CMainFrame::CMainFrame(wxString strTitle) : m_pFrameRenderTimer->Start(1000); // Send event every second + RestoreState(); + + wxLogTrace("CMainFrame::CMainFrame - Function Ending"); } @@ -111,6 +117,9 @@ CMainFrame::~CMainFrame(){ wxASSERT(NULL != m_pStatusbar); + SaveState(); + + if (m_pFrameRenderTimer) { m_pFrameRenderTimer->Stop(); delete m_pFrameRenderTimer;