biowulf% sbatch myscript.sh --time=10:00:00
Answer
swarm -b 2 -f swarmfile swarm -p 2 -f swarmfile swarm -t 2 -f swarmfile
Answer
The -p 2 flag 'packs' the commands so that two commands (2 lines in your swarm command file) run simultaneously on the 2 CPUs of an allocated core. This flag is set to '1' by default, can only be set to '1' or '2', and can only be set to '2' for single-threaded processes.
The -t 2 flag allocates 2 CPUs to each process (1 line in your swarm command file). The default is '-t 1', and it should only be increased if the swarm is running multi-threaded processes.
#!/bin/bash cd /data/$USER module load bam2mpg bam2mpg --region chr1 --mpg aln.chr1.mpg.out ref.fasta aln.sort.bam
Answer
cd /data/$USER; bam2mpg --region chr1 --mpg aln1.chr1.mpg.out ref.fasta aln1.sort.bam cd /data/$USER; bam2mpg --region chr1 --mpg aln2.chr1.mpg.out ref.fasta aln2.sort.bam [..other such commands, one line for each bamfile...]and be submitted with
swarm -f swarmfile --module bam2mpg
sbatch --time=10:00:00 job1 sbatch --time=10:00:00 job2 [...]
Answer
Submitting it as a swarm simply adds a layer of overhead to the process and needlessly loads the batch system.
In general, you should choose to use either swarm or sbatch to submit a collection of jobs.