To receive notifications about scheduled maintenance, please subscribe to the mailing-list gitlab-operations@sympa.ethz.ch. You can subscribe to the mailing-list at https://sympa.ethz.ch

Commit dbf24dcc authored by sfritschi's avatar sfritschi
Browse files

Added measurements

parent ca5b2c69
......@@ -697,7 +697,7 @@ def generate_dendrogram(basenet: Network, targetsize: List[int], \
if (not mute):
print("Throats left: %d Throats Unrealized: %d (%.2f%%)" % \
(throatsLeft, throatsUnrealized, throatsLeft / totalThroats * 100.))
(throatsLeft, throatsUnrealized, throatsUnrealized / totalThroats * 100.))
nRemain = len(poresRemain)
if (nRemain > serialThresh):
......
#!/bin/bash
for i in {1,2,4,8,16,32}
do
echo "Using $i processes";
mpirun -n $i python3 solve_flow.py $1;
done
from mpi4py import MPI
comm = MPI.COMM_WORLD
size = comm.Get_size()
rank = comm.Get_rank()
root = 0
import sys
sys.path.append('../')
from netflow import *
import netflow.netflow as netflow_par
import netflow.netgen as netgen_par
import netflow_serial.netflow as netflow_ser
def main():
......@@ -17,41 +20,50 @@ def main():
comm.Abort(1)
net = None
f = None
# Only initialize on root rank
if (rank == root):
f = open('measurements.txt', 'a+')
netPath = sys.argv[1]
try:
net = netflow.load_network_from(netPath)
net = netgen_par.load_network_from(netPath)
except Exception as e:
print("Error: {}".format(e))
comm.Abort(1)
print("Pores: %d" % (len(net.pores)))
start = MPI.Wtime()
pA, QA = netflow.solve_flow_periodic(network=net, \
solver=netflow.Solver.PETSC, mu=1e-3, c=3, P2L=1e2)
end = MPI.Wtime()
if rank == root:
print("PETSc time: %e s" % (end - start))
kreps = 4
elapsedPetsc = 0.
for _ in range(kreps):
start = MPI.Wtime()
pA, QA = netflow_par.solve_flow_periodic(network=net, \
solver=netflow_par.Solver.PETSC, mu=1e-3, c=3, P2L=1e2)
end = MPI.Wtime()
elapsedPetsc += end - start
start = MPI.Wtime()
pB, QB = netflow.solve_flow_periodic(network=net, \
solver=netflow.Solver.CG, mu=1e-3, c=3, P2L=1e2)
end = MPI.Wtime()
elapsedPetsc /= kreps
if rank == root:
print("Other time: %e s" % (end - start))
f.write("%d\t%e\n" % (size, elapsedPetsc))
f.close()
"""
if rank == root:
elapsedOther = 0.
for _ in range(kreps):
start = MPI.Wtime()
pB, QB = netflow_ser.solve_flow_periodic(network=net, mu=1e-3, c=3, P2L=1e2)
end = MPI.Wtime()
elapsedOther += end - start
diff = 0.
count = 0
for pore in net.pores:
if pore in pA:
count += 1
diff += (pA[pore] - pB[pore])**2
print("MSE: %e" % (diff / count))
elapsedOther /= kreps
print("PyAMG time: %e s" % elapsedOther)
print("Speedup: %.2f" % (elapsedOther / elapsedPetsc))
"""
if __name__ == '__main__':
main()
......@@ -70,6 +70,8 @@
\abx@aux@segm{0}{0}{MEYER2021101592}
\@writefile{toc}{\defcounter {refsection}{0}\relax }\@writefile{toc}{\contentsline {section}{\numberline {5}Discussion}{10}{section.5}\protected@file@percent }
\@writefile{toc}{\defcounter {refsection}{0}\relax }\@writefile{toc}{\contentsline {section}{\numberline {6}Acknowledgments}{10}{section.6}\protected@file@percent }
\abx@aux@cite{petsc-web-page}
\abx@aux@segm{0}{0}{petsc-web-page}
\@writefile{toc}{\defcounter {refsection}{0}\relax }\@writefile{toc}{\contentsline {section}{\numberline {A}PETSc Installation}{11}{appendix.A}\protected@file@percent }
\newlabel{appendix:install}{{A}{11}{PETSc Installation}{appendix.A}{}}
\@writefile{toc}{\defcounter {refsection}{0}\relax }\@writefile{toc}{\contentsline {section}{\numberline {B}Base Network}{11}{appendix.B}\protected@file@percent }
......
......@@ -2194,6 +2194,7 @@
<bcf:citekey order="7">MEYER2021103936</bcf:citekey>
<bcf:citekey order="8">MEYER2021101592</bcf:citekey>
<bcf:citekey order="9">MEYER2021101592</bcf:citekey>
<bcf:citekey order="10">petsc-web-page</bcf:citekey>
</bcf:section>
<!-- SORTING TEMPLATES -->
<bcf:sortingtemplate name="none">
......
This is pdfTeX, Version 3.14159265-2.6-1.40.20 (TeX Live 2019/Debian) (preloaded format=pdflatex 2021.4.27) 4 DEC 2021 23:53
This is pdfTeX, Version 3.14159265-2.6-1.40.20 (TeX Live 2019/Debian) (preloaded format=pdflatex 2021.4.27) 5 DEC 2021 15:05
entering extended mode
restricted \write18 enabled.
%&-line parsing enabled.
......@@ -1041,14 +1041,18 @@ File: plots/comparison_time.png Graphic file (type png)
<use plots/comparison_time.png>
Package pdftex.def Info: plots/comparison_time.png used on input line 320.
(pdftex.def) Requested size: 155.24895pt x 116.43451pt.
[9 <./plots/strong_scaling.png> <./plots/comparison_time.png>] [10]
<plots/base.png, id=188, 462.528pt x 346.896pt>
[9 <./plots/strong_scaling.png> <./plots/comparison_time.png>]
Underfull \hbox (badness 5288) in paragraph at lines 335--336
\OT1/cmr/m/n/10 achieved size-able per-for-mance im-
[]
[10]
<plots/base.png, id=189, 462.528pt x 346.896pt>
File: plots/base.png Graphic file (type png)
<use plots/base.png>
Package pdftex.def Info: plots/base.png used on input line 366.
(pdftex.def) Requested size: 207.0021pt x 155.25484pt.
[11 <./plots/base.png>] [12]
[11 <./plots/base.png>] [12]
Package atveryend Info: Empty hook `BeforeClearDocument' on input line 375.
Package atveryend Info: Empty hook `AfterLastShipout' on input line 375.
(./thesis.aux)
......@@ -1089,10 +1093,10 @@ s/type1/public/amsfonts/cm/cmsy7.pfb></usr/share/texlive/texmf-dist/fonts/type1
/public/amsfonts/cm/cmti10.pfb></usr/share/texlive/texmf-dist/fonts/type1/publi
c/amsfonts/cm/cmti9.pfb></usr/share/texlive/texmf-dist/fonts/type1/public/amsfo
nts/cm/cmtt10.pfb>
Output written on thesis.pdf (12 pages, 471481 bytes).
Output written on thesis.pdf (12 pages, 472749 bytes).
PDF statistics:
298 PDF objects out of 1000 (max. 8388607)
251 compressed objects within 3 object streams
299 PDF objects out of 1000 (max. 8388607)
252 compressed objects within 3 object streams
47 named destinations out of 1000 (max. 500000)
185 words of extra memory for PDF output out of 10000 (max. 10000000)
No preview for this file type
No preview for this file type
......@@ -299,7 +299,7 @@
\begin{multicols}{2}
\section{Performance Analysis}
\hspace{0.5cm}In the following we discuss the results of our parallel pore-connecting algorithm and compare it to the existing serial implementation from \cite{MEYER2021101592}. Particularly, we are interested in the \textbf{scaling} of our method with respect to the number of processes and the difference in \textbf{run-time} between the two implementations for varying target sizes of the generated domain. All performance measurements were conducted on \emph{Euler} and the specific type of node used is mentioned together with the results. The last sub-section is then dedicated to the distributed flow solver, comparing it to its serial counterpart for increasing numbers of pores.
\hspace{0.5cm}In the following we discuss the results of our parallel pore-connecting algorithm and compare it to the existing serial implementation from \cite{MEYER2021101592}. Particularly, we are interested in the \textbf{scaling} of our method with respect to the number of processes and the difference in \textbf{run-time} between the two implementations for varying target sizes of the generated domain. All performance measurements were conducted on \emph{Euler} and the specific type of node used is mentioned together with the results. The last sub-section is then dedicated to the distributed flow solver, comparing it to its serial counterpart for an increasing number of pores.
\subsection{Strong Scaling}
\hspace{0.5cm}Firstly, we investigate the \textbf{strong scaling} as shown in Figure ~\ref{fig:strong}. We observe that our method scales fairly well for an increasing number of processes, as the measurements lie reasonably close to the \emph{ideal} case. As expected, the speedup is not perfect, since the network generation function is not fully parallelized. In particular, the distribution of pores using dendrogram-based clustering is still serial. Additionally, connecting the individual pores cannot be parallelized in a useful way, as it involves substantial complexity concerning synchronization. It is also significantly faster and computationally cheap, than the parallel match finding. Despite all this, because these serial parts only account for a small fraction of the total computation time, we still observe a large \textbf{speedup} of up to a factor $20$.
\subsection{Comparison}
......@@ -332,7 +332,7 @@
\begin{multicols}{2}
\section{Discussion}
\hspace{0.5cm}In this work we have achieved sizeable performance improvements over the previous, serial implementations from \cite{MEYER2021101592}, especially regarding the generation algorithm. This allows us to compute much larger network realizations of improved quality and simulate the flow through them within a reasonable time-frame of a few hours.
\hspace{0.5cm}Throughout this work we have achieved sizeable performance improvements over the previous, serial implementations from \cite{MEYER2021101592}, especially regarding the generation algorithm. This allows us to compute much larger network realizations of improved quality and simulate the flow through them within a reasonable time-frame of a few hours. However, for larger network realizations, the \textbf{serial dendrogram-based distribution} step becomes the \emph{bottleneck}, taking upwards of 4 hours starting from networks with $10$ million pores. To enable \emph{efficient} generation of networks larger than that, this issue would have to be addressed in due time. Additionally, it is of great interest to study \emph{fluid particle transport} through increasingly large periodic network samples, as part of a future work.
\section{Acknowledgments}
\hspace{0.5cm}The author thankfully acknowledges the various discussions held with supervisor Daniel W. Meyer, who has guided the course of this thesis and offered valuable insight during development of the code.
\end{multicols}
......@@ -345,7 +345,7 @@
\label{appendix:install}
For the purposes of this thesis, PETSc was installed in the following way. Given \textbf{existing} (open)MPI compilers located at \verb|/usr/bin/| (Linux).
\begin{itemize}
\item Clone \href{https://gitlab.com/petsc/petsc}{PETSc repository}.
\item Clone \href{https://gitlab.com/petsc/petsc}{PETSc repository} from \cite{petsc-web-page}.
\item Run \textbf{configuration} script:\\
\begin{tabular}{ l l }
\verb|./configure| & \verb|--with-cc=/usr/bin/mpicc| \\
......
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