summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam M. Stück <adam@adast.xyz>2022-12-09 11:22:27 +0100
committerAdam M. Stück <adam@adast.xyz>2022-12-17 17:03:17 +0100
commit4927c63c5bec873709e4fca7d6ae2748b5fdebb5 (patch)
tree759df2011792a286f0dd41f5b2c91010b8d33aa9
parent4e2d6e247fb8e461cf81f6d8a3204a2e214dc261 (diff)
Simplified 'start_jobs' function
-rwxr-xr-xstart16
1 files changed, 4 insertions, 12 deletions
diff --git a/start b/start
index 596d81c..d4d0cc8 100755
--- a/start
+++ b/start
@@ -47,26 +47,18 @@ main() {
OUTPUT_PATH="$OUTPUT_PATH/$(date -u +"%d-%m-%YT%H.%M.%S")"
mkdir -p "$OUTPUT_PATH/pipeline"
cp -r "$PIPELINE_PATH" "$OUTPUT_PATH"
- start_jobs $USE_SBATCH "$MODELS_PATH"
+ start_jobs
}
start_jobs() {
- USE_SBATCH=$1
- MODELS_PATH=$2
-
STRAT_LEN=${#STRATEGIES[@]}
serialize_array STRATEGIES STRAT_STR "|"
- ALL_MODELS=$(find "$MODELS_PATH" -type d -printf '%f\n' | tail -n+2 | sort | head -n "$NUM_PROBLEMS")
-
TOTAL_TIME_LIMIT=$(echo "($TIME_LIMIT * $STRAT_LEN * 16) / 60 + 1" | bc)
- for MODEL in $ALL_MODELS; do
- if [ "$USE_SBATCH" == "true" ]; then
- sbatch --time "$TOTAL_TIME_LIMIT" "$PIPELINE_PATH/run-model" "$PIPELINE_PATH/verifypn-linux64" "$TIME_LIMIT" "$STRAT_STR" "$MODELS_PATH/$MODEL" "$OUTPUT_PATH/$MODEL.csv"
- else
- timeout "${TOTAL_TIME_LIMIT}m" "$PIPELINE_PATH/run-model" "$PIPELINE_PATH/verifypn-linux64" "$TIME_LIMIT" "$STRAT_STR" "$MODELS_PATH/$MODEL" "$OUTPUT_PATH/$MODEL.csv"
- fi
+ for MODEL in $(ls "$MODELS_PATH" | head -n "$NUM_PROBLEMS"); do
+ sbatch --time "$TOTAL_TIME_LIMIT" "$PIPELINE_PATH/run-model" "$BINARY" "$TIME_LIMIT" "$STRAT_STR" "$MODELS_PATH/$MODEL" "$OUTPUT_PATH/$MODEL.csv"
+ # timeout "${TOTAL_TIME_LIMIT}m" "$PIPELINE_PATH/run-model" "$BINARY" "$TIME_LIMIT" "$STRAT_STR" "$MODELS_PATH/$MODEL" "$OUTPUT_PATH/$MODEL.csv"
done
}