<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Scrapbook (Posts about coding)</title><link>https://scrapbook.netlify.app/</link><description></description><atom:link href="https://scrapbook.netlify.app/categories/coding.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2026 &lt;a href="mailto:non@existent.com"&gt;author&lt;/a&gt; </copyright><lastBuildDate>Fri, 16 Oct 2026 16:23:46 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>Compilation &amp; Tuning</title><link>https://scrapbook.netlify.app/posts/compilation-tuning.html</link><dc:creator>author</dc:creator><description>&lt;nav id="TOC" role="doc-toc"&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://scrapbook.netlify.app/posts/compilation-tuning.html#hpc_machine_microarchitecture" id="toc-hpc_machine_microarchitecture"&gt;HPC machine
microarchitecture&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://scrapbook.netlify.app/posts/compilation-tuning.html#compiler_flags" id="toc-compiler_flags"&gt;Compiler flags&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://scrapbook.netlify.app/posts/compilation-tuning.html#generate_auto_dispatch_code_paths_with_intel_compilers" id="toc-generate_auto_dispatch_code_paths_with_intel_compilers"&gt;Generate
auto-dispatch code paths with Intel compilers&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://scrapbook.netlify.app/posts/compilation-tuning.html#intel_compilers_for_amd" id="toc-intel_compilers_for_amd"&gt;Intel compilers for AMD&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://scrapbook.netlify.app/posts/compilation-tuning.html#building_notes" id="toc-building_notes"&gt;Building notes&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://scrapbook.netlify.app/posts/compilation-tuning.html#lammps" id="toc-lammps"&gt;LAMMPS&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://scrapbook.netlify.app/posts/compilation-tuning.html#gromacs" id="toc-gromacs"&gt;GROMACS&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/nav&gt;
&lt;h2 id="hpc_machine_microarchitecture"&gt;HPC machine
microarchitecture&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;ACCESS NCSA
&lt;ul&gt;
&lt;li&gt;Delta (AVX2): 2.45GHz 128 core, 2GB/core: 2 x AMD EPYC 7763 "Milan"
(Zen 3, 32MB L3), 256GB&lt;/li&gt;
&lt;li&gt;Delta-GPU (AVX2; cc86): 4 x NVIDIA A40 (48Gb), 2.45GHz 64 core,
4GB/core: AMD EPYC 7763 "Milan", 256GB&lt;/li&gt;
&lt;li&gt;Delta-GPU (AVX2; cc80): 4 x NVIDIA A100 (40Gb), 2.45GHz 64 core,
4GB/core: AMD EPYC 7763 "Milan", 256GB&lt;/li&gt;
&lt;li&gt;Delta-GPU (AVX2; cc80): 8 x NVIDIA A100 (40Gb), 2.45GHz 128 core,
16GB/core: 2 x AMD EPYC 7763 "Milan", 2048GB&lt;/li&gt;
&lt;li&gt;Delta-GPU (AVX2; CDNA): 8 x AMD MI100 (32Gb), 2.45GHz 128 core,
16GB/core: 2 x AMD EPYC 7763 "Milan", 2048GB&lt;/li&gt;
&lt;/ul&gt;&lt;/li&gt;
&lt;li&gt;ACCESS JHU
&lt;ul&gt;
&lt;li&gt;Rockfish (AVX512): 3.0GHz 48 core, 4GB/core: 2 x Intel Xeon 6248R
(Cascade Lake), 192GB DDR4&lt;/li&gt;
&lt;li&gt;Rockfish-GPU (AVX512): 4 x NVIDIA A110 (40Gb), 3.0GHz 48 core,
4GB/core: 2 x Intel Xeon 6248R (Cascade Lake), 192GB DDR4&lt;/li&gt;
&lt;/ul&gt;&lt;/li&gt;
&lt;li&gt;ACCESS Purdue
&lt;ul&gt;
&lt;li&gt;Anvil (AVX2): 2.45-3.5GHz 128 core, 2GB/core: 2 x AMD EPYC 7763 (Zen
3), 256GB DDR4, 56 Gb/s Interconnect&lt;/li&gt;
&lt;li&gt;Anvil-GPU (AVX2; cc80): 4 x NVIDIA A100, 2.45-3.5GHz 128 core,
4GB/core: 2 x AMD EPYC 7763 (Zen 3), 512GB DDR4, 56 Gb/s
Interconnect&lt;/li&gt;
&lt;/ul&gt;&lt;/li&gt;
&lt;li&gt;ACCESS PSC
&lt;ul&gt;
&lt;li&gt;Bridges2 (AVX2): 2.25-3.40GHz 128 core, 2GB/core: 2 x AMD EPYC 7742
(Zen 2, 256MB L3), 256GB DDR4, Mellanox ConnectX-6-HDR Infiniband
200Gb/s Adapter&lt;/li&gt;
&lt;li&gt;Bridges2-GPU (AVX512; cc70): 8 x NVIDIA Tesla V100 32GB SXM2,
2.5-3.9GHz 40 core, 12.8GB/core: 2 x Intel Xeon Gold 6248 (Cascade
Lake), 512GB DDR4, Mellanox ConnectX-6-HDR Infiniband 200Gb/s
Adapter&lt;/li&gt;
&lt;li&gt;Bridges2-AI-1 (AVX512; cc70): 8 x NVIDIA V100 16GB, 2.4-3.7GHz 40
core, 4.8GB/core: 2 x Intel Xeon Gold 6148 (Skylake), 192GB DDR4,
Mellanox ConnectX-6-HDR Infiniband 200Gb/s Adapter&lt;/li&gt;
&lt;li&gt;Bridges2-AI-2 (AVX512; cc70): 16 x NVIDIA Volta V100 32GB,
2.7-3.7GHz 48 core, 32GB/core: 2 x Intel Xeon Platinum 8168 (Skylake),
1.5TB DDR4, Mellanox ConnectX-6-HDR Infiniband 200Gb/s Adapter&lt;/li&gt;
&lt;li&gt;Bridges (AVX2): 2.3/3.3GHz 28 core, 4.57GB/core: 2 x Intel Xeon
E5-2695v3 (Haswell, 35MB LLC), 128GB DDR4&lt;/li&gt;
&lt;/ul&gt;&lt;/li&gt;
&lt;li&gt;ACCESS SDSC
&lt;ul&gt;
&lt;li&gt;Expanse (AVX2): 2.25-3.40GHz 128 core, 2GB/core: 2 x AMD EPYC 7742
(Zen 2, 256MB L3), 256GB DDR4, 56 Gb/s Interconnect&lt;/li&gt;
&lt;li&gt;Expanse-GPU (AVX512; cc70): 4 x NVIDIA V100 SMX2, 2.5-3.9GHz 40
core, 9.6GB/core: 2 x Intel Xeon Gold 6248 (Cascade Lake), 384GB
DDR4&lt;/li&gt;
&lt;li&gt;Comet (AVX2): 2.5GHz 24 core, 5.33GB/core: 2 x Intel Xeon E5-2680v3
(Haswell), 128GB DDR4, 56Gbps FDR InfiniBand with rack-level full
bisection bandwidth and 4:1 oversubscription cross-rack bandwidth&lt;/li&gt;
&lt;/ul&gt;&lt;/li&gt;
&lt;li&gt;ACCESS UDel
&lt;ul&gt;
&lt;li&gt;Darwin (AVX2): 2.5-3.35GHz 64 core, 8GB/core: 2 x AMD EPYC 7502 (Zen
2, 128MB L3), 512GB, Mellanox HDR100&lt;/li&gt;
&lt;li&gt;Darwin-GPU: NVIDIA T4 (cc75) / NVIDIA V100 (cc70) / AMD MI50&lt;/li&gt;
&lt;/ul&gt;&lt;/li&gt;
&lt;li&gt;ACCESS UTexas
&lt;ul&gt;
&lt;li&gt;Stampede3
&lt;ul&gt;
&lt;li&gt;SPR (AVX512): 1.90-3.50GHz 112 core 1.14GB/core: 2 x Intel Xeon CPU
MAX 9480 ("Sapphire Rapids HBM, 48KB L1 + 1MB L2 + 112.5MB L3 per
socket), 128 GB HBM 2e, 100Gb/sec Intel Omni-Path (OPA) network
(interconnected with PVC nodes)&lt;/li&gt;
&lt;li&gt;PVC (AVX512; Xe-HPC): CPU: 2.10-3.70GHz 112 core 4.57GB/core: 2 x
Xeon CPU MAX 8480 (Sapphire Rapids, 48KB L1 + 1MB L2 + 112.5MB L3 per
socket), 512 HB DDR5. GPU: 900-1600 MHz 512 core 1GB/core: 4 x Intel
Data Center GPU Max 1550s, 100Gb/sec Intel Omni-Path (OPA) network
(interconnected with SPR nodes)&lt;/li&gt;
&lt;li&gt;ICX (AVX512): 2.3GHz 80 core 3.2GB/core: 2 x Intel Xeon Platinum
8380 (IceLake, 48KB L1 + 1.25MB L2 + 60MB L3 per socket), 256GB DDR4
3.2GHz, 100Gb/sec Intel Omni-Path (OPA) network&lt;/li&gt;
&lt;li&gt;SKX (AVX512): 2.1GHz 48 core 4GB/core: 2 x Intel Xeon Platinum 8160
(Skylake, 32KB L1 + 1MB L2 + 33MB L3 per socket), 192GB DDR4 2.67GHz,
100Gb/sec Intel Omni-Path (OPA) network&lt;/li&gt;
&lt;/ul&gt;&lt;/li&gt;
&lt;li&gt;Stampede2 (multi-architecture:
&lt;code&gt;-xCOMMON-AVX512 -axCORE-AVX512,MIC-AVX512&lt;/code&gt;)
&lt;ul&gt;
&lt;li&gt;KNL (MIC-AVX512): 1.4GHz 68 core 1.4GB/core: Intel Xeon Phi 7250
(Knights Landing, 32KB L1 + 1MB L2 per two core + 16GB MCDRAM), 96GB
DDR4 2400MHz&lt;/li&gt;
&lt;/ul&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;/li&gt;
&lt;li&gt;NERSC
&lt;ul&gt;
&lt;li&gt;Perlmutter (AVX2): 2.45-3.5GHz 128 core, 4GB/core: 2 x AMD EPYC 7763
(Zen 3), 512GB DDR4, Slingshot 11 Interconnect&lt;/li&gt;
&lt;li&gt;Perlmutter-GPU (AVX2; cc80): 4 x NVIDIA A100, 2.45-3.5GHz 64 core,
4GB/core: AMD EPYC 7763 (Zen 3), 256GB DDR4, Slingshot 11
Interconnect&lt;/li&gt;
&lt;li&gt;Cori KNL (MIC-AVX512): 2.3GHz 32 core 4GB/core: 2 x Intel Xeon
E5-2698v3 (Haswell, 32KB L1 + 256 KB L2 + 40MB L3 per socket), 128 GB
DDR4 2133 MHz, Cray Aries with Dragonfly topology&lt;/li&gt;
&lt;li&gt;Cori (AVX2): 1.4GHz 68 core 1.4GB/core: Intel Xeon Phi 7250 (Knights
Landing, 32KB L1 + 1MB L2 per two core + 16GB MCDRAM), 96 GB DDR4 2400
MHz&lt;/li&gt;
&lt;li&gt;Edison (AVX): 2.4GHz 24 core, 2.67GB/core: 2 x Intel E5-2695v2 (Ivy
Bridge), 64GB DDR3 1866MHz, Cray Aries dragonfly topology&lt;/li&gt;
&lt;/ul&gt;&lt;/li&gt;
&lt;li&gt;ANL
&lt;ul&gt;
&lt;li&gt;Mira: IBM Blue Gene/Q&lt;/li&gt;
&lt;/ul&gt;&lt;/li&gt;
&lt;li&gt;UMass
&lt;ul&gt;
&lt;li&gt;Unity (multi-architecture: &lt;code&gt;-xCORE-AVX2 -axCORE-AVX512&lt;/code&gt;)
&lt;ul&gt;
&lt;li&gt;Intel Skylake&lt;/li&gt;
&lt;li&gt;AMD Zen 2&lt;/li&gt;
&lt;li&gt;GPU: GTX Titan X (cc52), GTX 1080ti (cc61), RTX 2080 (cc75), RTX
2080ti (cc75), Quadro RTX 8000 (cc75), Tesla M40 (cc52), Tesla V100
(cc70), Tesla A100 (cc80)&lt;/li&gt;
&lt;/ul&gt;&lt;/li&gt;
&lt;li&gt;GHPCC
&lt;ul&gt;
&lt;li&gt;Intel Skylake -&amp;gt; AVX512&lt;/li&gt;
&lt;li&gt;Haswell -&amp;gt; use Mesabi builds&lt;/li&gt;
&lt;li&gt;Sandy Bridge -&amp;gt; Itasca_sb builds&lt;/li&gt;
&lt;li&gt;AMD Piledriver, Bulldozer -&amp;gt; Itasca Nehalem builds&lt;/li&gt;
&lt;/ul&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;/li&gt;
&lt;li&gt;Others
&lt;ul&gt;
&lt;li&gt;Enterprise (AVX2): 2.2GHz 24 core, 2.67GB/core: 2 x Intel Xeon
E5-2650v4 (Broadwell), 64GB DDR4&lt;/li&gt;
&lt;li&gt;Mesabi (AVX2): 2.5GHz 24 core, 2.67GB/core: 2 x Intel Xeon E5-2680v3
(Haswell), 64GB DDR4&lt;/li&gt;
&lt;li&gt;Metropolis (AVX)
&lt;ul&gt;
&lt;li&gt;2.4GHz 8 core, 2GB/core: 2 x Intel Xeon E5-2609 (Sandy Bridge),
16GB&lt;/li&gt;
&lt;li&gt;2.5GHz 8 core, 2GB/core: 2 x Intel Xeon E5-2609v2 (Ivy Bridge),
16GB&lt;/li&gt;
&lt;li&gt;2.1GHz 8 core, 2GB/core: 2 x Intel Xeon E5-2620v2 (Ivy Bridge),
16GB&lt;/li&gt;
&lt;li&gt;2.1GHz 16 core: 2 x Intel Xeon E5-2620v4 (Broadwell)&lt;/li&gt;
&lt;/ul&gt;&lt;/li&gt;
&lt;li&gt;Itasca
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;_sb&lt;/code&gt; suffix (AVX): Intel Sandy Bridge&lt;/li&gt;
&lt;li&gt;Regular (SSE4.1): Intel Nehalem&lt;/li&gt;
&lt;/ul&gt;&lt;/li&gt;
&lt;li&gt;4170HE: AMD K10&lt;/li&gt;
&lt;/ul&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="compiler_flags"&gt;Compiler flags&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;CP2K, 7.1 H20-256&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;AOCC+AOCL:
&lt;code&gt;-O3 -march=znver3 -ffast-math -fopenmp -ffree-form -Hx,47,0x10000008 -Mbackslash&lt;/code&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;VASP, 6.1.2 GaAsBi-64 (VASP guide refers to &lt;code&gt;-02&lt;/code&gt; and not
&lt;code&gt;-O3&lt;/code&gt; as default optimisation level)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Intel:
&lt;code&gt;-O2 -assume byterecl -w -march=core-avx2 -fma -mavx2 -mfma -free -names lowercase -mkl=sequential -qopenmp -lmkl_blacs_openmpi_lp64 -lmkl_scalapack_lp64&lt;/code&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Quantum Espresso, 6.5 AUSURF112&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;GCC+AOCL: &lt;code&gt;-O3 -march=znver2 -ffast-math -fopenmp&lt;/code&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;NAMD, 2.14&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;AOCC+AOCL:
&lt;code&gt;-optimize -production -DCMK_OPTIMIZE -O3 -Ofast -g -m64 -march=znver3 -fPIC -ffp-contract=fast -fopenmp -Wno-deprecated-register -Wno-non-c-typedef-for-linkage -mllvm -inline-threshold=3000 -finline-hint-functions -mllvm -inlinehint-threshold=10000 -finline-functions&lt;/code&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;WRF, 3.9.1.1, CONUS 2.5KM&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;AOCC:
&lt;code&gt;-march=znver3 -ffp-contract=fast -mavx2 -mfma -mprefer-vector-width=256 -Ofast -ffast-math -fopenmp -m64 -w -finline-aggressive -fPIC&lt;/code&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;OpenFOAM, 2012, Motorbike 42m cells&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;GCC:
&lt;code&gt;-O3 -march=znver2 -mfma -ffp-contract=fast -funroll-loops -fno-signed-zeros -fno-trapping-math -fno-math-errno -ffinite-math-only -fno-rounding-math -fno-signaling-nans -fcx-limited-range -fexcess-precision=fast&lt;/code&gt;&lt;/p&gt;
&lt;h3 id="generate_auto_dispatch_code_paths_with_intel_compilers"&gt;Generate
auto-dispatch code paths with Intel compilers&lt;/h3&gt;
&lt;p&gt;Some HPC systems (e.g., NERSC Cori, XSEDE Stampede2) have different
kinds of compute nodes with different instruction sets: Broadwell
(&lt;code&gt;-xCORE-AVX2&lt;/code&gt;), Skylake/Icelake (&lt;code&gt;-xCORE-AVX512&lt;/code&gt;,
and KNL (&lt;code&gt;-xMIC-AVX512&lt;/code&gt;).&lt;/p&gt;
&lt;p&gt;A simpler approach can be used when building with the Intel compiler:
use CPU auto dispatch to build a multi-architecture ("fat") binary that
contains alternate code paths with optimized vector code for each type
of compute nodes. To produce a multi-architecture binary for Haswell,
Skylake/Icelake, and KNL nodes, build with the following options
&lt;code&gt;-xCORE-AVX2 -axCORE-AVX512,MIC-AVX512&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;These particular choices allow you to build on any node and use CPU
dispatch to produce a multi-architecture binary. We recommend that you
specify these flags in both the compile and link steps. Specify an
optimization level (e.g. &lt;code&gt;-O3&lt;/code&gt;) along with any other
appropriate compiler switches:
&lt;code&gt;icc -xCORE-AVX2 -axCORE-AVX512,MIC-AVX512 -O3 mycode.c -o myexe&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;The &lt;code&gt;-x&lt;/code&gt; option is the target base architecture
(instruction set). The base instruction set must run on all targeted
processors. Here we specify &lt;code&gt;CORE-AVX2&lt;/code&gt;, which is native for
older Broadwell processors and supported on all KNL and Skylake/Icelake
nodes. This option allows configure scripts and similar build systems to
run test executables on any login or compute node. The &lt;code&gt;-ax&lt;/code&gt;
option is a comma-separated list of alternate instruction sets:
&lt;code&gt;CORE-AVX512&lt;/code&gt; for Skylake and Icelake, and
&lt;code&gt;MIC-AVX512&lt;/code&gt; for KNL.&lt;/p&gt;
&lt;p&gt;If compatibility with Broadwell nodes is not needed, more aggressive
base option is &lt;code&gt;-xCOMMON-AVX512&lt;/code&gt;, which is a subset of AVX512
that runs on all KNL, Skylate, and Icelake nodes.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;On heterogeneous HPC clusters, it's best to avoid building
with &lt;code&gt;-xHost&lt;/code&gt;&lt;/strong&gt; (a flag that means "optimize for the
architecture on which I'm compiling now"). Using &lt;code&gt;-xHost&lt;/code&gt; on
a Skylake node, for example, will result in a binary that won't run on
KNL.&lt;/p&gt;
&lt;p&gt;Don't skip the &lt;code&gt;-x&lt;/code&gt; flag in a multi-architecture build:
the default is the very old SSE2 (Pentium 4) instruction set. Don't
create a multi-architecture build with a base option of either
&lt;code&gt;-xMIC-AVX512&lt;/code&gt; (native on KNL) or &lt;code&gt;-xCORE-AVX512&lt;/code&gt;
(native on Skylake/Icelake); there are no meaningful, compatible
alternate (&lt;code&gt;-ax&lt;/code&gt;) instruction sets:&lt;/p&gt;
&lt;div class="sourceCode" id="cb1"&gt;&lt;pre class="sourceCode bash"&gt;&lt;code class="sourceCode bash"&gt;&lt;span id="cb1-1"&gt;&lt;a href="https://scrapbook.netlify.app/posts/compilation-tuning.html#cb1-1" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="ex"&gt;$&lt;/span&gt; icc &lt;span class="at"&gt;-xCORE-AVX512&lt;/span&gt; &lt;span class="at"&gt;-axMIC-AVX512&lt;/span&gt; &lt;span class="at"&gt;-O3&lt;/span&gt; mycode.c &lt;span class="at"&gt;-o&lt;/span&gt; myexe  &lt;span class="co"&gt;# WRONG! Base incompatible with alternate&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Simplicity is a major advantage of this multi-architecture approach:
it allows you to build and run on any nodes, and performance is
generally comparable to single-architecture builds. There are some
trade-offs to consider, however. This approach will take a little longer
to compile than single-architecture builds, and will produce a larger
binary. In some cases, you might also pay a small performance penalty
over single-architecture approaches. For more information see the &lt;a href="https://software.intel.com/en-us/articles/performance-tools-for-software-developers-intel-compiler-options-for-sse-generation-and-processor-specific-optimizations"&gt;Intel
documentation&lt;/a&gt;.&lt;/p&gt;
&lt;h4 id="auto_dispatch_for_both_intel_and_amd_cpus"&gt;Auto-dispatch for
both Intel and AMD CPUs&lt;/h4&gt;
&lt;p&gt;For HPC systems (e.g., Unity) with both AMD and Intel compute nodes,
we may build auto-dispatch executables with
&lt;code&gt;-march=core-avx2 -mtune=core-avx2 -axCORE-AVX512&lt;/code&gt;. See &lt;a href="https://scrapbook.netlify.app/posts/compilation-tuning.html#Intel_compilers_for_AMD" title="wikilink"&gt;the notes below&lt;/a&gt; for
more details.&lt;/p&gt;
&lt;h3 id="intel_compilers_for_amd"&gt;Intel compilers for AMD&lt;/h3&gt;
&lt;p&gt;The Intel compiler is developed and targeted for the Intel hardware
and hence it has some minor issues when using it with AMD hardware.
Execution of code compiled with the Intel compiler might lead to crash
when executed on the AMD EPYC CPUs. The recommended flag to use the AVX2
instructions supported by the AMD EPYC CPUs is
&lt;code&gt;-march=core-avx2 -mtune=core-avx2&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;In some cases, when compiling with the &lt;code&gt;-xavx&lt;/code&gt;,
&lt;code&gt;-xavx2&lt;/code&gt; or &lt;code&gt;-xcore-avx2&lt;/code&gt; flags your application
will abort with a message that the processor is not compatible:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Please verify that both the operating system and the proce_ssor support Intel(R) X87, CMOV, MMX, FXSAVE, SSE, SSE2, SSE3, SSSE3, SSE4_1, SSE4_2, MOVBE, POPCNT, AVX, F16C, FMA, BMI, LZCNT and AVX2 instructions.&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;To solve this problem, avoid using the above-mentioned flags for the
compilation of the &lt;code&gt;main()&lt;/code&gt; function. Avoiding the use of
Interprocedural Optimization (remove the &lt;code&gt;-ipo&lt;/code&gt; flag) may
also be tried.&lt;/p&gt;
&lt;h2 id="building_notes"&gt;Building notes&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;NOTE:&lt;/strong&gt; These are abbreviated notes that have worked
in the past. Always read the current documentation, and only use these
notes as hints and examples for putting together a working build.&lt;/p&gt;
&lt;h3 id="lammps"&gt;LAMMPS&lt;/h3&gt;
&lt;p&gt;&lt;a href="https://docs.lammps.org/Build.html"&gt;Official
Documentation&lt;/a&gt;&lt;/p&gt;
&lt;h4 id="cmake_procedure"&gt;CMake procedure&lt;/h4&gt;
&lt;div class="sourceCode" id="cb3"&gt;&lt;pre class="sourceCode bash"&gt;&lt;code class="sourceCode bash"&gt;&lt;span id="cb3-1"&gt;&lt;a href="https://scrapbook.netlify.app/posts/compilation-tuning.html#cb3-1" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="ex"&gt;module&lt;/span&gt; add intel/2015/update3&lt;span class="kw"&gt;;&lt;/span&gt; &lt;span class="ex"&gt;module&lt;/span&gt; add impi/5.0.2.044/intel&lt;/span&gt;
&lt;span id="cb3-2"&gt;&lt;a href="https://scrapbook.netlify.app/posts/compilation-tuning.html#cb3-2" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="fu"&gt;mkdir&lt;/span&gt; ~/tools/lammps-git/build&lt;/span&gt;
&lt;span id="cb3-3"&gt;&lt;a href="https://scrapbook.netlify.app/posts/compilation-tuning.html#cb3-3" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="bu"&gt;cd&lt;/span&gt; ~/tools/lammps-git/build&lt;/span&gt;
&lt;span id="cb3-4"&gt;&lt;a href="https://scrapbook.netlify.app/posts/compilation-tuning.html#cb3-4" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="fu"&gt;cmake&lt;/span&gt; &lt;span class="at"&gt;-DCMAKE_CXX_COMPILER&lt;/span&gt;&lt;span class="op"&gt;=&lt;/span&gt;mpiicpc &lt;span class="at"&gt;-DCMAKE_C_COMPILER&lt;/span&gt;&lt;span class="op"&gt;=&lt;/span&gt;mpiicc &lt;span class="at"&gt;-DCMAKE_Fortran_COMPILER&lt;/span&gt;&lt;span class="op"&gt;=&lt;/span&gt;mpiifort &lt;span class="at"&gt;-DCMAKE_TUNE_FLAGS&lt;/span&gt;&lt;span class="op"&gt;=&lt;/span&gt;&lt;span class="st"&gt;'-O3 -xHost -ipo -fp-model fast=2 -no-prec-div -qoverride-limits -diag-disable=10441 -diag-disable=2196'&lt;/span&gt; &lt;span class="at"&gt;-DBUILD_MPI&lt;/span&gt;&lt;span class="op"&gt;=&lt;/span&gt;yes &lt;span class="at"&gt;-DBUILD_OMP&lt;/span&gt;&lt;span class="op"&gt;=&lt;/span&gt;yes &lt;span class="at"&gt;-DFFT&lt;/span&gt;&lt;span class="op"&gt;=&lt;/span&gt;MKL &lt;span class="at"&gt;-DLAMMPS_MEMALIGN&lt;/span&gt;&lt;span class="op"&gt;=&lt;/span&gt;64 &lt;span class="at"&gt;-DBUILD_SHARED_LIBS&lt;/span&gt;&lt;span class="op"&gt;=&lt;/span&gt;on &lt;span class="at"&gt;-DLAMMPS_EXCEPTIONS&lt;/span&gt;&lt;span class="op"&gt;=&lt;/span&gt;yes &lt;span class="at"&gt;-DPKG_COLVARS&lt;/span&gt;&lt;span class="op"&gt;=&lt;/span&gt;on &lt;span class="at"&gt;-DPKG_INTEL&lt;/span&gt;&lt;span class="op"&gt;=&lt;/span&gt;on &lt;span class="at"&gt;-DPKG_LEPTON&lt;/span&gt;&lt;span class="op"&gt;=&lt;/span&gt;on &lt;span class="at"&gt;-DPKG_KOKKOS&lt;/span&gt;&lt;span class="op"&gt;=&lt;/span&gt;on &lt;span class="at"&gt;-DPKG_KSPACE&lt;/span&gt;&lt;span class="op"&gt;=&lt;/span&gt;yes &lt;span class="at"&gt;-DPKG_MOLECULE&lt;/span&gt;&lt;span class="op"&gt;=&lt;/span&gt;yes &lt;span class="at"&gt;-DPKG_EXTRA-MOLECULE&lt;/span&gt;&lt;span class="op"&gt;=&lt;/span&gt;on &lt;span class="at"&gt;-DPKG_OPENMP&lt;/span&gt;&lt;span class="op"&gt;=&lt;/span&gt;on &lt;span class="at"&gt;-DPKG_OPT&lt;/span&gt;&lt;span class="op"&gt;=&lt;/span&gt;on &lt;span class="at"&gt;-DPKG_PYTHON&lt;/span&gt;&lt;span class="op"&gt;=&lt;/span&gt;on &lt;span class="at"&gt;-DPKG_REAXFF&lt;/span&gt;&lt;span class="op"&gt;=&lt;/span&gt;on &lt;span class="at"&gt;-DPKG_REPLICA&lt;/span&gt;&lt;span class="op"&gt;=&lt;/span&gt;on &lt;span class="at"&gt;-DPKG_RIGID&lt;/span&gt;&lt;span class="op"&gt;=&lt;/span&gt;on &lt;span class="at"&gt;-DCMAKE_INSTALL_PREFIX&lt;/span&gt;&lt;span class="op"&gt;=&lt;/span&gt;&lt;span class="va"&gt;$HOME&lt;/span&gt;/tools/lammps/intel-impi-mkl ../cmake&lt;/span&gt;
&lt;span id="cb3-5"&gt;&lt;a href="https://scrapbook.netlify.app/posts/compilation-tuning.html#cb3-5" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="fu"&gt;make&lt;/span&gt; &lt;span class="at"&gt;-j&lt;/span&gt; 2&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Example cmake line for GCC+&lt;/p&gt;
&lt;div class="sourceCode" id="cb4"&gt;&lt;pre class="sourceCode bash"&gt;&lt;code class="sourceCode bash"&gt;&lt;span id="cb4-1"&gt;&lt;a href="https://scrapbook.netlify.app/posts/compilation-tuning.html#cb4-1" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="fu"&gt;cmake&lt;/span&gt; &lt;span class="at"&gt;-DCMAKE_CXX_COMPILER&lt;/span&gt;&lt;span class="op"&gt;=&lt;/span&gt;mpicxx &lt;span class="at"&gt;-DCMAKE_C_COMPILER&lt;/span&gt;&lt;span class="op"&gt;=&lt;/span&gt;mpicc &lt;span class="at"&gt;-DCMAKE_Fortran_COMPILER&lt;/span&gt;&lt;span class="op"&gt;=&lt;/span&gt;mpif90 &lt;span class="at"&gt;-DCMAKE_TUNE_FLAGS&lt;/span&gt;&lt;span class="op"&gt;=&lt;/span&gt;&lt;span class="st"&gt;'-O3 -mtune=native -march=native -ffast-math -fassociative-math -freciprocal-math -fno-signed-zeros -fno-trapping-math -funroll-loops'&lt;/span&gt; &lt;span class="at"&gt;-DBUILD_MPI&lt;/span&gt;&lt;span class="op"&gt;=&lt;/span&gt;yes &lt;span class="at"&gt;-DBUILD_OMP&lt;/span&gt;&lt;span class="op"&gt;=&lt;/span&gt;yes &lt;span class="at"&gt;-DFFT&lt;/span&gt;&lt;span class="op"&gt;=&lt;/span&gt;FFTW3 &lt;span class="at"&gt;-DLAMMPS_MEMALIGN&lt;/span&gt;&lt;span class="op"&gt;=&lt;/span&gt;64 &lt;span class="at"&gt;-DBUILD_SHARED_LIBS&lt;/span&gt;&lt;span class="op"&gt;=&lt;/span&gt;on &lt;span class="at"&gt;-DLAMMPS_EXCEPTIONS&lt;/span&gt;&lt;span class="op"&gt;=&lt;/span&gt;yes &lt;span class="at"&gt;-DPKG_COLVARS&lt;/span&gt;&lt;span class="op"&gt;=&lt;/span&gt;on &lt;span class="at"&gt;-DPKG_INTEL&lt;/span&gt;&lt;span class="op"&gt;=&lt;/span&gt;on &lt;span class="at"&gt;-DPKG_LEPTON&lt;/span&gt;&lt;span class="op"&gt;=&lt;/span&gt;on &lt;span class="at"&gt;-DPKG_KOKKOS&lt;/span&gt;&lt;span class="op"&gt;=&lt;/span&gt;on &lt;span class="at"&gt;-DPKG_KSPACE&lt;/span&gt;&lt;span class="op"&gt;=&lt;/span&gt;yes &lt;span class="at"&gt;-DPKG_MOLECULE&lt;/span&gt;&lt;span class="op"&gt;=&lt;/span&gt;yes &lt;span class="at"&gt;-DPKG_EXTRA-MOLECULE&lt;/span&gt;&lt;span class="op"&gt;=&lt;/span&gt;on &lt;span class="at"&gt;-DPKG_OPENMP&lt;/span&gt;&lt;span class="op"&gt;=&lt;/span&gt;on &lt;span class="at"&gt;-DPKG_OPT&lt;/span&gt;&lt;span class="op"&gt;=&lt;/span&gt;on &lt;span class="at"&gt;-DPKG_PYTHON&lt;/span&gt;&lt;span class="op"&gt;=&lt;/span&gt;on &lt;span class="at"&gt;-DPKG_REAXFF&lt;/span&gt;&lt;span class="op"&gt;=&lt;/span&gt;on &lt;span class="at"&gt;-DPKG_REPLICA&lt;/span&gt;&lt;span class="op"&gt;=&lt;/span&gt;on &lt;span class="at"&gt;-DPKG_RIGID&lt;/span&gt;&lt;span class="op"&gt;=&lt;/span&gt;on &lt;span class="at"&gt;-DCMAKE_INSTALL_PREFIX&lt;/span&gt;&lt;span class="op"&gt;=&lt;/span&gt;&lt;span class="va"&gt;$HOME&lt;/span&gt;/tools/lammps/gcc-mpich2-fftw3 ../cmake&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h4 id="reax_old_make_system"&gt;Reax (old Make system)&lt;/h4&gt;
&lt;div class="sourceCode" id="cb5"&gt;&lt;pre class="sourceCode bash"&gt;&lt;code class="sourceCode bash"&gt;&lt;span id="cb5-1"&gt;&lt;a href="https://scrapbook.netlify.app/posts/compilation-tuning.html#cb5-1" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="bu"&gt;cd&lt;/span&gt; ~/tools/lammps-git/lib/reax&lt;span class="kw"&gt;;&lt;/span&gt; &lt;span class="fu"&gt;make&lt;/span&gt; &lt;span class="at"&gt;-f&lt;/span&gt; Makefile.ifort &lt;span class="co"&gt;# build Fortran reax library&lt;/span&gt;&lt;/span&gt;
&lt;span id="cb5-2"&gt;&lt;a href="https://scrapbook.netlify.app/posts/compilation-tuning.html#cb5-2" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="bu"&gt;cd&lt;/span&gt; ../../src&lt;/span&gt;
&lt;span id="cb5-3"&gt;&lt;a href="https://scrapbook.netlify.app/posts/compilation-tuning.html#cb5-3" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="co"&gt;# Modify CCFLAGS, LINKFLAGS, FFT_INC, and FFT_LIB in MAKE/Makefile.ompi_icc to add optimizations and point to MKL libraries&lt;/span&gt;&lt;/span&gt;
&lt;span id="cb5-4"&gt;&lt;a href="https://scrapbook.netlify.app/posts/compilation-tuning.html#cb5-4" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="co"&gt;# To use FFTW3: set FFT_INC = -DFFT_FFTW3, FFT_LIB = -lfftw3, and do module load fftw/3.3-ompi-double&lt;/span&gt;&lt;/span&gt;
&lt;span id="cb5-5"&gt;&lt;a href="https://scrapbook.netlify.app/posts/compilation-tuning.html#cb5-5" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="fu"&gt;make&lt;/span&gt; yes-opt yes-reax yes-user-intel yes-user-omp yes-user-reaxc&lt;/span&gt;
&lt;span id="cb5-6"&gt;&lt;a href="https://scrapbook.netlify.app/posts/compilation-tuning.html#cb5-6" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="fu"&gt;make&lt;/span&gt; yes-kspace yes-manybody yes-molecule yes-opt yes-reax yes-replica yes-user-intel yes-user-omp yes-user-reaxc&lt;/span&gt;
&lt;span id="cb5-7"&gt;&lt;a href="https://scrapbook.netlify.app/posts/compilation-tuning.html#cb5-7" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="fu"&gt;make&lt;/span&gt; ompi_icc &lt;span class="at"&gt;-j&lt;/span&gt; 16&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h4 id="aoccaocl_29_oct_20_lj"&gt;AOCC+AOCL 29-OCT-20 lj&lt;/h4&gt;
&lt;p&gt;&lt;code&gt;-g -O3 -march=znver2 -ffast-math -ffp-contract=fast -DNDEBG -pthread -fopenmp -std=c++11&lt;/code&gt;&lt;/p&gt;
&lt;h3 id="gromacs"&gt;GROMACS&lt;/h3&gt;
&lt;p&gt;&lt;a href="https://manual.gromacs.org/documentation/current/install-guide/index.html"&gt;Official
documentation&lt;/a&gt;: Do not rely solely on the "Quick and dirty
installation". You most likely need to read through the entire &lt;a href="https://manual.gromacs.org/documentation/current/install-guide/index.html#prerequisites"&gt;Prerequisites&lt;/a&gt;
section to build an executable with decent performance.&lt;/p&gt;
&lt;h4 id="example_procedure"&gt;Example procedure&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;gcc-mvapich-fftw&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="sourceCode" id="cb6"&gt;&lt;pre class="sourceCode bash"&gt;&lt;code class="sourceCode bash"&gt;&lt;span id="cb6-1"&gt;&lt;a href="https://scrapbook.netlify.app/posts/compilation-tuning.html#cb6-1" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="fu"&gt;mkdir&lt;/span&gt; ~/tools/gromacs-5.0.4/build&lt;/span&gt;
&lt;span id="cb6-2"&gt;&lt;a href="https://scrapbook.netlify.app/posts/compilation-tuning.html#cb6-2" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="bu"&gt;cd&lt;/span&gt; ~/tools/gromacs-5.0.4/build&lt;/span&gt;
&lt;span id="cb6-3"&gt;&lt;a href="https://scrapbook.netlify.app/posts/compilation-tuning.html#cb6-3" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="ex"&gt;module&lt;/span&gt; add gcc mvapich&lt;/span&gt;
&lt;span id="cb6-4"&gt;&lt;a href="https://scrapbook.netlify.app/posts/compilation-tuning.html#cb6-4" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="fu"&gt;cmake&lt;/span&gt; &lt;span class="at"&gt;-DCMAKE_C_COMPILER&lt;/span&gt;&lt;span class="op"&gt;=&lt;/span&gt;mpigcc &lt;span class="at"&gt;-DCMAKE_CXX_COMPILER&lt;/span&gt;&lt;span class="op"&gt;=&lt;/span&gt;mpigxx &lt;span class="at"&gt;-DGMX_DOUBLE&lt;/span&gt;&lt;span class="op"&gt;=&lt;/span&gt;ON &lt;span class="at"&gt;-DGMX_MPI&lt;/span&gt;&lt;span class="op"&gt;=&lt;/span&gt;ON &lt;span class="at"&gt;-DGMX_FFT_LIBRARY&lt;/span&gt;&lt;span class="op"&gt;=&lt;/span&gt;fftw3 &lt;span class="at"&gt;-DGMX_BUILD_OWN_FFTW&lt;/span&gt;&lt;span class="op"&gt;=&lt;/span&gt;ON &lt;span class="at"&gt;-DCMAKE_INSTALL_PREFIX&lt;/span&gt;&lt;span class="op"&gt;=&lt;/span&gt;&lt;span class="va"&gt;$HOME&lt;/span&gt;/tools/gromacs-2016.1/gcc-double-mpi ..&lt;/span&gt;
&lt;span id="cb6-5"&gt;&lt;a href="https://scrapbook.netlify.app/posts/compilation-tuning.html#cb6-5" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="fu"&gt;make&lt;/span&gt; &lt;span class="at"&gt;-j&lt;/span&gt; 16 install&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;intel-impi-mkl&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="sourceCode" id="cb7"&gt;&lt;pre class="sourceCode bash"&gt;&lt;code class="sourceCode bash"&gt;&lt;span id="cb7-1"&gt;&lt;a href="https://scrapbook.netlify.app/posts/compilation-tuning.html#cb7-1" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="ex"&gt;module&lt;/span&gt; add intel/2013/update2 impi/4.1.1.036/intel mkl/11.1.1.106&lt;/span&gt;
&lt;span id="cb7-2"&gt;&lt;a href="https://scrapbook.netlify.app/posts/compilation-tuning.html#cb7-2" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="fu"&gt;cmake&lt;/span&gt; &lt;span class="at"&gt;-DCMAKE_C_COMPILER&lt;/span&gt;&lt;span class="op"&gt;=&lt;/span&gt;mpiicc &lt;span class="at"&gt;-DCMAKE_CXX_COMPILER&lt;/span&gt;&lt;span class="op"&gt;=&lt;/span&gt;mpiicpc &lt;span class="at"&gt;-DGMX_DOUBLE&lt;/span&gt;&lt;span class="op"&gt;=&lt;/span&gt;ON &lt;span class="at"&gt;-DGMX_MPI&lt;/span&gt;&lt;span class="op"&gt;=&lt;/span&gt;ON &lt;span class="at"&gt;-DGMX_FFT_LIBRARY&lt;/span&gt;&lt;span class="op"&gt;=&lt;/span&gt;mkl &lt;span class="at"&gt;-DCMAKE_INSTALL_PREFIX&lt;/span&gt;&lt;span class="op"&gt;=&lt;/span&gt;&lt;span class="va"&gt;$HOME&lt;/span&gt;/tools/gromacs-5.0.4/build ..&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;intel-ompi-fftw&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="sourceCode" id="cb8"&gt;&lt;pre class="sourceCode bash"&gt;&lt;code class="sourceCode bash"&gt;&lt;span id="cb8-1"&gt;&lt;a href="https://scrapbook.netlify.app/posts/compilation-tuning.html#cb8-1" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="ex"&gt;module&lt;/span&gt; add intel/2013/update2 ompi/1.6.3/intel-2013-update2&lt;/span&gt;
&lt;span id="cb8-2"&gt;&lt;a href="https://scrapbook.netlify.app/posts/compilation-tuning.html#cb8-2" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="fu"&gt;cmake&lt;/span&gt; &lt;span class="at"&gt;-DCMAKE_C_COMPILER&lt;/span&gt;&lt;span class="op"&gt;=&lt;/span&gt;mpiicc &lt;span class="at"&gt;-DCMAKE_CXX_COMPILER&lt;/span&gt;&lt;span class="op"&gt;=&lt;/span&gt;mpiicpc &lt;span class="at"&gt;-DGMX_DOUBLE&lt;/span&gt;&lt;span class="op"&gt;=&lt;/span&gt;ON &lt;span class="at"&gt;-DGMX_MPI&lt;/span&gt;&lt;span class="op"&gt;=&lt;/span&gt;ON &lt;span class="at"&gt;-DGMX_FFT_LIBRARY&lt;/span&gt;&lt;span class="op"&gt;=&lt;/span&gt;fftw3 &lt;span class="at"&gt;-DGMX_BUILD_OWN_FFTW&lt;/span&gt;&lt;span class="op"&gt;=&lt;/span&gt;ON &lt;span class="at"&gt;-DCMAKE_INSTALL_PREFIX&lt;/span&gt;&lt;span class="op"&gt;=&lt;/span&gt;&lt;span class="va"&gt;$HOME&lt;/span&gt;/tools/gromacs-5.0.4/build ..&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h4 id="gcc_ompi_fftw_cuda_single_precision_only_for_gpu"&gt;gcc-ompi-fftw-cuda
(single-precision only for GPU)&lt;/h4&gt;
&lt;div class="sourceCode" id="cb9"&gt;&lt;pre class="sourceCode bash"&gt;&lt;code class="sourceCode bash"&gt;&lt;span id="cb9-1"&gt;&lt;a href="https://scrapbook.netlify.app/posts/compilation-tuning.html#cb9-1" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="ex"&gt;module&lt;/span&gt; add gcc/4.8.1 ompi/1.7.2/gnu-4.8.1 cuda/6.0&lt;/span&gt;
&lt;span id="cb9-2"&gt;&lt;a href="https://scrapbook.netlify.app/posts/compilation-tuning.html#cb9-2" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="fu"&gt;cmake&lt;/span&gt; &lt;span class="at"&gt;-DCMAKE_C_COMPILER&lt;/span&gt;&lt;span class="op"&gt;=&lt;/span&gt;mpigcc &lt;span class="at"&gt;-DCMAKE_CXX_COMPILER&lt;/span&gt;&lt;span class="op"&gt;=&lt;/span&gt;mpigxx &lt;span class="at"&gt;-DGMX_MPI&lt;/span&gt;&lt;span class="op"&gt;=&lt;/span&gt;ON &lt;span class="at"&gt;-DGMX_GPU&lt;/span&gt;&lt;span class="op"&gt;=&lt;/span&gt;on &lt;span class="at"&gt;-DGMX_FFT_LIBRARY&lt;/span&gt;&lt;span class="op"&gt;=&lt;/span&gt;fftw3 &lt;span class="at"&gt;-DGMX_BUILD_OWN_FFTW&lt;/span&gt;&lt;span class="op"&gt;=&lt;/span&gt;ON &lt;span class="at"&gt;-DCMAKE_INSTALL_PREFIX&lt;/span&gt;&lt;span class="op"&gt;=&lt;/span&gt;&lt;span class="va"&gt;$HOME&lt;/span&gt;/tools/gromacs-5.0.4/build ..&lt;/span&gt;
&lt;span id="cb9-3"&gt;&lt;a href="https://scrapbook.netlify.app/posts/compilation-tuning.html#cb9-3" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="fu"&gt;make&lt;/span&gt; &lt;span class="at"&gt;-j&lt;/span&gt; 16 install&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h4 id="cray_system_with_intel_knl_mic_static_build"&gt;Cray system with
Intel KNL MIC (static build)&lt;/h4&gt;
&lt;div class="sourceCode" id="cb10"&gt;&lt;pre class="sourceCode bash"&gt;&lt;code class="sourceCode bash"&gt;&lt;span id="cb10-1"&gt;&lt;a href="https://scrapbook.netlify.app/posts/compilation-tuning.html#cb10-1" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="fu"&gt;mkdir&lt;/span&gt; ~/tools/gromacs-2019.3/build&lt;/span&gt;
&lt;span id="cb10-2"&gt;&lt;a href="https://scrapbook.netlify.app/posts/compilation-tuning.html#cb10-2" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="bu"&gt;cd&lt;/span&gt; ~/tools/gromacs-2019.3/build&lt;/span&gt;
&lt;span id="cb10-3"&gt;&lt;a href="https://scrapbook.netlify.app/posts/compilation-tuning.html#cb10-3" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="fu"&gt;cmake&lt;/span&gt; &lt;span class="at"&gt;-DCMAKE_C_COMPILER&lt;/span&gt;&lt;span class="op"&gt;=&lt;/span&gt;cc &lt;span class="at"&gt;-DCMAKE_CXX_COMPILER&lt;/span&gt;&lt;span class="op"&gt;=&lt;/span&gt;CC &lt;span class="at"&gt;-DGMX_DOUBLE&lt;/span&gt;&lt;span class="op"&gt;=&lt;/span&gt;ON &lt;span class="at"&gt;-DGMX_MPI&lt;/span&gt;&lt;span class="op"&gt;=&lt;/span&gt;ON &lt;span class="at"&gt;-DGMX_FFT_LIBRARY&lt;/span&gt;&lt;span class="op"&gt;=&lt;/span&gt;mkl &lt;span class="at"&gt;-DGMX_BUILD_SHARED_EXE&lt;/span&gt;&lt;span class="op"&gt;=&lt;/span&gt;off &lt;span class="at"&gt;-DCMAKE_INSTALL_PREFIX&lt;/span&gt;&lt;span class="op"&gt;=&lt;/span&gt;&lt;span class="va"&gt;$HOME&lt;/span&gt;/tools/gromacs-2019.3/intel-double-impi-mkl ..&lt;/span&gt;
&lt;span id="cb10-4"&gt;&lt;a href="https://scrapbook.netlify.app/posts/compilation-tuning.html#cb10-4" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="fu"&gt;make&lt;/span&gt; &lt;span class="at"&gt;-j&lt;/span&gt; 16 install&lt;/span&gt;
&lt;span id="cb10-5"&gt;&lt;a href="https://scrapbook.netlify.app/posts/compilation-tuning.html#cb10-5" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="fu"&gt;rm&lt;/span&gt; &lt;span class="at"&gt;-r&lt;/span&gt; &lt;span class="pp"&gt;*&lt;/span&gt;&lt;/span&gt;
&lt;span id="cb10-6"&gt;&lt;a href="https://scrapbook.netlify.app/posts/compilation-tuning.html#cb10-6" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="fu"&gt;cmake&lt;/span&gt; &lt;span class="at"&gt;-DCMAKE_C_COMPILER&lt;/span&gt;&lt;span class="op"&gt;=&lt;/span&gt;cc &lt;span class="at"&gt;-DCMAKE_CXX_COMPILER&lt;/span&gt;&lt;span class="op"&gt;=&lt;/span&gt;CC &lt;span class="at"&gt;-DGMX_DOUBLE&lt;/span&gt;&lt;span class="op"&gt;=&lt;/span&gt;ON &lt;span class="at"&gt;-DGMX_MPI&lt;/span&gt;&lt;span class="op"&gt;=&lt;/span&gt;ON &lt;span class="at"&gt;-DGMX_FFT_LIBRARY&lt;/span&gt;&lt;span class="op"&gt;=&lt;/span&gt;mkl &lt;span class="at"&gt;-DGMX_BUILD_SHARED_EXE&lt;/span&gt;&lt;span class="op"&gt;=&lt;/span&gt;off &lt;span class="at"&gt;-DGMX_SIMD&lt;/span&gt;&lt;span class="op"&gt;=&lt;/span&gt;AVX_512_KNL &lt;span class="at"&gt;-DCMAKE_INSTALL_PREFIX&lt;/span&gt;&lt;span class="op"&gt;=&lt;/span&gt;&lt;span class="va"&gt;$HOME&lt;/span&gt;/tools/gromacs-2019.3/intel-double-impi-mkl-knl ..&lt;/span&gt;
&lt;span id="cb10-7"&gt;&lt;a href="https://scrapbook.netlify.app/posts/compilation-tuning.html#cb10-7" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="ex"&gt;module&lt;/span&gt; swap craype-haswell craype-mic-knl&lt;/span&gt;
&lt;span id="cb10-8"&gt;&lt;a href="https://scrapbook.netlify.app/posts/compilation-tuning.html#cb10-8" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="fu"&gt;make&lt;/span&gt; &lt;span class="at"&gt;-j&lt;/span&gt; 16 install&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h4 id="specifying_prebuilt_fftw"&gt;Specifying prebuilt FFTW&lt;/h4&gt;
&lt;div class="sourceCode" id="cb11"&gt;&lt;pre class="sourceCode bash"&gt;&lt;code class="sourceCode bash"&gt;&lt;span id="cb11-1"&gt;&lt;a href="https://scrapbook.netlify.app/posts/compilation-tuning.html#cb11-1" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="ex"&gt;module&lt;/span&gt; load fftw/3.3-ompi-double&lt;/span&gt;
&lt;span id="cb11-2"&gt;&lt;a href="https://scrapbook.netlify.app/posts/compilation-tuning.html#cb11-2" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="va"&gt;CC&lt;/span&gt;&lt;span class="op"&gt;=&lt;/span&gt;mpicc &lt;span class="va"&gt;CXX&lt;/span&gt;&lt;span class="op"&gt;=&lt;/span&gt;mpiCC &lt;span class="va"&gt;FFTW3_ROOT_DIR&lt;/span&gt;&lt;span class="op"&gt;=&lt;/span&gt;/soft/fftw/intel-ompi/3.3-double &lt;span class="fu"&gt;cmake&lt;/span&gt; &lt;span class="at"&gt;-DGMX_DOUBLE&lt;/span&gt;&lt;span class="op"&gt;=&lt;/span&gt;ON &lt;span class="at"&gt;-DGMX_MPI&lt;/span&gt;&lt;span class="op"&gt;=&lt;/span&gt;ON &lt;span class="at"&gt;-DGMX_PREFER_STATIC_LIBS&lt;/span&gt;&lt;span class="op"&gt;=&lt;/span&gt;ON &lt;span class="at"&gt;-DCMAKE_INSTALL_PREFIX&lt;/span&gt;&lt;span class="op"&gt;=&lt;/span&gt;&lt;span class="va"&gt;$HOME&lt;/span&gt;/tools/gromacs-4.5.5/build ..&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h4 id="specifying_mkl_libraries_typically_not_needed"&gt;Specifying MKL
libraries (typically not needed)&lt;/h4&gt;
&lt;div class="sourceCode" id="cb12"&gt;&lt;pre class="sourceCode bash"&gt;&lt;code class="sourceCode bash"&gt;&lt;span id="cb12-1"&gt;&lt;a href="https://scrapbook.netlify.app/posts/compilation-tuning.html#cb12-1" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="bu"&gt;export&lt;/span&gt; &lt;span class="va"&gt;MKL&lt;/span&gt;&lt;span class="op"&gt;=&lt;/span&gt;/soft/intel/mkl/10.2.7.041&lt;/span&gt;
&lt;span id="cb12-2"&gt;&lt;a href="https://scrapbook.netlify.app/posts/compilation-tuning.html#cb12-2" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="va"&gt;CC&lt;/span&gt;&lt;span class="op"&gt;=&lt;/span&gt;mpicc &lt;span class="va"&gt;CXX&lt;/span&gt;&lt;span class="op"&gt;=&lt;/span&gt;mpiCC &lt;span class="fu"&gt;cmake&lt;/span&gt; &lt;span class="at"&gt;-DGMX_DOUBLE&lt;/span&gt;&lt;span class="op"&gt;=&lt;/span&gt;ON &lt;span class="at"&gt;-DGMX_MPI&lt;/span&gt;&lt;span class="op"&gt;=&lt;/span&gt;ON &lt;span class="at"&gt;-DGMX_THREADS&lt;/span&gt;&lt;span class="op"&gt;=&lt;/span&gt;OFF &lt;span class="at"&gt;-DGMX_PREFER_STATIC_LIBS&lt;/span&gt;&lt;span class="op"&gt;=&lt;/span&gt;ON &lt;span class="at"&gt;-DCMAKE_INSTALL_PREFIX&lt;/span&gt;&lt;span class="op"&gt;=&lt;/span&gt;&lt;span class="va"&gt;$HOME&lt;/span&gt;/tools/gromacs-4.5.5/build &lt;span class="at"&gt;-DGMX_FFT_LIBRARY&lt;/span&gt;&lt;span class="op"&gt;=&lt;/span&gt;mkl &lt;span class="at"&gt;-DMKL_INCLUDE_DIR&lt;/span&gt;&lt;span class="op"&gt;=&lt;/span&gt;&lt;span class="va"&gt;${MKL}&lt;/span&gt;/include &lt;span class="st"&gt;"-DMKL_LIBRARIES=&lt;/span&gt;&lt;span class="va"&gt;${MKL}&lt;/span&gt;&lt;span class="st"&gt;/lib/em64t/libmkl_intel_lp64.so;&lt;/span&gt;&lt;span class="va"&gt;${MKL}&lt;/span&gt;&lt;span class="st"&gt;/lib/em64t/libmkl_core.so;&lt;/span&gt;&lt;span class="va"&gt;${MKL}&lt;/span&gt;&lt;span class="st"&gt;/lib/em64t/libmkl_sequential.so"&lt;/span&gt; ..&lt;/span&gt;
&lt;span id="cb12-3"&gt;&lt;a href="https://scrapbook.netlify.app/posts/compilation-tuning.html#cb12-3" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="fu"&gt;make&lt;/span&gt; install &lt;span class="at"&gt;-j&lt;/span&gt; 8&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h4 id="aoccaocl_2020.4_water_1536"&gt;AOCC+AOCL 2020.4 water_1536&lt;/h4&gt;
&lt;p&gt;&lt;code&gt;-DGMX_DOUBLE=0 -O3 -Ofast -g -m64 -march=znver3 -fPIC -ffast-math -ffp-contract=fast -Wno-deprecated-copy -Wno-error=deprecated-copy --gcc-toolchain=/usr -O3 -DNDEBUG -mavx2 -mfma -funroll-all-loops -pthread -fopenmp=libomp&lt;/code&gt;&lt;/p&gt;</description><category>coding</category><category>hpc</category><category>linux</category><category>research</category><guid>https://scrapbook.netlify.app/posts/compilation-tuning.html</guid><pubDate>Sat, 19 Mar 2022 04:48:10 GMT</pubDate></item><item><title>Post-processing/Analysis</title><link>https://scrapbook.netlify.app/posts/post-processing-analysis.html</link><dc:creator>author</dc:creator><description>&lt;nav id="TOC" role="doc-toc"&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://scrapbook.netlify.app/posts/post-processing-analysis.html#matlab" id="toc-matlab"&gt;Matlab&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://scrapbook.netlify.app/posts/post-processing-analysis.html#a_utility_function_for_processing_variable_length_input_argument_list" id="toc-a_utility_function_for_processing_variable_length_input_argument_list"&gt;A
utility function for processing variable length input argument
list&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://scrapbook.netlify.app/posts/post-processing-analysis.html#default_plot_styles" id="toc-default_plot_styles"&gt;Default
plot styles&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/nav&gt;
&lt;h2 id="matlab"&gt;Matlab&lt;/h2&gt;
&lt;h3 id="a_utility_function_for_processing_variable_length_input_argument_list"&gt;A
utility function for processing variable length input argument list&lt;/h3&gt;
&lt;div class="sourceCode" id="cb1"&gt;&lt;pre class="sourceCode matlab"&gt;&lt;code class="sourceCode matlab"&gt;&lt;span id="cb1-1"&gt;&lt;a href="https://scrapbook.netlify.app/posts/post-processing-analysis.html#cb1-1" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="co"&gt;% procVarArg Utility function for processing variable length input argument&lt;/span&gt;&lt;/span&gt;
&lt;span id="cb1-2"&gt;&lt;a href="https://scrapbook.netlify.app/posts/post-processing-analysis.html#cb1-2" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="co"&gt;% list&lt;/span&gt;&lt;/span&gt;
&lt;span id="cb1-3"&gt;&lt;a href="https://scrapbook.netlify.app/posts/post-processing-analysis.html#cb1-3" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="co"&gt;%&lt;/span&gt;&lt;/span&gt;
&lt;span id="cb1-4"&gt;&lt;a href="https://scrapbook.netlify.app/posts/post-processing-analysis.html#cb1-4" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="co"&gt;% Syntax&lt;/span&gt;&lt;/span&gt;
&lt;span id="cb1-5"&gt;&lt;a href="https://scrapbook.netlify.app/posts/post-processing-analysis.html#cb1-5" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="co"&gt;%   options = procVarArg(names, defaultValues, varArg)&lt;/span&gt;&lt;/span&gt;
&lt;span id="cb1-6"&gt;&lt;a href="https://scrapbook.netlify.app/posts/post-processing-analysis.html#cb1-6" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="co"&gt;%   [options, varargout] = procVarArg(names, defaultValues, varArg)&lt;/span&gt;&lt;/span&gt;
&lt;span id="cb1-7"&gt;&lt;a href="https://scrapbook.netlify.app/posts/post-processing-analysis.html#cb1-7" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="co"&gt;%&lt;/span&gt;&lt;/span&gt;
&lt;span id="cb1-8"&gt;&lt;a href="https://scrapbook.netlify.app/posts/post-processing-analysis.html#cb1-8" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="co"&gt;% Description&lt;/span&gt;&lt;/span&gt;
&lt;span id="cb1-9"&gt;&lt;a href="https://scrapbook.netlify.app/posts/post-processing-analysis.html#cb1-9" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="co"&gt;%   options = procVarArg(names, defaultValues, varArg) generates a comma&lt;/span&gt;&lt;/span&gt;
&lt;span id="cb1-10"&gt;&lt;a href="https://scrapbook.netlify.app/posts/post-processing-analysis.html#cb1-10" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="co"&gt;%   separated list and call struct, options, with k attribute names defined&lt;/span&gt;&lt;/span&gt;
&lt;span id="cb1-11"&gt;&lt;a href="https://scrapbook.netlify.app/posts/post-processing-analysis.html#cb1-11" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="co"&gt;%   in names (k by 1 matrix) and k default values defined in defaultValues&lt;/span&gt;&lt;/span&gt;
&lt;span id="cb1-12"&gt;&lt;a href="https://scrapbook.netlify.app/posts/post-processing-analysis.html#cb1-12" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="co"&gt;%   (k by 1 matrix). The property/value pairs that are explictly given in&lt;/span&gt;&lt;/span&gt;
&lt;span id="cb1-13"&gt;&lt;a href="https://scrapbook.netlify.app/posts/post-processing-analysis.html#cb1-13" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="co"&gt;%   varArg overwrite those in defaultValues. varArg is usually the variable&lt;/span&gt;&lt;/span&gt;
&lt;span id="cb1-14"&gt;&lt;a href="https://scrapbook.netlify.app/posts/post-processing-analysis.html#cb1-14" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="co"&gt;%   length input argument list, varargin, to the function calling&lt;/span&gt;&lt;/span&gt;
&lt;span id="cb1-15"&gt;&lt;a href="https://scrapbook.netlify.app/posts/post-processing-analysis.html#cb1-15" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="co"&gt;%   procVarArg.&lt;/span&gt;&lt;/span&gt;
&lt;span id="cb1-16"&gt;&lt;a href="https://scrapbook.netlify.app/posts/post-processing-analysis.html#cb1-16" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="co"&gt;%&lt;/span&gt;&lt;/span&gt;
&lt;span id="cb1-17"&gt;&lt;a href="https://scrapbook.netlify.app/posts/post-processing-analysis.html#cb1-17" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="co"&gt;%   [options, varargout] = procVarArg(names, defaultValues, varArg) stores&lt;/span&gt;&lt;/span&gt;
&lt;span id="cb1-18"&gt;&lt;a href="https://scrapbook.netlify.app/posts/post-processing-analysis.html#cb1-18" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="co"&gt;%   parameters from varArg that are not found in names in varargout.&lt;/span&gt;&lt;/span&gt;
&lt;span id="cb1-19"&gt;&lt;a href="https://scrapbook.netlify.app/posts/post-processing-analysis.html#cb1-19" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="co"&gt;%   Currently, vargargout support only one variable that will store all the&lt;/span&gt;&lt;/span&gt;
&lt;span id="cb1-20"&gt;&lt;a href="https://scrapbook.netlify.app/posts/post-processing-analysis.html#cb1-20" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="co"&gt;%   parameters not in names.&lt;/span&gt;&lt;/span&gt;
&lt;span id="cb1-21"&gt;&lt;a href="https://scrapbook.netlify.app/posts/post-processing-analysis.html#cb1-21" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="co"&gt;%&lt;/span&gt;&lt;/span&gt;
&lt;span id="cb1-22"&gt;&lt;a href="https://scrapbook.netlify.app/posts/post-processing-analysis.html#cb1-22" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="co"&gt;% See also varargin varargout&lt;/span&gt;&lt;/span&gt;
&lt;span id="cb1-23"&gt;&lt;a href="https://scrapbook.netlify.app/posts/post-processing-analysis.html#cb1-23" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;/span&gt;
&lt;span id="cb1-24"&gt;&lt;a href="https://scrapbook.netlify.app/posts/post-processing-analysis.html#cb1-24" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="kw"&gt;function&lt;/span&gt; [&lt;span class="va"&gt;options&lt;/span&gt;&lt;span class="op"&gt;,&lt;/span&gt;&lt;span class="va"&gt;varargout&lt;/span&gt;] &lt;span class="op"&gt;=&lt;/span&gt; &lt;span class="va"&gt;procVarArg&lt;/span&gt;(&lt;span class="va"&gt;names&lt;/span&gt;&lt;span class="op"&gt;,&lt;/span&gt;&lt;span class="va"&gt;defaultValues&lt;/span&gt;&lt;span class="op"&gt;,&lt;/span&gt;&lt;span class="va"&gt;varArg&lt;/span&gt;)&lt;/span&gt;
&lt;span id="cb1-25"&gt;&lt;a href="https://scrapbook.netlify.app/posts/post-processing-analysis.html#cb1-25" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;/span&gt;
&lt;span id="cb1-26"&gt;&lt;a href="https://scrapbook.netlify.app/posts/post-processing-analysis.html#cb1-26" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="va"&gt;structInput&lt;/span&gt;&lt;span class="op"&gt;=&lt;/span&gt;&lt;span class="va"&gt;cell&lt;/span&gt;(&lt;span class="fl"&gt;2&lt;/span&gt;&lt;span class="op"&gt;,&lt;/span&gt;&lt;span class="va"&gt;length&lt;/span&gt;(&lt;span class="va"&gt;names&lt;/span&gt;))&lt;span class="op"&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span id="cb1-27"&gt;&lt;a href="https://scrapbook.netlify.app/posts/post-processing-analysis.html#cb1-27" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="va"&gt;structInput&lt;/span&gt;(&lt;span class="fl"&gt;1&lt;/span&gt;&lt;span class="op"&gt;,:&lt;/span&gt;)&lt;span class="op"&gt;=&lt;/span&gt;&lt;span class="va"&gt;names&lt;/span&gt;&lt;span class="op"&gt;';&lt;/span&gt;&lt;/span&gt;
&lt;span id="cb1-28"&gt;&lt;a href="https://scrapbook.netlify.app/posts/post-processing-analysis.html#cb1-28" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="va"&gt;structInput&lt;/span&gt;(&lt;span class="fl"&gt;2&lt;/span&gt;&lt;span class="op"&gt;,:&lt;/span&gt;)&lt;span class="op"&gt;=&lt;/span&gt;&lt;span class="va"&gt;defaultValues&lt;/span&gt;&lt;span class="op"&gt;';&lt;/span&gt;&lt;/span&gt;
&lt;span id="cb1-29"&gt;&lt;a href="https://scrapbook.netlify.app/posts/post-processing-analysis.html#cb1-29" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="va"&gt;options&lt;/span&gt;&lt;span class="op"&gt;=&lt;/span&gt;&lt;span class="va"&gt;struct&lt;/span&gt;(&lt;span class="va"&gt;structInput&lt;/span&gt;{&lt;span class="op"&gt;:&lt;/span&gt;})&lt;span class="op"&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span id="cb1-30"&gt;&lt;a href="https://scrapbook.netlify.app/posts/post-processing-analysis.html#cb1-30" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;/span&gt;
&lt;span id="cb1-31"&gt;&lt;a href="https://scrapbook.netlify.app/posts/post-processing-analysis.html#cb1-31" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="va"&gt;nVArgOut&lt;/span&gt;&lt;span class="op"&gt;=&lt;/span&gt;&lt;span class="va"&gt;max&lt;/span&gt;(&lt;span class="va"&gt;nargout&lt;/span&gt;&lt;span class="op"&gt;,&lt;/span&gt;&lt;span class="fl"&gt;1&lt;/span&gt;)&lt;span class="op"&gt;-&lt;/span&gt;&lt;span class="fl"&gt;1&lt;/span&gt;&lt;span class="op"&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span id="cb1-32"&gt;&lt;a href="https://scrapbook.netlify.app/posts/post-processing-analysis.html#cb1-32" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="kw"&gt;if&lt;/span&gt; &lt;span class="va"&gt;nVArgOut&lt;/span&gt;&lt;span class="op"&gt;&amp;gt;&lt;/span&gt;&lt;span class="fl"&gt;1&lt;/span&gt;&lt;/span&gt;
&lt;span id="cb1-33"&gt;&lt;a href="https://scrapbook.netlify.app/posts/post-processing-analysis.html#cb1-33" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;    &lt;span class="va"&gt;error&lt;/span&gt;(&lt;span class="ss"&gt;'ternsurf:TooManyOutputVar'&lt;/span&gt;&lt;span class="op"&gt;,&lt;/span&gt;&lt;span class="ss"&gt;'Too many output variables. Currently support at most two output variables.'&lt;/span&gt;)&lt;span class="op"&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span id="cb1-34"&gt;&lt;a href="https://scrapbook.netlify.app/posts/post-processing-analysis.html#cb1-34" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="kw"&gt;end&lt;/span&gt;&lt;/span&gt;
&lt;span id="cb1-35"&gt;&lt;a href="https://scrapbook.netlify.app/posts/post-processing-analysis.html#cb1-35" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="va"&gt;iVarArgOut&lt;/span&gt;&lt;span class="op"&gt;=&lt;/span&gt;&lt;span class="fl"&gt;0&lt;/span&gt;&lt;span class="op"&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span id="cb1-36"&gt;&lt;a href="https://scrapbook.netlify.app/posts/post-processing-analysis.html#cb1-36" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;/span&gt;
&lt;span id="cb1-37"&gt;&lt;a href="https://scrapbook.netlify.app/posts/post-processing-analysis.html#cb1-37" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="va"&gt;nVarArg&lt;/span&gt;&lt;span class="op"&gt;=&lt;/span&gt;&lt;span class="va"&gt;size&lt;/span&gt;(&lt;span class="va"&gt;varArg&lt;/span&gt;&lt;span class="op"&gt;,&lt;/span&gt;&lt;span class="fl"&gt;2&lt;/span&gt;)&lt;span class="op"&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span id="cb1-38"&gt;&lt;a href="https://scrapbook.netlify.app/posts/post-processing-analysis.html#cb1-38" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="va"&gt;iVarArg&lt;/span&gt;&lt;span class="op"&gt;=&lt;/span&gt;&lt;span class="fl"&gt;1&lt;/span&gt;&lt;span class="op"&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span id="cb1-39"&gt;&lt;a href="https://scrapbook.netlify.app/posts/post-processing-analysis.html#cb1-39" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="va"&gt;flag&lt;/span&gt;&lt;span class="op"&gt;=&lt;/span&gt;&lt;span class="fl"&gt;2&lt;/span&gt;&lt;span class="op"&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span id="cb1-40"&gt;&lt;a href="https://scrapbook.netlify.app/posts/post-processing-analysis.html#cb1-40" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;/span&gt;
&lt;span id="cb1-41"&gt;&lt;a href="https://scrapbook.netlify.app/posts/post-processing-analysis.html#cb1-41" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="kw"&gt;while&lt;/span&gt; &lt;span class="va"&gt;iVarArg&lt;/span&gt;&lt;span class="op"&gt;&amp;lt;=&lt;/span&gt;&lt;span class="va"&gt;nVarArg&lt;/span&gt;&lt;/span&gt;
&lt;span id="cb1-42"&gt;&lt;a href="https://scrapbook.netlify.app/posts/post-processing-analysis.html#cb1-42" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;    &lt;span class="va"&gt;arg&lt;/span&gt;&lt;span class="op"&gt;=&lt;/span&gt;&lt;span class="va"&gt;varArg&lt;/span&gt;{&lt;span class="va"&gt;iVarArg&lt;/span&gt;}&lt;span class="op"&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span id="cb1-43"&gt;&lt;a href="https://scrapbook.netlify.app/posts/post-processing-analysis.html#cb1-43" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;    &lt;span class="kw"&gt;if&lt;/span&gt; &lt;span class="va"&gt;flag&lt;/span&gt;&lt;span class="op"&gt;==&lt;/span&gt;&lt;span class="fl"&gt;1&lt;/span&gt;&lt;/span&gt;
&lt;span id="cb1-44"&gt;&lt;a href="https://scrapbook.netlify.app/posts/post-processing-analysis.html#cb1-44" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;        &lt;span class="kw"&gt;if&lt;/span&gt; &lt;span class="va"&gt;ischar&lt;/span&gt;(&lt;span class="va"&gt;arg&lt;/span&gt;)&lt;/span&gt;
&lt;span id="cb1-45"&gt;&lt;a href="https://scrapbook.netlify.app/posts/post-processing-analysis.html#cb1-45" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;            &lt;span class="va"&gt;arg&lt;/span&gt;&lt;span class="op"&gt;=&lt;/span&gt;&lt;span class="va"&gt;lower&lt;/span&gt;(&lt;span class="va"&gt;deblank&lt;/span&gt;(&lt;span class="va"&gt;arg&lt;/span&gt;))&lt;span class="op"&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span id="cb1-46"&gt;&lt;a href="https://scrapbook.netlify.app/posts/post-processing-analysis.html#cb1-46" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;        &lt;span class="kw"&gt;end&lt;/span&gt;&lt;/span&gt;
&lt;span id="cb1-47"&gt;&lt;a href="https://scrapbook.netlify.app/posts/post-processing-analysis.html#cb1-47" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;        &lt;span class="va"&gt;options&lt;/span&gt;.(&lt;span class="va"&gt;names&lt;/span&gt;{&lt;span class="va"&gt;iName&lt;/span&gt;&lt;span class="op"&gt;,:&lt;/span&gt;})&lt;span class="op"&gt;=&lt;/span&gt;&lt;span class="va"&gt;arg&lt;/span&gt;&lt;span class="op"&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span id="cb1-48"&gt;&lt;a href="https://scrapbook.netlify.app/posts/post-processing-analysis.html#cb1-48" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;        &lt;span class="va"&gt;flag&lt;/span&gt;&lt;span class="op"&gt;=&lt;/span&gt;&lt;span class="fl"&gt;2&lt;/span&gt;&lt;span class="op"&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span id="cb1-49"&gt;&lt;a href="https://scrapbook.netlify.app/posts/post-processing-analysis.html#cb1-49" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;    &lt;span class="kw"&gt;elseif&lt;/span&gt; &lt;span class="va"&gt;flag&lt;/span&gt;&lt;span class="op"&gt;==&lt;/span&gt;&lt;span class="fl"&gt;2&lt;/span&gt;&lt;/span&gt;
&lt;span id="cb1-50"&gt;&lt;a href="https://scrapbook.netlify.app/posts/post-processing-analysis.html#cb1-50" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;        &lt;span class="kw"&gt;if&lt;/span&gt; &lt;span class="op"&gt;~&lt;/span&gt;&lt;span class="va"&gt;ischar&lt;/span&gt;(&lt;span class="va"&gt;arg&lt;/span&gt;)&lt;/span&gt;
&lt;span id="cb1-51"&gt;&lt;a href="https://scrapbook.netlify.app/posts/post-processing-analysis.html#cb1-51" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;           &lt;span class="va"&gt;error&lt;/span&gt;(&lt;span class="ss"&gt;'ternsurf:ParamNotString'&lt;/span&gt;&lt;span class="op"&gt;,&lt;/span&gt;&lt;span class="ss"&gt;'Parameter name must be a string.'&lt;/span&gt;&lt;span class="op"&gt;,&lt;/span&gt;&lt;span class="va"&gt;iVarArg&lt;/span&gt;)&lt;span class="op"&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span id="cb1-52"&gt;&lt;a href="https://scrapbook.netlify.app/posts/post-processing-analysis.html#cb1-52" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;        &lt;span class="kw"&gt;end&lt;/span&gt;&lt;/span&gt;
&lt;span id="cb1-53"&gt;&lt;a href="https://scrapbook.netlify.app/posts/post-processing-analysis.html#cb1-53" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;        &lt;span class="va"&gt;iName&lt;/span&gt;&lt;span class="op"&gt;=&lt;/span&gt;&lt;span class="va"&gt;find&lt;/span&gt;(&lt;span class="va"&gt;strncmpi&lt;/span&gt;(&lt;span class="va"&gt;arg&lt;/span&gt;&lt;span class="op"&gt;,&lt;/span&gt;&lt;span class="va"&gt;names&lt;/span&gt;&lt;span class="op"&gt;,&lt;/span&gt;&lt;span class="va"&gt;length&lt;/span&gt;(&lt;span class="va"&gt;arg&lt;/span&gt;)))&lt;span class="op"&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span id="cb1-54"&gt;&lt;a href="https://scrapbook.netlify.app/posts/post-processing-analysis.html#cb1-54" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;        &lt;span class="kw"&gt;if&lt;/span&gt; &lt;span class="va"&gt;isempty&lt;/span&gt;(&lt;span class="va"&gt;iName&lt;/span&gt;)&lt;/span&gt;
&lt;span id="cb1-55"&gt;&lt;a href="https://scrapbook.netlify.app/posts/post-processing-analysis.html#cb1-55" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;            &lt;span class="va"&gt;flag&lt;/span&gt;&lt;span class="op"&gt;=&lt;/span&gt;&lt;span class="fl"&gt;0&lt;/span&gt;&lt;span class="op"&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span id="cb1-56"&gt;&lt;a href="https://scrapbook.netlify.app/posts/post-processing-analysis.html#cb1-56" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;            &lt;span class="kw"&gt;continue&lt;/span&gt;&lt;/span&gt;
&lt;span id="cb1-57"&gt;&lt;a href="https://scrapbook.netlify.app/posts/post-processing-analysis.html#cb1-57" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;        &lt;span class="kw"&gt;elseif&lt;/span&gt; &lt;span class="va"&gt;length&lt;/span&gt;(&lt;span class="va"&gt;iName&lt;/span&gt;)&lt;span class="op"&gt;&amp;gt;&lt;/span&gt;&lt;span class="fl"&gt;1&lt;/span&gt;&lt;/span&gt;
&lt;span id="cb1-58"&gt;&lt;a href="https://scrapbook.netlify.app/posts/post-processing-analysis.html#cb1-58" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;            &lt;span class="va"&gt;jName&lt;/span&gt;&lt;span class="op"&gt;=&lt;/span&gt;&lt;span class="va"&gt;find&lt;/span&gt;(&lt;span class="va"&gt;strcmpi&lt;/span&gt;(&lt;span class="va"&gt;arg&lt;/span&gt;&lt;span class="op"&gt;,&lt;/span&gt;&lt;span class="va"&gt;names&lt;/span&gt;))&lt;span class="op"&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span id="cb1-59"&gt;&lt;a href="https://scrapbook.netlify.app/posts/post-processing-analysis.html#cb1-59" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;            &lt;span class="kw"&gt;if&lt;/span&gt; &lt;span class="va"&gt;length&lt;/span&gt;(&lt;span class="va"&gt;jName&lt;/span&gt;)&lt;span class="op"&gt;==&lt;/span&gt;&lt;span class="fl"&gt;1&lt;/span&gt;&lt;/span&gt;
&lt;span id="cb1-60"&gt;&lt;a href="https://scrapbook.netlify.app/posts/post-processing-analysis.html#cb1-60" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;                &lt;span class="va"&gt;iName&lt;/span&gt;&lt;span class="op"&gt;=&lt;/span&gt;&lt;span class="va"&gt;jName&lt;/span&gt;&lt;span class="op"&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span id="cb1-61"&gt;&lt;a href="https://scrapbook.netlify.app/posts/post-processing-analysis.html#cb1-61" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;            &lt;span class="kw"&gt;else&lt;/span&gt;&lt;/span&gt;
&lt;span id="cb1-62"&gt;&lt;a href="https://scrapbook.netlify.app/posts/post-processing-analysis.html#cb1-62" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;                &lt;span class="va"&gt;allMatchedNames&lt;/span&gt;&lt;span class="op"&gt;=&lt;/span&gt;[&lt;span class="ss"&gt;'('&lt;/span&gt;&lt;span class="op"&gt;,&lt;/span&gt;&lt;span class="va"&gt;names&lt;/span&gt;{&lt;span class="va"&gt;iName&lt;/span&gt;(&lt;span class="fl"&gt;1&lt;/span&gt;)&lt;span class="op"&gt;,:&lt;/span&gt;}]&lt;span class="op"&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span id="cb1-63"&gt;&lt;a href="https://scrapbook.netlify.app/posts/post-processing-analysis.html#cb1-63" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;                &lt;span class="kw"&gt;for&lt;/span&gt; &lt;span class="va"&gt;jName&lt;/span&gt;&lt;span class="op"&gt;=&lt;/span&gt;&lt;span class="va"&gt;iName&lt;/span&gt;(&lt;span class="fl"&gt;2&lt;/span&gt;&lt;span class="op"&gt;:&lt;/span&gt;&lt;span class="va"&gt;length&lt;/span&gt;(&lt;span class="va"&gt;iName&lt;/span&gt;))&lt;span class="op"&gt;'&lt;/span&gt;&lt;/span&gt;
&lt;span id="cb1-64"&gt;&lt;a href="https://scrapbook.netlify.app/posts/post-processing-analysis.html#cb1-64" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;                    &lt;span class="va"&gt;allMatchedNames&lt;/span&gt;&lt;span class="op"&gt;=&lt;/span&gt;[&lt;span class="va"&gt;allMatchedNames&lt;/span&gt;&lt;span class="op"&gt;,&lt;/span&gt;&lt;span class="ss"&gt;', '&lt;/span&gt;&lt;span class="op"&gt;,&lt;/span&gt;&lt;span class="va"&gt;names&lt;/span&gt;{&lt;span class="va"&gt;jName&lt;/span&gt;&lt;span class="op"&gt;,:&lt;/span&gt;}]&lt;span class="op"&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span id="cb1-65"&gt;&lt;a href="https://scrapbook.netlify.app/posts/post-processing-analysis.html#cb1-65" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;                &lt;span class="kw"&gt;end&lt;/span&gt;&lt;/span&gt;
&lt;span id="cb1-66"&gt;&lt;a href="https://scrapbook.netlify.app/posts/post-processing-analysis.html#cb1-66" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;                &lt;span class="va"&gt;allMatchedNames&lt;/span&gt;&lt;span class="op"&gt;=&lt;/span&gt;[&lt;span class="va"&gt;allMatchedNames&lt;/span&gt;&lt;span class="op"&gt;,&lt;/span&gt;&lt;span class="ss"&gt;')'&lt;/span&gt;]&lt;span class="op"&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span id="cb1-67"&gt;&lt;a href="https://scrapbook.netlify.app/posts/post-processing-analysis.html#cb1-67" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;                &lt;span class="va"&gt;error&lt;/span&gt;(&lt;span class="ss"&gt;'ternsurf:AmbiguousParamName'&lt;/span&gt;&lt;span class="op"&gt;,&lt;/span&gt;&lt;span class="ss"&gt;'Ambiguous parameter name: '&lt;/span&gt;&lt;span class="op"&gt;,&lt;/span&gt;&lt;span class="va"&gt;arg&lt;/span&gt;&lt;span class="op"&gt;,&lt;/span&gt;&lt;span class="va"&gt;allMatchedNames&lt;/span&gt;)&lt;span class="op"&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span id="cb1-68"&gt;&lt;a href="https://scrapbook.netlify.app/posts/post-processing-analysis.html#cb1-68" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;            &lt;span class="kw"&gt;end&lt;/span&gt;&lt;/span&gt;
&lt;span id="cb1-69"&gt;&lt;a href="https://scrapbook.netlify.app/posts/post-processing-analysis.html#cb1-69" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;        &lt;span class="kw"&gt;end&lt;/span&gt;&lt;/span&gt;
&lt;span id="cb1-70"&gt;&lt;a href="https://scrapbook.netlify.app/posts/post-processing-analysis.html#cb1-70" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;        &lt;span class="va"&gt;flag&lt;/span&gt;&lt;span class="op"&gt;=&lt;/span&gt;&lt;span class="fl"&gt;1&lt;/span&gt;&lt;span class="op"&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span id="cb1-71"&gt;&lt;a href="https://scrapbook.netlify.app/posts/post-processing-analysis.html#cb1-71" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;    &lt;span class="kw"&gt;else&lt;/span&gt;&lt;/span&gt;
&lt;span id="cb1-72"&gt;&lt;a href="https://scrapbook.netlify.app/posts/post-processing-analysis.html#cb1-72" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;        &lt;span class="va"&gt;iVarArgOut&lt;/span&gt;&lt;span class="op"&gt;=&lt;/span&gt;&lt;span class="va"&gt;iVarArgOut&lt;/span&gt;&lt;span class="op"&gt;+&lt;/span&gt;&lt;span class="fl"&gt;1&lt;/span&gt;&lt;span class="op"&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span id="cb1-73"&gt;&lt;a href="https://scrapbook.netlify.app/posts/post-processing-analysis.html#cb1-73" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;        &lt;span class="va"&gt;varargout&lt;/span&gt;{&lt;span class="va"&gt;iVarArgOut&lt;/span&gt;}&lt;span class="op"&gt;=&lt;/span&gt;&lt;span class="va"&gt;varArg&lt;/span&gt;{&lt;span class="va"&gt;iVarArg&lt;/span&gt;}&lt;span class="op"&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span id="cb1-74"&gt;&lt;a href="https://scrapbook.netlify.app/posts/post-processing-analysis.html#cb1-74" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;    &lt;span class="kw"&gt;end&lt;/span&gt;&lt;/span&gt;
&lt;span id="cb1-75"&gt;&lt;a href="https://scrapbook.netlify.app/posts/post-processing-analysis.html#cb1-75" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;    &lt;span class="va"&gt;iVarArg&lt;/span&gt;&lt;span class="op"&gt;=&lt;/span&gt;&lt;span class="va"&gt;iVarArg&lt;/span&gt;&lt;span class="op"&gt;+&lt;/span&gt;&lt;span class="fl"&gt;1&lt;/span&gt;&lt;span class="op"&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span id="cb1-76"&gt;&lt;a href="https://scrapbook.netlify.app/posts/post-processing-analysis.html#cb1-76" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="kw"&gt;end&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h3 id="default_plot_styles"&gt;Default plot styles&lt;/h3&gt;
&lt;p&gt;Name the following file &lt;code&gt;startup.m&lt;/code&gt; and put it in a
directory in the MATLAB search paths.&lt;/p&gt;
&lt;div class="sourceCode" id="cb2"&gt;&lt;pre class="sourceCode matlab"&gt;&lt;code class="sourceCode matlab"&gt;&lt;span id="cb2-1"&gt;&lt;a href="https://scrapbook.netlify.app/posts/post-processing-analysis.html#cb2-1" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="co"&gt;% startup.m&lt;/span&gt;&lt;/span&gt;
&lt;span id="cb2-2"&gt;&lt;a href="https://scrapbook.netlify.app/posts/post-processing-analysis.html#cb2-2" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="co"&gt;%&lt;/span&gt;&lt;/span&gt;
&lt;span id="cb2-3"&gt;&lt;a href="https://scrapbook.netlify.app/posts/post-processing-analysis.html#cb2-3" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="co"&gt;% Set default values of several properties for the graphic object with&lt;/span&gt;&lt;/span&gt;
&lt;span id="cb2-4"&gt;&lt;a href="https://scrapbook.netlify.app/posts/post-processing-analysis.html#cb2-4" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="co"&gt;% handle 0, which is the root ancestor and default behavior for all plots.&lt;/span&gt;&lt;/span&gt;
&lt;span id="cb2-5"&gt;&lt;a href="https://scrapbook.netlify.app/posts/post-processing-analysis.html#cb2-5" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="co"&gt;% PropertyName is formed by concatenating the string 'Default', the object&lt;/span&gt;&lt;/span&gt;
&lt;span id="cb2-6"&gt;&lt;a href="https://scrapbook.netlify.app/posts/post-processing-analysis.html#cb2-6" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="co"&gt;% type (e.g., 'Figure', 'Axes', 'Line', and 'Text'), and the property name&lt;/span&gt;&lt;/span&gt;
&lt;span id="cb2-7"&gt;&lt;a href="https://scrapbook.netlify.app/posts/post-processing-analysis.html#cb2-7" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="co"&gt;% (e.g., 'Color', 'FontName', 'LineWidth').&lt;/span&gt;&lt;/span&gt;
&lt;span id="cb2-8"&gt;&lt;a href="https://scrapbook.netlify.app/posts/post-processing-analysis.html#cb2-8" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="co"&gt;%&lt;/span&gt;&lt;/span&gt;
&lt;span id="cb2-9"&gt;&lt;a href="https://scrapbook.netlify.app/posts/post-processing-analysis.html#cb2-9" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="co"&gt;% See also STARTUP SET&lt;/span&gt;&lt;/span&gt;
&lt;span id="cb2-10"&gt;&lt;a href="https://scrapbook.netlify.app/posts/post-processing-analysis.html#cb2-10" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;/span&gt;
&lt;span id="cb2-11"&gt;&lt;a href="https://scrapbook.netlify.app/posts/post-processing-analysis.html#cb2-11" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="va"&gt;set&lt;/span&gt;(&lt;span class="fl"&gt;0&lt;/span&gt;&lt;span class="op"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;'DefaultFigureColor'&lt;/span&gt;&lt;span class="op"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;'white'&lt;/span&gt;&lt;span class="op"&gt;,&lt;/span&gt; &lt;span class="op"&gt;...&lt;/span&gt;&lt;/span&gt;
&lt;span id="cb2-12"&gt;&lt;a href="https://scrapbook.netlify.app/posts/post-processing-analysis.html#cb2-12" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="ss"&gt;'DefaultAxesColor'&lt;/span&gt;&lt;span class="op"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;'none'&lt;/span&gt;&lt;span class="op"&gt;,&lt;/span&gt; &lt;span class="op"&gt;...&lt;/span&gt;&lt;/span&gt;
&lt;span id="cb2-13"&gt;&lt;a href="https://scrapbook.netlify.app/posts/post-processing-analysis.html#cb2-13" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="ss"&gt;'DefaultAxesFontAngle'&lt;/span&gt;&lt;span class="op"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;'normal'&lt;/span&gt;&lt;span class="op"&gt;,&lt;/span&gt; &lt;span class="op"&gt;...&lt;/span&gt;&lt;/span&gt;
&lt;span id="cb2-14"&gt;&lt;a href="https://scrapbook.netlify.app/posts/post-processing-analysis.html#cb2-14" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="ss"&gt;'DefaultAxesFontName'&lt;/span&gt;&lt;span class="op"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;'Helvetica'&lt;/span&gt;&lt;span class="op"&gt;,&lt;/span&gt; &lt;span class="op"&gt;...&lt;/span&gt;&lt;/span&gt;
&lt;span id="cb2-15"&gt;&lt;a href="https://scrapbook.netlify.app/posts/post-processing-analysis.html#cb2-15" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="ss"&gt;'DefaultAxesFontUnits'&lt;/span&gt;&lt;span class="op"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;'points'&lt;/span&gt;&lt;span class="op"&gt;,&lt;/span&gt; &lt;span class="op"&gt;...&lt;/span&gt;&lt;/span&gt;
&lt;span id="cb2-16"&gt;&lt;a href="https://scrapbook.netlify.app/posts/post-processing-analysis.html#cb2-16" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="ss"&gt;'DefaultAxesFontSize'&lt;/span&gt;&lt;span class="op"&gt;,&lt;/span&gt; &lt;span class="fl"&gt;24&lt;/span&gt;&lt;span class="op"&gt;,&lt;/span&gt; &lt;span class="op"&gt;...&lt;/span&gt;&lt;/span&gt;
&lt;span id="cb2-17"&gt;&lt;a href="https://scrapbook.netlify.app/posts/post-processing-analysis.html#cb2-17" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="ss"&gt;'DefaultAxesFontWeight'&lt;/span&gt;&lt;span class="op"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;'normal'&lt;/span&gt;&lt;span class="op"&gt;,&lt;/span&gt; &lt;span class="op"&gt;...&lt;/span&gt;&lt;/span&gt;
&lt;span id="cb2-18"&gt;&lt;a href="https://scrapbook.netlify.app/posts/post-processing-analysis.html#cb2-18" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="ss"&gt;'DefaultAxesGridLineStyle'&lt;/span&gt;&lt;span class="op"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;':'&lt;/span&gt;&lt;span class="op"&gt;,&lt;/span&gt; &lt;span class="op"&gt;...&lt;/span&gt;&lt;/span&gt;
&lt;span id="cb2-19"&gt;&lt;a href="https://scrapbook.netlify.app/posts/post-processing-analysis.html#cb2-19" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="ss"&gt;'DefaultAxesLayer'&lt;/span&gt;&lt;span class="op"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;'Bottom'&lt;/span&gt;&lt;span class="op"&gt;,&lt;/span&gt; &lt;span class="op"&gt;...&lt;/span&gt;&lt;/span&gt;
&lt;span id="cb2-20"&gt;&lt;a href="https://scrapbook.netlify.app/posts/post-processing-analysis.html#cb2-20" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="ss"&gt;'DefaultAxesLineWidth'&lt;/span&gt;&lt;span class="op"&gt;,&lt;/span&gt; &lt;span class="fl"&gt;2&lt;/span&gt;&lt;span class="op"&gt;,&lt;/span&gt; &lt;span class="op"&gt;...&lt;/span&gt;&lt;/span&gt;
&lt;span id="cb2-21"&gt;&lt;a href="https://scrapbook.netlify.app/posts/post-processing-analysis.html#cb2-21" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="ss"&gt;'DefaultAxesTickLength'&lt;/span&gt;&lt;span class="op"&gt;,&lt;/span&gt; [&lt;span class="fl"&gt;0.02&lt;/span&gt;&lt;span class="op"&gt;,&lt;/span&gt;&lt;span class="fl"&gt;0.02&lt;/span&gt;]&lt;span class="op"&gt;,&lt;/span&gt; &lt;span class="op"&gt;...&lt;/span&gt;&lt;/span&gt;
&lt;span id="cb2-22"&gt;&lt;a href="https://scrapbook.netlify.app/posts/post-processing-analysis.html#cb2-22" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="ss"&gt;'DefaultAxesUnits'&lt;/span&gt;&lt;span class="op"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;'inches'&lt;/span&gt;&lt;span class="op"&gt;,&lt;/span&gt; &lt;span class="op"&gt;...&lt;/span&gt;&lt;/span&gt;
&lt;span id="cb2-23"&gt;&lt;a href="https://scrapbook.netlify.app/posts/post-processing-analysis.html#cb2-23" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="ss"&gt;'DefaultAxesPosition'&lt;/span&gt;&lt;span class="op"&gt;,&lt;/span&gt;[&lt;span class="fl"&gt;0.85&lt;/span&gt; &lt;span class="fl"&gt;0.8&lt;/span&gt; &lt;span class="fl"&gt;3.25&lt;/span&gt; &lt;span class="fl"&gt;3.25&lt;/span&gt;]&lt;span class="op"&gt;,...&lt;/span&gt;&lt;/span&gt;
&lt;span id="cb2-24"&gt;&lt;a href="https://scrapbook.netlify.app/posts/post-processing-analysis.html#cb2-24" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="ss"&gt;'DefaultAxesVisible'&lt;/span&gt;&lt;span class="op"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;'on'&lt;/span&gt;&lt;span class="op"&gt;,&lt;/span&gt; &lt;span class="op"&gt;...&lt;/span&gt;&lt;/span&gt;
&lt;span id="cb2-25"&gt;&lt;a href="https://scrapbook.netlify.app/posts/post-processing-analysis.html#cb2-25" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="ss"&gt;'DefaultAxesXcolor'&lt;/span&gt;&lt;span class="op"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;'black'&lt;/span&gt;&lt;span class="op"&gt;,&lt;/span&gt; &lt;span class="op"&gt;...&lt;/span&gt;&lt;/span&gt;
&lt;span id="cb2-26"&gt;&lt;a href="https://scrapbook.netlify.app/posts/post-processing-analysis.html#cb2-26" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="ss"&gt;'DefaultAxesYcolor'&lt;/span&gt;&lt;span class="op"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;'black'&lt;/span&gt;&lt;span class="op"&gt;,&lt;/span&gt; &lt;span class="op"&gt;...&lt;/span&gt;&lt;/span&gt;
&lt;span id="cb2-27"&gt;&lt;a href="https://scrapbook.netlify.app/posts/post-processing-analysis.html#cb2-27" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="ss"&gt;'DefaultAxesZcolor'&lt;/span&gt;&lt;span class="op"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;'black'&lt;/span&gt;&lt;span class="op"&gt;,&lt;/span&gt; &lt;span class="op"&gt;...&lt;/span&gt;&lt;/span&gt;
&lt;span id="cb2-28"&gt;&lt;a href="https://scrapbook.netlify.app/posts/post-processing-analysis.html#cb2-28" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="ss"&gt;'DefaultLineColor'&lt;/span&gt;&lt;span class="op"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;'black'&lt;/span&gt;&lt;span class="op"&gt;,&lt;/span&gt; &lt;span class="op"&gt;...&lt;/span&gt;&lt;/span&gt;
&lt;span id="cb2-29"&gt;&lt;a href="https://scrapbook.netlify.app/posts/post-processing-analysis.html#cb2-29" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="ss"&gt;'DefaultLineLineStyle'&lt;/span&gt;&lt;span class="op"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;'-'&lt;/span&gt;&lt;span class="op"&gt;,&lt;/span&gt; &lt;span class="op"&gt;...&lt;/span&gt;&lt;/span&gt;
&lt;span id="cb2-30"&gt;&lt;a href="https://scrapbook.netlify.app/posts/post-processing-analysis.html#cb2-30" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="ss"&gt;'DefaultLineLineWidth'&lt;/span&gt;&lt;span class="op"&gt;,&lt;/span&gt; &lt;span class="fl"&gt;2&lt;/span&gt;&lt;span class="op"&gt;,&lt;/span&gt; &lt;span class="op"&gt;...&lt;/span&gt;&lt;/span&gt;
&lt;span id="cb2-31"&gt;&lt;a href="https://scrapbook.netlify.app/posts/post-processing-analysis.html#cb2-31" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="ss"&gt;'DefaultLineMarker'&lt;/span&gt;&lt;span class="op"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;'none'&lt;/span&gt;&lt;span class="op"&gt;,&lt;/span&gt; &lt;span class="op"&gt;...&lt;/span&gt;&lt;/span&gt;
&lt;span id="cb2-32"&gt;&lt;a href="https://scrapbook.netlify.app/posts/post-processing-analysis.html#cb2-32" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="ss"&gt;'DefaultLineMarkerSize'&lt;/span&gt;&lt;span class="op"&gt;,&lt;/span&gt; &lt;span class="fl"&gt;9&lt;/span&gt;&lt;span class="op"&gt;,&lt;/span&gt; &lt;span class="op"&gt;...&lt;/span&gt;&lt;/span&gt;
&lt;span id="cb2-33"&gt;&lt;a href="https://scrapbook.netlify.app/posts/post-processing-analysis.html#cb2-33" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="ss"&gt;'DefaultTextColor'&lt;/span&gt;&lt;span class="op"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;'black'&lt;/span&gt;&lt;span class="op"&gt;,&lt;/span&gt; &lt;span class="op"&gt;...&lt;/span&gt;&lt;/span&gt;
&lt;span id="cb2-34"&gt;&lt;a href="https://scrapbook.netlify.app/posts/post-processing-analysis.html#cb2-34" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="ss"&gt;'DefaultTextFontName'&lt;/span&gt;&lt;span class="op"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;'Helvetica'&lt;/span&gt;&lt;span class="op"&gt;,&lt;/span&gt; &lt;span class="op"&gt;...&lt;/span&gt;&lt;/span&gt;
&lt;span id="cb2-35"&gt;&lt;a href="https://scrapbook.netlify.app/posts/post-processing-analysis.html#cb2-35" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="ss"&gt;'DefaultTextFontUnits'&lt;/span&gt;&lt;span class="op"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;'points'&lt;/span&gt;&lt;span class="op"&gt;,&lt;/span&gt; &lt;span class="op"&gt;...&lt;/span&gt;&lt;/span&gt;
&lt;span id="cb2-36"&gt;&lt;a href="https://scrapbook.netlify.app/posts/post-processing-analysis.html#cb2-36" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="ss"&gt;'DefaultTextFontSize'&lt;/span&gt;&lt;span class="op"&gt;,&lt;/span&gt; &lt;span class="fl"&gt;24&lt;/span&gt;&lt;span class="op"&gt;,&lt;/span&gt; &lt;span class="op"&gt;...&lt;/span&gt;&lt;/span&gt;
&lt;span id="cb2-37"&gt;&lt;a href="https://scrapbook.netlify.app/posts/post-processing-analysis.html#cb2-37" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="ss"&gt;'DefaultTextFontWeight'&lt;/span&gt;&lt;span class="op"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;'normal'&lt;/span&gt;&lt;span class="op"&gt;,&lt;/span&gt; &lt;span class="op"&gt;...&lt;/span&gt;&lt;/span&gt;
&lt;span id="cb2-38"&gt;&lt;a href="https://scrapbook.netlify.app/posts/post-processing-analysis.html#cb2-38" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="ss"&gt;'DefaultTextHorizontalAlignment'&lt;/span&gt;&lt;span class="op"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;'left'&lt;/span&gt;&lt;span class="op"&gt;,&lt;/span&gt; &lt;span class="op"&gt;...&lt;/span&gt;&lt;/span&gt;
&lt;span id="cb2-39"&gt;&lt;a href="https://scrapbook.netlify.app/posts/post-processing-analysis.html#cb2-39" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="ss"&gt;'DefaultTextInterpreter'&lt;/span&gt;&lt;span class="op"&gt;,&lt;/span&gt;&lt;span class="ss"&gt;'latex'&lt;/span&gt;&lt;span class="op"&gt;,&lt;/span&gt; &lt;span class="op"&gt;...&lt;/span&gt;&lt;/span&gt;
&lt;span id="cb2-40"&gt;&lt;a href="https://scrapbook.netlify.app/posts/post-processing-analysis.html#cb2-40" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="ss"&gt;'DefaultTextVerticalAlignment'&lt;/span&gt;&lt;span class="op"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;'middle'&lt;/span&gt; &lt;span class="op"&gt;...&lt;/span&gt;&lt;/span&gt;
&lt;span id="cb2-41"&gt;&lt;a href="https://scrapbook.netlify.app/posts/post-processing-analysis.html#cb2-41" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;)&lt;span class="op"&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</description><category>coding</category><category>hpc</category><category>research</category><guid>https://scrapbook.netlify.app/posts/post-processing-analysis.html</guid><pubDate>Mon, 05 Dec 2016 23:29:14 GMT</pubDate></item><item><title>Coding Guidelines</title><link>https://scrapbook.netlify.app/posts/coding-guidelines.html</link><dc:creator>author</dc:creator><description>&lt;nav id="TOC" role="doc-toc"&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://scrapbook.netlify.app/posts/coding-guidelines.html#getting_started" id="toc-getting_started"&gt;Getting
Started&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://scrapbook.netlify.app/posts/coding-guidelines.html#using_git" id="toc-using_git"&gt;Using Git&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://scrapbook.netlify.app/posts/coding-guidelines.html#git_tutorials" id="toc-git_tutorials"&gt;Git
Tutorials&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://scrapbook.netlify.app/posts/coding-guidelines.html#git_guidelines" id="toc-git_guidelines"&gt;Git
Guidelines&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://scrapbook.netlify.app/posts/coding-guidelines.html#sample_git_workflow" id="toc-sample_git_workflow"&gt;Sample
Git Workflow&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://scrapbook.netlify.app/posts/coding-guidelines.html#installing_git" id="toc-installing_git"&gt;Installing
Git&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://scrapbook.netlify.app/posts/coding-guidelines.html#profiling_your_code" id="toc-profiling_your_code"&gt;Profiling Your Code&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://scrapbook.netlify.app/posts/coding-guidelines.html#language_agnostic" id="toc-language_agnostic"&gt;Language
Agnostic&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://scrapbook.netlify.app/posts/coding-guidelines.html#python" id="toc-python"&gt;Python&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://scrapbook.netlify.app/posts/coding-guidelines.html#general_tips" id="toc-general_tips"&gt;General Tips&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/nav&gt;
&lt;h2 id="getting_started"&gt;Getting Started&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;&lt;a href="https://software-carpentry.org/lessons/"&gt;Software
Carpentry&lt;/a&gt; can help you learn &lt;strong&gt;basic coding
practices&lt;/strong&gt;: working with a Unix shell, using Git, and basic
Python commands. There is also a &lt;a href="https://education.molssi.org/python_scripting_cms/aio/index.html"&gt;nice
overview&lt;/a&gt; by the NSF MolSSI group on scripting for scientific
computing.&lt;/li&gt;
&lt;li&gt;It pays to have a reasonable familiarity with a terminal editor such
as Vim, which makes editing and working on remote machines easier.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Python&lt;/strong&gt;: You should familiarize yourself with &lt;a href="https://realpython.com/python-pep8/"&gt;PEP 8 guidelines&lt;/a&gt; and use
tools like Pylint, Google’s yapf, or Sublime Text’s AutoPEP8 to enforce
good style. It can also be helpful to use &lt;a href="https://docs.python.org/3/library/typing.html"&gt;optional type
hints&lt;/a&gt; so that others can more easily understand your code. Google
has a comprehensive &lt;a href="http://google.github.io/styleguide/pyguide.html"&gt;style guide for
Python code&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;While working in Jupyter notebooks is a great way to analyze
experiments and provide tutorials of code, rigorous testing and
reproducible research is more easily conducted with a well-organized and
documented codebase (see &lt;a href="https://github.com/drivendata/cookiecutter-data-science"&gt;here&lt;/a&gt;
for an example layout).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Git&lt;/strong&gt;: Get started with this &lt;a href="http://git-scm.com/docs/gittutorial"&gt;tutorial&lt;/a&gt; and Chapter 2:
Git Basics from the &lt;a href="https://git-scm.com/book/en/v2"&gt;Pro Git&lt;/a&gt;
book. Check out various git commands on its &lt;a href="http://git-scm.com/docs/git"&gt;man page&lt;/a&gt;. For more complete
information, see &lt;a href="http://git-scm.com/documentation"&gt;git
documentation&lt;/a&gt;, particularly the &lt;a href="http://git-scm.com/docs/user-manual"&gt;user manual&lt;/a&gt; and the &lt;a href="https://git-scm.com/book/en/v2"&gt;Pro Git&lt;/a&gt; book. For a quick
interactive git tutorial, check &lt;a href="https://learngitbranching.js.org/?locale=en_US"&gt;learn git
branching&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;For reproducibility, you should always use a &lt;strong&gt;dependency
manager&lt;/strong&gt; like &lt;a href="https://docs.conda.io/projects/conda/en/latest/user-guide/getting-started.html"&gt;Conda&lt;/a&gt;
or, for more complex dependencies beyond Python packages, &lt;a href="https://docs.docker.com/get-started/overview/"&gt;Docker
containers&lt;/a&gt; (see &lt;a href="https://kordinglab.com/2022/10/28/LabTeaching-Docker-for-Science.html"&gt;here&lt;/a&gt;
for a short tutorial).&lt;/li&gt;
&lt;li&gt;If you’re not sure what your development workflow should be, or how
to use certain tools like Git, please just ask the group! We all have to
learn this for the first time at some point, so there is no shame in
asking. If you think “there must be a better way to do this”, there
probably is.&lt;/li&gt;
&lt;li&gt;We should always try to look for a general solution than an ad-hoc
fix. When problems we are dealing with grow in complexity (they
inevitably will), we will find solutions that are general in nature and
clear in logic are easier to extend and maintain.&lt;/li&gt;
&lt;li&gt;If we find ourselves doing the same thing twice, odds are that there
is a better way to it. Spend 10 minutes (even hours) to learn a
technique that can be implemented in 1 minute, rather than spend 1
minute to come up with a technique that takes 10 minutes. Even if the
learning phase takes longer, it will usually pay off in the long run:
you may likely apply the better method many times in the future and you
have sharpened your coding skills.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id="using_git"&gt;Using Git&lt;/h2&gt;
&lt;h3 id="git_tutorials"&gt;Git Tutorials&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://learngitbranching.js.org/"&gt;This website&lt;/a&gt; is a
useful tool for learning Git with simple, step-by-step tutorials and
good visuals&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="git_guidelines"&gt;Git Guidelines&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;Pull changes from the upstream repository frequently, so that
conflicts can be dealt with easily. We often tend to defer this work to
save time, but this debt is always paid later in much bigger
proportions.&lt;/li&gt;
&lt;li&gt;Merge to the upstream repository frequently (through &lt;a href="https://docs.gitlab.com/ee/user/project/merge_requests/creating_merge_requests.html"&gt;a
Pull Request&lt;/a&gt;), so other people can checkout your changes and stay
sync.&lt;/li&gt;
&lt;li&gt;Double check that changes to be submitted are correct and do not
change other functionality inadvertently. Run the test suite if it
exists.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Remove unnecessary files (any files that can be regenerated)
before pushing&lt;/strong&gt;, such as editor generated backups (*~) and
temporary files (#*#), compiled executables (they are too large and
should not be managed by version control systems), and simulation output
from running test suites. &lt;a href="https://git-scm.com/docs/gitignore"&gt;Learn to use&lt;/a&gt;
&lt;code&gt;.gitignore&lt;/code&gt; files to ignore unwanted files.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Never commit any proprietary information&lt;/strong&gt; (e.g.,
private data, passwords), even to a private repository. Triple check
this before making any repository public.&lt;/li&gt;
&lt;li&gt;Before merging with upstream, clean up the commit history to include
only major, self-contained entries. &lt;a href="https://medium.com/@slamflipstrom/a-beginners-guide-to-squashing-commits-with-git-rebase-8185cf6e62ec"&gt;Squash&lt;/a&gt;
small, bookkeeping commits (e.g., test1, debug2, try3) or use the &lt;a href="https://docs.gitlab.com/ee/user/project/merge_requests/squash_and_merge.html"&gt;Squash
and Merge&lt;/a&gt; functionality provided by GitLab.&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id="sample_git_workflow"&gt;Sample Git Workflow&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;This brief walk-through augments, but does not replace the tutorials
suggested in Point 5 of &lt;a href="https://scrapbook.netlify.app/posts/coding-guidelines.html#Getting_Started" title="wikilink"&gt;Getting Started&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Install git on Ubuntu or WSL:&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="sourceCode" id="cb1"&gt;&lt;pre class="sourceCode bash"&gt;&lt;code class="sourceCode bash"&gt;&lt;span id="cb1-1"&gt;&lt;a href="https://scrapbook.netlify.app/posts/coding-guidelines.html#cb1-1" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="fu"&gt;sudo&lt;/span&gt; apt update&lt;/span&gt;
&lt;span id="cb1-2"&gt;&lt;a href="https://scrapbook.netlify.app/posts/coding-guidelines.html#cb1-2" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="fu"&gt;sudo&lt;/span&gt; apt install git&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;Set up your git user name and email:&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="sourceCode" id="cb2"&gt;&lt;pre class="sourceCode bash"&gt;&lt;code class="sourceCode bash"&gt;&lt;span id="cb2-1"&gt;&lt;a href="https://scrapbook.netlify.app/posts/coding-guidelines.html#cb2-1" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="fu"&gt;git&lt;/span&gt; config &lt;span class="at"&gt;--global&lt;/span&gt; user.name &lt;span class="st"&gt;"Full Name"&lt;/span&gt;&lt;/span&gt;
&lt;span id="cb2-2"&gt;&lt;a href="https://scrapbook.netlify.app/posts/coding-guidelines.html#cb2-2" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="fu"&gt;git&lt;/span&gt; config &lt;span class="at"&gt;--global&lt;/span&gt; user.email you@university.edu&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;Clone a repository on GitLab from the group space to your user
space.&lt;/li&gt;
&lt;li&gt;Clone the repository to your laptop or group server over ssh:&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="sourceCode" id="cb3"&gt;&lt;pre class="sourceCode bash"&gt;&lt;code class="sourceCode bash"&gt;&lt;span id="cb3-1"&gt;&lt;a href="https://scrapbook.netlify.app/posts/coding-guidelines.html#cb3-1" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="fu"&gt;git&lt;/span&gt; clone git@gitlab.com:USERNAME/MCCCS MCCCS&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;This will create a new directory called "MCCCS" under the current
working directory, and clone (only) the "master" branch from the remote
side.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Show the remote repositories that have been set up with your working
tree:&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="sourceCode" id="cb4"&gt;&lt;pre class="sourceCode bash"&gt;&lt;code class="sourceCode bash"&gt;&lt;span id="cb4-1"&gt;&lt;a href="https://scrapbook.netlify.app/posts/coding-guidelines.html#cb4-1" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="fu"&gt;git&lt;/span&gt; remote&lt;/span&gt;
&lt;span id="cb4-2"&gt;&lt;a href="https://scrapbook.netlify.app/posts/coding-guidelines.html#cb4-2" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="fu"&gt;git&lt;/span&gt; remote show origin&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;The remote repository "origin" is automatically created when you do
"git clone".&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Add the upstream repository from the group space:&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="sourceCode" id="cb5"&gt;&lt;pre class="sourceCode bash"&gt;&lt;code class="sourceCode bash"&gt;&lt;span id="cb5-1"&gt;&lt;a href="https://scrapbook.netlify.app/posts/coding-guidelines.html#cb5-1" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="fu"&gt;git&lt;/span&gt; remote add upstream git@gitlab.com:group-server/MCCCS&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;Examine the branches currently available:&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="sourceCode" id="cb6"&gt;&lt;pre class="sourceCode bash"&gt;&lt;code class="sourceCode bash"&gt;&lt;span id="cb6-1"&gt;&lt;a href="https://scrapbook.netlify.app/posts/coding-guidelines.html#cb6-1" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="fu"&gt;git&lt;/span&gt; branch &lt;span class="co"&gt;# local branches, only having "master"&lt;/span&gt;&lt;/span&gt;
&lt;span id="cb6-2"&gt;&lt;a href="https://scrapbook.netlify.app/posts/coding-guidelines.html#cb6-2" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="fu"&gt;git&lt;/span&gt; branch &lt;span class="at"&gt;-r&lt;/span&gt; &lt;span class="co"&gt;# remote branches, containing "master" and "serial"&lt;/span&gt;&lt;/span&gt;
&lt;span id="cb6-3"&gt;&lt;a href="https://scrapbook.netlify.app/posts/coding-guidelines.html#cb6-3" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="fu"&gt;git&lt;/span&gt; branch &lt;span class="at"&gt;-a&lt;/span&gt; &lt;span class="co"&gt;# show both local and remote branches&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;"serial" is a branch that holds some coarse graining stuff. The
"master" branch is the MPI parallel version. Remote branches are a
mirror image of branches in remote repositories and you
&lt;strong&gt;NEVER&lt;/strong&gt; switch to them directly or write to them.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Suppose you want to work on the "serial" branch, &lt;strong&gt;DO
NOT&lt;/strong&gt; switch to them directly! Instead, create a corresponding
local branch which will "track" the remote branch (&lt;a href="https://git-scm.com/book/en/v2/Git-Branching-Remote-Branches"&gt;remote-tracking
branch&lt;/a&gt;):&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="sourceCode" id="cb7"&gt;&lt;pre class="sourceCode bash"&gt;&lt;code class="sourceCode bash"&gt;&lt;span id="cb7-1"&gt;&lt;a href="https://scrapbook.netlify.app/posts/coding-guidelines.html#cb7-1" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="fu"&gt;git&lt;/span&gt; checkout &lt;span class="at"&gt;-b&lt;/span&gt; serial origin/serial&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;You can now check the available branches again by "git branch
-a".&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Switch back to the "master" branch:&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="sourceCode" id="cb8"&gt;&lt;pre class="sourceCode bash"&gt;&lt;code class="sourceCode bash"&gt;&lt;span id="cb8-1"&gt;&lt;a href="https://scrapbook.netlify.app/posts/coding-guidelines.html#cb8-1" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="fu"&gt;git&lt;/span&gt; checkout master&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;Make some changes.&lt;/li&gt;
&lt;li&gt;Frequently you should commit your changes to your working tree:&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="sourceCode" id="cb9"&gt;&lt;pre class="sourceCode bash"&gt;&lt;code class="sourceCode bash"&gt;&lt;span id="cb9-1"&gt;&lt;a href="https://scrapbook.netlify.app/posts/coding-guidelines.html#cb9-1" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="fu"&gt;git&lt;/span&gt; status &lt;span class="co"&gt;# this will show any modified, added, and deleted files&lt;/span&gt;&lt;/span&gt;
&lt;span id="cb9-2"&gt;&lt;a href="https://scrapbook.netlify.app/posts/coding-guidelines.html#cb9-2" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="fu"&gt;git&lt;/span&gt; commit &lt;span class="at"&gt;-a&lt;/span&gt; &lt;span class="co"&gt;# commit all changes including those unstaged&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;This will only update your local repository.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;If changes have been made in the &lt;code&gt;upstream&lt;/code&gt; repository,
we can update our working tree by:&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="sourceCode" id="cb10"&gt;&lt;pre class="sourceCode bash"&gt;&lt;code class="sourceCode bash"&gt;&lt;span id="cb10-1"&gt;&lt;a href="https://scrapbook.netlify.app/posts/coding-guidelines.html#cb10-1" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="fu"&gt;git&lt;/span&gt; fetch &lt;span class="at"&gt;-p&lt;/span&gt; upstream&lt;/span&gt;
&lt;span id="cb10-2"&gt;&lt;a href="https://scrapbook.netlify.app/posts/coding-guidelines.html#cb10-2" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="fu"&gt;git&lt;/span&gt; merge upstream/master&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;If you have been making changes locally that conflict with
&lt;code&gt;upstream&lt;/code&gt;, git will complain and you have to commit your
changes to your working tree first. We will then use the &lt;a href="https://git-scm.com/book/en/v2/Git-Branching-Rebasing"&gt;rebase
workflow&lt;/a&gt; to merge changes:&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="sourceCode" id="cb11"&gt;&lt;pre class="sourceCode bash"&gt;&lt;code class="sourceCode bash"&gt;&lt;span id="cb11-1"&gt;&lt;a href="https://scrapbook.netlify.app/posts/coding-guidelines.html#cb11-1" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="fu"&gt;git&lt;/span&gt; rebase &lt;span class="at"&gt;--onto&lt;/span&gt; upstream/master &lt;span class="op"&gt;&amp;lt;&lt;/span&gt;LAST_COMMON_COMMIT&lt;span class="op"&gt;&amp;gt;&lt;/span&gt; HEAD&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;where &lt;last_common_commit&gt; is the last commit common between
&lt;code&gt;upstream&lt;/code&gt; and your working tree. Make sure to check out the
&lt;a href="https://git-scm.com/docs/git-rebase"&gt;documentation&lt;/a&gt; and
understand this command.&lt;/last_common_commit&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Next, when we are satisfied and our changes have passed the test
suites, we can push them back to &lt;code&gt;origin&lt;/code&gt;:&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="sourceCode" id="cb12"&gt;&lt;pre class="sourceCode bash"&gt;&lt;code class="sourceCode bash"&gt;&lt;span id="cb12-1"&gt;&lt;a href="https://scrapbook.netlify.app/posts/coding-guidelines.html#cb12-1" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="fu"&gt;git&lt;/span&gt; push origin master&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;Create a &lt;a href="https://docs.gitlab.com/ee/user/project/merge_requests/creating_merge_requests.html"&gt;a
Pull Request&lt;/a&gt; on GitLab against the upstream repository.&lt;/li&gt;
&lt;li&gt;Now suppose we are going to do something big, making a new branch
could be a good idea:&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="sourceCode" id="cb13"&gt;&lt;pre class="sourceCode bash"&gt;&lt;code class="sourceCode bash"&gt;&lt;span id="cb13-1"&gt;&lt;a href="https://scrapbook.netlify.app/posts/coding-guidelines.html#cb13-1" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="fu"&gt;git&lt;/span&gt; branch test-miracle  &lt;span class="co"&gt;# new branch will be based on the currently checked out branch&lt;/span&gt;&lt;/span&gt;
&lt;span id="cb13-2"&gt;&lt;a href="https://scrapbook.netlify.app/posts/coding-guidelines.html#cb13-2" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="fu"&gt;git&lt;/span&gt; checkout test-miracle  &lt;span class="co"&gt;# switch to the new branch&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;After the new feature has been fully tested, you can merge them back
to the "master" branch. Make sure you are on one of the to-be-merged
branches and merge the other one now:&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="sourceCode" id="cb14"&gt;&lt;pre class="sourceCode bash"&gt;&lt;code class="sourceCode bash"&gt;&lt;span id="cb14-1"&gt;&lt;a href="https://scrapbook.netlify.app/posts/coding-guidelines.html#cb14-1" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="fu"&gt;git&lt;/span&gt; checkout master  &lt;span class="co"&gt;# make sure you are on the to-be-merged branch&lt;/span&gt;&lt;/span&gt;
&lt;span id="cb14-2"&gt;&lt;a href="https://scrapbook.netlify.app/posts/coding-guidelines.html#cb14-2" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="fu"&gt;git&lt;/span&gt; merge test-miracle  &lt;span class="co"&gt;# merge the other branch&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;If changes have been made on only "test-miracle" since the last
merge, they are simply replayed on "master" (i.e., &lt;a href="https://git-scm.com/docs/git-merge#_fast_forward_merge"&gt;fast-forward
merge&lt;/a&gt;). If changes have been made on both branches, they are merged
intelligently (i.e., &lt;a href="https://git-scm.com/docs/git-merge#_true_merge"&gt;three-way
merge&lt;/a&gt;). If there are conflicts, git merge will report them and let
you resolve them, updating the rest of the tree already to the result
state; you can git commit when you resolve the conflicts. If no changes
conflicted, a commit is made automatically with a convenient log message
(or you can do &lt;code&gt;git merge --no-commit branch&lt;/code&gt; to review the
merge result and then do the commit yourself).&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Check the differences between two files, directories, or
branches:&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="sourceCode" id="cb15"&gt;&lt;pre class="sourceCode bash"&gt;&lt;code class="sourceCode bash"&gt;&lt;span id="cb15-1"&gt;&lt;a href="https://scrapbook.netlify.app/posts/coding-guidelines.html#cb15-1" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="fu"&gt;git&lt;/span&gt; diff&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;Browse the history of the development either in text or graphical
mode:&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="sourceCode" id="cb16"&gt;&lt;pre class="sourceCode bash"&gt;&lt;code class="sourceCode bash"&gt;&lt;span id="cb16-1"&gt;&lt;a href="https://scrapbook.netlify.app/posts/coding-guidelines.html#cb16-1" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="fu"&gt;git&lt;/span&gt; log  &lt;span class="co"&gt;# show full history in plain text&lt;/span&gt;&lt;/span&gt;
&lt;span id="cb16-2"&gt;&lt;a href="https://scrapbook.netlify.app/posts/coding-guidelines.html#cb16-2" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="fu"&gt;git&lt;/span&gt; log serial..master  &lt;span class="co"&gt;# show everything that is reachable from "master" but exclude anything that is reachable from "serial",&lt;/span&gt;&lt;/span&gt;
&lt;span id="cb16-3"&gt;&lt;a href="https://scrapbook.netlify.app/posts/coding-guidelines.html#cb16-3" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;                        &lt;span class="co"&gt;# i.e., show the changes between the current state of "master" and the point where the two branches diverge&lt;/span&gt;&lt;/span&gt;
&lt;span id="cb16-4"&gt;&lt;a href="https://scrapbook.netlify.app/posts/coding-guidelines.html#cb16-4" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="fu"&gt;git&lt;/span&gt; log serial...master  &lt;span class="co"&gt;# show everything that is reachable from either one, but exclude anything that is reachable from both of them&lt;/span&gt;&lt;/span&gt;
&lt;span id="cb16-5"&gt;&lt;a href="https://scrapbook.netlify.app/posts/coding-guidelines.html#cb16-5" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="ex"&gt;gitk&lt;/span&gt; &lt;span class="kw"&gt;&amp;amp;&lt;/span&gt;  &lt;span class="co"&gt;# show full history in graphical mode&lt;/span&gt;&lt;/span&gt;
&lt;span id="cb16-6"&gt;&lt;a href="https://scrapbook.netlify.app/posts/coding-guidelines.html#cb16-6" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="ex"&gt;gitk&lt;/span&gt; serial..master  &lt;span class="kw"&gt;&amp;amp;&lt;/span&gt; &lt;span class="co"&gt;# same two-dot range notation as used with git log&lt;/span&gt;&lt;/span&gt;
&lt;span id="cb16-7"&gt;&lt;a href="https://scrapbook.netlify.app/posts/coding-guidelines.html#cb16-7" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="ex"&gt;gitk&lt;/span&gt; serial...master  &lt;span class="kw"&gt;&amp;amp;&lt;/span&gt; &lt;span class="co"&gt;# same three-dot range notation as used with git log&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Please refer to the &lt;a href="http://schacon.github.com/git/user-manual.html"&gt;user manual&lt;/a&gt;
for specifics on these commands.&lt;/p&gt;
&lt;h3 id="installing_git"&gt;Installing Git&lt;/h3&gt;
&lt;h4 id="mac_os_x"&gt;Mac OS X&lt;/h4&gt;
&lt;p&gt;You can install git from Fink:&lt;/p&gt;
&lt;div class="sourceCode" id="cb17"&gt;&lt;pre class="sourceCode bash"&gt;&lt;code class="sourceCode bash"&gt;&lt;span id="cb17-1"&gt;&lt;a href="https://scrapbook.netlify.app/posts/coding-guidelines.html#cb17-1" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="ex"&gt;fink&lt;/span&gt; install git&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;or MacPorts:&lt;/p&gt;
&lt;div class="sourceCode" id="cb18"&gt;&lt;pre class="sourceCode bash"&gt;&lt;code class="sourceCode bash"&gt;&lt;span id="cb18-1"&gt;&lt;a href="https://scrapbook.netlify.app/posts/coding-guidelines.html#cb18-1" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="ex"&gt;port&lt;/span&gt; install git-core&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;or brew:&lt;/p&gt;
&lt;div class="sourceCode" id="cb19"&gt;&lt;pre class="sourceCode bash"&gt;&lt;code class="sourceCode bash"&gt;&lt;span id="cb19-1"&gt;&lt;a href="https://scrapbook.netlify.app/posts/coding-guidelines.html#cb19-1" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="ex"&gt;brew&lt;/span&gt; install git&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;or using &lt;a href="http://syntaxhighlight.google.com/p/git-osx-installer/downloads/list?can=3"&gt;Git
OSX Installer&lt;/a&gt; if you are running 10.5 or above.&lt;/p&gt;
&lt;h4 id="linux"&gt;Linux&lt;/h4&gt;
&lt;p&gt;On Fedora, CentOS, RedHat:&lt;/p&gt;
&lt;div class="sourceCode" id="cb20"&gt;&lt;pre class="sourceCode bash"&gt;&lt;code class="sourceCode bash"&gt;&lt;span id="cb20-1"&gt;&lt;a href="https://scrapbook.netlify.app/posts/coding-guidelines.html#cb20-1" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="ex"&gt;yum&lt;/span&gt; install git&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;On Ubuntu, Debian:&lt;/p&gt;
&lt;div class="sourceCode" id="cb21"&gt;&lt;pre class="sourceCode bash"&gt;&lt;code class="sourceCode bash"&gt;&lt;span id="cb21-1"&gt;&lt;a href="https://scrapbook.netlify.app/posts/coding-guidelines.html#cb21-1" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="ex"&gt;apt-get&lt;/span&gt; update&lt;/span&gt;
&lt;span id="cb21-2"&gt;&lt;a href="https://scrapbook.netlify.app/posts/coding-guidelines.html#cb21-2" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="ex"&gt;apt-get&lt;/span&gt; install git&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h4 id="windows"&gt;Windows&lt;/h4&gt;
&lt;p&gt;Download and install the &lt;a href="http://syntaxhighlight.google.com/p/msysgit/downloads/list"&gt;msysGit&lt;/a&gt;
package.&lt;/p&gt;
&lt;h4 id="installing_from_source"&gt;Installing from source&lt;/h4&gt;
&lt;div class="sourceCode" id="cb22"&gt;&lt;pre class="sourceCode bash"&gt;&lt;code class="sourceCode bash"&gt;&lt;span id="cb22-1"&gt;&lt;a href="https://scrapbook.netlify.app/posts/coding-guidelines.html#cb22-1" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="bu"&gt;cd&lt;/span&gt; ~&lt;/span&gt;
&lt;span id="cb22-2"&gt;&lt;a href="https://scrapbook.netlify.app/posts/coding-guidelines.html#cb22-2" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="fu"&gt;wget&lt;/span&gt; http://git-core.googlecode.com/files/git-1.7.9.tar.gz &lt;span class="co"&gt;# Refer to [http://git-scm.com/download] for most current versions&lt;/span&gt;&lt;/span&gt;
&lt;span id="cb22-3"&gt;&lt;a href="https://scrapbook.netlify.app/posts/coding-guidelines.html#cb22-3" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="fu"&gt;tar&lt;/span&gt; xzf git-1.7.9.tar.gz&lt;/span&gt;
&lt;span id="cb22-4"&gt;&lt;a href="https://scrapbook.netlify.app/posts/coding-guidelines.html#cb22-4" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="bu"&gt;cd&lt;/span&gt; git-1.7.9&lt;/span&gt;
&lt;span id="cb22-5"&gt;&lt;a href="https://scrapbook.netlify.app/posts/coding-guidelines.html#cb22-5" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="fu"&gt;make&lt;/span&gt; prefix=/usr all&lt;/span&gt;
&lt;span id="cb22-6"&gt;&lt;a href="https://scrapbook.netlify.app/posts/coding-guidelines.html#cb22-6" aria-hidden="true" tabindex="-1"&gt;&lt;/a&gt;&lt;span class="fu"&gt;sudo&lt;/span&gt; make prefix=/usr install&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h2 id="profiling_your_code"&gt;Profiling Your Code&lt;/h2&gt;
&lt;p&gt;To properly speed-up your code's implementations, it's best to have a
targeted approach. Rather than timing your code, making changes, and
then retiming, it's best to know what portions of your code is taking
the most time and make improvements to that function/subroutine. This is
where profilers come in. Profilers will can analyze each function of
your code and determine the time it takes or the memory required to run
your code.&lt;/p&gt;
&lt;h3 id="language_agnostic"&gt;Language Agnostic&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;We can apply the Monte Carlo method for profiling our code. If we
run our code and in random instances interrupt our program
(&lt;code&gt;ctrl-c&lt;/code&gt;) and determine which function our code was in, if
there's a function that's particularly slow, we'll find that the code is
being interrupted in that section of code a majority of the time. With
enough samples, we can find the sore spots in the code and make the
appropriate adjustments there. For more information, see this &lt;a href="https://stackoverflow.com/questions/375913/how-do-i-profile-c-code-running-on-linux/378024#378024"&gt;StackOverflow
post&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;For cpu profiling, see &lt;a href="https://www.intel.com/content/www/us/en/developer/tools/oneapi/vtune-profiler.html#gs.8j28jq"&gt;VTune&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;For memory profiling, see &lt;a href="https://valgrind.org/"&gt;valgrind&lt;/a&gt; for a multi-language
solution&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="python"&gt;Python&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;For cpu profiling, &lt;a href="https://docs.python.org/3/library/profile.html#module-cProfile"&gt;cProfile&lt;/a&gt;
is a built-in method for deterministically profiling your python code.
After running the profiler, use the &lt;a href="https://docs.python.org/3/library/profile.html#the-stats-class"&gt;Stats
class&lt;/a&gt; to analyze the data from the profiler. It will output the
times each function is called, how long each function runs per call, the
cumulative time it takes for each function to run, and much more.&lt;/li&gt;
&lt;/ul&gt;
&lt;ul&gt;
&lt;li&gt;For memory usage, &lt;a href="https://github.com/bloomberg/memray"&gt;memray&lt;/a&gt; provides good
visualization of how memory is allocated in your script and can simply
be installed using the &lt;code&gt;pip&lt;/code&gt; package manager.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="general_tips"&gt;General Tips&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;When profiling your code, it may not be enough to compare a single
variation of your code. Try making small changes to see what
correlations you can glean (e.g. Run 100 frames of analysis and then 200
frames of analysis and see how memory/time scales. Does it scale
linearly? Is this expected? Is memory that should be deallocated still
allocated?)&lt;/li&gt;
&lt;/ul&gt;</description><category>coding</category><category>research</category><guid>https://scrapbook.netlify.app/posts/coding-guidelines.html</guid><pubDate>Wed, 30 Jan 2013 19:22:13 GMT</pubDate></item></channel></rss>