#!/usr/bin/env bash

# Parameters
versions=("v0" "v1" "v2")
q_values=(20 21 22 23 24 25 26 27 28 29 30)

# Make scripts
for version in "${versions[@]}"; do
  for q in "${q_values[@]}"; do
    filename="Bitnc${version^^}Q${q}.sh"  # Convert v0 -> V0 etc...
    cat > "$filename" <<EOL
#! /usr/bin/env bash

#SBATCH --job-name=Bitnc${version^^}Q${q}
#SBATCH --nodes=1
#SBATCH --gres=gpu:1
#SBATCH --time=10:00

module load gcc/9.2.0 cuda/11.1.0

./out/${version}/bitonicCUDA -v --validation --perf 7 -b 512 -q ${q}

EOL
    echo "Create: $filename"
  done
done