tromp / cuckoo

a memory-bound graph-theoretic proof-of-work system
Other
822 stars 173 forks source link

Feature request: Add structured output #64

Closed casey closed 5 years ago

casey commented 5 years ago

I'm working on a tool that runs a bunch of cuckoo cycle solvers and saves output (including time, algorithm use, and graph size) to a file. The hope is that people in the community will use this tool to benchmark and report their GPU/CPU performance, which I can then use to produce a public website that shows the performance of the different solvers and algorithms across different GPUs and CPUs.

You can see the current work in progress code here.

Parsing data from the solver output was pretty painful. Would you consider adding some kind of structured output, for example JSON, to make such tools easier to write? Ideally it would log all parameters that the solver was launched with, information on the CPU or GPU which the solver was running on, and information about solution times for the graphs searched.

tromp commented 5 years ago

Wouldn't you rather use the provided

CALL_CONVENTION int run_solver(SolverCtx ctx, char header, int header_length, u32 nonce, u32 range, SolverSolutions solutions, SolverStats stats )

// Solver statistics, to be instantiated by caller // and filled by solver if desired struct SolverStats { u32 device_id = 0; u32 edge_bits = 0; char plugin_name[MAX_NAME_LEN]; // will be filled in caller-side char device_name[MAX_NAME_LEN]; bool has_errored = false; char error_reason[MAX_NAME_LEN]; u32 iterations = 0; u64 last_start_time = 0; u64 last_end_time = 0; u64 last_solution_time = 0; };

API for that?

casey commented 5 years ago

😭Yes, yes I would. Thanks for the tip!

casey commented 5 years ago

What is the suggested way to call that function? It's defined in mean.cu, along with main, but I'd like to call it from a separate binary with a different main function.

tromp commented 5 years ago

What is the suggested way to call that function? It's defined in mean.cu, along with main, but I'd like to call it from a separate binary with a different main function.

If you compile mean.cu into a .so library, the main() function will be ignored and absent in the library. You can then write your own program using the API and link with the library. That's what grin-miner does.

regards, -John

casey commented 5 years ago

Gotcha, that makes sense. Thanks!