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 05beed26 authored by sfritschi's avatar sfritschi
Browse files

Updated thesis

parent 6318b49b
......@@ -43,7 +43,7 @@ def main():
netflow.save_network_to(path, dendro)
print("network saved to: {}".format(path))
print("Generated network statistics:")
print("\nGenerated network statistics:")
print("Throats: %d" % len(dendro.throats))
print("Pores: %d" % len(dendro.pores))
......
import sys
sys.path.append('../')
import netflow.netgen as netgen_par
import netflow_serial.netgen as netgen_ser
def compute_target_sizes(max_power2):
power = 0
d = 3
target_sizes = [[1, 1, 1]]
while (power < max_power2):
prev = target_sizes[d * power]
for i in range(d):
t = prev.copy()
t[i] <<= 1
prev = t
target_sizes.append(t)
power += 1
return target_sizes
def main():
if (len(sys.argv) != 3):
raise AssertionError("Usage: python3 quality.py <nthreads> <max_power>")
basenet = netgen_par.load_network_from('../network/network.h5')
print("Network statistics:")
print("Throats: %d" % len(basenet.throats))
pore_throat_counts = [len(pore.throats) for pore in basenet.pores]
print("Max. number of throats per pore: %d" % max(pore_throat_counts))
print("Min. number of throats per pore: %d" % min(pore_throat_counts))
print("Avg. number of throats per pore: %f" % (sum(pore_throat_counts) / len(pore_throat_counts)))
del pore_throat_counts
nthreads = int(sys.argv[1])
print("Using: {} threads".format(nthreads))
targetsizes = compute_target_sizes(int(sys.argv[2]))
cutoff = 0.5 * max([basenet.ub[i] - basenet.lb[i] \
for i in range(len(basenet.ub))])
for target in targetsizes:
print("Target size: {}".format(target))
_ = netgen_par.generate_dendrogram(basenet=basenet, targetsize=target, \
cutoff=cutoff, sd=42, nthreads=nthreads, mute=False)
_ = netgen_ser.generate_dendrogram(basenet=basenet, targetsize=target, \
cutoff=cutoff, sd=42, mute=False)
if __name__ == '__main__':
main()
......@@ -163,8 +163,8 @@ class CellList:
def match_maker(self, pores: List[Pore], tid: int):
n = len(pores)
for i, pore in enumerate(pores):
#if (tid == 0):
# print(f"progress {((i+1) / n)*100.:.1f}%", end="\r", flush=True)
if (tid == 0):
print(f"progress {((i+1) / n)*100.:.1f}%", end="\r", flush=True)
candidates = self.find_candidates(pore)
# Find best candidate for each throat of pore
......@@ -810,7 +810,7 @@ def generate_dendrogram(basenet: Network, targetsize: List[int], \
remainder = nRemain % nthreads
loads = [nRemain // nthreads + (i < remainder) for i in range(nthreads)]
# Compute inclusive-scan yielding offsets in poresRemain threads
# Compute inclusive-scan yielding offsets in poresRemain
displs = [0]
displs += accumulate(loads)
......@@ -950,7 +950,7 @@ def generate_dendrogram(basenet: Network, targetsize: List[int], \
format(len(throats), nUnrealized, percent))
avg_throat_diff /= count
print("Avg. throat length difference: %e" % avg_throat_diff)
print("Relative to Lmax: %.1f%%" % (avg_throat_diff / basenet.Lmax * 100.))
print("Relative to Lmax: %.3f%%" % (avg_throat_diff / basenet.Lmax * 100.))
# assemble and return network
network = Network(lb=[0.0 for k in range(d)],
......@@ -981,6 +981,8 @@ def generate_dendrogram(basenet: Network, targetsize: List[int], \
nborInd.add(nbor.index)
# Make sure pore isn't connected to the same nbor twice
assert(len(nborInd) == nthroats)
# Make sure there are no self-connections
assert(pore.index not in nborInd)
checkUnrealized //= 2 # counted every throat twice
# Make sure missing throats are accounted for
......
......@@ -512,6 +512,8 @@ def generate_dendrogram(basenet: Network, targetsize: List[int], \
throats = []
k = 0 # count of unrealised throats
nnbrs0 = 0; nnbrs = 0; # (initial) maximum number of neighbors
throatTotal = sum([len(pore.throats) for pore in pores[:n]]) // 2
for i, pore in enumerate(pores[:n]):
# (re)run triangulation if maximal number of neighbors exceeds
# threshold given by 2x init. maximum (large nnbrs -> expensive search)
......@@ -595,7 +597,7 @@ def generate_dendrogram(basenet: Network, targetsize: List[int], \
nnbrs = expel(pore, cpore, neighborhood, front, candidates, nnbrs)
print("\b"*24 + "{0:d} throats in total, {1:d} unrealised".\
format(len(throats), k))
# assemble and return network
network = Network(lb=[0.0 for k in range(d)],
ub=L, Lmax=basenet.Lmax, label='from_' + basenet.label)
......
......@@ -56,24 +56,26 @@
\@writefile{toc}{\defcounter {refsection}{0}\relax }\@writefile{toc}{\contentsline {subsection}{\numberline {3.4}Results}{7}{subsection.3.4}\protected@file@percent }
\abx@aux@cite{MEYER2021101592}
\abx@aux@segm{0}{0}{MEYER2021101592}
\@writefile{lot}{\defcounter {refsection}{0}\relax }\@writefile{lot}{\contentsline {table}{\numberline {2}{\ignorespaces Shown are the fraction of throats that were left unrealized, as well as the average deviation from the target length relative to $L_m$, for both serial and parallel algorithms applied to networks of increasing size.\relax }}{8}{table.caption.4}\protected@file@percent }
\newlabel{table:comp}{{2}{8}{Shown are the fraction of throats that were left unrealized, as well as the average deviation from the target length relative to $L_m$, for both serial and parallel algorithms applied to networks of increasing size.\relax }{table.caption.4}{}}
\@writefile{toc}{\defcounter {refsection}{0}\relax }\@writefile{toc}{\contentsline {section}{\numberline {4}Performance Analysis}{8}{section.4}\protected@file@percent }
\@writefile{toc}{\defcounter {refsection}{0}\relax }\@writefile{toc}{\contentsline {subsection}{\numberline {4.1}Strong Scaling}{8}{subsection.4.1}\protected@file@percent }
\@writefile{toc}{\defcounter {refsection}{0}\relax }\@writefile{toc}{\contentsline {subsection}{\numberline {4.2}Comparison}{8}{subsection.4.2}\protected@file@percent }
\@writefile{toc}{\defcounter {refsection}{0}\relax }\@writefile{toc}{\contentsline {subsection}{\numberline {4.3}Flow Simulation}{8}{subsection.4.3}\protected@file@percent }
\newlabel{fig:strong}{{3a}{9}{For a fixed problem size where the network to be generated is $3^3 = 27$ times as large as the base network, we compute the \emph {speedup} for $1, 2, 4, 8, 16$ and $32$ threads. The time measurements of the parallel generation algorithm were conducted on an Euler IV node equipped with Intel Xeon Gold 6150 CPUs and $36$ cores in total.\relax }{figure.caption.5}{}}
\newlabel{sub@fig:strong}{{a}{9}{For a fixed problem size where the network to be generated is $3^3 = 27$ times as large as the base network, we compute the \emph {speedup} for $1, 2, 4, 8, 16$ and $32$ threads. The time measurements of the parallel generation algorithm were conducted on an Euler IV node equipped with Intel Xeon Gold 6150 CPUs and $36$ cores in total.\relax }{figure.caption.5}{}}
\newlabel{fig:comp}{{3b}{9}{Run-times of both serial and parallel algorithms in seconds, as measured on Euler IV node. Measurements are only performed once, since the impact of noise is negligible for sufficiently large networks. The generated size on the $x$-axis refers to the number of times the base network fits inside the generated network. The parallel version is consistently between $10$ and $20$ times faster.\relax }{figure.caption.5}{}}
\newlabel{sub@fig:comp}{{b}{9}{Run-times of both serial and parallel algorithms in seconds, as measured on Euler IV node. Measurements are only performed once, since the impact of noise is negligible for sufficiently large networks. The generated size on the $x$-axis refers to the number of times the base network fits inside the generated network. The parallel version is consistently between $10$ and $20$ times faster.\relax }{figure.caption.5}{}}
\@writefile{toc}{\defcounter {refsection}{0}\relax }\@writefile{toc}{\contentsline {subsection}{\numberline {4.3}Flow Simulation}{9}{subsection.4.3}\protected@file@percent }
\abx@aux@cite{MEYER2021101592}
\abx@aux@segm{0}{0}{MEYER2021101592}
\newlabel{fig:strong}{{3a}{9}{For a fixed problem size where the network to be generated is $3^3 = 27$ times as large as the base network, we compute the \emph {speedup} for $1, 2, 4, 8, 16$ and $32$ threads. The time measurements of the parallel generation algorithm were conducted on an Euler IV node equipped with Intel Xeon Gold 6150 CPUs and $36$ cores in total.\relax }{figure.caption.4}{}}
\newlabel{sub@fig:strong}{{a}{9}{For a fixed problem size where the network to be generated is $3^3 = 27$ times as large as the base network, we compute the \emph {speedup} for $1, 2, 4, 8, 16$ and $32$ threads. The time measurements of the parallel generation algorithm were conducted on an Euler IV node equipped with Intel Xeon Gold 6150 CPUs and $36$ cores in total.\relax }{figure.caption.4}{}}
\newlabel{fig:comp}{{3b}{9}{Run-times of both serial and parallel algorithms in seconds, as measured on Euler IV node. Measurements are only performed once, since the impact of noise is negligible for sufficiently large networks. The generated size on the $x$-axis refers to the number of times the base network fits inside the generated network. The parallel version is consistently between $10$ and $20$ times faster.\relax }{figure.caption.4}{}}
\newlabel{sub@fig:comp}{{b}{9}{Run-times of both serial and parallel algorithms in seconds, as measured on Euler IV node. Measurements are only performed once, since the impact of noise is negligible for sufficiently large networks. The generated size on the $x$-axis refers to the number of times the base network fits inside the generated network. The parallel version is consistently between $10$ and $20$ times faster.\relax }{figure.caption.4}{}}
\@writefile{toc}{\defcounter {refsection}{0}\relax }\@writefile{toc}{\contentsline {section}{\numberline {5}Discussion}{9}{section.5}\protected@file@percent }
\@writefile{toc}{\defcounter {refsection}{0}\relax }\@writefile{toc}{\contentsline {section}{\numberline {6}Acknowledgments}{9}{section.6}\protected@file@percent }
\@writefile{toc}{\defcounter {refsection}{0}\relax }\@writefile{toc}{\contentsline {section}{\numberline {A}PETSc Installation}{10}{appendix.A}\protected@file@percent }
\newlabel{appendix:install}{{A}{10}{PETSc Installation}{appendix.A}{}}
\@writefile{toc}{\defcounter {refsection}{0}\relax }\@writefile{toc}{\contentsline {section}{\numberline {B}Base Network}{10}{appendix.B}\protected@file@percent }
\newlabel{appendix:base}{{B}{10}{Base Network}{appendix.B}{}}
\@writefile{lof}{\defcounter {refsection}{0}\relax }\@writefile{lof}{\contentsline {figure}{\numberline {4}{\ignorespaces Network consisting of 2636 pores and 4291 throats, inscribed within a cube extending $1.07$ mm in each spatial direction. The pore-arrangement is obviously \emph {not uniform}, as can be seen by the clustering of pores in some regions, while others are mostly undisturbed. The \emph {porosity}, measured as the relative fraction of volume taken up by the void-space geometry, is roughly $32\%$.\relax }}{10}{figure.caption.5}\protected@file@percent }
\newlabel{fig:base}{{4}{10}{Network consisting of 2636 pores and 4291 throats, inscribed within a cube extending $1.07$ mm in each spatial direction. The pore-arrangement is obviously \emph {not uniform}, as can be seen by the clustering of pores in some regions, while others are mostly undisturbed. The \emph {porosity}, measured as the relative fraction of volume taken up by the void-space geometry, is roughly $32\%$.\relax }{figure.caption.5}{}}
\@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 }
\@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 }
\newlabel{appendix:base}{{B}{11}{Base Network}{appendix.B}{}}
\@writefile{lof}{\defcounter {refsection}{0}\relax }\@writefile{lof}{\contentsline {figure}{\numberline {4}{\ignorespaces Network consisting of 2636 pores and 4291 throats, inscribed within a cube extending $1.07$ mm in each spatial direction. The pore-arrangement is obviously \emph {not uniform}, as can be seen by the clustering of pores in some regions, while others are mostly undisturbed. The \emph {porosity}, measured as the relative fraction of volume taken up by the void-space geometry, is roughly $32\%$.\relax }}{11}{figure.caption.6}\protected@file@percent }
\newlabel{fig:base}{{4}{11}{Network consisting of 2636 pores and 4291 throats, inscribed within a cube extending $1.07$ mm in each spatial direction. The pore-arrangement is obviously \emph {not uniform}, as can be seen by the clustering of pores in some regions, while others are mostly undisturbed. The \emph {porosity}, measured as the relative fraction of volume taken up by the void-space geometry, is roughly $32\%$.\relax }{figure.caption.6}{}}
\abx@aux@refcontextdefaultsdone
\abx@aux@defaultrefcontext{0}{MEYER2021103936}{none/global//global/global}
\abx@aux@defaultrefcontext{0}{MEYER2021101592}{none/global//global/global}
......
This is pdfTeX, Version 3.14159265-2.6-1.40.20 (TeX Live 2019/Debian) (preloaded format=pdflatex 2021.4.27) 4 DEC 2021 13:13
This is pdfTeX, Version 3.14159265-2.6-1.40.20 (TeX Live 2019/Debian) (preloaded format=pdflatex 2021.4.27) 4 DEC 2021 20:30
entering extended mode
restricted \write18 enabled.
%&-line parsing enabled.
......@@ -1010,30 +1010,50 @@ Package pdftex.def Info: plots/flux_PETSC.png used on input line 77.
[3] [4 <./plots/flux_PETSC.png>] [5] [6]
Package hyperref Info: bookmark level for unknown algorithm defaults to 0 on in
put line 249.
[7]
<plots/strong_scaling.png, id=161, 462.528pt x 346.896pt>
Overfull \hbox (2.24487pt too wide) in paragraph at lines 288--288
[]\OT1/cmr/bx/n/10 Unrealized
[]
Overfull \hbox (2.24487pt too wide) in paragraph at lines 288--288
[]\OT1/cmr/bx/n/10 Unrealized
[]
Underfull \hbox (badness 10000) in paragraph at lines 288--288
[]\OT1/cmr/bx/n/10 Deviation
[]
Underfull \hbox (badness 10000) in paragraph at lines 288--289
[]\OT1/cmr/bx/n/10 Deviation
[]
[7] [8]
<plots/strong_scaling.png, id=169, 462.528pt x 346.896pt>
File: plots/strong_scaling.png Graphic file (type png)
<use plots/strong_scaling.png>
Package pdftex.def Info: plots/strong_scaling.png used on input line 298.
Package pdftex.def Info: plots/strong_scaling.png used on input line 313.
(pdftex.def) Requested size: 155.24895pt x 116.43451pt.
<plots/comparison_time.png, id=162, 462.528pt x 346.896pt>
<plots/comparison_time.png, id=170, 462.528pt x 346.896pt>
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 305.
Package pdftex.def Info: plots/comparison_time.png used on input line 320.
(pdftex.def) Requested size: 155.24895pt x 116.43451pt.
[8] [9 <./plots/strong_scaling.png> <./plots/comparison_time.png>]
<plots/base.png, id=182, 462.528pt x 346.896pt>
[9 <./plots/strong_scaling.png> <./plots/comparison_time.png>] [10]
<plots/base.png, id=188, 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 351.
Package pdftex.def Info: plots/base.png used on input line 366.
(pdftex.def) Requested size: 207.0021pt x 155.25484pt.
[10 <./plots/base.png>] [11]
Package atveryend Info: Empty hook `BeforeClearDocument' on input line 360.
Package atveryend Info: Empty hook `AfterLastShipout' on input line 360.
(./thesis.aux)
Package atveryend Info: Executing hook `AtVeryEndDocument' on input line 360.
Package atveryend Info: Executing hook `AtEndAfterFileList' on input line 360.
[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)
Package atveryend Info: Executing hook `AtVeryEndDocument' on input line 375.
Package atveryend Info: Executing hook `AtEndAfterFileList' on input line 375.
Package rerunfilecheck Info: File `thesis.out' has not changed.
(rerunfilecheck) Checksum: 13059BCF5A4577A45746B607DC3AADA1;1094.
Package logreq Info: Writing requests to 'thesis.run.xml'.
......@@ -1041,13 +1061,13 @@ Package logreq Info: Writing requests to 'thesis.run.xml'.
)
Here is how much of TeX's memory you used:
26426 strings out of 483107
494958 string characters out of 5964630
1137318 words of memory out of 5000000
40989 multiletter control sequences out of 15000+600000
26429 strings out of 483107
494992 string characters out of 5964630
1137563 words of memory out of 5000000
40990 multiletter control sequences out of 15000+600000
542561 words of font info for 59 fonts, out of 8000000 for 9000
59 hyphenation exceptions out of 8191
60i,8n,60p,2036b,1256s stack positions out of 5000i,500n,10000p,200000b,80000s
60i,10n,60p,2036b,1256s stack positions out of 5000i,500n,10000p,200000b,80000s
</home/sev/.texlive2019/texmf-var/fonts/pk/ljfour/jknappen/ec/tcrm1000.600pk
></usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmbx10.pfb></usr
/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmbx12.pfb></usr/share
......@@ -1069,10 +1089,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 (11 pages, 468906 bytes).
Output written on thesis.pdf (12 pages, 471472 bytes).
PDF statistics:
292 PDF objects out of 1000 (max. 8388607)
246 compressed objects within 3 object streams
45 named destinations out of 1000 (max. 500000)
298 PDF objects out of 1000 (max. 8388607)
251 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
......@@ -245,7 +245,7 @@
\newpage
\begin{algorithm}[ht]
\begin{algorithm}[H]
\caption{Connect pores in parallel}
\begin{algorithmic}
\State Initialize $cellList$ using $pores$ and compute $totalThroats$
......@@ -277,9 +277,24 @@
\begin{multicols}{2}
\subsection{Results}
\hspace{0.5cm}Lastly, we discuss the quality of network realizations generated by our method. The immediate advantage of this iterative algorithm is that it connects as many pores as it can, achieving a much \textbf{larger fraction of realized throats}.
\hspace{0.5cm}Lastly, we discuss the quality of network realizations generated by our method. The immediate advantage of this iterative algorithm is that it connects as many pores as possible, achieving a much \textbf{larger fraction of realized throats} in the process. Apart from this, we take a closer look at the established throat connections, by examining their \textbf{deviations} from the target lengths $L_t$ of the original network. In the following, we focus on the average deviation for all realized throats and normalize it using the maximal throat length $L_m$. This way, we further compare the quality of networks generated by the serial and parallel algorithms respectively. For such networks of increasing size, we list the mentioned quality measures for both implementations in Table ~\ref{table:comp}. It is apparent that our method not only realizes many more throat connections, but they are also closer to the imposed target length \emph{on average}.
\end{multicols}
\begin{table}[ht]
\centering
\caption{Shown are the fraction of throats that were left unrealized, as well as the average deviation from the target length relative to $L_m$, for both serial and parallel algorithms applied to networks of increasing size.}
\begin{tabular}{|p{0.15\textwidth}|p{0.15\textwidth}|p{0.15\textwidth}|p{0.15\textwidth}|p{0.15\textwidth}|}
\hline
\textbf{\#Throats} & \textbf{Unrealized \textcolor{blue}{parallel}} & \textbf{Unrealized \textcolor{red}{serial}} & \textbf{Deviation \textcolor{blue}{parallel}} & \textbf{Deviation \textcolor{red}{serial}} \\
\hline
3832 & 0.05\% & 0.26\% & 1.59\% & 2.83\% \\
7664 & 0.04\% & 0.26\% & 1.50\% & 2.72\% \\
15328 & 0.03\% & 0.39\% & 1.55\% & 2.73\% \\
30656 & 0.04\% & 0.36\% & 1.59\% & 2.76\% \\
\hline
\end{tabular}
\label{table:comp}
\end{table}
\newpage
\begin{multicols}{2}
......@@ -317,7 +332,7 @@
\begin{multicols}{2}
\section{Discussion}
\hspace{0.5cm}In this work we have achieved large 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 identical quality and simulate the flow through them within a reasonable time-frame of a few hours.
\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.
\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 helpful insight during development of the code.
\end{multicols}
......
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