plb2 icon indicating copy to clipboard operation
plb2 copied to clipboard

Reduction of Sudoku output

Open SpinTensor opened this issue 1 year ago • 3 comments

All BMs give only a single number as output for validating the computational result, except the Sudoku one, which spits out the solved sudokus several times. This might slow down the program, as the computations might wait on the return of the print functions. Maybe this should be reduced to one of the Sudokus only, to better measure the computational time?

SpinTensor avatar Jan 05 '24 11:01 SpinTensor

Yes, good point. Sudoku is the only benchmark here that repeats the same input. I worry compiler might optimize key functions out if there is no outcome, so force the programs to output. Perhaps we may sum over the middle number (i.e. out[41]). I may try this at some point.

attractivechaos avatar Jan 05 '24 14:01 attractivechaos

I worry compiler might optimize key functions out if there is no outcome, so force the programs to output.

Writing to /dev/null seems like it would be a better option than printing.

nsajko avatar Jan 06 '24 12:01 nsajko

Yes /dev/null helps because the frame-buffer of the terminal, or the filesystem does not need to answer to the program. I agree that the some output must be written, and preferably in a way that does not allow optimizations. I think the sum of a number from the sudoku would be good. Basically sum over out[41] for all 200 Sudokus. This way nothing can be dropped.

SpinTensor avatar Jan 06 '24 16:01 SpinTensor