Skip to content

Instantly share code, notes, and snippets.

@sean-smith
Last active July 30, 2020 00:19

Revisions

  1. Sean Smith revised this gist May 8, 2020. 1 changed file with 22 additions and 0 deletions.
    22 changes: 22 additions & 0 deletions schedulers.md
    Original file line number Diff line number Diff line change
    @@ -48,4 +48,26 @@ Example job submission script:
    #SBATCH --output=%x_%j.out
    module load openmpi
    mpirun job
    ```


    # Run Job on All Nodes

    ## SGE
    ```bash
    NODES=30
    CORES=36
    qsub -t 1-$NODES:1 -pe mpi $NODES*$CORES job.sh
    ```

    ## SLURM

    ```bash
    NODES=30
    srun --ntasks-per-node 1 --ntasks $NODES job.sh
    ```

    ## TORQUE
    ```bash
    qsub -l nodes=$NODES:ppn=1 job.sh
    ```
  2. Sean Smith revised this gist May 8, 2020. 1 changed file with 22 additions and 11 deletions.
    33 changes: 22 additions & 11 deletions schedulers.md
    Original file line number Diff line number Diff line change
    @@ -1,16 +1,16 @@
    # General

    | | sge | slurm | torque |
    |------------------------|---------------------|------------|--------------|
    | Submit Interactive Job | qlogin | srun | qsub -I |
    | Submit Batch Job | qsub | sbatch | qsub |
    | Number of Slots | -pe mpi [n] | -n [n] | -l ppn=[n] |
    | Number of Nodes | -pe mpi [slots * n] | -N [n] | -l nodes=[n] |
    | Cancel Job | qdel | scancel | qdel |
    | See Queue | qstat | squeue | qstat |
    | See Nodes | qhost | sinfo -N | pbsnodes |
    | Script Directive | #$ | #SBATCH | #PBS |
    | Job Name | -N [name] | --job-name | -N [name] |
    | | sge | slurm | torque |
    |------------------------|---------------------|-------------------|--------------|
    | Submit Interactive Job | qlogin | srun | qsub -I |
    | Submit Batch Job | qsub | sbatch | qsub |
    | Number of Slots | -pe mpi [n] | -n [n] | -l ppn=[n] |
    | Number of Nodes | -pe mpi [slots * n] | -N [n] | -l nodes=[n] |
    | Cancel Job | qdel | scancel | qdel |
    | See Queue | qstat | squeue | qstat |
    | See Nodes | qhost | sinfo -N | pbsnodes |
    | Script Directive | #$ | #SBATCH | #PBS |
    | Job Name | -N [name] | --job-name [name] | -N [name] |

    # Slurm

    @@ -37,4 +37,15 @@ Fri May 8 16:49:47 2020
    NODELIST NODES PARTITION STATE CPUS S:C:T MEMORY TMP_DISK WEIGHT AVAIL_FE REASON
    ip-10-0-10-70 1 compute* idle 72 72:1:1 1 0 1 (null) none
    ip-10-0-10-133 1 compute* idle 72 72:1:1 1 0 1 (null) none
    ```

    Example job submission script:

    ```bash
    #!/bin/bash
    #SBATCH --job-name=test
    #SBATCH --ntasks=8
    #SBATCH --output=%x_%j.out
    module load openmpi
    mpirun job
    ```
  3. Sean Smith revised this gist May 8, 2020. 1 changed file with 13 additions and 17 deletions.
    30 changes: 13 additions & 17 deletions schedulers.md
    Original file line number Diff line number Diff line change
    @@ -1,29 +1,25 @@
    # General Reference
    # General

    | | sge | slurm | torque |
    |------------------------|-------------|------------|-------------------|
    | Submit Interactive Job | qlogin | srun | qsub -I |
    | Submit Batch Job | qsub | sbatch | qsub |
    | Number of Slots | -pe mpi [n] | -n [n] | -l nodes=1:ppn=16 |
    | Number of Nodes | qdel | scancel | qdel |
    | See Queue | qstat | squeue | qstat |
    | See Nodes | qhost | sinfo -N | pbsnodes |
    | Script Directive | #$ | #SBATCH | #PBS |
    | Job Name | -N [name] | --job-name | -N [name] |
    | | sge | slurm | torque |
    |------------------------|---------------------|------------|--------------|
    | Submit Interactive Job | qlogin | srun | qsub -I |
    | Submit Batch Job | qsub | sbatch | qsub |
    | Number of Slots | -pe mpi [n] | -n [n] | -l ppn=[n] |
    | Number of Nodes | -pe mpi [slots * n] | -N [n] | -l nodes=[n] |
    | Cancel Job | qdel | scancel | qdel |
    | See Queue | qstat | squeue | qstat |
    | See Nodes | qhost | sinfo -N | pbsnodes |
    | Script Directive | #$ | #SBATCH | #PBS |
    | Job Name | -N [name] | --job-name | -N [name] |

    # Slurm Cheatsheet
    # Slurm

    Submit jobs with:
    ```
    $ sbatch
    $ srun
    ```

    | | sge | slurm | torque |
    |-----------------|-----|-------|--------|
    | number of nodes | N/A | -N | |
    | number of vcpus | -np | -n | |

    See the queue with:
    ```
    $ squeue
  4. Sean Smith revised this gist May 8, 2020. 1 changed file with 13 additions and 0 deletions.
    13 changes: 13 additions & 0 deletions schedulers.md
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,16 @@
    # General Reference

    | | sge | slurm | torque |
    |------------------------|-------------|------------|-------------------|
    | Submit Interactive Job | qlogin | srun | qsub -I |
    | Submit Batch Job | qsub | sbatch | qsub |
    | Number of Slots | -pe mpi [n] | -n [n] | -l nodes=1:ppn=16 |
    | Number of Nodes | qdel | scancel | qdel |
    | See Queue | qstat | squeue | qstat |
    | See Nodes | qhost | sinfo -N | pbsnodes |
    | Script Directive | #$ | #SBATCH | #PBS |
    | Job Name | -N [name] | --job-name | -N [name] |

    # Slurm Cheatsheet

    Submit jobs with:
  5. Sean Smith revised this gist May 8, 2020. No changes.
  6. Sean Smith renamed this gist May 8, 2020. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  7. Sean Smith revised this gist May 8, 2020. 1 changed file with 16 additions and 1 deletion.
    17 changes: 16 additions & 1 deletion slurm.md
    Original file line number Diff line number Diff line change
    @@ -1,11 +1,26 @@
    # Slurm Cheatsheet

    Submit jobs with:
    ```
    $ squeue
    $ sbatch
    $ srun
    ```

    | | sge | slurm | torque |
    |-----------------|-----|-------|--------|
    | number of nodes | N/A | -N | |
    | number of vcpus | -np | -n | |

    See the queue with:
    ```
    $ squeue
    ```

    Cancel Jobs with:
    ```
    $ scancel [jobid]
    ```

    See the nodes details:
    ```
    $ sinfo -Nl
  8. Sean Smith revised this gist May 8, 2020. 1 changed file with 4 additions and 0 deletions.
    4 changes: 4 additions & 0 deletions slurm.md
    Original file line number Diff line number Diff line change
    @@ -4,6 +4,10 @@
    $ squeue
    $ sbatch
    $ srun
    ```

    See the nodes details:
    ```
    $ sinfo -Nl
    Fri May 8 16:49:47 2020
    NODELIST NODES PARTITION STATE CPUS S:C:T MEMORY TMP_DISK WEIGHT AVAIL_FE REASON
  9. Sean Smith revised this gist May 8, 2020. 1 changed file with 5 additions and 1 deletion.
    6 changes: 5 additions & 1 deletion slurm.md
    Original file line number Diff line number Diff line change
    @@ -4,5 +4,9 @@
    $ squeue
    $ sbatch
    $ srun
    $ sinfo
    $ sinfo -Nl
    Fri May 8 16:49:47 2020
    NODELIST NODES PARTITION STATE CPUS S:C:T MEMORY TMP_DISK WEIGHT AVAIL_FE REASON
    ip-10-0-10-70 1 compute* idle 72 72:1:1 1 0 1 (null) none
    ip-10-0-10-133 1 compute* idle 72 72:1:1 1 0 1 (null) none
    ```
  10. Sean Smith created this gist May 6, 2020.
    8 changes: 8 additions & 0 deletions slurm.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,8 @@
    # Slurm Cheatsheet

    ```
    $ squeue
    $ sbatch
    $ srun
    $ sinfo
    ```