Do this by having a reinit thread that is told via a queue which device to restart.
If this thread fails to return from opencl code, it should not interrupt the workings of other devices.
Method for WIN32
- Add a hidden '--bench-algo' option to cgminer that only
benchmarks the specified algorithm.
- Create a chunk of shared mem
- Launch a new instance of cgminer with --bench-algo, and
act as a debugger for it to silently catch crashes.
- Once it completes, either successfully or because of a
crash, read benchmarked value from shared mem
The --algo switch now accepts the "auto" argument.
When "auto" is passed to --algo, cgminer starts by benchmarking
all the CPU algorithms it nows about and picks the fastest.
This is useful for benchmarking, but also for folks who run
cgminer on a large number of heterogeneous computers because
it saves them from having to configure each instance optimally.
Caveat emptor: depending on the platform, some algorithms will
fail with "illegal instruction" (e.g. via padlock code on non via
platforms, or SSE4 code on non SSE4 platforms).
To protect against this, cgminer runs the benchmarks in a child
process. The crash, if any occurs in the child, and the parent
marks this algo as "fails" and continues benchmarking the next
algorithm.
Unfortunately, this safeguard is only implemented for Linux
because I have no clue how to do this on win32 (nor access to
a win32 box).
Option lets user specify a command <cmd> that will get
forked by cgminer on startup. cgminer's stderr output
subsequently gets piped directly to this command.
This permits smart batch monitoring of the miner by a
baby-sitter log parser while retaining the full benefit
of the curses interface, e.g. when running cgminer under
screen.
Doing the same thing is possible using advanced bash
redirection paraphernalia, but it is somewhat of a pain,
especially when running screen'd.
This option makes things more straightforward.