Comparaison des versions

Légende

  • Ces lignes ont été ajoutées. Ce mot a été ajouté.
  • Ces lignes ont été supprimées. Ce mot a été supprimé.
  • La mise en forme a été modifiée.

...

Example Bash Script

The following is a bash script called myFirstScript.sh. It will show an example of the above options in action.the example script slurm-mpi.sh. This can be found by running grab-examples when you log into SPORC. 

#!/bin/bash -l
#NOTE# NOTE the -l flag!
# myFirstScript.sh used to showcase the basic slurm
# commands. Modify this # This is an example job file for a multi-core MPI job.
# Note that all of the following statements below that begin
# with #SBATCH are actually commands to the SLURM scheduler
# Please copy this file to your home directory and modify it 
# to suit your needs.
#
# If you need any help,please email rc-help@rit.edu
#
# Name of the job - You'll probably want to customize this.
#SBATCH -J myFirstJobmpi_test
# Use the resources available on this account
#SBATCH -A myAccount
#Standard Standard out and Standard Error output files 
#SBATCH -o myFirstJobmpi_test.o
#SBATCH -e myFirstJobmpi_test.e
#To# To send mail for updates on the job#SBATCHemails, set the address below and remove one of the '#' sings
##SBATCH --mail-user=abc1234@rit.edu
#SBATCH --mail-type=ALL
#Request 4 Days, 6 Hours, 5 Minutes, 3 Seconds<email>
# notify on state change: BEGIN, END, FAIL, OR ALL
# 5 days is the run time MAX, # anything over will be KILLED#SBATCH -t 4-06:05:03
# Put in debug partition for testing small jobs, like this one
# But because our requested time is over 1 day, it won't run, so
# use any tier you have available
#SBATCH -p tier3
# Request 4 cores for one task, note how you can put multiple commands
# on one line
#SBATCH -n 1 -c 4
#Job memory requirements in MBunless you talk with RC
# Request 4 days and 5 hours
#SBATCH -t 4-5:0:0
#Put the job in the appropriate partition matching the account and request FOUR cours
#SBATCH - A <account_name> -p <onboard, tier1, tier2, tier3> -n 4
#Job membory requirements in MB=m (default), GB=g, or TB=t
#SBATCH --mem=300M#Job3g
#
# Your job script goes below this line.
#
echo " (${HOSTNAME}) sleeping for 1 minute to simulate work (ish)"
echo "(${HOSTNAME}) even though this script as claimed for cores"
echo "(${HOSTNAME}) ... it won't be using all "
sleep 60
echo " *(${HOSTNAME}) Ahhh, alarm clock!"

Download myFirstScript.sh

Running sbatch 

[abc1234@sporcsubmit ~]$ sbatch myFirstScriptslurm-mpi.sh
Submitted batch job 2914

...

See Using the Cluster - Advanced Usage for topics such as loops and dependent jobs. Some documentation will also give you example bash scripts for your specific program.

srun

srun is used for jobs that require MPI. It schedules your job to be ran on the Slurm Scheduler similar to sbatch. To use simply create an sbatch file like the example above and add srun ./<mpi_program> below the sbatch commands. Then run the sbatch file as you normally would.

sinteractive

If your job requires interaction or graphical components, use sinteractive. Here is the link to our documentation on sinteractive.

squeue

Lists the state of all jobs being run or scheduled to run. 

...