I have 100 files, and I want to parallelise my submission to save time instead of running jobs one by one. How can I change this script to a Job-array in LSF using bsub submission system and run 10 jobs at every time?
#BSUB -J ExampleJob1 #Set the job name to "ExampleJob1"
#BSUB -L /bin/bash #Uses the bash login shell to initialize the job's execution environment.
#BSUB -W 2:00 #Set the wall clock limit to 2hr
#BSUB -n 1 #Request 1 core
#BSUB -R "span[ptile=1]" #Request 1 core per node.
#BSUB -R "rusage[mem=5000]" #Request 5000MB per process (CPU) for the job
#BSUB -M 5000 #Set the per process enforceable memory limit to 5000MB.
#BSUB -o Example1Out.%J #Send stdout and stderr to "Example1Out.[jobID]"
path=./home/
for each in *.bam
do
samtools coverage ${each} -o ${each}_coverage.txt
done
Thank you for your time; any help is appreciated. I am a starter at LSF and am quite confused.
You tagged your question with nextflow, so I will provide a minimal (untested) solution using Nextflow by enabling the LSF executor. By using Nextflow, we can abstract away the underlying job submission system and focus on writing the pipeline however trivial. I think this approach is preferable, but it does place a dependency on Nextflow. I think it's a small one and maybe it's overkill for your current requirements, but Nextflow comes with other benefits, like being able to modify and resume when those requirements inevitably change.
Contents of
main.nf:Contents of
nextflow.config:Run using:
Note also: