| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192 |
- #!/bin/bash
- fast=false
- ncpus=$(nproc)
- while -n "$1"; do
- if [ "$1" == "--fast" ]; then
- fast=true
- elif [ "$1" == "-n" ]; then
- ncpus="$2"
- shift
- fi
- shift
- done
- abort() {
- echo "Step $1 failed."
- echo "To restart from this step, try running:"
- if [ "$1" == "setup" ]; then
- echo " rm -rf belarus-2020-2021 cmz lox-new lox-old sigma-compiler simga-proofs spongefish"
- elif [ "$1" == "belarus" ]; then
- echo " rm -rf appendix-a-results.{pdf,tex} section-3-results"
- echo " docker stop tp-belarus"
- echo " docker rm tp-belarus"
- elif [ "$1" == "lox-gen" ]; then
- echo " rm -rf parsing-results/{lox-{old,new},troll-patrol}"
- echo " docker stop {lox-{old,new},troll-patrol}-{trust_levels,invitations,blockage_migration{05,50,100}}.log troll-patrol-reporting.log"
- echo " docker rm {lox-{old,new},troll-patrol}-{trust_levels,invitations,blockage_migration{05,50,100}}.log troll-patrol-reporting.log"
- elif [ "$1" == "lox-eval" ]; then
- echo " rm -f appendix-b-results.{pdf,tex} table-{2,3}-results.{pdf,tex}"
- echo " docker stop tp-lox"
- echo " docker rm tp-lox"
- fi
- echo "Then run this script again."
- echo "Exiting..."
- exit 1
- }
- if [ -z "$(command -v numactl)" ]; then
- echo "This script uses numactl to isolate each experiment to a single processing unit."
- echo "You do not seem to have numactl installed. You can still run this script without numactl, but this may affect the results."
- read -p "Continue without numactl? [y/N] " confirm
- confirm=$(echo "$confirm" | tr '[:lower:]' '[:upper:]')
- if [[ "$confirm" != "Y" && "$confirm" != "YES" ]]; then
- exit 1
- else
- echo "Continuing without numactl"
- fi
- fi
- # Set up dockers
- if [ ! -d troll-patrol ]; then
- # Clean up any remnants of previous attempts and try again
- rm -rf belarus-2020-2021 cmz lox-new lox-old sigma-compiler simga-proofs spongefish
- # Set up our dockers
- ./scripts/setup.sh || abort "setup"
- fi
- # Get Belarus results
- if [[ ! -f appendix-a-results.pdf || ! -f section-3-results ]]; then
- # Clean up any remnants of previous attempts and try again
- rm -f appendix-a-results.{pdf,tex} section-3-results
- if [ "$1" == "--fast" ]; then
- ./scripts/belarus.sh --fast || abort "belarus"
- else
- ./scripts/belarus.sh || abort "belarus"
- fi
- fi
- # Run Lox benchmarks
- if [[ ! -d parsing-results/lox-old || ! -d parsing-results/lox-new || ! -d parsing-results/troll-patrol ]]; then
- # Clean up any remnants of previous attempts and try again
- rm -rf parsing-results/{lox-{old,new},troll-patrol}
- ./scripts/generate-lox-results.sh -n "$ncpus" || abort "lox-gen"
- fi
- # Process Lox benchmark results
- if [[ ! -f appendix-b-results.pdf || ! -f table-2-results.pdf || ! -f table-3-results.pdf ]]; then
- # Clean up any remnants of previous attempts and try again
- rm -f appendix-b-results.{pdf,tex} table-{2,3}-results.{pdf,tex}
- ./scripts/process-lox-results.sh || abort "lox-eval"
- fi
- echo "Done!"
- echo "Results from Section 3 can be found in the section-3-results file."
- echo "Table 4 (in Appendix A) can be found in appendix-a-results.pdf."
- echo "Results from Section 6 (Tables 2 and 3) can be found in the table-2-results.pdf and table-3-results.pdf files."
- echo "Table 5 (in Appendix B) can be found in appendix-b-results.pdf."
|