from itertools import product
import os 
import subprocess 
import shutil
import itertools
from itertools import product
import os 
import subprocess 
import shutil
import itertools
name = "initial_kg"
SLURMSCRIPT = "#!/bin/bash" \
                    + f"\n#SBATCH --job-name=gen_kg" \
                    +"\n#SBATCH --output=./logs/generate_kg.out" \
                    +"\n#SBATCH --error=./logs/generate_kg.err" \
                    +"\n#SBATCH --partition=general" \
                    +"\n#SBATCH --time=7:00:00" \
                    +"\n#SBATCH --mem=64G" \
                    +"\n#SBATCH --nodes=1" \
                    +"\n#SBATCH --exclude=babel-6-17"\
                    +"\n#SBATCH --requeue"\
                    +"\nsource ../../miniconda3/etc/profile.d/conda.sh"\
                    +"\nconda activate sa"\
                    +f"\n python build_kg.py --save_file {name}" 
f = open("jobarrayscriptgenkg.sbatch", "w")
f.write(SLURMSCRIPT)
f.close()
subprocess.run(f'sbatch jobarrayscriptgenkg.sbatch', shell=True)