You want to run a job with serial application.
To accomplish this, follow the steps:
1.- Specify the resouces required in Slurm directives in job script. Use 1 node, 1 core, serial queue.
2.- Submit the job on login nodes. Please be aware that job submission is not possible on compute nodes.
Job script for a serial job. Save it using a meaningful filename. E.g., "serial_job.sh"
#!/bin/bash
#SBATCH -p serial
# Set number of nodes to run
#SBATCH --nodes=1
# Set number of tasks to run
#SBATCH --ntasks=1
# Set number of cores per task (default is 1)
#SBATCH --cpus-per-task=1
# Walltime format hh:mm:ss
#SBATCH --time=00:30:00
# Output and error files
#SBATCH -o job.%J.out
#SBATCH -e job.%J.err
# **** Put all #SBATCH directives above this line! ****
# **** Otherwise they will not be in effective! ****
#
# **** Actual commands start here ****
# Load modules here (safety measure)
module purge
# You may need to load gcc here .. This is application specific
# module load gcc
# Replace this with your actual command. 'serial-hello-world' for example
hostname
Submit the job, run the following command in terminal
sbatch serial_job.sh
At this point, a job is submitted. A job ID will appears on the screen. Mark it down for future reference.
Check your jobs
If you forgot your job id, this command shows you all your present jobs.
squeue -u <your-account-name>
This command shows more verbose information on your jobs, even the completed ones.
sacct --format="JobID,CPUTime,MaxRSS" -j <your-job-id>
Cancel your jobs
At some point, if you need to cancel your job
scancel <your-job-id>
see slurm_commands
page in the index for more info.
Normally, all lines begin with #
is commented out in bash script. However, all SLURM directives start with #SBATCH
. To comment out a SLURM directive, use ##SBATCH
to begin the line. E.g.,
# The line below is effective
#SBATCH --nodes=1
# The line below is commented out, ineffective
##SBATCH --nodes=1
# The line below is also commented out, as it starts with # but not with #SBATCH
# SBATCH --nodes=1
Receive email notification
# This line specifies the email address.
# Change it to your actual email address.
#SBATCH --mail-user=first.last@nyu.edu
#
# This line specifies when you want to be alerted.
# If you set it to ALL, you will receive email notifications
# when the job starts, ends, aborts, resubmits.
# Another useful option is END. In this case you will only
# receive notification when the job ends.
#SBATCH --mail-type=ALL
Specify memory for the job
# This directive set the memory required by the job per node
# This example set the memory to 10GB per node
#SBATCH --mem=10G
NYUAD HPC Apps Team:
--------------------
- Benoit Marchand
- Guowei He
- Jorge Naranjo
Please refer to the online documentation available here