diff --git a/docker/bashrc b/docker/bashrc index f0e4bb29104396ad8ba0e239fc24c07f7f9ee28e..146be858b74bbb6bea7f7c57d9f88ddd1a08d6da 100644 --- a/docker/bashrc +++ b/docker/bashrc @@ -1,6 +1,10 @@ function csv_viewer { column -t -s, -n "$@" | less -F -S -X -K } +alias configure_default="/trainbenchmark/scripts/configure.sh 1 1024 900 10" +alias configure_medium="/trainbenchmark/scripts/configure.sh 8 256 60 5" +alias configure_small="/trainbenchmark/scripts/configure.sh 1 128 20 2" + alias doc_motd="bash /trainbenchmark/docs/motd" alias doc_basic="bash /trainbenchmark/docs/basic" alias doc_advanced="bash /trainbenchmark/docs/advanced" diff --git a/docker/tips b/docker/tips index ba8f3b2fba55a52068b45b9853dfdd536b6265d7..67710d85cd7d07b452865e86da31e3666f23f993 100644 --- a/docker/tips +++ b/docker/tips @@ -4,3 +4,4 @@ Use "doc_advanced" to see advanced configuration Use "csv_view" to get a nicely formatted output of csv files I am the Fog Frog What the Fog? +Use "./scripts/configure.sh" to change problem sizes. Some defaults are also inside the commands "configure_default", "configure_medium", "configure_small" diff --git a/docs/advanced b/docs/advanced index 1ff79dd35e7e1e28a58660843132509cfce4600a..5c0159e23a1a09823e8c1a8cbd3bd9ea5603af61 100644 --- a/docs/advanced +++ b/docs/advanced @@ -1,6 +1,9 @@ #!/bin/bash echo -e "\033[1;91mAdvanced Configuration:" echo -e "" +echo -e "\033[1;91mCoarse Configuration" +echo -e "\033[0mUse the ./scripts/configure.sh command or configure_small or configure_medium or configure_default" +echo -e "" echo -e "\033[1;91mGeneration of test-models" echo -e "\033[0mFor example to change the maxSize option. Can be configured inside:" echo -e "* trainbenchmark-scripts/src-template/GeneratorScript.groovy" diff --git a/docs/basic b/docs/basic index e453350baae0ab7c6bbb12f13c0fcde096d4439a..4daa18a5ccd3c79cd9cd04945251569557697746 100644 --- a/docs/basic +++ b/docs/basic @@ -1,6 +1,7 @@ #!/bin/bash echo -e "\033[1;96mQuick Start" -echo -e "\033[0m* ./gradlew generate # will generate the test-models in default settings takes ~40gb" +echo -e "\033[0m* configure_small" +echo -e "* ./gradlew generate # will generate the test-models in default settings takes ~40gb" echo -e "* ./gradlew individualInjectBenchmark" echo -e "* ./gradlew individualRepairBenchmark" echo -e "" diff --git a/scripts/configure.sh b/scripts/configure.sh new file mode 100755 index 0000000000000000000000000000000000000000..fb3a9d59b65c10bcaf509cf2965fc7ca89b8242b --- /dev/null +++ b/scripts/configure.sh @@ -0,0 +1,37 @@ +#!/bin/bash + +cd "$( cd "$( dirname "$0" )" && pwd )/../"||exit 1 + +MINSIZE="$1" +MAXSIZE="$2" +TIMEOUT="$3" +RUNS="$4" + +if [ -z "$RUNS" ] +then + echo "Usage: ./scripts/configure.sh min max timeout runs" + echo "Will configure the generateor and benchmark to use problems between sizes min and max" + echo "The benchmark receives a timeout in seconds and the amount of runs" + echo "Default is: ./scripts/configure.sh 1 1024 900 10" + exit 1 +fi + +echo -e "\\033[1;96mRemember that this only configures and initializes. Further steps:" +echo -e "\\033[1;91mGenerate:" +echo -e "\\033[0m if not yet done run ./gradlew generate" +echo " maxSize 1024 -> ~40GB of data" +echo -e "\\033[1;91mBenchmark:" +echo -e "\\033[0m ./gradlew individualInjectBenchmark" +echo " ./gradlew individualRepairBenchmark" + +sed -i "s/^def minSize =.*/def minSize = $MINSIZE/" ./trainbenchmark-scripts/src-template/GeneratorScript.groovy +sed -i "s/^def maxSize =.*/def maxSize = $MAXSIZE/" ./trainbenchmark-scripts/src-template/GeneratorScript.groovy +sed -i "s/^def minSize =.*/def minSize = $MINSIZE/" ./trainbenchmark-scripts/src-template/IndividualBenchmarkInjectScript.groovy +sed -i "s/^def maxSize =.*/def maxSize = $MAXSIZE/" ./trainbenchmark-scripts/src-template/IndividualBenchmarkInjectScript.groovy +sed -i "s/^def timeout =.*/def timeout = $TIMEOUT/" ./trainbenchmark-scripts/src-template/IndividualBenchmarkInjectScript.groovy +sed -i "s/^def runs =.*/def runs = $RUNS/" ./trainbenchmark-scripts/src-template/IndividualBenchmarkInjectScript.groovy +sed -i "s/^def minSize =.*/def minSize = $MINSIZE/" ./trainbenchmark-scripts/src-template/IndividualBenchmarkRepairScript.groovy +sed -i "s/^def maxSize =.*/def maxSize = $MAXSIZE/" ./trainbenchmark-scripts/src-template/IndividualBenchmarkRepairScript.groovy +sed -i "s/^def timeout =.*/def timeout = $TIMEOUT/" ./trainbenchmark-scripts/src-template/IndividualBenchmarkRepairScript.groovy +sed -i "s/^def runs =.*/def runs = $RUNS/" ./trainbenchmark-scripts/src-template/IndividualBenchmarkRepairScript.groovy +./gradlew --no-daemon initScripts