There's no way to convey this to sbatch.  But you can modify your script to 
achieve parallel execution by adding an ampersand to your srun lines:

#!/bin/bash
srun -n 1 script1.py &
srun -n 1 script2.py &
srun -n 1 script3.py

> -----Original Message-----
> From: [email protected] [mailto:owner-slurm-
> [email protected]] On Behalf Of Chris Rataj
> Sent: Thursday, November 03, 2011 2:05 PM
> To: [email protected]
> Subject: [slurm-dev] Running multiple tasks from a single batch script
> 
> Hi
> I'm new to SLURM, and i encountered a problem.
> I tried to use sbatch to run parallel tasks from a single batch
> script, but, as i noticed, they are being run sequentially. What
> should i do to force sbatch to run all tasks simultaneously?
> 
> Code:
> Master script:
> 
> `sbatch -n "$count" -c 1 -J Name script.log`
> 
> where $count is the number of tasks to run and script.log is the batch
> script
> 
> Batch script:
> 
> #!/bin/bash
> srun -n 1 script1.py
> srun -n 1 script2.py
> srun -n 1 script3.py
> 
> Any ideas?

Reply via email to