Skip to content
Snippets Groups Projects
Commit 79135c09 authored by AdminXVII's avatar AdminXVII Committed by Michael Aaron Murphy
Browse files

Run one process per CPU

parent c1df8c06
No related branches found
No related tags found
No related merge requests found
...@@ -68,14 +68,17 @@ export TAGFAIL ...@@ -68,14 +68,17 @@ export TAGFAIL
export TAGPASS export TAGPASS
export EXAMPLES_DIR export EXAMPLES_DIR
# See https://prefetch.net/blog/2017/08/17/using-xargs-and-lscpu-to-spawn-one-process-per-cpu-core/
CPU_CORES=$(lscpu -p=CORE,ONLINE | grep -c 'Y')
# Build debug binary # Build debug binary
cargo +$TOOLCHAIN build cargo +$TOOLCHAIN build
# Iterate over every Ion script in examples directory # Iterate over every Ion script in examples directory
ls -1 $EXAMPLES_DIR/*.ion | xargs -P 0 -n 1 -I {} bash -c "check_return_value {}" ls -1 $EXAMPLES_DIR/*.ion | xargs -P $CPU_CORES -n 1 -I {} bash -c "check_return_value {}"
# Iterate over every parameter set # Iterate over every parameter set
ls -1 $EXAMPLES_DIR/*.params | xargs -P 0 -n 1 -I {} bash -c "test_cli {}" ls -1 $EXAMPLES_DIR/*.params | xargs -P $CPU_CORES -n 1 -I {} bash -c "test_cli {}"
# Build debug binary for testing structopt argument parsing # Build debug binary for testing structopt argument parsing
cargo +$TOOLCHAIN build --features=advanced_arg_parsing cargo +$TOOLCHAIN build --features=advanced_arg_parsing
# Iterate over every parameter set # Iterate over every parameter set
ls -1 $EXAMPLES_DIR/*.params | xargs -P 0 -n 1 -I {} bash -c "test_cli {}" ls -1 $EXAMPLES_DIR/*.params | xargs -P $CPU_CORES -n 1 -I {} bash -c "test_cli {}"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment