Post Reply 
Benchmarks: A harness for running benchmarks
12-04-2017, 12:09 AM
Post: #1
Benchmarks: A harness for running benchmarks
A simple harness for selecting and running benchmarks.
You can tailor whether or not you want results printed, or in lists.
(For a definitive benchmark, you wouldn't choose both).

Stephen Lewkowicz (G1CMZ)
Visit this user's website Find all posts by this user
Quote this message in a reply
12-04-2017, 12:11 AM (This post was last modified: 12-05-2017 09:15 PM by StephenG1CMZ.)
Post: #2
RE: Benchmarks: A harness for running benchmarks
Version 0.1

Code:

 LOCAL ID:="Benchmarks V0.1 \n 2017 StephenG1CMZ";

 //IMPORT REQUIRED BENCHMARKS
 //IMPORT({MWIPS,SAVAGE);
 
 EXPORT ABOUT()
 BEGIN
  MSGBOX(ID);
  MSGBOX("A harness for benchmarks");
  MSGBOX("Refer to individual benchmarks");
 END;

 //CUSTOMISE
 //SELECT OUTPUT 
 //TO LIST OR TO SCREEN (OR LOGFILE TBD)
 EXPORT BenchmarkList:=1;
 EXPORT BenchmarkAns:={};
 EXPORT BenchmarkPrint:=1;
 //END CUSTOMISE

 EXPORT OUTREAL(LST)
 //REQUIRED TO OUTPUT OR USE RESULTS
 //HOW IS UNSPECIFIED
 BEGIN 
  //ONLY 1 OUTPUT IS REQUIRED
  //THE SELECTION/ALTERNATIVE IS AN OVERHEAD ANDSHOULDBE REMOVED
  IF BenchmarkPrint THEN
   PRINT(LST);
  END;
  IF BenchmarkList THEN
   BenchmarkAns(0):=LST;
  END;
 END;

 EXPORT BenchmarkReset()
 BEGIN
  PRINT();
  PRINT(ID);
  BenchmarkAns:={};
 END;

 EXPORT ChooseBenchmark()
 BEGIN
  LOCAL CHS;
  LOCAL BLST:={"","","Whetstone (MWIPS)","","Savage"};
  WHILE CHOOSE(CHS,"Benchmarks (UNVERIFIED)",BLST) DO
   CASE
    IF CHS==3  THEN
     BenchmarkPrint:=0; 
     //MWIPS(); 
     DRAWMENU("","","","","","Esc");
     WAIT();
    END;
    IF CHS==5 THEN 
     SAVAGE();   
     DRAWMENU("","","","","","Esc");
     WAIT();
  
    END;
    DEFAULT
    END;
  END;
 END;

 EXPORT BENCHMARKS()
 BEGIN
  ABOUT();
  ChooseBenchmark();
 END;

Note: There is a complication in getting Whetstones and Benchmarks to compile.
Whetstones requires OUTREAL, so Benchmarks must be compiled first...
Except Benchmarks requires MWIPS so Whetstones must be compiled first.

The lazy solution:
1 Comment out MWIPS
2 Compile Benchmarks
3 Compile Whetstones
4 Uncomment MWIPS and re-compile Benchmarks.
*** I forgot Step 4 in Version 0.1 ***

An alternative method:(with MWIPS uncommented as intended)
1 write an empty OUTREAL
2 Compile Whetstones
3 Compile Benchmarks
4 Recompile whichever OUTREAL you wish to use.

Stephen Lewkowicz (G1CMZ)
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)