User Tools

Site Tools


slurm

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
slurm [2025/06/30 10:52] amcguireslurm [2025/06/30 17:59] (current) amcguire
Line 93: Line 93:
  
 <code> <code>
-(base) amcguire@fe01:~$ cat mpi-hello.c +amcguire@fe01:~$ cat mpi-hello.c 
 #include <mpi.h> #include <mpi.h>
 #include <unistd.h> #include <unistd.h>
Line 120: Line 120:
     MPI_Finalize();     MPI_Finalize();
 } }
 +amcguire@fe01:~$ cat hello-job.sh
 +#!/bin/bash
 +#SBATCH -J mpi-hello            # Job name
 +#SBATCH -n 2                    # Number of processes
 +#SBATCH -t 0:10:00              # Max wall time
 +#SBATCH -o hello-job.out        # Output file name
  
-(base) amcguire@fe01:~$ mpicc -o mpi-hello mpi-hello.c +# Disable the Infiniband transport for OpenMPI (not present on all clusters) 
-(base) amcguire@fe01:~$ ls -l mpi-hello+#export OMPI_MCA_btl="^openib" 
 + 
 +# Run the job (assumes the batch script is submitted from the same directory) 
 +mpirun -np 2 ./mpi-hello 
 + 
 +amcguire@fe01:~$ mpicc -o mpi-hello mpi-hello.c 
 +amcguire@fe01:~$ ls -l mpi-hello
 -rwxrwx--- 1 amcguire amcguire 16992 Jun 30 10:49 mpi-hello -rwxrwx--- 1 amcguire amcguire 16992 Jun 30 10:49 mpi-hello
 +amcguire@fe01:~$ sbatch -w p001,p002 -p peanut-cpu hello-job.sh
 +Submitted batch job 1196702
 +amcguire@fe01:~$ cat hello-job.out 
 +Hello from process 0 of 2 on host p001
 +Hello from process 1 of 2 on host p002
 </code> </code>
  
/var/lib/dokuwiki/data/attic/slurm.1751298729.txt.gz · Last modified: 2025/06/30 10:52 by amcguire

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki