Created
July 30, 2015 09:15
-
-
Save matthewrmshin/8d73ccc405dfedfcd18c to your computer and use it in GitHub Desktop.
Test cylc scan
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -eu | |
begin() { | |
for I in $(seq -w 1 30); do | |
mkdir -p "${HOME}/cylc-run/scan-test-${I}" | |
cat >"${HOME}/cylc-run/scan-test-${I}/suite.rc" <<'__SUITERC__' | |
[scheduling] | |
[[dependencies]] | |
graph = t1 | |
[runtime] | |
[[t1]] | |
script = false | |
__SUITERC__ | |
cylc register "scan-test-${I}" "${HOME}/cylc-run/scan-test-${I}" | |
cylc run "scan-test-${I}" | |
done 1>'/dev/null' 2>&1 | |
} | |
finish() { | |
for I in $(seq -w 1 30); do | |
cylc shutdown '--interval=5' '--max-polls=12' "scan-test-${I}" & | |
done 1>'/dev/null' 2>&1 | |
wait | |
cylc unregister 'scan-test-\d\d' 1>'/dev/null' 2>&1 | |
rm -fr "${HOME}/cylc-run/scan-test-"* | |
} | |
timeit() { | |
python -m timeit -n "${1:-10}" -r 1 ' | |
from subprocess import Popen, PIPE | |
Popen(["cylc", "scan", "localhost"], stdout=PIPE).wait() | |
' | |
} | |
FUNC="${1:-'timeit'}" | |
shift 1 | |
${FUNC} "$@" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment