Commit b58940fc authored by COULAUD Olivier's avatar COULAUD Olivier

Check memory with eztrace and openmp algorithm improvements in progress.

parent 76ab0b1b
...@@ -12,7 +12,7 @@ set(CMAKE_DISABLE_IN_SOURCE_BUILD ON) ...@@ -12,7 +12,7 @@ set(CMAKE_DISABLE_IN_SOURCE_BUILD ON)
# Project Declaration # Project Declaration
#=========================================================================== #===========================================================================
project(SCALFMM C CXX) project(SCALFMM C CXX)
INCLUDE( CMakeDependentOption )
# check if compiling into source directories # check if compiling into source directories
string(COMPARE EQUAL "${CMAKE_SOURCE_DIR}" "${CMAKE_BINARY_DIR}" insource) string(COMPARE EQUAL "${CMAKE_SOURCE_DIR}" "${CMAKE_BINARY_DIR}" insource)
if(insource) if(insource)
......
...@@ -19,6 +19,11 @@ ...@@ -19,6 +19,11 @@
#include "../Utils/FGlobal.hpp" #include "../Utils/FGlobal.hpp"
#include "../Utils/FAssert.hpp" #include "../Utils/FAssert.hpp"
#ifdef SCALFMM_USE_EZTRACE
extern "C" {
#include "eztrace.h"
}
#endif
/** /**
* @brief The FFmmOperations enum * @brief The FFmmOperations enum
* To chose which operation has to be performed. * To chose which operation has to be performed.
......
...@@ -208,8 +208,15 @@ protected: ...@@ -208,8 +208,15 @@ protected:
/** M2L */ /** M2L */
void transferPass(){ void transferPass(){
#ifdef SCALFMM_USE_EZTRACE
eztrace_start();
#endif
this->transferPassWithFinalize() ; this->transferPassWithFinalize() ;
} #ifdef SCALFMM_USE_EZTRACE
eztrace_stop();
#endif
}
void transferPassWithOutFinalize(){ void transferPassWithOutFinalize(){
FLOG( FLog::Controller.write("\tStart Downward Pass (M2L)\n").write(FLog::Flush); ); FLOG( FLog::Controller.write("\tStart Downward Pass (M2L)\n").write(FLog::Flush); );
......
...@@ -266,9 +266,19 @@ protected: ...@@ -266,9 +266,19 @@ protected:
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// Transfer // Transfer
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
/** M2L */
void transferPass(){
#ifdef SCALFMM_USE_EZTRACE
eztrace_start();
#endif
this->transferPassWithFinalize() ;
#ifdef SCALFMM_USE_EZTRACE
eztrace_stop();
#endif
}
/** Runs the M2L kernel. */ /** Runs the M2L kernel. */
void transferPass(){ void transferPassWithFinalize(){
FLOG( FLog::Controller.write("\tStart Downward Pass (M2L)\n").write(FLog::Flush); ); FLOG( FLog::Controller.write("\tStart Downward Pass (M2L)\n").write(FLog::Flush); );
FLOG(FTic counterTime); FLOG(FTic counterTime);
......
...@@ -505,7 +505,19 @@ protected: ...@@ -505,7 +505,19 @@ protected:
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
/** Runs the M2L kernel. */ /** Runs the M2L kernel. */
void transferPass(){ /** M2L */
void transferPass(){
#ifdef SCALFMM_USE_EZTRACE
eztrace_start();
#endif
this->transferPassWithFinalize() ;
//
#ifdef SCALFMM_USE_EZTRACE
eztrace_stop();
#endif
}
void transferPassWithFinalize(){
FLOG( FLog::Controller.write("\tStart Downward Pass (M2L)\n").write(FLog::Flush); ); FLOG( FLog::Controller.write("\tStart Downward Pass (M2L)\n").write(FLog::Flush); );
FLOG(FTic counterTime); FLOG(FTic counterTime);
......
...@@ -80,6 +80,13 @@ ...@@ -80,6 +80,13 @@
#cmakedefine SCALFMM_USE_AVX #cmakedefine SCALFMM_USE_AVX
#cmakedefine __SSEPE_INTEL_COMPILER #cmakedefine __SSEPE_INTEL_COMPILER
///////////////////////////////////////////////////////
// EZTRACE
///////////////////////////////////////////////////////
#cmakedefine SCALFMM_USE_EZTRACE
/////////////////////////////////////////////////////// ///////////////////////////////////////////////////////
// Assert tests // Assert tests
/////////////////////////////////////////////////////// ///////////////////////////////////////////////////////
......
...@@ -15,15 +15,31 @@ project_dir=$HOME/Dev/src/ScalFMM/scalfmm ; ...@@ -15,15 +15,31 @@ project_dir=$HOME/Dev/src/ScalFMM/scalfmm ;
# PlaFRIM environment # PlaFRIM environment
# #
source $HOME/Config/bashrc.bash source $HOME/Config/bashrc.bash
module add compiler/gcc/5.1.0 compiler/intel/64/2016_beta; module li
# #
EXEC="Utils/Release/ChebyshevInterpolationCmpAlgo" EXEC="Utils/Release/ChebyshevInterpolationCmpAlgo"
FILEPERF="RES-Cheb-openmp" FILEPERF="RES-Cheb-openmp"
OPTION="-show-info -show-compile" OPTION="-show-info -show-compile"
# #
DATE=`date +%y-%m-%d-%H%M`
echo $DATE
#
cd $project_dir/BuildIntel2016 cd $project_dir/BuildIntel2016
#
# INTEL
#
# module add compiler/gcc/5.1.0 compiler/intel/64/2016_beta
# cd $project_dir/BuildIntel2016
#
# GCC
#
module add compiler/gcc/5.1.0 intel/mkl/64/11.2/2015.3.187
cd $project_dir/BuildGCC51
#
# For eztrace
#
module add mpi/openmpi/gcc/1.8.4 trace/eztrace/1.0
module li
# #
# #
PER_SIZE=`cat /proc/cpuinfo |grep processor |wc -l` PER_SIZE=`cat /proc/cpuinfo |grep processor |wc -l`
...@@ -38,17 +54,20 @@ pwd ...@@ -38,17 +54,20 @@ pwd
#export OMP_PROC_BIND=true #export OMP_PROC_BIND=true
export KMP_AFFINITY=scatter export KMP_AFFINITY=scatter
NUM=`git rev-list HEAD --count` NUM=`git rev-list HEAD --count`
echo $DISTRIB echo $DISTRIB
mkdir ${DATE}
for dist in `seq 0 $NBTEST`; for dist in `seq 0 $NBTEST`;
do do
echo "Distribution: " $dist ${DISTRIB[$dist]} " depth octree " ${DEPTH[$dist]} echo "Distribution: " $dist ${DISTRIB[$dist]} " depth octree " ${DEPTH[$dist]}
FILE=${data_dir}/${DISTRIB[$dist]}-1M-ref.bfma FILE=${data_dir}/${DISTRIB[$dist]}-1M-ref.bfma
mkdir ${DISTRIB[$dist]} FILEGNU=${DISTRIB[$dist]}.txt
mkdir ${DATE}/${DISTRIB[$dist]}
touch $FILEGNU
# #
# Loop on algorithm # Loop on algorithm
for a in `seq 0 2`; for a in `seq 0 3`;
do do
echo "# Core GlabalTIME P2PTIME M2LTIME ENERGY PotentialError ForceError"> $FILEPERF-${DISTRIB[$dist]}-${ALGO[$a]}.out echo "# Core GlabalTIME P2PTIME M2LTIME MALLOC FREE MEMUse ENERGY PotentialError ForceError"> $FILEPERF-${DISTRIB[$dist]}-${ALGO[$a]}.out
# One computation # One computation
for l in $PER_SIZE ; for l in $PER_SIZE ;
do do
...@@ -57,18 +76,28 @@ echo "# Core GlabalTIME P2PTIME M2LTIME ENERGY PotentialError ForceError"> $FI ...@@ -57,18 +76,28 @@ echo "# Core GlabalTIME P2PTIME M2LTIME ENERGY PotentialError ForceError"> $FI
echo "Running on " ${l} " threads with algo " ${ALGO[$a]} echo "Running on " ${l} " threads with algo " ${ALGO[$a]}
$EXEC ${OPTION} -f $FILE -depth ${DEPTH[$dist]} -subdepth 4 -t $l -cmp -algo ${ALGO[$a]}>> $OUTPUT $EXEC ${OPTION} -f $FILE -depth ${DEPTH[$dist]} -subdepth 4 -t $l -cmp -algo ${ALGO[$a]}>> $OUTPUT
# #
eztrace_stats /tmp/coulaud_eztrace_log_rank_1 > TRACE
TIME=`grep "@Algorithm" $OUTPUT | awk '{print $4}'` TIME=`grep "@Algorithm" $OUTPUT | awk '{print $4}'`
TIMEP2P=`grep "P2P" $OUTPUT | awk '{print $4}'` TIMEP2P=`grep "P2P" $OUTPUT | grep "second" | awk '{print $4}'`
TIMEM2L=`grep "M2L" $OUTPUT | grep "second" | awk '{print $2}'` TIMEM2L=`grep "M2L" $OUTPUT | grep "second" | awk '{print $2}'`
Energy=`grep "Energy" $OUTPUT | awk '{print $3}'` Energy=`grep "Energy" $OUTPUT | awk '{print $3}'`
P1=`grep " Potential " $OUTPUT | awk '{print $7}'` P1=`grep " Potential " $OUTPUT | awk '{print $7}'`
P2=`grep " F " $OUTPUT | awk '{print $7}'` P2=`grep " F " $OUTPUT | awk '{print $7}'`
echo " " $l " " $TIME " " $TIMEP2P " " $TIMEM2L " " $Energy " " $P1 " " $P2 MALLOC=`grep Total TRACE | grep malloc | awk '{print $2}'`
echo " " $l " " $TIME " " $TIMEP2P " " $TIMEM2L " " $Energy " " $P1 " " $P2 >> $FILEPERF-${DISTRIB[$dist]}-${ALGO[$a]}.out FREE=`grep Total TRACE | grep malloc | awk '{print $7}'`
mv $OUTPUT ${DISTRIB[$dist]} MEM=`grep Total TRACE | grep malloc | awk '{print $15}'`
echo " " $l " " $TIME " " $TIMEP2P " " $TIMEM2L " " $MALLOC " " $FREE " " $MEM " " $Energy " " $P1 " " $P2
echo " " $l " " $TIME " " $TIMEP2P " " $TIMEM2L " " $MALLOC " " $FREE " " $MEM " "$Energy " " $P1 " " $P2 >> $FILEPERF-${DISTRIB[$dist]}-${ALGO[$a]}.out
mv $OUTPUT ${DATE}/${DISTRIB[$dist]}
mv /tmp/coulaud_eztrace_log_rank_1 ${DATE}/${DISTRIB[$dist]}/trace-${DISTRIB[$dist]}-${ALGO[$a]}-${l}
rm TRACE
done done
echo ${DISTRIB[$dist]}/$FILEPERF-${DISTRIB[$dist]}-${ALGO[$a]}.out >> $FILEGNU
mv $FILEPERF-${DISTRIB[$dist]}-${ALGO[$a]}.out ${DATE}/${DISTRIB[$dist]}
echo "----------------------------------------------------------" echo "----------------------------------------------------------"
done done
echo "-------------------------------------------------------------------" echo "---------------------------- END ALGO ---------------------------------------"
mv $FILEGNU ${DATE}
done done
echo " ---------------------- FINISH -------------------------------" echo " ---------------------- FINISH -------------------------------"
...@@ -18,7 +18,7 @@ set xlabel "Number of core" ...@@ -18,7 +18,7 @@ set xlabel "Number of core"
# #
# OUTPUT # OUTPUT
#set terminal postscript enhanced color 'Helvetica' 20 #set terminal postscript enhanced color 'Helvetica' 20
set terminal postscript enhanced color "times-roman,24" #set terminal postscript enhanced color "times-roman,24"
set output 'HistogramTime.eps' set output 'HistogramTime.eps'
# #
# PLOT # PLOT
...@@ -26,11 +26,10 @@ set output 'HistogramTime.eps' ...@@ -26,11 +26,10 @@ set output 'HistogramTime.eps'
set style data histograms set style data histograms
set style histogram rowstacked set style histogram rowstacked
#set style histogram cluster gap 1
#unset ytics #unset ytics
set boxwidth 0.75 set boxwidth 0.75
set style fill solid 1.0 border set style fill solid 1.0 border
set xtics border ("4" 0, "8" 1, "12" 2, "16" 3, "20" 4, "24" 5) set xtics border ("4" 0, "8" 1, "12" 2, "16" 3, "20" 4, "24" 5)
#plot "RES-Cheb-openmp-unitsphere-basic.out" using 3 t "P2P", "" using 4 lc 4 t "M2L" , "" using ($2-$4-$3) lc 5 t "Remain operators" plot "RES-Cheb-openmp-unitsphere-basic.out" using 3 t "P2P", "" using 4 lc 4 t "M2L" , "" using ($2-$4-$3) lc 5 t "Remain operators"
plot "RES-Cheb-openmp-unitsphere-basic.out" using 3, "" using 4 lc 4 , "" using ($2-$4-$3) lc 5 #plot "RES-Cheb-openmp-unitsphere-basic.out" using 3, "" using 4 lc 4 , "" using ($2-$4-$3) lc 5
Markdown is supported
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