001、
(base) [b20223040323@admin1 batch_test02]$ ls ## 测试sam文件 template.slurm test.sam (base) [b20223040323@admin1 batch_test02]$ cat template.slurm ## 测试模板 #!/bin/bash #SBATCH -J xxxx #SBATCH -p Cnode2 ##SBATCH -o %j.xxxx.result ##SBATCH -e %j.xxxx.error #SBATCH -N 1 #SBATCH -n xxxx #SBATCH --cpus-per-task=1 STIME=`date +%s` samtools view -@ xxxx -b -S test.sam > xxxx.bam let ETIME=`date +%s`-$STIME echo thread_xxxx Elapsed time: $ETIMEs > xxxx.time ## 分别给与4、16、32、64线程; 记录程序运行时间 (base) [b20223040323@admin1 batch_test02]$ for i in 4 16 32 64; do sed "s/xxxx/$i/g" template.slurm > $i.slurm; done (base) [b20223040323@admin1 batch_test02]$ find *.slurm | grep -v "template.slurm" | xargs -n 1 sbatch ## 投递任务 Submitted batch job 396044 Submitted batch job 396045 Submitted batch job 396046 Submitted batch job 396047
002、运行结果:
标签:文件,samtools,SBATCH,xxxx,sam,##,数对,slurm,batch From: https://www.cnblogs.com/liujiaxin2018/p/17742098.html