#!/bin/bash
#SBATCH --job-name=<JOB NAME>
#SBATCH --nodes=4
#SBATCH --cpus-per-task=1
#SBATCH --time=00:10:00
#SBATCH --mail-user=<EMAIL ADDRESS>
#SBATCH --mail-type=FAIL,BEGIN,END
#SBATCH --error=std.err
#SBATCH --output=std.out

# Save job specific information for troubleshooting
echo "Job ID is $SLURM_JOBID"
echo "Running on host $SLURMD_NODENAME"
echo "Working directory is $SLURM_SUBMIT_DIR"
echo "The following processors are allocated to this job:"
echo $SLURM_NODELIST

# Run the program
echo "Start: $(date +%F_%T)"
module load OpenMPI
mpirun -np 4 $SLURM_SUBMIT_DIR/mpi_send_recv_1 
echo "Stop: $(date +%F_%T)"