Skip to content

Commit

Permalink
deploy: c29027c
Browse files Browse the repository at this point in the history
  • Loading branch information
aaadelmann committed May 25, 2024
1 parent 749dc84 commit 5e1e902
Show file tree
Hide file tree
Showing 10 changed files with 53 additions and 31 deletions.
4 changes: 2 additions & 2 deletions Basics.html
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
</div><!--header-->
<div class="contents">
<div class="textblock"><p ><a class="anchor" id="md_extras_Basics"></a> Following classes are core components of the IPPL library. The examples are meant to show how to use these classes.</p>
<h1><a class="anchor" id="autotoc_md32"></a>
<h1><a class="anchor" id="autotoc_md36"></a>
Structure of IPPL</h1>
<p ><img src="ippl_structure.jpg" alt="ippl_structure" width="400" class="inline"/></p>
<ul>
Expand All @@ -96,7 +96,7 @@ <h1><a class="anchor" id="autotoc_md32"></a>
<li><a href="custom_preconditioner.html">Creating a Custom Preconditioner</a></li>
<li><a href="custom_solver.html">Creating a Custom Solver</a></li>
</ul>
<h1><a class="anchor" id="autotoc_md33"></a>
<h1><a class="anchor" id="autotoc_md37"></a>
Example Code</h1>
<p ><b>Hello World in IPPL</b></p><ul>
<li><a href="hello_world.html">HelloWorld</a></li>
Expand Down
12 changes: 6 additions & 6 deletions Installation.html
Original file line number Diff line number Diff line change
Expand Up @@ -81,31 +81,31 @@
</div><!--header-->
<div class="contents">
<div class="textblock"><p ><a class="anchor" id="md_extras_IPPLonEULER"></a> This guide outlines the steps to install the IPPL library on the EULER cluster. Before beginning, ensure you are connected to the ETH-VPN to access the cluster.</p>
<h1><a class="anchor" id="autotoc_md34"></a>
<h1><a class="anchor" id="autotoc_md38"></a>
Connecting to the EULER Cluster</h1>
<p >Use SSH to connect to EULER. Replace '&lt;username&gt;' with your actual username. </p><pre class="fragment"> ssh -Y &lt;username&gt;@euler.ethz.ch
</pre><p> The '-Y' flag enables trusted X11 forwarding, necessary for running graphical applications remotely.</p>
<h1><a class="anchor" id="autotoc_md35"></a>
<h1><a class="anchor" id="autotoc_md39"></a>
Preparing the Environment</h1>
<p ><em>Load the New Software Stack:</em> Transition to the new software stack to access the latest dependencies: </p><pre class="fragment"> env2lmod
</pre><p> <em>Clean the Environment:</em> Ensure no previous modules are loaded to avoid conflicts: </p><pre class="fragment"> module purge
</pre><p> <em>Load Dependencies:</em> Load the required modules for IPPL: </p><pre class="fragment"> module load gcc/11.4.0 cmake/3.26.3 cuda/12.1.1 openmpi/4.1.4
</pre> <h1><a class="anchor" id="autotoc_md36"></a>
</pre> <h1><a class="anchor" id="autotoc_md40"></a>
Cloning the IPPL Library and Build Scripts</h1>
<p >Clone the IPPL library from its repository: </p><pre class="fragment"> git clone https://github.com/IPPL-framework/ippl.git
</pre><p> Clone the IPPL build scripts for a simplified installation process: </p><pre class="fragment"> git clone https://github.com/IPPL-framework/ippl-build-scripts.git
</pre> <h1><a class="anchor" id="autotoc_md37"></a>
</pre> <h1><a class="anchor" id="autotoc_md41"></a>
Building IPPL</h1>
<p >Choose from the following options based on your needs. If necessary, you can build multiple versions in separate directories.</p>
<p ><b>Serial Version</b> (for single-node computing) </p><pre class="fragment"> ./ippl-build-scripts/999-build-everything -t serial -k -f -i -u
</pre><p> <b>OpenMP Version</b> (for multi-threaded computing): </p><pre class="fragment"> ./ippl-build-scripts/999-build-everything -t openmp -k -f -i -u
</pre><p> <b>CUDA Version</b> (for GPU computing): </p><pre class="fragment"> ./ippl-build-scripts/999-build-everything -t cuda -k -f -i -u
</pre> <h1><a class="anchor" id="autotoc_md38"></a>
</pre> <h1><a class="anchor" id="autotoc_md42"></a>
Testing Your Installation</h1>
<p >Launch an interactive job on EULER to test your installation: </p><pre class="fragment"> srun -n 1 --time=1:00:00 --mem-per-cpu=32g --pty bash
</pre><p> This command allocates one computing node with 32GB of RAM for 60 minutes.</p>
<p ><b>Task</b> : Execute a miniapp in the '/alpine' folder to verify the installation (don't forget to compile with Make).</p>
<h1><a class="anchor" id="autotoc_md39"></a>
<h1><a class="anchor" id="autotoc_md43"></a>
Links</h1>
<p >Repository for Independent Parallel Particle Layer (IPPL) </p><pre class="fragment"> https://github.com/IPPL-framework/ippl
</pre><p> Repository for IPPL Build Scripts </p><pre class="fragment"> https://github.com/IPPL-framework/ippl-build-scripts
Expand Down
6 changes: 3 additions & 3 deletions LandauDamping.html
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
</div><!--header-->
<div class="contents">
<div class="textblock"><p >This is an example demonstrating the setup and execution of a Landau damping simulation using the IPPL framework.</p>
<h3><a class="anchor" id="autotoc_md29"></a>
<h3><a class="anchor" id="autotoc_md33"></a>
Usage</h3>
<p >The executable can be run with the following command-line arguments: </p><div class="fragment"><div class="line">srun ./LandauDamping &lt;nx&gt; [&lt;ny&gt;...] &lt;Np&gt; &lt;Nt&gt; &lt;stype&gt; &lt;lbthres&gt; &lt;tintegr&gt; --overallocate &lt;ovfactor&gt; --info 10</div>
</div><!-- fragment --><ul>
Expand All @@ -94,11 +94,11 @@ <h3><a class="anchor" id="autotoc_md29"></a>
<li><b>tintegr</b>: Type of time integrator. For example Leapfrog.</li>
<li><b>ovfactor</b>: Over-allocation factor for buffers used in communication. A value of 1.0 means no over-allocation.</li>
</ul>
<h3><a class="anchor" id="autotoc_md30"></a>
<h3><a class="anchor" id="autotoc_md34"></a>
Example Command</h3>
<div class="fragment"><div class="line">srun ./LandauDamping 128 128 128 10000 10 FFT 0.01 LeapFrog --overallocate 2.0 --info 10</div>
</div><!-- fragment --><p> This command runs a simulation with a 128x128x128 grid, 10,000 particles, for 10 time steps, using the FFT solver, a load balancing threshold of 1%, with LeapFrog integration, overallocating buffers by a factor of 2.</p>
<h3><a class="anchor" id="autotoc_md31"></a>
<h3><a class="anchor" id="autotoc_md35"></a>
Implementation Detail</h3>
<p >The main function initializes the Ippl framework, sets up the simulation parameters from command-line arguments, and then creates and configures an instance of <code><a class="el" href="classLandauDampingManager.html">LandauDampingManager</a></code> to manage the simulation. It performs pre-run operations to set up the simulation environment and then runs the simulation for the specified number of time steps. <a class="el" href="structTiming.html">Timing</a> information is collected and output for performance analysis. </p><div class="fragment"><div class="line"><span class="keyword">constexpr</span> <span class="keywordtype">unsigned</span> <a class="code hl_variable" href="BumponTailInstability_8cpp.html#afef54e0ebfe65da0a396b342dcbe30f5">Dim</a> = 3;</div>
<div class="line"><span class="keyword">using </span><a class="code hl_typedef" href="BumponTailInstability_8cpp.html#a6b2d038ea9c8d2651eecffe0e28b7ebb">T</a> = double;</div>
Expand Down
4 changes: 2 additions & 2 deletions basic_index.html
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
<div class="contents">
<div class="textblock"><h1><a class="anchor" id="index"></a>
Introduction</h1>
<h2><a class="anchor" id="autotoc_md14"></a>
<h2><a class="anchor" id="autotoc_md18"></a>
Index</h2>
<p >The Index class represents a strided range of indices, and it is used to define the index extent of Field objects on construction.</p>
<p ><b>Constructors</b>:</p><ul>
Expand All @@ -101,7 +101,7 @@ <h2><a class="anchor" id="autotoc_md14"></a>
<div class="line">j-I : j-a-i*s</div>
<div class="line">j*I : j*a + i*j*s</div>
<div class="line">I/j : a/j + i*s/j <span class="comment">// Note: j/I is not defined due to non-uniform stride and fraction prohibition.</span></div>
</div><!-- fragment --><h2><a class="anchor" id="autotoc_md15"></a>
</div><!-- fragment --><h2><a class="anchor" id="autotoc_md19"></a>
NDIndex</h2>
<p >NDIndex is a class that acts as a container for multiple Index instances. It simplifies operations such as intersections across N dimensions by forwarding requests to its contained Index objects.</p>
<h1><a class="anchor" id="Example"></a>
Expand Down
2 changes: 1 addition & 1 deletion basic_solver.html
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ <h2><a class="anchor" id="example_poisson_solver"></a>
</div><!-- fragment --><p >Now we can define the solver object and solve the Poisson equation: </p><div class="fragment"><div class="line"><a class="code hl_typedef" href="FieldSolverBase_8h.html#a058d5b00b9dceacf33c817c5af1f32a0">Solver_t</a> FFTsolver(fieldE, rho, params);</div>
<div class="line">FFTsolver.solve();</div>
</div><!-- fragment --><p> The potential is stored in the rho Field. The E-Field is stored in the fieldE Field.</p>
<h2><a class="anchor" id="autotoc_md16"></a>
<h2><a class="anchor" id="autotoc_md20"></a>
[Optional] Using a Preconditioner</h2>
<p >If you want to precondition the solver you can add following parameters to the parameter list: </p><div class="fragment"><div class="line"><span class="comment">// Define the preconditioner type (jacobi, newton, chebyshev, richardson or gauss_seidel)</span></div>
<div class="line">params.<a class="code hl_function" href="classippl_1_1ParameterList.html#ab4b572b0db6bad6f631b23320a8f4722">add</a>(<span class="stringliteral">&quot;preconditioner_type&quot;</span>, preconditioner_type);</div>
Expand Down
6 changes: 3 additions & 3 deletions basics_fields.html
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
<div class="textblock"><h1><a class="anchor" id="field_intro"></a>
Introduction</h1>
<p >This sections provides the readers with a brief background on the used classes for handling Fields in IPPL. </p>
<h2><a class="anchor" id="autotoc_md11"></a>
<h2><a class="anchor" id="autotoc_md15"></a>
FieldLayout</h2>
<p >FieldLayout describes how a given index space (represented by an NDIndex object) is distributed among MPI ranks. It performs the initial partitioning. The user may request that a particular dimension not be partitioned by flagging that axis as 'SERIAL' (instead of 'PARALLEL'). </p><div class="fragment"><div class="line"><span class="keywordtype">int</span> pt = 25;</div>
<div class="line"><a class="code hl_class" href="classippl_1_1Index.html">ippl::Index</a> I(pt);</div>
Expand All @@ -96,7 +96,7 @@ <h2><a class="anchor" id="autotoc_md11"></a>
<div class="ttc" id="aclassippl_1_1Index_html"><div class="ttname"><a href="classippl_1_1Index.html">ippl::Index</a></div><div class="ttdef"><b>Definition:</b> Index.h:40</div></div>
<div class="ttc" id="aclassippl_1_1NDIndex_html"><div class="ttname"><a href="classippl_1_1NDIndex.html">ippl::NDIndex</a></div><div class="ttdef"><b>Definition:</b> NDIndex.h:21</div></div>
</div><!-- fragment --><p> In this example, we create a 3-dimensional FieldLayout with 25 points in each direction. The layout is distributed among MPI ranks.</p>
<h2><a class="anchor" id="autotoc_md12"></a>
<h2><a class="anchor" id="autotoc_md16"></a>
BareField</h2>
<p >The BareField class in IPPL is a template class that represents a numerical field in a computational domain. It is designed to handle data in up to three dimensions and supports various data types through its template parameter T. It provides a Kokkos-based multidimensional array, or view, which is the main data structure used to store field values. The class is integrated with IPPL's field layout and halo cell system for managing computational domains and communication between them, especially in parallel computing environments. A field can be initialized with a specific layout, and it supports operations such as resizing, updating the layout, and operations related to ghost cells which are used for boundary conditions and domain communication. It offers functions for calculating aggregate values over the field, such as sums, maxima, minima, and products. Fields can be assigned values from constants or other fields through expression templates, allowing for complex computations and assignments. The class provides range policies for iteration that can exclude or include ghost layers, giving flexibility in how the field data is traversed and manipulated.</p>
<div class="fragment"><div class="line"><span class="keyword">constexpr</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> dim = 3;</div>
Expand All @@ -111,7 +111,7 @@ <h2><a class="anchor" id="autotoc_md12"></a>
</div><!-- fragment --><h1><a class="anchor" id="Field"></a>
Field</h1>
<p >The Field class in IPPL is an advanced version of BareField, augmented with a mesh for defining the spatial domain and equipped with customizable boundary conditions. The class is templated to be flexible for various data types (T), dimensions (Dim), mesh types (Mesh), and centering schemes (<a class="el" href="classCentering.html">Centering</a>), along with additional <a class="el" href="namespaceKokkos.html">Kokkos</a> view arguments (ViewArgs...). It's associated with a Mesh object that dictates the structure of the simulation space. Boundary conditions can be set and updated, affecting how the field interacts with the limits of the simulation space. Offers methods for calculating volume integrals and averages, which are useful for analyzing the field over its entire domain. Inherits from BareField, allowing for basic field operations and attribute access.</p>
<h3><a class="anchor" id="autotoc_md13"></a>
<h3><a class="anchor" id="autotoc_md17"></a>
Example: Creating a Field</h3>
<p >The following example showcases the creation and basic manipulation of a field in IPPL:</p>
<div class="fragment"><div class="line"><span class="keyword">using namespace </span><a class="code hl_namespace" href="namespaceippl.html">ippl</a>;</div>
Expand Down
16 changes: 8 additions & 8 deletions custom_preconditioner.html
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
<div class="headertitle"><div class="title">Defining Custom Preconditioners </div></div>
</div><!--header-->
<div class="contents">
<div class="textblock"><h1><a class="anchor" id="autotoc_md17"></a>
<div class="textblock"><h1><a class="anchor" id="autotoc_md21"></a>
Introduction to the Preconditioner Base Class</h1>
<p >The preconditioner class in the IPPL framework serves as an abstract base class for different preconditioning strategies applied in iterative solvers. It encapsulates common functionalities and interfaces that are essential for all types of preconditioners. Structure of the Preconditioner Base Class</p>
<ul>
Expand All @@ -89,7 +89,7 @@
<li>Virtual Function ('operator()'): This is a pure virtual function in the base class that must be implemented by derived classes to define the specific preconditioning behavior.</li>
</ul>
<p >Steps to Create a Custom Preconditioner </p>
<h2><a class="anchor" id="autotoc_md18"></a>
<h2><a class="anchor" id="autotoc_md22"></a>
Step 1: Define the Preconditioner Class</h2>
<p >Begin by defining a new class that inherits from the 'preconditioner&lt;Field&gt;' provided by the IPPL framework. This new class should implement all abstract methods from the base class and can add additional members as needed for its specific strategy.</p>
<div class="fragment"><div class="line"><span class="keyword">template</span> &lt;<span class="keyword">typename</span> Field&gt;</div>
Expand All @@ -106,15 +106,15 @@ <h2><a class="anchor" id="autotoc_md18"></a>
<div class="line"> }</div>
<div class="line">};</div>
<div class="ttc" id="aclassippl_1_1Field_html"><div class="ttname"><a href="classippl_1_1Field.html">ippl::Field&lt; T, Dim, Mesh_t&lt; Dim &gt;, Centering_t&lt; Dim &gt;, ViewArgs... &gt;</a></div></div>
</div><!-- fragment --><h2><a class="anchor" id="autotoc_md19"></a>
</div><!-- fragment --><h2><a class="anchor" id="autotoc_md23"></a>
Step 2: Implement the Constructor</h2>
<p >Use the constructor of your custom preconditioner to initialize any data members and forward any necessary parameters to the base class constructor, which sets the type name of the preconditioner. </p>
<h2><a class="anchor" id="autotoc_md20"></a>
<h2><a class="anchor" id="autotoc_md24"></a>
Step 3: Override the Operator Function</h2>
<p >Implement the 'operator()' function to apply your preconditioning logic to the input field. This method is crucial as it defines how the preconditioner modifies the input data, aligning with the specific algorithmic needs of your solver. </p>
<h1><a class="anchor" id="autotoc_md21"></a>
<h1><a class="anchor" id="autotoc_md25"></a>
Example Implementations</h1>
<h2><a class="anchor" id="autotoc_md22"></a>
<h2><a class="anchor" id="autotoc_md26"></a>
Jacobi Preconditioner</h2>
<p >The 'jacobi_preconditioner' provided by IPPL is a derived class of preconditioner. It implements a specific preconditioning strategy using an inverse diagonal matrix and a damping factor. Here is how it extends the base class:</p>
<div class="fragment"><div class="line"><span class="keyword">template</span> &lt;<span class="keyword">typename</span> Field, <span class="keyword">typename</span> InvDiagF&gt;</div>
Expand All @@ -138,7 +138,7 @@ <h2><a class="anchor" id="autotoc_md22"></a>
<div class="ttc" id="aclassippl_1_1BareField_html_a03944cc0274a28c7d2de62c3d54a62bc"><div class="ttname"><a href="classippl_1_1BareField.html#a03944cc0274a28c7d2de62c3d54a62bc">ippl::BareField::getLayout</a></div><div class="ttdeci">Layout_t &amp; getLayout() const</div><div class="ttdef"><b>Definition:</b> BareField.h:133</div></div>
<div class="ttc" id="aclassippl_1_1Field_html_abea4a038e36f4d8d55107df74356efb7"><div class="ttname"><a href="classippl_1_1Field.html#abea4a038e36f4d8d55107df74356efb7">ippl::Field::get_mesh</a></div><div class="ttdeci">KOKKOS_INLINE_FUNCTION Mesh_t &amp; get_mesh() const</div><div class="ttdef"><b>Definition:</b> Field.h:64</div></div>
<div class="ttc" id="anamespacestd_html"><div class="ttname"><a href="namespacestd.html">std</a></div><div class="ttdef"><b>Definition:</b> Tuple.h:351</div></div>
</div><!-- fragment --> <h2><a class="anchor" id="autotoc_md23"></a>
</div><!-- fragment --> <h2><a class="anchor" id="autotoc_md27"></a>
Scaling Preconditioner</h2>
<p >A simple example of a custom preconditioner that scales the input field can be structured as follows:</p>
<div class="fragment"><div class="line"><span class="keyword">template</span> &lt;<span class="keyword">typename</span> Field&gt;</div>
Expand All @@ -152,7 +152,7 @@ <h2><a class="anchor" id="autotoc_md22"></a>
<div class="line"> <span class="keywordflow">return</span> scale_factor * u; <span class="comment">// Scales the input field</span></div>
<div class="line"> }</div>
<div class="line">};</div>
</div><!-- fragment --><h1><a class="anchor" id="autotoc_md24"></a>
</div><!-- fragment --><h1><a class="anchor" id="autotoc_md28"></a>
Integration with Solvers</h1>
<p >To utilize your custom preconditioner in a solver, instantiate it and configure the solver to use it. </p>
</div></div><!-- contents -->
Expand Down
Loading

0 comments on commit 5e1e902

Please sign in to comment.