#!/usr/bin/env python3 import os import shutil nofJobs = 1000 timeLimit="08:00:00" #All data in data dir will be removed removeData = False dataDir = "/lustre/nyx/cbm/users/slebedev/hades/data/digipar/" logFile = dataDir + "/log/log_slurm-%A_%a.out" errorFile = dataDir + "/error/error_slurm-%A_%a.out" jobName = "HRICH" if removeData: print("All data in dataDir will be removed. Dir:" + dataDir) print("Removing...") if os.path.exists(dataDir): shutil.rmtree(dataDir) os.makedirs(dataDir) print("All data was removed.") if os.path.exists(os.path.dirname(logFile)): shutil.rmtree(os.path.dirname(logFile)) os.makedirs(os.path.dirname(logFile)) if os.path.exists(os.path.dirname(errorFile)): shutil.rmtree(os.path.dirname(errorFile)) os.makedirs(os.path.dirname(errorFile)) #-p debug commandStr=('sbatch --job-name={} --time={} --output={} --error={} --array=1-{} batch_job.py {}').format(jobName, timeLimit, logFile, errorFile, nofJobs, dataDir) #print(commandStr) os.system(commandStr)