Commit 8d88e40d authored by mova's avatar mova
Browse files

use run.sh script to submit multiple batches

parent 449f2564
......@@ -24,3 +24,15 @@ loadfile_parser.add_argument(
)
args = parser.parse_args()
if __name__ == "__main__":
import sys
for tag in args.tag.split(","):
command = ""
for e in sys.argv[1:]:
if e is not args.tag:
command += e + " "
else:
command += tag + " "
print(args.command + " " + tag + " " + command)
#!/bin/bash
if [[ $1 == 'local' ]]; then
REMOTE=false
elif [[ $1 == 'remote' ]]; then
REMOTE=true
else
echo "First argument must be local or remote."
exit 1
fi
shift
IFS=$'\n'
readarray -t lines < <(python ./fgsim/utils/cli.py $@)
for line in ${lines[@]}; do
IFS=' ' read -r -a linesplit <<< $line
CMD=${linesplit[0]}
TAG=${linesplit[1]}
RESTCMD=${linesplit[@]:2}
# echo "Line: $line"
# echo "... CMD $CMD tag $TAG Rest $RESTCMD"
if [[ $REMOTE == 'true' ]]; then
sbatch \
--partition=allgpu,cms-desy \
--time=24:00:00 \
--mail-type=ALL \
--nodes=1 \
--constraint="P100" \
--output=wd/slurm-$CMD-$TAG-%j.out \
--job-name=$CMD-$TAG-%j run_in_env.sh $RESTCMD
else
./run_in_env.sh $RESTCMD
fi
done
exit
#!/bin/bash
#SBATCH --partition=allgpu,cms-desy
#SBATCH --time=12:00:00
#SBATCH --mail-type=ALL
#SBATCH --nodes=1
#SBATCH --constraint="P100"
#SBATCH --output=wd/slurm-%j.out
#SBATCH --job-name=${2}
export LD_PRELOAD=""
source /etc/profile.d/modules.sh
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment