Skip to content

Commit

Permalink
added slurm scripts and a readme for using them
Browse files Browse the repository at this point in the history
  • Loading branch information
leobrowning92 committed May 1, 2018
1 parent b049b86 commit 90ce6aa
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 1 deletion.
13 changes: 13 additions & 0 deletions slurm/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
## Slurm instructions

the `srun.sh` script is a standalone script to run a single slurm job in the current working directory. This should usually be run in its own directory as it will generate a number of outfiles, as well as data and job id files.

it can be run, once the desired slurm and python parameters for the job are set in `srun.sh`, using:

sbatch srun.sh

The `sbatch.sh` file is used to batch creat a number of slurm jobs, and will generate its own measurement subdirectories for each parameter set. The example files will run 32 measurements on 32 cores for each job, and a job will be submitted for 6 stick densities, from 4 to 20 per um.

slurm parameters are set in the `srun_header.sh` file, while parameters for the python job are set in `sbatch.sh`. These must be checked to ensure they match, and for that reason could be integrated into a single script at some point. Usage is:

bash sbatch.sh
15 changes: 15 additions & 0 deletions slurm/sbatch.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash
# this dictates the number of measurements to be made, and for what densities
for density in 4 9 10 11 14 20
do
n=$(echo $density*3600 | bc)
echo $n
mkdir meas_32x$density
cp srun_header.sh meas_32x$density/srun.sh
echo 'python3 ~/gitrepos/networksim-cntfet/measure_perc.py -s --cores 32 --start '$n' --step 0 --number 32 --scaling 60'>>meas_32x$density/srun.sh
cd meas_32x$density/
output=$(sbatch srun.sh)
echo $output
touch 'jobid_'${output:20}
cd ..
done
2 changes: 1 addition & 1 deletion srun.sh → slurm/srun.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
#SBATCH -o outfile # send stdout to outfile
#SBATCH -e errfile # send stderr to errfile
#SBATCH -t 10:00:00 # time requested in hour:minute:second
#SBATCH --mem-per-cpu=1024
#SBATCH --mem-per-cpu=1024 #memory per task in MB
#SBATCH --mail-user=$USER@localhost
python3 ~/gitrepos/networksim-cntfet/measure_perc.py -s --cores 32 --start 36000 --step 0 --number 32 --scaling 60
8 changes: 8 additions & 0 deletions slurm/srun_header.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash
#SBATCH -N 1 # nodes requested
#SBATCH -n 32 # tasks requested. default is one core per task
#SBATCH -o outfile # send stdout to outfile
#SBATCH -e errfile # send stderr to errfile
#SBATCH --mem-per-cpu=1024
#SBATCH -t 24:00:00 # time requested in hour:minute:second
#SBATCH --mail-user=$USER@localhost

0 comments on commit 90ce6aa

Please sign in to comment.