Skip to content

Instantly share code, notes, and snippets.

@whitequark
Created February 25, 2016 16:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save whitequark/eeb0b961aa18da9345a1 to your computer and use it in GitHub Desktop.
Save whitequark/eeb0b961aa18da9345a1 to your computer and use it in GitHub Desktop.
#!/bin/sh
reset() {
ssh lab.m-labs.hk './miniconda/bin/artiq_flash -m qc1 start'; sleep 1s
}
ping -w 30 -i 0.5 -c 2 kc705.lab.m-labs.hk
timeout 30s artiq_run -vv $1 2>&1 | tee /tmp/artiq_run$$
if grep KERNEL_FINISHED /tmp/artiq_run$$; then
exit 0 # no crash
elif grep LOAD_FAILED /tmp/artiq_run$$; then
exit 0 # uninteresting crash
elif grep "LLVM IR parsing error" /tmp/artiq_run$$; then
exit 0 # uninteresting crash
elif grep 'TimeoutError' /tmp/artiq_run$$; then
reset
exit 1 # interesting crash
else
reset
exit 0 # uninteresting crash, but might've killed device
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment