Commit 668e17d7 authored by sfritschi's avatar sfritschi
Browse files

Updated thesis and renamed variables

parent 9f6b776a
......@@ -769,14 +769,14 @@ def generate_dendrogram(basenet: Network, targetsize: List[int], \
# Additional parameters:
maxIters = 6 # Maximum number of iterations until we give up
throatTolerance = 0.002 # Max. 0.2% may not be realized
throatTolerance = 0.01 # Max. 1% may not be realized
iterCount = 0
throatsLeft = totalThroats
throatThreshold = int(throatTolerance * totalThroats)
# Pores in interior that are not fully-connected yet
reduced_pores = pores[:n]
poresRemain = pores[:n]
while (iterCount < maxIters and throatsLeft > throatThreshold):
if (not mute):
......@@ -786,7 +786,7 @@ def generate_dendrogram(basenet: Network, targetsize: List[int], \
if (not mute): print("computing best matches")
# Compute best matches for each pore in parallel using available threads
for tid in range(nthreads):
poreList = reduced_pores[displs[tid] : displs[tid+1]]
poreList = poresRemain[displs[tid] : displs[tid+1]]
worker = mp.Process(target=cellList.match_maker, args=(poreList, tid))
worker.start()
workers.append(worker)
......@@ -795,7 +795,7 @@ def generate_dendrogram(basenet: Network, targetsize: List[int], \
worker.join()
# Iterate over remaining (reduced) pores
for it, pore in enumerate(reduced_pores):
for it, pore in enumerate(poresRemain):
if (not mute):
print(f"progress {((it+1) / n)*100.:.1f}%", end="\r", flush=True)
......@@ -811,7 +811,7 @@ def generate_dendrogram(basenet: Network, targetsize: List[int], \
if throatIdx not in poreTtbr:
continue # Throat already realized
# TODO: Remaining throats not properly tracked
if match == -1: # give up
poreTtbr.clear()
break
......@@ -871,21 +871,21 @@ def generate_dendrogram(basenet: Network, targetsize: List[int], \
throatCount = 0
# Copy throats back to original pores and update #throats left
# and compute remaining (reduced) pores
next_pores = []
for pore in reduced_pores:
nextPores = []
for pore in poresRemain:
poreTtbr = ttbrs[pore.index]
throatCount += len(poreTtbr)
pore.throats = poreTtbr.copy()
if len(poreTtbr) > 0:
# Insert in random order for improved load balancing
next_pores.insert(randint(0,len(next_pores)), pore)
nextPores.insert(randint(0,len(nextPores)), pore)
reduced_pores = next_pores
poresRemain = nextPores
# Recompute loads and displacements for all threads
n_reduced = len(reduced_pores)
remainder = n_reduced % nthreads
loads = [n_reduced // nthreads] * nthreads
nremain = len(poresRemain)
remainder = nremain % nthreads
loads = [nremain // nthreads] * nthreads
for i in range(remainder):
loads[i] += 1
......@@ -897,7 +897,7 @@ def generate_dendrogram(basenet: Network, targetsize: List[int], \
iterCount += 1
# Unrealized throats
n_unrealized = totalThroats - len(throats)
nunrealized = totalThroats - len(throats)
# Free memory associated with cellList (not needed anymore)
del cellList
......@@ -905,9 +905,9 @@ def generate_dendrogram(basenet: Network, targetsize: List[int], \
# DEBUG
if (iterCount == maxIters):
print("Maximum iteration count reached!")
percent = n_unrealized / totalThroats * 100.
percent = nunrealized / totalThroats * 100.
print("\b"*24 + "{0:d} throats in total, {1:d} unrealised ({2:.3f}%)".\
format(len(throats), n_unrealized, percent))
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.))
......
......@@ -43,10 +43,15 @@
\@writefile{lof}{\defcounter {refsection}{0}\relax }\@writefile{lof}{\contentsline {figure}{\numberline {1}{\ignorespaces Pressures $p_{\mathrm {in}}$ and $p_{\mathrm {out}}$ are applied to in-pores and out-pores respectively, driving the network flow. The resulting pressure system is solved with the available solvers and the different fluxes are shown for the individual pores in the case of PETSc (using 4 processes). Since the sequential solvers produce an identical plot, they are omitted here. \relax }}{4}{figure.caption.1}\protected@file@percent }
\providecommand*\caption@xref[2]{\@setref\relax\@undefined{#1}}
\newlabel{fig:balance}{{1}{4}{Pressures $p_{\mathrm {in}}$ and $p_{\mathrm {out}}$ are applied to in-pores and out-pores respectively, driving the network flow. The resulting pressure system is solved with the available solvers and the different fluxes are shown for the individual pores in the case of PETSc (using 4 processes). Since the sequential solvers produce an identical plot, they are omitted here. \relax }{figure.caption.1}{}}
\@writefile{toc}{\defcounter {refsection}{0}\relax }\@writefile{toc}{\contentsline {section}{\numberline {3}Parallel Network Generation Algorithm}{4}{section.3}\protected@file@percent }
\@writefile{toc}{\defcounter {refsection}{0}\relax }\@writefile{toc}{\contentsline {subsection}{\numberline {3.1}Cell-Lists}{4}{subsection.3.1}\protected@file@percent }
\@writefile{toc}{\defcounter {refsection}{0}\relax }\@writefile{toc}{\contentsline {section}{\numberline {A}PETSc Installation}{5}{appendix.A}\protected@file@percent }
\newlabel{appendix:install}{{A}{5}{PETSc Installation}{appendix.A}{}}
\@writefile{toc}{\defcounter {refsection}{0}\relax }\@writefile{toc}{\contentsline {section}{\numberline {3}Parallel Network Generation}{4}{section.3}\protected@file@percent }
\@writefile{toc}{\defcounter {refsection}{0}\relax }\@writefile{toc}{\contentsline {subsection}{\numberline {3.1}Cell Lists}{4}{subsection.3.1}\protected@file@percent }
\@writefile{toc}{\defcounter {refsection}{0}\relax }\@writefile{toc}{\contentsline {subsection}{\numberline {3.2}Iterative Algorithm}{5}{subsection.3.2}\protected@file@percent }
\@writefile{lot}{\defcounter {refsection}{0}\relax }\@writefile{lot}{\contentsline {table}{\numberline {1}{\ignorespaces Sample run of parallel pore-connecting algorithm using 4 threads. The generated network is 3 times as large as the base network in all directions. The maximal feasible number of throats is 103464, of which 961 were not realized due to falling below the threshold of 1\%.\relax }}{5}{table.caption.2}\protected@file@percent }
\newlabel{table:iter}{{1}{5}{Sample run of parallel pore-connecting algorithm using 4 threads. The generated network is 3 times as large as the base network in all directions. The maximal feasible number of throats is 103464, of which 961 were not realized due to falling below the threshold of 1\%.\relax }{table.caption.2}{}}
\@writefile{loa}{\defcounter {refsection}{0}\relax }\@writefile{loa}{\contentsline {algorithm}{\numberline {1}{\ignorespaces Connect pores in parallel\relax }}{6}{algorithm.1}\protected@file@percent }
\newlabel{alg:connect}{{1}{6}{Connect pores in parallel\relax }{algorithm.1}{}}
\@writefile{toc}{\defcounter {refsection}{0}\relax }\@writefile{toc}{\contentsline {section}{\numberline {A}PETSc Installation}{6}{appendix.A}\protected@file@percent }
\newlabel{appendix:install}{{A}{6}{PETSc Installation}{appendix.A}{}}
\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) 27 NOV 2021 17:54
This is pdfTeX, Version 3.14159265-2.6-1.40.20 (TeX Live 2019/Debian) (preloaded format=pdflatex 2021.4.27) 28 NOV 2021 11:32
entering extended mode
restricted \write18 enabled.
%&-line parsing enabled.
......@@ -792,33 +792,126 @@ File: lstmisc.sty 2019/09/10 1.8c (Carsten Heinz)
File: listings.cfg 2019/09/10 1.8c listings configuration
))
Package: listings 2019/09/10 1.8c (Carsten Heinz)
\@quotelevel=\count418
\@quotereset=\count419
(/usr/share/texlive/texmf-dist/tex/latex/l3backend/l3backend-pdfmode.def
(/usr/share/texlive/texmf-dist/tex/latex/amsmath/amsmath.sty
Package: amsmath 2020/01/20 v2.17e AMS math features
\@mathmargin=\skip74
For additional information on amsmath, use the `?' option.
(/usr/share/texlive/texmf-dist/tex/latex/amsmath/amstext.sty
Package: amstext 2000/06/29 v2.01 AMS text
(/usr/share/texlive/texmf-dist/tex/latex/amsmath/amsgen.sty
File: amsgen.sty 1999/11/30 v2.0 generic functions
\@emptytoks=\toks28
\ex@=\dimen267
))
(/usr/share/texlive/texmf-dist/tex/latex/amsmath/amsbsy.sty
Package: amsbsy 1999/11/29 v1.2d Bold Symbols
\pmbraise@=\dimen268
)
(/usr/share/texlive/texmf-dist/tex/latex/amsmath/amsopn.sty
Package: amsopn 2016/03/08 v2.02 operator names
)
\inf@bad=\count418
LaTeX Info: Redefining \frac on input line 227.
\uproot@=\count419
\leftroot@=\count420
LaTeX Info: Redefining \overline on input line 389.
\classnum@=\count421
\DOTSCASE@=\count422
LaTeX Info: Redefining \ldots on input line 486.
LaTeX Info: Redefining \dots on input line 489.
LaTeX Info: Redefining \cdots on input line 610.
\Mathstrutbox@=\box104
\strutbox@=\box105
\big@size=\dimen269
LaTeX Font Info: Redeclaring font encoding OML on input line 733.
LaTeX Font Info: Redeclaring font encoding OMS on input line 734.
\macc@depth=\count423
\c@MaxMatrixCols=\count424
\dotsspace@=\muskip21
\c@parentequation=\count425
\dspbrk@lvl=\count426
\tag@help=\toks29
\row@=\count427
\column@=\count428
\maxfields@=\count429
\andhelp@=\toks30
\eqnshift@=\dimen270
\alignsep@=\dimen271
\tagshift@=\dimen272
\tagwidth@=\dimen273
\totwidth@=\dimen274
\lineht@=\dimen275
\@envbody=\toks31
\multlinegap=\skip75
\multlinetaggap=\skip76
\mathdisplay@stack=\toks32
LaTeX Info: Redefining \[ on input line 2859.
LaTeX Info: Redefining \] on input line 2860.
)
(/usr/share/texlive/texmf-dist/tex/latex/algorithms/algorithm.sty
Package: algorithm 2009/08/24 v0.1 Document Style `algorithm' - floating enviro
nment
(/usr/share/texlive/texmf-dist/tex/latex/float/float.sty
Package: float 2001/11/08 v1.3d Float enhancements (AL)
\c@float@type=\count430
\float@exts=\toks33
\float@box=\box106
\@float@everytoks=\toks34
\@floatcapt=\box107
)
\@float@every@algorithm=\toks35
\c@algorithm=\count431
)
(/usr/share/texlive/texmf-dist/tex/latex/algorithmicx/algpseudocode.sty
Package: algpseudocode
(/usr/share/texlive/texmf-dist/tex/latex/algorithmicx/algorithmicx.sty
Package: algorithmicx 2005/04/27 v1.2 Algorithmicx
Document Style algorithmicx 1.2 - a greatly improved `algorithmic' style
\c@ALG@line=\count432
\c@ALG@rem=\count433
\c@ALG@nested=\count434
\ALG@tlm=\skip77
\ALG@thistlm=\skip78
\c@ALG@Lnr=\count435
\c@ALG@blocknr=\count436
\c@ALG@storecount=\count437
\c@ALG@tmpcounter=\count438
\ALG@tmplength=\skip79
)
Document Style - pseudocode environments for use with the `algorithmicx' style
)
\@quotelevel=\count439
\@quotereset=\count440
(/usr/share/texlive/texmf-dist/tex/latex/l3backend/l3backend-pdfmode.def
File: l3backend-pdfmode.def 2020-02-03 L3 backend support: PDF mode
\l__kernel_color_stack_int=\count420
\l__pdf_internal_box=\box104
\l__kernel_color_stack_int=\count441
\l__pdf_internal_box=\box108
)
(./thesis.aux)
\openout1 = `thesis.aux'.
LaTeX Font Info: Checking defaults for OML/cmm/m/it on input line 21.
LaTeX Font Info: ... okay on input line 21.
LaTeX Font Info: Checking defaults for OMS/cmsy/m/n on input line 21.
LaTeX Font Info: ... okay on input line 21.
LaTeX Font Info: Checking defaults for OT1/cmr/m/n on input line 21.
LaTeX Font Info: ... okay on input line 21.
LaTeX Font Info: Checking defaults for T1/cmr/m/n on input line 21.
LaTeX Font Info: ... okay on input line 21.
LaTeX Font Info: Checking defaults for TS1/cmr/m/n on input line 21.
LaTeX Font Info: ... okay on input line 21.
LaTeX Font Info: Checking defaults for OMX/cmex/m/n on input line 21.
LaTeX Font Info: ... okay on input line 21.
LaTeX Font Info: Checking defaults for U/cmr/m/n on input line 21.
LaTeX Font Info: ... okay on input line 21.
LaTeX Font Info: Checking defaults for PD1/pdf/m/n on input line 21.
LaTeX Font Info: ... okay on input line 21.
LaTeX Font Info: Checking defaults for OML/cmm/m/it on input line 28.
LaTeX Font Info: ... okay on input line 28.
LaTeX Font Info: Checking defaults for OMS/cmsy/m/n on input line 28.
LaTeX Font Info: ... okay on input line 28.
LaTeX Font Info: Checking defaults for OT1/cmr/m/n on input line 28.
LaTeX Font Info: ... okay on input line 28.
LaTeX Font Info: Checking defaults for T1/cmr/m/n on input line 28.
LaTeX Font Info: ... okay on input line 28.
LaTeX Font Info: Checking defaults for TS1/cmr/m/n on input line 28.
LaTeX Font Info: ... okay on input line 28.
LaTeX Font Info: Checking defaults for OMX/cmex/m/n on input line 28.
LaTeX Font Info: ... okay on input line 28.
LaTeX Font Info: Checking defaults for U/cmr/m/n on input line 28.
LaTeX Font Info: ... okay on input line 28.
LaTeX Font Info: Checking defaults for PD1/pdf/m/n on input line 28.
LaTeX Font Info: ... okay on input line 28.
Package biblatex Info: Trying to load language 'english'...
Package biblatex Info: ... file 'english.lbx' found.
......@@ -834,26 +927,27 @@ Package biblatex Info: Trying to load bibliographic data...
Package biblatex Info: ... file 'thesis.bbl' found.
(./thesis.bbl)
Package biblatex Info: Reference section=0 on input line 21.
Package biblatex Info: Reference segment=0 on input line 21.
Package biblatex Info: Reference section=0 on input line 28.
Package biblatex Info: Reference segment=0 on input line 28.
Package caption Info: Begin \AtBeginDocument code.
Package caption Info: float package is loaded.
Package caption Info: hyperref package is loaded.
Package caption Info: listings package is loaded.
Package caption Info: End \AtBeginDocument code.
ABD: EveryShipout initializing macros
(/usr/share/texlive/texmf-dist/tex/context/base/mkii/supp-pdf.mkii
[Loading MPS to PDF converter (version 2006.09.02).]
\scratchcounter=\count421
\scratchdimen=\dimen267
\scratchbox=\box105
\nofMPsegments=\count422
\nofMParguments=\count423
\everyMPshowfont=\toks28
\MPscratchCnt=\count424
\MPscratchDim=\dimen268
\MPnumerator=\count425
\makeMPintoPDFobject=\count426
\everyMPtoPDFconversion=\toks29
\scratchcounter=\count442
\scratchdimen=\dimen276
\scratchbox=\box109
\nofMPsegments=\count443
\nofMParguments=\count444
\everyMPshowfont=\toks36
\MPscratchCnt=\count445
\MPscratchDim=\dimen277
\MPnumerator=\count446
\makeMPintoPDFobject=\count447
\everyMPtoPDFconversion=\toks37
) (/usr/share/texlive/texmf-dist/tex/latex/epstopdf-pkg/epstopdf-base.sty
Package: epstopdf-base 2020-01-24 v2.11 Base part for package epstopdf
Package epstopdf-base Info: Redefining graphics rule for `.eps' on input line 4
......@@ -863,8 +957,8 @@ Package epstopdf-base Info: Redefining graphics rule for `.eps' on input line 4
File: epstopdf-sys.cfg 2010/07/13 v1.3 Configuration of (r)epstopdf for TeX Liv
e
))
\AtBeginShipoutBox=\box106
Package hyperref Info: Link coloring OFF on input line 21.
\AtBeginShipoutBox=\box110
Package hyperref Info: Link coloring OFF on input line 28.
(/usr/share/texlive/texmf-dist/tex/latex/hyperref/nameref.sty
Package: nameref 2019/09/16 v2.46 Cross-referencing by name of section
......@@ -875,84 +969,79 @@ Package: refcount 2019/12/15 v3.6 Data extraction from label references (HO)
(/usr/share/texlive/texmf-dist/tex/generic/gettitlestring/gettitlestring.sty
Package: gettitlestring 2019/12/15 v1.6 Cleanup title references (HO)
)
\c@section@level=\count427
\c@section@level=\count448
)
LaTeX Info: Redefining \ref on input line 21.
LaTeX Info: Redefining \pageref on input line 21.
LaTeX Info: Redefining \nameref on input line 21.
LaTeX Info: Redefining \ref on input line 28.
LaTeX Info: Redefining \pageref on input line 28.
LaTeX Info: Redefining \nameref on input line 28.
(./thesis.out) (./thesis.out)
\@outlinefile=\write5
\openout5 = `thesis.out'.
\c@lstlisting=\count428
LaTeX Font Info: External font `cmex10' loaded for size
(Font) <12> on input line 23.
LaTeX Font Info: External font `cmex10' loaded for size
(Font) <8> on input line 23.
LaTeX Font Info: External font `cmex10' loaded for size
(Font) <6> on input line 23.
\c@lstlisting=\count449
[1
{/var/lib/texmf/fonts/map/pdftex/updmap/pdftex.map}] [2]
<plots/flux_PETSC.png, id=66, 462.528pt x 346.896pt>
<plots/flux_PETSC.png, id=70, 462.528pt x 346.896pt>
File: plots/flux_PETSC.png Graphic file (type png)
<use plots/flux_PETSC.png>
Package pdftex.def Info: plots/flux_PETSC.png used on input line 65.
Package pdftex.def Info: plots/flux_PETSC.png used on input line 72.
(pdftex.def) Requested size: 276.00105pt x 207.01175pt.
LaTeX Font Info: External font `cmex10' loaded for size
(Font) <7> on input line 66.
LaTeX Font Info: External font `cmex10' loaded for size
(Font) <5> on input line 66.
LaTeX Warning: `h' float specifier changed to `ht'.
[3]
Underfull \hbox (badness 10000) in paragraph at lines 71--71
Underfull \hbox (badness 10000) in paragraph at lines 78--78
[]\OT1/cmr/bx/n/14.4 Parallel Net-work
[]
[4 <./plots/flux_PETSC.png>]
Package hyperref Info: bookmark level for unknown algorithm defaults to 0 on in
put line 110.
Underfull \hbox (badness 10000) in paragraph at lines 71--71
\OT1/cmr/bx/n/14.4 Gen-er-a-tion Al-go-
[]
[4 <./plots/flux_PETSC.png>] [5] [6]
Package atveryend Info: Empty hook `BeforeClearDocument' on input line 100.
Package atveryend Info: Empty hook `AfterLastShipout' on input line 100.
LaTeX Warning: `h' float specifier changed to `ht'.
[5] [6] [7]
Package atveryend Info: Empty hook `BeforeClearDocument' on input line 162.
Package atveryend Info: Empty hook `AfterLastShipout' on input line 162.
(./thesis.aux)
Package atveryend Info: Executing hook `AtVeryEndDocument' on input line 100.
Package atveryend Info: Executing hook `AtEndAfterFileList' on input line 100.
Package atveryend Info: Executing hook `AtVeryEndDocument' on input line 162.
Package atveryend Info: Executing hook `AtEndAfterFileList' on input line 162.
Package rerunfilecheck Info: File `thesis.out' has not changed.
(rerunfilecheck) Checksum: 56255825A004A602EC91C16993FDD835;522.
(rerunfilecheck) Checksum: AA3CBB7EB769D633AAD438AE1872089A;581.
Package logreq Info: Writing requests to 'thesis.run.xml'.
\openout1 = `thesis.run.xml'.
)
Here is how much of TeX's memory you used:
24865 strings out of 483107
473080 string characters out of 5964630
1096648 words of memory out of 5000000
39502 multiletter control sequences out of 15000+600000
538403 words of font info for 44 fonts, out of 8000000 for 9000
26070 strings out of 483107
488688 string characters out of 5964630
1117582 words of memory out of 5000000
40667 multiletter control sequences out of 15000+600000
540150 words of font info for 51 fonts, out of 8000000 for 9000
59 hyphenation exceptions out of 8191
60i,7n,60p,2000b,1258s stack positions out of 5000i,500n,10000p,200000b,80000s
60i,8n,60p,2000b,1258s 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
/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmcsc10.pfb></usr/share/texl
ive/texmf-dist/fonts/type1/public/amsfonts/cm/cmmi10.pfb></usr/share/texlive/te
xmf-dist/fonts/type1/public/amsfonts/cm/cmr10.pfb></usr/share/texlive/texmf-dis
t/fonts/type1/public/amsfonts/cm/cmr12.pfb></usr/share/texlive/texmf-dist/fonts
/type1/public/amsfonts/cm/cmr7.pfb></usr/share/texlive/texmf-dist/fonts/type1/p
ublic/amsfonts/cm/cmsl10.pfb></usr/share/texlive/texmf-dist/fonts/type1/public/
amsfonts/cm/cmti10.pfb></usr/share/texlive/texmf-dist/fonts/type1/public/amsfon
ts/cm/cmtt10.pfb>
Output written on thesis.pdf (6 pages, 177016 bytes).
ive/texmf-dist/fonts/type1/public/amsfonts/cm/cmex10.pfb></usr/share/texlive/te
xmf-dist/fonts/type1/public/amsfonts/cm/cmmi10.pfb></usr/share/texlive/texmf-di
st/fonts/type1/public/amsfonts/cm/cmmi7.pfb></usr/share/texlive/texmf-dist/font
s/type1/public/amsfonts/cm/cmr10.pfb></usr/share/texlive/texmf-dist/fonts/type1
/public/amsfonts/cm/cmr12.pfb></usr/share/texlive/texmf-dist/fonts/type1/public
/amsfonts/cm/cmr7.pfb></usr/share/texlive/texmf-dist/fonts/type1/public/amsfont
s/cm/cmsl10.pfb></usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/c
msy10.pfb></usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmsy7.p
fb></usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmti10.pfb></u
sr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmtt10.pfb>
Output written on thesis.pdf (7 pages, 221328 bytes).
PDF statistics:
154 PDF objects out of 1000 (max. 8388607)
131 compressed objects within 2 object streams
22 named destinations out of 1000 (max. 500000)
90 words of extra memory for PDF output out of 10000 (max. 10000000)
186 PDF objects out of 1000 (max. 8388607)
158 compressed objects within 2 object streams
27 named destinations out of 1000 (max. 500000)
98 words of extra memory for PDF output out of 10000 (max. 10000000)
......@@ -4,6 +4,7 @@
\BOOKMARK [2][-]{subsection.2.2}{Solver}{section.2}% 4
\BOOKMARK [2][-]{subsection.2.3}{Limitations}{section.2}% 5
\BOOKMARK [2][-]{subsection.2.4}{Results}{section.2}% 6
\BOOKMARK [1][-]{section.3}{Parallel Network Generation Algorithm}{}% 7
\BOOKMARK [2][-]{subsection.3.1}{Cell-Lists}{section.3}% 8
\BOOKMARK [1][-]{appendix.A}{PETSc Installation}{}% 9
\BOOKMARK [1][-]{section.3}{Parallel Network Generation}{}% 7
\BOOKMARK [2][-]{subsection.3.1}{Cell Lists}{section.3}% 8
\BOOKMARK [2][-]{subsection.3.2}{Iterative Algorithm}{section.3}% 9
\BOOKMARK [1][-]{appendix.A}{PETSc Installation}{}% 10
No preview for this file type
No preview for this file type
......@@ -11,6 +11,13 @@
\usepackage{tikz} % figures
\usepackage{hyperref} % web-links
\usepackage{listings} % line break in verb environment
\usepackage{amsmath} % math commands
% packages for algorithms
\usepackage{algorithm}
\usepackage{algpseudocode}
% argmin
\DeclareMathOperator*{\argmin}{arg\min}
% references
\addbibresource{bib/RandomGenerationFlowNetworks.bib}
......@@ -66,21 +73,76 @@
\caption{Pressures $p_{\mathrm{in}}$ and $p_{\mathrm{out}}$ are applied to in-pores and out-pores respectively, driving the network flow. The resulting pressure system is solved with the available solvers and the different fluxes are shown for the individual pores in the case of PETSc (using 4 processes). Since the sequential solvers produce an identical plot, they are omitted here. }
\label{fig:balance}
\end{figure}
\begin{multicols}{2}
\section{Parallel Network Generation Algorithm}
\hspace{0.5cm} The existing serial dendrogram-based network generation algorithm, as presented in \cite{MEYER2021101592}, is now modified. Concretely, to allow connecting all pores that populate the larger, generated network domain in parallel, we rely on a shared memory approach via the \verb|multiprocessing| Python module. To accomplish this, we first shifted our attention to \emph{cell lists}, which offer a direct application of the already existing \textbf{maximal throat length} parameter $L_{\mathrm{m}}$ as a suitable \textbf{cell size}.
\subsection{Cell-Lists}
\hspace{0.5cm} To speed up neighbor search for the \emph{stationary} pores, we have opted to use the well-known cell lists data structure instead of the triangulation based approach outlined in \cite{MEYER2021103936}. This choice was supported by the suitable properties of cell lists for our purpose of generating a network of similar pore-arrangement. It is also favorable over the triangulation method as the cell lists are only initialized once, and pores that have already been processed by the algorithm can be removed efficiently. Primarily however, it allows a straight-forward application of parallel computing, by distributing the work needed to find the neighbors of individual pores evenly.
\section{Parallel Network Generation}
\hspace{0.5cm}The existing serial dendrogram-based network generation algorithm, as presented in \cite{MEYER2021101592}, is now modified. Concretely, to allow connecting all pores that populate the larger, generated network domain in parallel, we rely on a shared memory approach via the \verb|multiprocessing| Python module. To accomplish this, we first shift our attention to \emph{cell lists}, which offer a direct application of the already existing \textbf{maximal throat length} parameter $L_m$ as a suitable \textbf{cell size}.
\subsection{Cell Lists}
\hspace{0.5cm}To speed up neighbor search for the \emph{stationary} pores, we have opted to use the well-known cell lists data structure instead of the triangulation based approach outlined in \cite{MEYER2021103936}. This choice is supported by the useful properties of cell lists for our purpose of generating a network of similar pore-arrangement. It is also favorable over the triangulation method as the cell lists are only initialized once, and pores that have already been processed by the algorithm can be removed efficiently. Primarily however, it allows a straight-forward application of parallel computing, by distributing the work needed to find the neighbors of individual pores evenly. See figures TODO for further details.
\newpage
\subsection{Iterative Algorithm}
\hspace{0.5cm}To connect the generated pores by throats, we employ an \textbf{iterative} strategy. Beforehand however, the cell list is constructed based on the extent of the full domain (including periodic buffer layer) and cell-size $L_m$. Next, all pores are placed in their respective cell computed from their position. Now, for each pore and for each of its throats, which are copied from the base network and are sought to be realized, we find an \emph{ideal} match from its \textbf{neighboring cells}. Here, ideal refers to minimal absolute difference between physical distance of the pores and original length of the current throat $L_t$. Given position of $i$-th pore $\mathbf{p}_i$ and original throat length $L_t$ we seek:
\begin{equation}
j^* = \argmin_{j \in \mathcal{N}(i)}\Bigr| ||\mathbf{p}_i - \mathbf{p}_j||_2 - L_t \Bigr|
\end{equation}
Where $\mathcal{N}(i)$ is the set of all pores in adjacent cells to pore $i$. Finding $j^*$ for different pores is \emph{embarrassingly parallel} and can therefore be computed by a large number of threads, storing their results in shared memory. Each thread works on an even chunk of the pores located \emph{inside} the domain. Subsequently, these ideal matches are connected, while avoiding \textbf{conflicts} between different pores seeking the same neighbor. Finally we repeat the two steps from above, now only considering pores that still have throats left in \emph{random} order (for improved \textbf{load balancing}), until only a specified \textbf{fraction of total feasible throats} are left e.g. $1\%$. Empirically, this process converges very fast and consistently, for different target sizes of the full domain, after merely 3-4 iterations. The first iteration alone achieves $\approx 70\%$ of all possible throats, see Table ~\ref{table:iter}. The procedure is summarized as pseudo-code in Algorithm ~\ref{alg:connect}.
\end{multicols}
\begin{table}[h]
\centering
\caption{Sample run of parallel pore-connecting algorithm using 4 threads. The generated network is 3 times as large as the base network in all directions. The maximal feasible number of throats is 103464, of which 961 were not realized due to falling below the threshold of 1\%.}
\begin{tabular}{|c|c|c|}
\hline
\textbf{Iteration} & \textbf{Throats left} & \textbf{Rel. percentage} \\
\hline
0 & 103464 & 100.0\% \\
1 & 18444 & 17.8\% \\
2 & 4094 & 4.0\% \\
3 & 961 & 0.9\% \\
\hline
\end{tabular}
\label{table:iter}
\end{table}
\begin{algorithm}[h]
\caption{Connect pores in parallel}
\begin{algorithmic}
\State Initialize $cellList$ using $pores$ and compute $totalThroats$
\State $poresRemain \gets pores$
\State $throatsLeft \gets totalThroats$
\State $iterCount \gets 0$
\State $throatThreshold \gets \lfloor 0.01 * totalThroats\rfloor$ \Comment{at most 1\% of $totalThroats$}
\While{$iterCount < maxIters$ \textbf{and} $throatsLeft > throatThreshold$}
\State Spawn $nthreads$ threads
\State Compute best matches for all pores in $poresRemain$ using threads
\State Store result in shared memory location $poreMatchTable$
\For{$pore$ \textbf{in} $poresRemain$}
\For{$throat$ \textbf{in} $pore.throats$}
\State Fetch $match$ pore from $poreMatchTable$
\If{$throat$ is not already realized \textbf{and} $match$ is valid}
\State Realize $throat$
\EndIf
\EndFor
\EndFor
\State Compute list of pores with throats left in random order: $nextPores$
\State $poresRemain \gets nextPores$
\State Count throats that are still left: $nextThroats$
\State $throatsLeft \gets nextThroats$
\State $iterCount \gets iterCount + 1$
\EndWhile
\end{algorithmic}
\label{alg:connect}
\end{algorithm}
\newpage
\appendix
\begin{center} \Large{\textbf{Appendix}} \end{center}
\section{PETSc Installation}
\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/|.
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 Run \textbf{configuration} script:\\
......
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