Post Reply 
Benchmarks: A harness for running benchmarks
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)
https://my.numworks.com/python/steveg1cmz
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Benchmarks: A harness for running benchmarks - StephenG1CMZ - 12-04-2017 12:11 AM



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