Commit d3551377 authored by Ondrej Vysocky's avatar Ondrej Vysocky
Browse files

READEX scripts for autofilter, dyndetect and PTF

parent e8646efb
#!/bin/sh
#SBATCH --time=00:30:00 # walltime
#SBATCH --nodes=2 # number of processor cores (i.e. tasks)
#SBATCH --ntasks=24
#SBATCH --tasks-per-node=24
#SBATCH --cpus-per-task=1
#SBATCH --exclusive
#SBATCH --partition=haswell
#SBATCH --comment="cpufreqchown"
#SBATCH --cpu-freq=Low
#SBATCH --mem-per-cpu=2500M # memory per CPU core
#SBATCH -J "PTFfoam" # job name
#SBATCH --mail-user=ondrej.vysocky@vsb.cz # email address
#SBATCH --mail-type=ALL
#SBATCH -A p_readex
handle_error() {
if [ $1 != 0 ]; then
echo "Error from job_build.sh on $2."
exit 1
fi
}
#module purge
#module use /projects/p_readex/modules
#module load readex/ci_readex_bullxmpi1.2.8.4_gcc5.3.0
#source env/set_env_es_rrl
#source env/paths.default
#source env/threading.openmp 1
#export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
cd $HOME/OpenFOAM
source $HOME/OpenFOAM/FOAMMODULES-ScorepGCC-Taurus.sh
cd $HOME/OpenFOAM/OpenFOAM-v1612+/tutorials/incompressible/simpleFoam/motorBike
export SCOREP_SUBSTRATE_PLUGINS=rrl
export SCOREP_RRL_PLUGINS=cpu_freq_plugin,uncore_freq_plugin
export SCOREP_RRL_VERBOSE="WARN"
#module load scorep-hdeem/sync-2017-01-31-git-hdeem2.2.20ms-xmpi-gcc5.3
#module load scorep-uncore
module load scorep-hdeem/sync-2017-04-13-git-hdeem2.2.20ms-xmpi-gcc6.3
export SCOREP_METRIC_PLUGINS=hdeem_sync_plugin
export SCOREP_METRIC_HDEEM_SYNC_PLUGIN_CONNECTION="INBAND"
export SCOREP_METRIC_HDEEM_SYNC_PLUGIN_VERBOSE="WARN"
export SCOREP_METRIC_HDEEM_SYNC_PLUGIN_STATS_TIMEOUT_MS=1000
#module load valgrind
export SCOREP_MPI_ENABLE_GROUPS=ENV
export SCOREP_FILTERING_FILE=scorep.filt
#export OMP_NUM_THREADS=1
#psc_frontend --apprun="./miniMD_openmpi -i in2.data" --mpinumprocs=8 --ompnumthreads=1 --phase=INTEGRATE_RUN_LOOP --tune=readex_tuning --config-file=readex_config.xml --info=20 --force-localhost --selective-info=AutotuneAll,AutotunePlugins
#psc_frontend --apprun="./miniMD_openmpi -i in2.data" --mpinumprocs=8 --ompnumthreads=1 --phase=INTEGRATE_RUN_LOOP --tune=readex_tuning --config-file=readex_config.xml --force-localhost #--info=20 --selective-info=AutotuneAll,AutotunePlugins
psc_frontend --apprun="simpleFoam -parallel" --mpinumprocs=24 --ompnumthreads=1 --phase=iteration --tune=readex_tuning --config-file=readex_config_extended.xml --force-localhost --info=7 --selective-info=AutotuneAll,AutotunePlugins
handle_error $? "\"sh -l job_psc.sh\""
# $1 = mpi procs
# $2 = omp threads
# $3 = input file name
# $4 = -t for scorep_autofilter
# $5 = phase region for readex-dyn-detect and psc_frontend
# $6 = -t for readex-dyn-detect
# $7 = -c for readex-dyn-detect
# $8 = -v for readex-dyn-detect
# $9 = -w for readex-dyn-detect
#!/bin/sh
cp ../scorep.filt .
#source ../environment.sh
#module use /projects/p_readex/modules
#module load ptf/ci_readex_bullxmpi1.2.8.4_gcc5.3.0_slurm_starter_with_scorep
export SCOREP_ENABLE_TRACING=false
export SCOREP_ENABLE_PROFILING=true
export SCOREP_TOTAL_MEMORY=3G
export SCOREP_FILTERING_FILE="$(pwd)/scorep.filt"
export SCOREP_PROFILING_FORMAT=cube_tuple
export SCOREP_METRIC_PAPI=PAPI_TOT_INS,PAPI_L3_TCM
export SCOREP_FILTERING_FILE=scorep.filt
echo "running simpleFoam for readex-dyn-detect"
# run the application.. update this line for different applications
#srun -n 24 ./kripke $KRIPKE_COMMAND
srun -n 24 simpleFoam -parallel
echo "running simpleFoam done"
echo "running readex-dyn-detect"
#echo "phase region = $2"
#readex-dyn-detect -t $1 -p $2 -c $3 -v $4 -w $5 scorep-*/profile.cubex
#readex-dyn-detect -t $1 -p $2 scorep-*/profile.cubex
readex-dyn-detect -p "iteration" -t 0.001 scorep-*/profile.cubex
echo
echo "running readex-dyn-detect done"
echo "extending readex_config.xml"
#module switch python/2.7 python
#python3 add_tuning_settings.py -i readex_config.xml -o readex_config_extended.xml
#module switch python python/2.7
echo "extension done"
cp -R scorep-* ../
cp readex_config.xml ../
cp readex_config_extended.xml ../
#!/bin/sh
#source ../environment.sh
export SCOREP_ENABLE_TRACING=false
export SCOREP_ENABLE_PROFILING=true
export SCOREP_TOTAL_MEMORY=3G
export SCOREP_PROFILING_FORMAT=cube_tuple
export SCOREP_METRIC_PAPI=PAPI_TOT_INS,PAPI_L3_TCM
export SCOREP_FILTERING_FILE=scorep.filt
#export LD_LIBRARY_PATH=/sw/global/compilers/intel/2016/compilers_and_libraries_2016/linux/lib/intel64
rm -rf scorep-*
rm -f old_scorep.filt
echo "" > scorep.filt
result=1
while [ $result != 0 ]; do
echo "result = "$result
# run the application.. update this for different applications
#mpirun -np $3 ./miniMD_openmpi -i $2 1>/dev/null
# srun -n 24 ./kripke --procs 2,2,6 --niter 20 --nest GZD --zones 4,4,4 --groups 200
# srun -n 24 ./kripke --procs 2,2,6 --niter 10 --nest GZD --zones 32,32,32 --legendre 8 --dset 32
#srun -n 24 ./kripke $KRIPKE_COMMAND #--procs 2,2,6 --niter 10 --nest GZD --zones 64,64,64 --legendre 8 --dset 32
srun -n 24 simpleFoam -parallel
echo "ITERATION done."
sh -l do_scorep_autofilter_single.sh 1.0 #$1
result=$?
echo "scorep_autofilter_singe done ($result)."
result=0
done
echo "end."
cp scorep.filt ../
#!/bin/sh
cp scorep.filt old_scorep.filt
scorep-autofilter -t $1 -f scorep scorep-*/profile.cubex # 1>/dev/null
echo "#############"
cat scorep.filt
echo "#############"
#rm -rf scorep-*
commString=$(comm -1 -2 scorep.filt old_scorep.filt)
if [ "$commString" == "" ]; then
cp scorep.filt old_scorep.filt
exit 1
else
filtFileBeginString="SCOREP_REGION_NAMES_BEGIN"
filtFileEndString="SCOREP_REGION_NAMES_END"
filtFileExcludeString="EXCLUDE"
sort scorep.filt > sorted_scorep.filt
sort old_scorep.filt > sorted_old_scorep.filt
commString=$(comm -2 -3 sorted_scorep.filt sorted_old_scorep.filt)
if [ "$commString" != "" ]; then
echo $filtFileBeginString > new_scorep.filt
echo $filtFileExcludeString >> new_scorep.filt
comm -2 -3 sorted_scorep.filt sorted_old_scorep.filt > comm1.txt
exec < "old_scorep.filt"
while read line; do
if [ "$line" != "$filtFileEndString" ] && [ "$line" != "$filtFileBeginString" ] && [ "$line" != "$filtFileExcludeString" ]; then
echo $line >> new_scorep.filt
fi
done
cat comm1.txt >> new_scorep.filt
echo $filtFileEndString >> new_scorep.filt
mv new_scorep.filt scorep.filt
rm -f sorted_scorep.filt sorted_old_scorep.filt comm1.txt
echo "++++++++++++"
echo $commString
echo "++++++++++++"
exit 1
else
mv old_scorep.filt scorep.filt
rm -f sorted_scorep.filt sorted_old_scorep.filt comm1.txt
echo "++++++++++++"
echo $commString
echo "++++++++++++"
exit 0
fi
fi
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