Feb 18, 2015, 2:36 PM
Post #1 of 2
I have the following Bash script for job submission to SLURM on a cluster:
How can I convert my script for submitting SLURM jobs from Bash to Perl?
#SBATCH -A 1234
#SBATCH -t 2-00:00
#SBATCH -n 24
module add xxx
The #SBATCH lines are SLURM commands:
#SBATCH -A 1234 is the project number (1234)
#SBATCH -t 2-00:00 is the job time
#SBATCH -n 24 is the number of cores
module add xxx loads the Environment Module xxx (in this case I'm actually using module add gaussian, where gaussian is a computational quantum-chemistry program).
srun is the SLURM command to launch a job. resp.com includes commands for gaussian and atom coordinates.
I tried converting the Bash script to the following Perl script, but it didn't work. How can I do this in Perl?
system ("#SBATCH -A 1234");
system ("#SBATCH -t 2-00:00");
system ("#SBATCH -n 24");
system ("module add xxx");
system ("srun resp.com ");