mirror of
https://github.com/sockspls/badfish
synced 2025-04-29 16:23:09 +00:00
Fix profile-build
After async I/O patches 'bench' changed behaviour and now waits for input at the end of the test run. This is due to listener thread stay blocked on std::getline() even after test run is finished, as soon as we feed something the thread unblocks and then quickly exits. This is not a big problem, but has the bad side effect of breaking profile builds that hang forever at the end of the test run. The tricky workaround is to create a pipe that connects to stockfish input and then, when test run is finished, breaking the pipe: this makes std::getline() immediately return. So this patch adds a 'sleep 10' piped into 'stockfish bench' test run command. After 10 seconds sleep ends, the pipe breaks and 'bench' finishes as usual. Thanks to Oliver Korff for reporting the issue, and to Mike Whiteley for having co-authored this solution. No functional change. Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
parent
43204d9ac2
commit
c2600a73cf
1 changed files with 3 additions and 3 deletions
|
@ -385,7 +385,7 @@ profile-build:
|
|||
$(MAKE) ARCH=$(ARCH) COMP=$(COMP) $(profile_make)
|
||||
@echo ""
|
||||
@echo "Step 2/4. Running benchmark for pgo-build ..."
|
||||
@$(PGOBENCH) > /dev/null
|
||||
@sleep 10 | $(PGOBENCH) > /dev/null
|
||||
@echo ""
|
||||
@echo "Step 3/4. Building final executable ..."
|
||||
@touch *.cpp
|
||||
|
@ -405,14 +405,14 @@ double-profile-build:
|
|||
$(MAKE) ARCH=x86-64 COMP=$(COMP) $(profile_make)
|
||||
@echo ""
|
||||
@echo "Step 2/6. Running benchmark for pgo-build (popcnt disabled)..."
|
||||
@$(PGOBENCH) > /dev/null
|
||||
@sleep 10 | $(PGOBENCH) > /dev/null
|
||||
@echo ""
|
||||
@echo "Step 3/6. Building executable for benchmark (popcnt enabled)..."
|
||||
@touch *.cpp *.h
|
||||
$(MAKE) ARCH=x86-64-modern COMP=$(COMP) $(profile_make)
|
||||
@echo ""
|
||||
@echo "Step 4/6. Running benchmark for pgo-build (popcnt enabled)..."
|
||||
@$(PGOBENCH) > /dev/null
|
||||
@sleep 10 | $(PGOBENCH) > /dev/null
|
||||
@echo ""
|
||||
@echo "Step 5/6. Building final executable ..."
|
||||
@touch *.cpp *.h
|
||||
|
|
Loading…
Add table
Reference in a new issue