From 4927c63c5bec873709e4fca7d6ae2748b5fdebb5 Mon Sep 17 00:00:00 2001 From: "Adam M. Stück" Date: Fri, 9 Dec 2022 11:22:27 +0100 Subject: Simplified 'start_jobs' function --- start | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) (limited to 'start') 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 } -- cgit v1.2.3-70-g09d2