
]$ echo ". /opt/intel/oneapi/setvars.sh" >> ~/.bashrc


# Script
# ------- #
]$ cat oneapibench.sh
#!/bin/bash -l
#SBATCH --job-name=int_bench
#SBATCH --nodes=4
#SBATCH --error=int_bench-%j.err
#SBATCH --output=int_bench-%j.log
#SBATCH --cpus-per-task=8


export JOBNAME=int_bench
NNODES=4
NCPUPN=8
WORKDIR=$HOME/$RANDOM
NTHREDS=$(( $NNODES * $NCPUPN ))



echo "Start Benchmark on $NNODES nodes by $NCPUPN cores per node,on $NTHREDS threds in workdir $WORKDIR"
TEST=MPI1
echo "Test type: IMB-MPI1 - build the executable file for the IMB-MPI1 component"
BENCHSOURCE=/net/storage/scratch/home/azaroche/mpichtest01/oneimb

mkdir $WORKDIR;
cd $WORKDIR
cp $BENCHSOURCE/IMB-$TEST ./

echo I_MPI_DEBUG=10  mpirun -np $NTHREDS ./IMB-$TEST
echo workdir=$WORKDIR


# Start mpirun with debug 10
#---------------------------#
I_MPI_DEBUG=10 mpirun -np $NTHREDS ./IMB-$TEST > bench.out
echo output: $WORKDIR/bench.out



# Start of script
# ---------------- #
[azaroche@dell mpichtest01]$ sbatch -p hu oneintbench.sh
Submitted batch job 828

[azaroche@dell mpichtest01]$ squeue -o"%.7i %.9P %.8j %.8u %.2t %B %.10M %.6D %C %c %m" --job 829
  JOBID PARTITION 	NAME 	USER ST EXEC_HOST   	TIME  NODES CPUS MIN_CPUS MIN_MEMORY
	829    	hu int_benc azaroche  R hu1   	3:52  	4 32 8 0
[azaroche@dell mpichtest01]$


# Results
# -------------- #
[azaroche@dell mpichtest01]$ ll int_bench-829*
-rw-rw-r--. 1 azaroche azaroche	0 Mar 24 00:33 int_bench-829.err
-rw-rw-r--. 1 azaroche azaroche 1307 Mar 24 00:38 int_bench-829.log

[azaroche@dell mpichtest01]$ tail -2  int_bench-829.log
workdir=/net/storage/scratch/home/azaroche/22880
output: /net/storage/scratch/home/azaroche/22880/bench.out



[azaroche@dell mpichtest01]$ tail -10 /net/storage/scratch/home/azaroche/22880/bench.out
#---------------------------------------------------
# Benchmarking Barrier
# #processes = 32
#---------------------------------------------------
#repetitions  t_min[usec]  t_max[usec]  t_avg[usec]
     	1000  2.64         2.64         2.64


# All processes entering MPI_Finalize
[azaroche@dell mpichtest01]$ 
