#!/bin/bash
#
echo "This is a SAMPLE run script.  Change it to reflect the correct number"
echo "of CPUs/threads, number of nodes, MPI processes per node, etc.."
#

#
# You can find description of all Intel MPI parameters in the 
# Intel MPI Reference Manual. 
# See <intel mpi installdir>/doc/Reference_manual.pdf
#

export I_MPI_EAGER_THRESHOLD=128000
#          This setting may give 1-2% of performance increase over the
#          default value of 262000 for large problems and high number of cores

date

cp HPL_serial.dat HPL.dat

echo -n "This run was done on: "
date
 
# Capture some meaningful data for future reference:
echo -n "This run was done on: " >> xhpl_em64t_dynamic_outputs.txt
date >> xhpl_em64t_dynamic_outputs.txt
echo "HPL.dat: " >> xhpl_em64t_dynamic_outputs.txt
cat HPL.dat >> xhpl_em64t_dynamic_outputs.txt
echo "Binary name: " >> xhpl_em64t_dynamic_outputs.txt
ls -l xhpl_em64t_dynamic >> xhpl_em64t_dynamic_outputs.txt
echo "This script: " >> xhpl_em64t_dynamic_outputs.txt
cat runme_em64t_dynamic >> xhpl_em64t_dynamic_outputs.txt
echo "Environment variables: " >> xhpl_em64t_dynamic_outputs.txt
env >> xhpl_em64t_dynamic_outputs.txt
echo "Actual run: " >> xhpl_em64t_dynamic_outputs.txt

# Environment variables can also be set on the Intel MPI command 
# line using the -genv option:

mpiexec -np 4 ./xhpl_em64t_dynamic | tee -a xhpl_em64t_dynamic_outputs.txt

# In case of multiple nodes involved, please set the number of MPI processes 
# per node (ppn=1,2 typically) through the -perhost option (because the 
# default is all cores):

# mpiexec -perhost <ppn> -np <n> ./xhpl_em64t_dynamic

echo -n "Done: " >> xhpl_em64t_dynamic_outputs.txt
date >> xhpl_em64t_dynamic_outputs.txt

echo -n "Done: "
date
