Commit ea3f9c53 authored by Christopher Werner's avatar Christopher Werner
Browse files

cleaned up job script

parent 0d856417
#!/bin/bash
#SBATCH --partition=CourseDevQ
#SBATCH --reservation=SOHPCCourse
#SBATCH --nodes=1
#SBATCH --time=00:05:00
#SBATCH --job-name=mpi_hello
#SBATCH --output=mpi_hello.log
#SBATCH --account=course
echo -e "\n##########"
# Set number of processes
nproc=4
module load intel/2020u4
echo -e "\n##### C Part 1 Compilation #####"
mpicc -o hello_c.o hello.c
echo -e "\n##### C Part 2 Compilation #####"
mpicc -o hello_c2.o hello_p2.c
echo -e "\n##### C Part 3 Compilation #####"
mpicc -o hello_c3.o hello_p3.c -std=c99
echo -e "\n##### C Part 1 Run #####"
mpirun -n $nproc ./hello_c.o
echo -e "\n##### C Part 2 Run #####"
mpirun -n $nproc ./hello_c2.o
echo -e "\n##### C Part 3 Run #####"
mpirun -n $nproc ./hello_c3.o
echo -e "\n##########"
# Compile and run Fortran version
echo -e "\n##### Fortran Part 1 Compilation #####"
mpif90 -o hello_f90.o hello.f90
echo -e "\n##### Fortran Part 2 Compilation #####"
mpif90 -o hello_f90_2.o hello_p2.f90
echo -e "\n##### Fortran Part 3 Compilation #####"
mpif90 -o hello_f90_3.o hello_p3.f90
echo -e "\n##########"
echo -e "\n##### Fortran Part 1 Run #####"
mpirun -n $nproc ./hello_f90.o
echo -e "\n##### Fortran Part 2 Run #####"
mpirun -n $nproc ./hello_f90_2.o
echo -e "\n##### Fortran Part 3 Run #####"
mpirun -n $nproc ./hello_f90_3.o
echo -e "##########\n"
echo -e "\n##########"
echo "End of exercise"
echo -e "\n##########"
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment