Commit 46063dc7 authored by Tomas Hardin's avatar Tomas Hardin Committed by Tomas Härdin

Scripts and cmake things for large test jobs on HPC2N

Downloading and placing all required tarballs in the correct places
is likely to be tedious.
parent 4714b072
Pipeline #1088 passed with stages
in 29 minutes and 57 seconds
......@@ -49,6 +49,7 @@ else ()
set(MATIO_DEFAULT OFF)
endif ()
option(USE_MATIO "Enable Matlab output via libmatio?" ${MATIO_DEFAULT})
option(USE_TRACEANALYZER "Add instrumentation for Intel Traceanalyzer?" OFF)
set(CMAKE_INSTALL_PREFIX ${CMAKE_CURRENT_BINARY_DIR}/install)
......@@ -525,6 +526,12 @@ if (NOT WIN32)
endif ()
install(TARGETS mpi-speed-test DESTINATION bin)
if (USE_TRACEANALYZER)
set_target_properties(mpi-speed-test PROPERTIES LINK_FLAGS -trace)
set_target_properties(${MPI_MASTER_NAME} PROPERTIES LINK_FLAGS -trace)
endif ()
# CPack setup
set(CPACK_PACKAGE_NAME "fmigo")
# set(CPACK_PACKAGE_VENDOR "")
......
ml purge
# GCC, Intel MPI and traceanalyzer
#ml load gimpi/2018b itac/2018.1.017
# cmake won't work if compiled with gimpi/2018b, with this error:
# /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.22' not found (required by ./cmake)
ml load gimpi/2017b itac/2018.1.017
ml load gimpi/2017b itac/2017.3.030
export PREFIX=/pfs/nobackup/home/t/thardin/local
alias python=$PREFIX/bin/python3
......
set -e
#source boilerplate.sh
# To build this you'll want to put this and boilerplate.sh one level above the fmigo directory
# and also download the dependencies that each step uses and put them in appropriate directories.
# The second part hasn't been automated yet.
# An earlier version of this script would download and build cmake, but version 3.5.1 is fine.
if false
then
wget https://github.com/protocolbuffers/protobuf/releases/download/v3.6.1/protobuf-all-3.6.1.tar.gz
fi
set -e
# Separated out so we can bring the required variables
# into the shell when fiddling with the build.
source boilerplate.sh
if false
then
pushd cmake
rm -rf cmake-3.12.2
tar xfvz cmake-3.12.2.tar.gz
cd cmake-3.12.2
./bootstrap --prefix=$PREFIX
make -j12
make install
popd
fi
if false
if true
then
pushd zmq
rm -rf zeromq-4.2.3
......@@ -32,7 +21,7 @@ then
popd
fi
if false
if true
then
pushd protobuf
rm -rf protobuf-3.6.1
......@@ -44,12 +33,8 @@ then
popd
fi
if false
if true
then
#pushd cpython
#rm -rf cpython-master
#unzip cpython-master.zip
#cd cpython-master
pushd python
rm -rf Python-3.7.0
tar xfvJ Python-3.7.0.tar.xz
......@@ -63,7 +48,7 @@ then
popd
fi
if false
if true
then
pushd pip
python3 get-pip.py --prefix $PREFIX
......@@ -78,11 +63,11 @@ then
rm -rf build
mkdir build
cd build
cmake .. -DCMAKE_CXX_FLAGS="-I$PREFIX/include" -DCMAKE_C_FLAGS="-I$PREFIX/include" -DCMAKE_EXE_LINKER_FLAGS="-L$PREFIX/lib" -DCMAKE_INSTALL_PREFIX=$PREFIX
cmake .. -DCMAKE_CXX_FLAGS="-I$PREFIX/include" -DCMAKE_C_FLAGS="-I$PREFIX/include" -DCMAKE_EXE_LINKER_FLAGS="-L$PREFIX/lib" -DCMAKE_INSTALL_PREFIX=$PREFIX -DUSE_TRACEANALYZER=ON
# call cmake a second time to tell it not to add any "impi" stuff to the link commands
cmake .. -DMPI_CXX_LIBRARIES="" -DMPI_C_LIBRARIES="" -DMPI_CXX_LINK_FLAGS="" -DMPI_C_LINK_FLAGS="" -DMPI_EXTRA_LIBRARY=""
make -j12
make install
# fmigo-mpi will have references to "impi" in its link command. mpi-speed-test does not.
# making fmigo-mpi dump traces requires manually editing the impi stuff out, for now
popd
fi
set -e
#for N in 6 12 24 48 96
#for N in 192 384 768
#for N in 200 220 240 255 256 260
#for N in 300 340 380
#for N in 310 320 330
#for N in 340
for N in 768
#for N in 1536
do
D=fmigo-kinematic-N$N
mkdir -p $D
cp abisko-perftest3.sh perftest3.sh $D
(
cd $D
sed -i -e "s/-n 6/-n $N/;s|../../../../../|../../../../../../|" abisko-perftest3.sh
sed -i -e "s/^n=6/n=$N/;s|pushd ../../../..|pushd ../../../../..|;s|../../../../buildi/fmigo-mpi|../../../../../buildi/fmigo-mpi|" perftest3.sh
sbatch abisko-perftest3.sh
)
done
set -e
pushd ../../../..
source boilerplate.sh
popd
# Designed not to oversubscribe on 8-core machine (ThinkPad W540, granular)
n=6
N=$(bc <<< "$n - 1")
FMU=${FMUS_DIR}/gsl/clutch/clutch.fmu
FMUS="$FMU"
CONNS=
for i in $(seq 0 $(python <<< "print($N - 2)"))
do
ip1=$(python <<< "print($i + 1)")
CONNS="$CONNS -C shaft,$i,$ip1,x_s,v_s,a_s,force_in_s,x_e,v_e,a_e,force_in_e"
FMUS="$FMUS $FMU"
done
echo $(python <<< "print($N - 1)") kinematic connections
# Walltime test
# 100k steps
if true
then
#(
#for x in `seq 1 11`
#do
# 100k steps
time mpirun -np $(python <<< "print($N + 1)") ../../../../buildi/fmigo-mpi -t 1 -d 0.0001 -f none -l 2 -a - $FMUS <<< "$CONNS"
#done
#) 2>&1 | grep real | sort
fi
# Valgrind slow awesomeness
# 10k steps
if false
then
URIS=
for j in $(seq 1 $N)
do
PORT=$(python <<< "print(1023 + $j)")
if [ $j -eq 1 ]
then
valgrind --tool=callgrind --callgrind-out-file=fmigo-server-2.callgrind fmigo-server -p $PORT $EXTRA -l 4 $FMU &
else
fmigo-server -p $PORT $EXTRA $FMU &
fi
URIS="$URIS tcp://localhost:$PORT"
done
# 10k steps
time valgrind --tool=callgrind --callgrind-out-file=fmigo-master-2.callgrind fmigo-master -l 4 -t 5 -d 0.0005 -f none $CONNS $URIS
#time fmigo-master -l 4 -t 50 -d 0.0005 -f none -a - $URIS <<< "$CONNS"
# real 0m17,574s
#time perf record -a -F 999 -g -- fmigo-master -l 4 -t 5 -d 0.0005 -f none -a - $URIS <<< "$CONNS"
#perf script | ~/FlameGraph/stackcollapse-perf.pl > out.perf-folded
#~/FlameGraph/flamegraph.pl out.perf-folded > perf-fmigo-master.svg
fi
# Flamegraph test
if false
then
# real 0m41,211s
for x in `seq 1 5`
do
time perf record -a -F 5000 -g -- mpiexec -np $(python <<< "print($N + 1)") fmigo-mpi -t 10 -d 0.0005 -f none -a - $FMUS <<< "$CONNS"
done
perf script | ~/FlameGraph/stackcollapse-perf.pl > out.perf-folded-2
#~/FlameGraph/flamegraph.pl out.perf-folded-2 > perf-fmigo-mpi.svg
~/FlameGraph/difffolded.pl out.perf-folded out.perf-folded-2 | ~/FlameGraph/flamegraph.pl > perf-fmigo-mpi.svg
fi
#echo mpi-speed-test comparison:
#time mpiexec -np $(python <<< "print($N + 1)") mpi-speed-test
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